Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
8,193,563
2011-11-19T10:58:00.000
1
0
0
0
0
python,machine-learning,data-mining,k-means,prediction
0
8,194,069
0
4
0
false
0
0
If you are considering assigning a value based on the average value within the nearest cluster, you are talking about some form of "soft decoder", which estimates not only the correct value of the coordinate but your level of confidence in the estimate. The alternative would be a "hard decoder" where only values of 0 ...
1
9
1
0
I'm messing around with machine learning, and I've written a K Means algorithm implementation in Python. It takes a two dimensional data and organises them into clusters. Each data point also has a class value of either a 0 or a 1. What confuses me about the algorithm is how I can then use it to predict some values for...
Predicting Values with k-Means Clustering Algorithm
0
0.049958
1
0
0
14,656
8,196,618
2011-11-19T19:24:00.000
0
0
0
0
0
c++,python,c,winapi,api
0
14,110,911
0
2
0
false
0
1
You can get DC of first window, and get DC of second window. And after this do BitBlt or StretchBlt. It has to work... But I don't know what about DirectX/Open-Gl... I think it has to work too. But anyway. It won't take much time to check it.
1
3
0
0
I want to create a simple project (the language doesn't really matter/but I prefer C++) which simply takes a window title as it's input and duplicate it's visual part, bit by bit, to a new window. just like a mirror better I'd say. As far as I remember there was a win32 API for this but I can't remember, so would you p...
How to duplicate a window's clientarea to another window?
0
0
1
0
0
226
8,202,949
2011-11-20T16:35:00.000
8
1
1
0
0
python,class,inheritance,pydev,hierarchy
0
8,202,983
0
5
0
true
0
0
Hit f4 with class name highlighted to open hierarchy view.
1
10
0
1
Assuming I have a class X, how do I check which is the base class/classes, and their base class/classes etc? I'm using Eclipse with PyDev, and for Java for example you could type CTRL + T on a class' name and see the hierarchy, like: java.lang.Object java.lang.Number java.lang.Integer Is it possible for Pyt...
How do I inspect a Python's class hierarchy?
1
1.2
1
0
0
4,686
8,207,755
2011-11-21T05:42:00.000
1
0
0
0
0
python,remote-desktop,rdp,pywinauto
0
8,264,720
0
1
0
false
0
0
After trying out various things I figured that the window which opens after pressing the "Connect" button on mstsc can be found by searching for the window with the title 'XYZ - Remote Desktop' where XYZ is the name of the remote server. I have tested this on the WinXP.
1
0
0
0
I have just started to use the pywinauto module to automate GUI tasks. One of them is to launch the remote desktop exe (mstsc.exe)->Login->Invoke another tool there. However, I manged to connect to the remote server but the control gets lost after that. I did not manage to login. So, the question is how to use the pywi...
pywinauto with Remote Desktop
0
0.197375
1
0
0
1,705
8,214,339
2011-11-21T15:41:00.000
1
1
0
0
0
python,audio,evolutionary-algorithm,csound
0
8,214,378
0
2
0
false
0
0
sending parameter values from python to csound could be done using the osc protocol sending audio from csound to python could be done by routing jack channels between the two applications
2
5
0
0
I am currently working on a specialization project on simulating guitar effects with Evolutionary Algorithms, and want to use Python and CSound to do this. The idea is to generate effect parameters in my algorithm in Python, send them to CSound and apply the filter to the audio file, then send the new audio file back t...
CSound and Python communication
0
0.099668
1
0
0
986
8,214,339
2011-11-21T15:41:00.000
1
1
0
0
0
python,audio,evolutionary-algorithm,csound
0
8,218,664
0
2
0
false
0
0
You can use Csound's python API, so you can run Csound within python and pass values using the software bus. See csound.h. You might also want to use the csPerfThread wrapper class which can schedule messages to and from Csound when it is running. All functionality is available from python.
2
5
0
0
I am currently working on a specialization project on simulating guitar effects with Evolutionary Algorithms, and want to use Python and CSound to do this. The idea is to generate effect parameters in my algorithm in Python, send them to CSound and apply the filter to the audio file, then send the new audio file back t...
CSound and Python communication
0
0.099668
1
0
0
986
8,248,397
2011-11-23T20:06:00.000
3
0
1
1
0
python,windows,python-3.x,python-3.2
0
8,248,427
0
7
0
false
0
0
If you import os you can use os.getcwd to get the current working directory, and you can use os.chdir to change your directory
1
255
0
0
I am using Python 3.2 on Windows 7. When I open the Python shell, how can I know what the current directory is and how can I change it to another directory where my modules are?
How to know/change current directory in Python shell?
0
0.085505
1
0
0
539,479
8,250,936
2011-11-24T00:27:00.000
0
0
0
0
0
python,django,django-admin,timeout,shared-hosting
1
8,252,044
0
4
0
false
1
0
First, a webserver typically has at least two "interfaces", each with one or more IPs. The "loopback" interface will have the IP 127.0.0.1, and is ONLY accessible from the machine running the server. So, running on 127.0.0.1:8000 means that you are telling runserver to be accessible ONLY from that server itself, on po...
2
3
0
0
I'm developing a Django application on a shared hosting service (hostmonster) and am, of course, unable to access the runserver on the default localhost ip of 127.0.0.1:8000 over Firefox. The Django Project site's documentation details how to set up remote access to the run-server, but I'm not having any success with t...
Accessing Django Runserver on Shared Hosting
0
0
1
0
0
5,897
8,250,936
2011-11-24T00:27:00.000
0
0
0
0
0
python,django,django-admin,timeout,shared-hosting
1
8,252,018
0
4
0
false
1
0
I'm betting that port 8000 is blocked. That explains the timeouts you mention in the last couple sentences: the firewall is set to simply drop the packets and not return any connection refusal responses. You're going to have to ask your hosting company if there's a way around this, but there might not be one. At the le...
2
3
0
0
I'm developing a Django application on a shared hosting service (hostmonster) and am, of course, unable to access the runserver on the default localhost ip of 127.0.0.1:8000 over Firefox. The Django Project site's documentation details how to set up remote access to the run-server, but I'm not having any success with t...
Accessing Django Runserver on Shared Hosting
0
0
1
0
0
5,897
8,257,686
2011-11-24T13:16:00.000
1
1
1
0
0
c#,memory-management,ironpython
0
8,257,843
0
2
0
true
0
1
Finding out how much memory an object takes in .NET is a pretty difficult task. I've hit the same problem several times. There are some imperfect methods, but none are very precise. My suggestion is to get some estimate of how much a path will take, and then pass a bunch of them leaving a good margin of safety. Even if...
1
3
0
0
I'm working on a monte carol pricer and I need to improve the efficiency of the engine. MonteCarlo path are created by a third party library (in c++) Pricing is done in IronPython (script created by the end user) Everything else is driven by a c# application the pricing process is as follow: C# application request t...
Virtual memory address management in c#
1
1.2
1
0
0
871
8,262,017
2011-11-24T20:06:00.000
2
0
1
0
0
python,class,vector,initialization
0
8,262,970
0
5
0
false
0
0
Your instructor seems not to "speak Python as a native language". ;) The entire concept for the class is pretty silly; real Python programmers just use the built-in sequence types directly. But then, this sort of thing is normal for academic exercises, sadly... Add a constructor to the Vector class. In Python, the co...
2
1
0
0
I'm working on this project which deals with vectors in python. But I'm new to python and don't really know how to crack it. Here's the instruction: "Add a constructor to the Vector class. The constructor should take a single argument. If this argument is either an int or a long or an instance of a class derived from o...
Vector in python
0
0.07983
1
0
0
8,979
8,262,017
2011-11-24T20:06:00.000
0
0
1
0
0
python,class,vector,initialization
0
8,263,003
0
5
0
false
0
0
This may or may not be appropriate depending on the homework, but in Python programming it's not very usual to explicitly check the type of an argument and change the behaviour based on that. It's more normal to just try to use the features you expect it to have (possibly catching exceptions if necessary to fall back t...
2
1
0
0
I'm working on this project which deals with vectors in python. But I'm new to python and don't really know how to crack it. Here's the instruction: "Add a constructor to the Vector class. The constructor should take a single argument. If this argument is either an int or a long or an instance of a class derived from o...
Vector in python
0
0
1
0
0
8,979
8,269,722
2011-11-25T13:17:00.000
0
0
1
0
0
python,list,text-files,anagram
0
8,269,802
0
6
0
false
0
0
load all words (lines) into list, while words are in separate lines this can be done via readlines() (you will have to use strip() to remove line ends): words = [s.strip() for s in f.readlines()] for each word create anagram use word list in operator for that anagram to check if anagram exists if exists then print
1
2
0
0
I have text files with a few thousands words in them (one word in a line). I've written a function which take two words (strings), and checks if one word is an Anagram of the other (that means if the two words contains the same letters, even if in different order). Now I want to go over my huge text file and search for...
how do i go over lines in an open text file on Python (2.72)
0
0
1
0
0
3,485
8,274,664
2011-11-25T22:07:00.000
0
0
0
0
1
python,django,django-models
0
8,515,995
0
2
0
false
1
0
I think its perfectly reasonable to create a "through" table such as location, which associates an asset, a content (foreign key) and a content_type (warehouse or shipment) . And you could set a unique constraint on the asset_fk so thatt it can only exist in one location at a time
2
0
0
0
I'm working through the design of a Django inventory tracking application, and have hit a snag in the model layout. I have a list of inventoried objects (Assets), which can either exist in a Warehouse or in a Shipment. I want to store different lists of attributes for the two types of locations, e.g.: For Warehouses, ...
Django design patterns - models with ForeignKey references to multiple classes
1
0
1
0
0
235
8,274,664
2011-11-25T22:07:00.000
1
0
0
0
1
python,django,django-models
0
8,515,865
0
2
0
true
1
0
what about having a generic foreign key on Assets?
2
0
0
0
I'm working through the design of a Django inventory tracking application, and have hit a snag in the model layout. I have a list of inventoried objects (Assets), which can either exist in a Warehouse or in a Shipment. I want to store different lists of attributes for the two types of locations, e.g.: For Warehouses, ...
Django design patterns - models with ForeignKey references to multiple classes
1
1.2
1
0
0
235
8,282,130
2011-11-26T22:30:00.000
5
0
1
0
0
python,floating-point,number-formatting,exponent
0
8,282,181
0
2
0
false
0
0
g and G are similar to the output you would get on a calculator display if the output is very large or very small you will get a response in scientific notation. For example 0.000001 gives "1e-06" with g and "1E-06" with G. However numbers that are not too small or too large are displayed simply as decimals 1000 gives ...
1
8
0
0
I feel a bit silly for asking what I'm sure is a rather basic question, but I've been learning Python and I'm having difficulty understanding what exactly the "g" and "G" string formats actually do. The documentation has this to say: Floating point format. Uses lowercase exponential format if exponent is less than -4 ...
In laymans terms, what does the Python string format "g" actually mean?
0
0.462117
1
0
0
6,837
8,282,352
2011-11-26T23:13:00.000
0
0
1
1
0
python,xcode,applescript
0
13,686,960
1
2
0
false
0
1
You can also use the py-aemreceive module from py-appscript. I use that to implement AppleScript support in my Tkinter app.
1
5
0
0
I want my Python program to be AppleScript-able, just like an Objective C program would be. Is that possible? (Note, this is not about running AppleScript from Python programs, nor about calling Python programs from AppleScript via Unix program invocation. Those are straightforward. I need genuine AppleScriptability of...
Can a program written in Python be AppleScripted?
1
0
1
0
0
206
8,284,086
2011-11-27T06:45:00.000
4
0
1
0
0
python,twisted
0
8,286,511
0
2
0
false
0
0
It's easy to support more than 10,000 concurrent connections. What can be harder is supporting so many active connections. The kind of activity you expect to find on your connections is more likely to determine how many you can support at once. What do you expect these connections to be doing? Construct a test whic...
1
1
0
0
Twisted server supports more than 10,000 concurrent connections. I want to write a test case to check it using Python. What I know is just using multiprocessing + threading + greenlet. My question is how to confirm Twisted's support for more than 10,000 concurrent connections? Something I know is using logger, but is ...
How to calculating and testing the number of concurrent connections?
0
0.379949
1
0
0
1,595
8,290,781
2011-11-28T02:03:00.000
0
0
0
0
0
python,user-interface,tablelayout
0
8,295,831
0
1
0
true
0
1
Tkinter would be enough for this. You can create any level of complexity on the layout even with the "grid" layout manager, which allows you to specify "columnspam" and "rowspam" for widgets that will take more than a single cell.
1
1
0
0
I need to create a GUI in Python for a client server interaction. The GUI is on the client side for which I want to create complex tables. I tried to use wxPython's grid class, but its too tough to create a complex table in that. I saw a couple of examples for simple table layouts. I tried to put up a snapshot of the...
Draw complex table layout in Python GUI
0
1.2
1
0
0
903
8,295,078
2011-11-28T11:22:00.000
0
0
0
1
0
python,rabbitmq
0
8,296,293
0
1
0
true
0
0
No, there is no way to find how many publishers are still publishing to a queue in AMQP. You'll have to roll your own system. A way to do this would be to have a fanout exchange that every worker binds a queue to (let's call it the "control" exchange), and have the publisher send a special message to it when it finish...
1
1
0
0
I'm using RabbitMQ with Python/pika to distribute some batch jobs. So I think I have a very common scenario: One process fills a queue with jobs to be done. Multiple workers retrieve jobs, transform data and put the results in a second queue. Another single process retrives the results and merges them. The works very f...
"Invalidate" RabbitMQ queue or sending "DONE signal"
0
1.2
1
0
0
177
8,298,442
2011-11-28T15:51:00.000
0
0
1
0
0
python,image-processing,camera,ramdisk
0
8,299,093
0
3
0
false
0
0
Ah, proprietary binaries that only give certain options. Yay. The simplest solution would be adding a solid state hard drive. You will still be saving to disk, but disk IO will be much higher for reading and writing. A better solution would be outputting the tiff to stdout, perhaps in a different format, and piping it...
2
0
0
0
I have a little program here (python 2.7) that runs on an old machine and it basically keeps getting pictures (for timelapses) by running an external binary and converts them to an efficient format to save up disk space. I want to minimize the disk operations, because it's already pretty old and I want it to last some ...
Should I use a ramdisk for pictures that are converted and removed?
0
0
1
0
0
399
8,298,442
2011-11-28T15:51:00.000
0
0
1
0
0
python,image-processing,camera,ramdisk
0
24,181,039
0
3
0
false
0
0
If on Debian (and possibly its derivatives), use "/run/shm" directory.
2
0
0
0
I have a little program here (python 2.7) that runs on an old machine and it basically keeps getting pictures (for timelapses) by running an external binary and converts them to an efficient format to save up disk space. I want to minimize the disk operations, because it's already pretty old and I want it to last some ...
Should I use a ramdisk for pictures that are converted and removed?
0
0
1
0
0
399
8,299,614
2011-11-28T17:14:00.000
0
1
0
0
0
python,mysql
0
8,299,759
0
3
0
false
0
0
Your strategy is reasonable though I would first look at doing as much of the work as possible in the database query using LIKE and other SQL functions. It should be possible to make a query that matches complex criteria.
2
0
0
0
Background: I am writing a matching script in python that will match records of a transaction in one database to names of customers in another database. The complexity is that names are not unique and can be represented multiple different ways from transaction to transaction. Rather than doing multiple queries on the d...
Could someone give me their two cents on this optimization strategy
0
0
1
1
0
98
8,299,614
2011-11-28T17:14:00.000
2
1
0
0
0
python,mysql
0
8,299,780
0
3
0
false
0
0
Regarding: "would this be faster:" The behind-the-scenes logistics of the SQL engine are really optimized for this sort of thing. You might need to create an SQL PROCEDURE or a fairly complex query, however. Caveat, if you're not particularly good at or fond of maintaining SQL, and this isn't a time-sensitive query, th...
2
0
0
0
Background: I am writing a matching script in python that will match records of a transaction in one database to names of customers in another database. The complexity is that names are not unique and can be represented multiple different ways from transaction to transaction. Rather than doing multiple queries on the d...
Could someone give me their two cents on this optimization strategy
0
0.132549
1
1
0
98
8,299,966
2011-11-28T17:40:00.000
1
0
1
0
0
python
0
8,425,387
0
1
1
true
0
1
Depending on graphical requirements, I would say that for a lightweight app you could get away with PyQt or PyGame. For more demanding real-time graphical requirements you could use something like PyOgre or PyOpenGL. You may need to also research graph-layout/data-visualisation algorithms or libraries (e.g. dot) depend...
1
3
0
0
I'm trying to create a Python implementation of Dawkins' biomorphs as described in his book, The Blind Watchmaker. It works like this: A parent organism is displayed, as well as its offspring which are just mutated versions of the parent. Then the user clicks on a descendant it wants to breed, and all the offspring wil...
Biomorph Implementation in Python
0
1.2
1
0
0
718
8,310,262
2011-11-29T11:55:00.000
4
0
0
0
0
java,python,web-services,corba
0
8,310,341
0
1
0
false
1
0
You will need a Java CORBA provider - for example IONA or JacORB. Generate the IDL files for your python service and then use whatever IDL -> stub compiler your Java ORB provides to generate the java client-side bindings. From there it should be as simple as binding to the corbaloc:// at which your python server is ru...
1
0
0
0
i'm working on a project thata i need develop one web service ( in java ) that get one simple number from a Corba python implementation... how can i proceed with this?? im using omniOrb and already done the server.py that genetares one simple number! thx a lot
Corba python integration with web service java
0
0.664037
1
0
1
375
8,338,661
2011-12-01T08:55:00.000
0
0
0
0
0
python,oauth,sha1,hmac
0
62,871,193
0
8
0
false
0
0
In Python 3.7 there is an optimized way to do this. HMAC(key, msg, digest).digest() uses an optimized C or inline implementation, which is faster for messages that fit into memory.
1
57
0
0
I am trying to use the OAuth of a website, which requires the signature method to be 'HMAC-SHA1' only. I am wondering how to implement this in Python?
Implementation HMAC-SHA1 in python
1
0
1
0
1
70,277
8,340,567
2011-12-01T11:23:00.000
6
0
1
0
0
python,grammar,abstract-syntax-tree
0
8,341,353
0
2
0
true
0
0
If you look at ast.NodeVisitor, it's a fairly trivial class. You can either subclass it or just reimplement its walking strategy to whatever you need. For instance, keeping references to the parent when nodes are visited is very simple to implement this way, just add a visit method that also accepts the parent as an ar...
1
11
1
0
I'm analyzing the AST generated by python code for "fun and profit", and I would like to have something more graphical than "ast.dump" to actually see the AST generated. In theory is already a tree, so it shouldn't be too hard to create a graph, but I don't understand how I could do it. ast.walk seems to walk with a BF...
Python ast to dot graph
0
1.2
1
0
0
3,299
8,342,335
2011-12-01T13:45:00.000
1
0
0
0
0
python,dom,xpath,html-parsing,lxml
0
8,342,483
0
2
0
false
0
0
lxml was written on C. And if you use x86 it is best chose. If we speak about techniques there is no big difference between Xpath and DOM - it's very quickly methods. But if you will use find or findAll in BeautifulSoup it will be slow than other. BeautifulSoup was written on Python. This lib needs a lot of memory for ...
1
6
0
0
I know how to parse a page using Python. My question is which is the fastest method of all parsing techniques, how fast is it from others? The parsing techniques I know are Xpath, DOM, BeautifulSoup, and using the find method of Python.
Xpath vs DOM vs BeautifulSoup vs lxml vs other Which is the fastest approach to parse a webpage?
0
0.099668
1
0
1
4,678
8,356,517
2011-12-02T12:45:00.000
18
0
1
0
1
python,urllib2,httplib
1
8,376,268
0
2
0
true
0
0
This was caused by a library's failure to close connections, leading to a large number of connections stuck in a CLOSE_WAIT state. Eventually this causes the 'Temporary failure in name resolution' error due to resource exhaustion.
1
21
0
0
After running for a number of hours on Linux, my Python 2.6 program that uses urllib2, httplib and threads, starts raising this error for every request: <class 'urllib2.URLError'> URLError(gaierror(-3, 'Temporary failure in name resolution'),) If I restart the program it starts working again. My guess is some kind of r...
Permanent 'Temporary failure in name resolution' after running for a number of hours
0
1.2
1
0
1
18,882
8,368,463
2011-12-03T14:51:00.000
0
0
1
1
1
python,windows,command-prompt
0
8,368,528
0
2
0
false
0
0
No. If you know how to open the command prompt, navigate to a directory ("cd") and list a directory ("dir" on windows and "ls" on linux), then you can probably jump right into those python tutorials.
1
0
0
0
I saw a couple of tutorials and they all make use of termial/command-prompt and I just dont know how they work. Is it necessary to know how they work before learning python or you can just earn it like you would learn some other language(lets say C) It'll be great if you could recommend something. NOTE: I am a windows...
Is it necessary to have the knowledge of using terminal/command-prompt for learning python
0
0
1
0
0
147
8,370,135
2011-12-03T18:59:00.000
-2
0
0
0
0
python,py2exe
0
23,424,057
0
3
0
false
0
1
import os Then in your code os.system("pause")
1
2
0
0
I am using py2exe to make executable. I want to know how to pause the program until a button is pressed.. just like we do in C using system("pause"); As the program terminates automatically in windows, I need this tool. Is there anything better than py2exe which does similar work ?
how to pause a program until a button is pressed
0
-0.132549
1
0
0
21,409
8,370,951
2011-12-03T20:57:00.000
0
0
0
0
1
python,3d
1
8,874,392
0
1
0
true
0
1
You can use pyopengl. i think you might have to install pygame...
1
0
0
0
Pygame and Pyglet are for 2D game development. Pysoy needs many requirements to be installed. I can't figure out how to install Pyogre. Panda3d is giving me this error and don't know how to fix it. importerror no module named direct.showbase.showbase Is there any other good 3D game development library that could be ...
What is the best Python library for 3D game development?
0
1.2
1
0
0
2,006
8,379,513
2011-12-04T23:39:00.000
1
0
0
1
0
python,redis,celery
0
11,473,359
0
1
0
false
0
0
The problem with using pub/sub is that it's not persistant. If you're looking to do closer to real time communication celery might not be your best choice.
1
11
0
0
Is there an efficient way to start tasks via Redis Pub/Sub and return the value of the task back to a Pub/Sub channel to start another task based on the result? Does anybody have an idea on how to put this together? Maybe decorators are a good idea to handle and prepare the return value back to a Pub/Sub channel wi...
Start Python Celery task via Redis Pub/Sub
0
0.197375
1
0
0
2,033
8,385,602
2011-12-05T12:53:00.000
0
0
1
0
0
python,arrays,numpy
0
8,385,718
0
6
0
false
0
0
Numpy arrays are extremily similar to 'normal' arrays such as those in c. Notice that every element has to be of the same type. The speedup is great because you can take advantage of prefetching and you can instantly access any element in array by it's index.
1
84
1
0
I just changed a program I am writing to hold my data as numpy arrays as I was having performance issues, and the difference was incredible. It originally took 30 minutes to run and now takes 2.5 seconds! I was wondering how it does it. I assume it is that the because it removes the need for for loops but beyond that I...
Why are NumPy arrays so fast?
0
0
1
0
0
47,312
8,396,511
2011-12-06T07:20:00.000
1
0
0
0
0
python,ruby,google-sheets
0
8,778,840
0
1
0
true
1
0
This is not currently possible, Google does not let python or ruby runs in the browser. Conditional formatting is currently limited to simple rules based on cell contents. Google has recently rolled macros ability in their spreadsheets but that is limited to JavaScript and does not support conditional formatting.
1
0
0
0
Does anybody know how to apply conditional formatting to a google spreadsheet document using ruby or python?
Conditional formatting using ruby or python
0
1.2
1
0
0
428
8,412,636
2011-12-07T09:00:00.000
1
0
0
0
0
c#,python,sql-server,stored-procedures,smo
0
8,414,549
0
1
0
false
1
0
There is no easy way to access SMO from Python (because there is no generic solution for accessing .NET from Python), so I would write a command-line tool in C# and call it from Python using the subprocess module. Perhaps you could do something with ctypes but I have no idea if that's feasible. But, perhaps a more impo...
1
0
0
0
The idea is to make a script that would get stored procedure and udf contents (code) every hour (for example) and add it to SVN repo. As a result we have sql versioning control system. Does anyone know how to backup stored procedure code using Python (sqlAlchemy, pyodbc or smth). I'v done this via C# before using SQL ...
backup msSQL stored proc or UDF code via Python
0
0.197375
1
1
0
244
8,417,971
2011-12-07T15:36:00.000
1
0
0
0
0
python,django,django-models
0
8,418,076
0
2
0
true
1
0
django takes care of safely storing strings in the database. html is a worry when displaying to the user, and django provides some help there as well, escaping html unless explicitly told not to
1
0
0
0
I have a view in django that is going to save HTML data to a model, and I'm wondering how I might go about filtering it before saving it to the model? Are there built in functions for it? I know there are template filters, but I don't think those help me in this case. What I'll be doing is getting the content of a div ...
Filter POST data in Django
0
1.2
1
0
0
688
8,419,558
2011-12-07T17:17:00.000
2
0
1
1
0
python,subprocess,multiprocessing
0
8,420,171
0
2
0
false
0
0
You could look in os.setpgid(pid, pgrp) direction.
1
1
0
0
For a Linux system, I am writing a program in Python, who spawns child processes. I am using the "multiprocessing" library and I am wondering if there is a method to call sub-processes with a different user than the current one. I'd like to be able to run each subprocess with a different user (like Postfix, for example...
In Python how to call subprocesses under a different user?
1
0.197375
1
0
0
2,331
8,425,089
2011-12-08T01:35:00.000
0
1
0
1
0
python,ssh,pexpect
0
8,425,184
0
2
0
false
0
0
If it's a short file you can get output of ssh command using subprocess.Popen ssh root@ip_address_of_the_server 'cat /path/to/your/file' Note: Password less setup using keys should be configured in order for it to work.
1
1
0
0
With Python, I need to read a file into a script similar to open(file,"rb"). However, the file is on a server that I can access through SSH. Any suggestions on how I can easily do this? I am trying to avoid paramiko and am using pexpect to log into the SSH server, so a method using pexpect would be ideal. Thanks, Eric
Python - Read in binary file over SSH
0
0
1
0
0
1,242
8,426,196
2011-12-08T04:32:00.000
0
0
1
0
0
java,python
0
8,426,447
0
3
0
false
0
0
For Pythonistas who don't know, the behaviour of Java's Class.getResource is basically: the supplied file name is (unless it's already an absolute path) transformed into a relative path by using the class' package (since the directory path to the class file is expected to mirror the explicit "package" declaration for t...
1
2
0
0
In java if I want to read a file that contains resource data for my algorithms how do I do it so the path is correctly referenced. Clarification I am trying to understand how in the Python world one packages data along with code in a module. For example I might be writing some code that looks at a string and tries to c...
What is the equivalent to python equivalent to using Class.getResource()
0
0
1
0
0
1,032
8,431,451
2011-12-08T13:07:00.000
4
0
0
0
0
c++,python,sql,sqlite
0
8,431,705
0
2
0
false
0
0
Use the second (more normalized) approach. You could even get away with fewer tables than you mentioned: tblNutrients -- NutrientID -- NutrientName -- NutrientUOM (unit of measure) -- Otherstuff tblFood -- FoodId -- FoodName -- Otherstuff tblFoodNutrients -- FoodID (FK) -- NutrientID (FK) -- UOMCount It will b...
1
2
0
0
I am parsing the USDA's food database and storing it in SQLite for query purposes. Each food has associated with it the quantities of the same 162 nutrients. It appears that the list of nutrients (name and units) has not changed in quite a while, and since this is a hobby project I don't expect to follow any sudden c...
How to store data with large number (constant) of properties in SQL
0
0.379949
1
1
0
373
8,432,620
2011-12-08T14:35:00.000
0
0
0
0
1
python,sqlite,pyqt,qtreewidget,qtreewidgetitem
0
14,873,799
0
2
0
false
0
1
I managed this by using the data property of the TreewidgetItem by setting a value in it. Using that value as a reference to find one or more or even all TreewidgetItem(s) makes it easy to save a complete tree.
1
2
0
0
I'm working on a project that contains a QTreeWidget. This widget will have Parent nodes with childs nodes and or other siblings nodes. Attached to each node will be a unique ID in the form of an integer as well as a name. Now..... what methods can or should I use to save all the nodes in the QTreeWidget to disk and...
QTreeWidget and PyQt: Methods to save and read data back in from file
1
0
1
0
0
2,266
8,451,426
2011-12-09T20:37:00.000
3
0
1
0
0
python
0
8,451,487
0
4
0
false
0
0
Install pip and do pip freeze. If you are using virtualenv, it is already installed in it.
1
3
0
0
For example, in rails you can do a 'gem list' and it will show all of the gems that you have installed. Any clue how I can do this in python? Also, I am using virtualenv, not sure if that helps?
How do I list the libraries that exist in python?
1
0.148885
1
0
0
881
8,453,362
2011-12-10T00:25:00.000
0
0
0
0
0
python,interface,upload,web
0
8,453,549
0
2
0
false
0
1
I would recommend you look at something like Django and mod_wsgi. Generally helps if you have shell access to the server.
1
0
0
0
I am a beginner in python. For practice reasons I want to learn how to upload a python code to a website. I have a domain and web hosting service, however I'm really confused about how to integrate my code with a web page on my website. (I have a decent bit of knowledge with Tkinter) Can anybody show me how to upload t...
Simple python code to website
0
0
1
0
0
3,068
8,454,339
2011-12-10T04:15:00.000
1
0
1
1
1
python,ubuntu,module
0
8,454,391
0
2
0
false
0
0
python is gonna check if there is a $PYTHONPATH environment variable set. Use that for the path of your other modules. use export PYTHONPATH="path:locations"
1
0
0
0
I have a system python installation and a personal python installation in my home directory. My personal python comes in ahead in my $PATH and I usually run that. But the system python installation has some modules that I want to use with my personal python installation. So, basically, I want to append the sys.path of ...
Append system python installation's sys.path to my personal python installation
0
0.099668
1
0
0
717
8,466,851
2011-12-11T19:37:00.000
2
0
0
0
0
python,django,forms,validation,authentication
0
8,473,116
0
4
0
true
1
0
I would definitely go with validating on the form. You could even go as far as having more form validation in the admin if you felt like it.
1
11
0
0
I'm trying to make sure that the first name and last name field are not optional for the auth User model but I'm not sure how to change it. I can't use a sub class as I have to use the authentication system. Two solutions I can think of are: to put the name in the user profile but it's a little silly to have a field t...
Making first name, last name a required attribute rather than an optional one in Django's auth User model
0
1.2
1
0
0
5,078
8,467,700
2011-12-11T21:38:00.000
15
0
0
0
0
python,web-scraping,scrapy
0
8,468,824
0
4
0
true
1
0
Partially fill your item on the first page, and the put it in your request's meta. When the callback for the next page is called, it can take the partially filled request, put more data into it, and then return it.
1
21
0
0
Need example in scrapy on how to get a link from one page, then follow this link, get more info from the linked page, and merge back with some data from first page.
How do I merge results from target page to current page in scrapy?
0
1.2
1
0
0
10,013
8,479,320
2011-12-12T18:51:00.000
2
0
0
1
0
python,django,celery,django-celery
0
8,479,823
0
1
0
false
1
0
it's actually easy: you start one celery-instance per ec2-instance. set concurrency to the number of cores per ec2-instance. now the tasks don't interfere and distribute nicely among you instances. (the above assumes that your tasks are cpu bound)
1
0
0
0
I am using Celery with Django to manage a task que and using one (or more) small(single core) EC2 instances to process the task. I have some considerations. My task eats 100% CPU on a single core. - uses whatever CPU available but only in one core If 2 tasks are in progress on the same core, each task will be slowed d...
How to evenly distribute tasks among nodes with Celery?
0
0.379949
1
0
0
1,269
8,500,225
2011-12-14T06:17:00.000
2
1
1
0
0
python
0
8,500,285
0
3
0
true
0
0
You could serialize the object with the pickle module (or maybe json?) If you really want to stick with os.system, then you could have MyBot.py write the pickled object to a file, which GP.py could read once MyBot.py returns. If you use the subprocess module instead, then you could have MyBot.py write the pickled objec...
1
1
0
0
I have a genetic expression tree program to control a bot. I have a GP.py and a MyBot.py. I need to be able to have the MyBot.py access an object created in GP.py The GP.py is starting the MyBot.py via the os.system() command I have hundreds of tree objects in the GP.py file and the MyBot.py needs to evaluate them. I c...
How to pass object between python instances
0
1.2
1
0
0
771
8,501,756
2011-12-14T08:59:00.000
0
0
1
0
0
python,filesystems
0
8,501,985
0
4
0
false
0
0
You should first ask the question: What operations should my "file system" support? Based on the answer you select the data representation. For example, if you choose to support only create and delete and the order of the files in the dictionary is not important, then select a python dictionary. A dictionary will map ...
2
1
0
0
I’m working on simple class something like “in memory linux-like filesystem” for educational purposes. Files will be as StringIO objects. I can’t make decision how to implement files-folders hierarchy type in Python. I’m thinking about using list of objects with fields: type, name, parent what else? Maybe I should loo...
Representing filesystem table
0
0
1
0
0
846
8,501,756
2011-12-14T08:59:00.000
0
0
1
0
0
python,filesystems
0
8,502,479
0
4
0
false
0
0
What's the API of the filestore? Do you want to keep creation, modification and access times? Presumably the primary lookup will be by file name. Are any other retrieval operations anticipated? If only lookup by name is required then one possible representation is to map the filestore root directory on to a Python dict...
2
1
0
0
I’m working on simple class something like “in memory linux-like filesystem” for educational purposes. Files will be as StringIO objects. I can’t make decision how to implement files-folders hierarchy type in Python. I’m thinking about using list of objects with fields: type, name, parent what else? Maybe I should loo...
Representing filesystem table
0
0
1
0
0
846
8,506,002
2011-12-14T14:22:00.000
0
0
0
1
1
python,daemon,tornado,upstart
0
8,516,641
0
2
0
false
1
0
There are two often used solutions The first one is to let your application honestly report its pid. If you could force your application to write the actual pid into the pidfile then you could get its pid from there. The second one is a little more complicated. You may add specific environment variable for the script i...
2
1
0
0
Few days ago I found out that my webapp wrote ontop of the tornadoweb framework doesn't stop or restart via upstart. Upstart just hangs and doesn't do anything. I investigated the issue and found that upstart recieves wrong PID, so it can only run once my webapp daemon and can't do anything else. Strace shows that my d...
Tornadoweb webapp cannot be managed via upstart
0
0
1
0
0
417
8,506,002
2011-12-14T14:22:00.000
1
0
0
1
1
python,daemon,tornado,upstart
0
10,837,488
0
2
0
true
1
0
Sorry my silence, please. Investigation of the issue ended with the knowledge about uuid python library which adds 2 forks to my daemon. I get rid of this lib and tornado daemon works now properly. Alternative answer was supervisord which can run any console tools as a daemon which can't daemonize by itself.
2
1
0
0
Few days ago I found out that my webapp wrote ontop of the tornadoweb framework doesn't stop or restart via upstart. Upstart just hangs and doesn't do anything. I investigated the issue and found that upstart recieves wrong PID, so it can only run once my webapp daemon and can't do anything else. Strace shows that my d...
Tornadoweb webapp cannot be managed via upstart
0
1.2
1
0
0
417
8,508,167
2011-12-14T16:40:00.000
0
0
1
0
0
python,string,text-files
0
8,508,385
0
3
0
false
0
0
I had the same problem when I first was learning Python, coming from Perl. Perl will "do what you mean" (or at least what it thinks you mean), and automatically convert something that looks like a number into a number when you try to use it like a number. (I'm generalizing, but you get the idea). The Python philosophy ...
1
0
0
0
I'm learning python and now I'm having some problems with reading and analyzing txt files. I want to open in python a .txt file that contains many lines and in each line I have one fruit and it's price. I would like to know how to make python recognize their prices as a number (since it recognizes as a string when I us...
using data from a txt file in python
0
0
1
0
0
4,297
8,545,492
2011-12-17T14:48:00.000
0
0
1
0
0
python
0
8,545,533
0
7
0
false
0
0
Easiest way is to split data into two char arrays and then loop through comparing the letters and return the index when the two chars do not equal each other. This method will work fine as long as both strings are equal in length.
1
22
0
0
I have two strings of equal length, how can I find all the locations where the strings are different? For example, "HELPMEPLZ" and "HELPNEPLX" are different at positions 4 and 8.
Find the position of difference between two strings
0
0
1
0
0
49,782
8,551,735
2011-12-18T12:36:00.000
1
1
1
0
0
python,ide,sublimetext2,sublimetext
0
62,906,919
0
16
0
false
0
0
seems the Ctrl+Break doesn't work on me, neither the Preference - User... use keys, Alt → t → c
4
315
0
0
I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the editor. Is it done using build system? How do I do it ?
How do I run Python code from Sublime Text 2?
0
0.012499
1
0
0
582,824
8,551,735
2011-12-18T12:36:00.000
5
1
1
0
0
python,ide,sublimetext2,sublimetext
0
40,689,778
0
16
0
false
0
0
[ This applies to ST3 (Win), not sure about ST2 ] To have the output visible in Sublime as another file (+ one for errors), do this: Create a new build system: Tools > Build Systems > New Build System... Use the following configuration: { "cmd": ["python.exe", "$file", "1>", "$file_name.__STDOUT__.txt",...
4
315
0
0
I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the editor. Is it done using build system? How do I do it ?
How do I run Python code from Sublime Text 2?
0
0.062419
1
0
0
582,824
8,551,735
2011-12-18T12:36:00.000
0
1
1
0
0
python,ide,sublimetext2,sublimetext
0
10,363,165
0
16
0
false
0
0
I had the same problem. You probably haven't saved the file yet. Make sure to save your code with .py extension and it should work.
4
315
0
0
I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the editor. Is it done using build system? How do I do it ?
How do I run Python code from Sublime Text 2?
0
0
1
0
0
582,824
8,551,735
2011-12-18T12:36:00.000
0
1
1
0
0
python,ide,sublimetext2,sublimetext
0
8,552,005
0
16
0
false
0
0
You can access the Python console via “View/Show console” or Ctrl+`.
4
315
0
0
I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the editor. Is it done using build system? How do I do it ?
How do I run Python code from Sublime Text 2?
0
0
1
0
0
582,824
8,554,562
2011-12-18T20:27:00.000
9
0
0
0
1
python,ruby-on-rails,ruby,r,r-exams
0
8,554,862
1
4
0
false
1
0
The way you have worded your question it's not really clear why you have to mark the students' work online. Especially since you say that you generate assignments using sweave. If you use R to generate the (randomised) questions, then you really have to use R to mark them (or output the data set). For my courses, I use...
2
13
0
0
I teach undergraduate statistics, and am interested in administering personalized online assignments. I have already solved one portion of the puzzle, the generation of multiple version of a question using latex/markdown + knitr/sweave, using seeds. I am now interested in developing a web-based system, that would use ...
Personalizing Online Assignments for a Statistics Class
0
1
1
0
0
656
8,554,562
2011-12-18T20:27:00.000
2
0
0
0
1
python,ruby-on-rails,ruby,r,r-exams
0
8,564,007
1
4
0
false
1
0
I found one possible solution that might work using the RGoogleDocs package. I am posting this as an answer only because it is long. I am still interested in better approaches, and hence will keep the question open. Here is the gist of the idea, which is still untested. Create multiple versions of each assignment usin...
2
13
0
0
I teach undergraduate statistics, and am interested in administering personalized online assignments. I have already solved one portion of the puzzle, the generation of multiple version of a question using latex/markdown + knitr/sweave, using seeds. I am now interested in developing a web-based system, that would use ...
Personalizing Online Assignments for a Statistics Class
0
0.099668
1
0
0
656
8,559,398
2011-12-19T09:37:00.000
2
0
1
0
0
python,regex
0
8,559,424
0
3
0
false
0
0
Use (?<=#)(\w+)(?=#) and capture the first group. You can even cycle through a string which contains several embedded strings and it will work. This uses both a positive lookbehind and positive lookahead.
1
1
0
0
Given a string #abcde#jfdkjfd, how can I get the string between two # ? And I also want that if no # pair(means no # or only one #), the function will return None.
python string parsing using regular expression
0
0.132549
1
0
0
4,295
8,571,366
2011-12-20T05:57:00.000
0
0
0
0
0
python,pyqt
0
8,571,839
0
2
0
false
0
1
the .py file generated from pyuic is not supposed to be edited by the user, best way it is intended to use is to subclass the class in .py file into your own class and do the necessary changes in your class..
1
0
0
0
I have .ui, .py and .pyc files generated. Now, when I edit the .py file, how will it reflect changes in the .ui file? How do I connect .the ui and .py files together as QT designer allows only .ui files for running purposes?
Running .py files
0
0
1
0
0
227
8,588,126
2011-12-21T10:08:00.000
108
0
0
0
0
python,postgresql,sqlalchemy,psycopg2
0
8,588,766
0
2
0
true
0
0
SQLAlchemy is a ORM, psycopg2 is a database driver. These are completely different things: SQLAlchemy generates SQL statements and psycopg2 sends SQL statements to the database. SQLAlchemy depends on psycopg2 or other database drivers to communicate with the database! As a rather complex software layer SQLAlchemy does...
2
57
0
0
I am writing a quick and dirty script which requires interaction with a database (PG). The script is a pragmatic, tactical solution to an existing problem. however, I envisage that the script will evolve over time into a more "refined" system. Given the fact that it is currently being put together very quickly (i.e. I ...
SQLAlchemy or psycopg2?
0
1.2
1
1
0
40,683
8,588,126
2011-12-21T10:08:00.000
11
0
0
0
0
python,postgresql,sqlalchemy,psycopg2
0
8,589,254
0
2
0
false
0
0
To talk with database any one need driver for that. If you are using client like SQL Plus for oracle, MysqlCLI for Mysql then it will direct run the query and that client come with DBServer pack. To communicate from outside with any language like java, c, python, C#... We need driver to for that database. psycopg2 is ...
2
57
0
0
I am writing a quick and dirty script which requires interaction with a database (PG). The script is a pragmatic, tactical solution to an existing problem. however, I envisage that the script will evolve over time into a more "refined" system. Given the fact that it is currently being put together very quickly (i.e. I ...
SQLAlchemy or psycopg2?
0
1
1
1
0
40,683
8,591,602
2011-12-21T14:43:00.000
0
1
0
0
0
python,web
0
8,592,171
0
1
0
true
1
0
You can get a virtual server instance on amazon or rackspace or many others for a very small fee per month, $20 - $60. This will give you a clean install of the OS of your choice. No need to invest in hardware. From there you can follow any of the many many tutorials on deploying a django app.
1
0
0
0
hi every one I was wondering how to go about deploying a small time python database web application. Is buying some cheap hardware and installing a server good on it a good route to go?
deploying a python web application
0
1.2
1
0
0
215
8,616,487
2011-12-23T13:10:00.000
0
0
0
1
0
python,google-app-engine,variables,global
0
8,617,102
0
4
0
false
1
0
Interesting question. Some bad news first, I don't think there's a better way of storing data; no, you won't be able to stop new instances from spawning and no, you cannot make seperate instances always have the same data. What you could do is have the instances perioidically sync themselves with a master record in th...
3
2
0
0
Our situation is as follows: We are working on a schoolproject where the intention is that multiple teams walk around in a city with smarthphones and play a city game while walking. As such, we can have 10 active smarthpones walking around in the city, all posting their location, and requesting data from the google app...
How to keep global variables persistent over multiple google appengine instances?
0
0
1
0
0
2,158
8,616,487
2011-12-23T13:10:00.000
0
0
0
1
0
python,google-app-engine,variables,global
0
8,617,199
0
4
0
false
1
0
Consider jabber protocol for communication between peers. Free limits are on quite high level for it.
3
2
0
0
Our situation is as follows: We are working on a schoolproject where the intention is that multiple teams walk around in a city with smarthphones and play a city game while walking. As such, we can have 10 active smarthpones walking around in the city, all posting their location, and requesting data from the google app...
How to keep global variables persistent over multiple google appengine instances?
0
0
1
0
0
2,158
8,616,487
2011-12-23T13:10:00.000
3
0
0
1
0
python,google-app-engine,variables,global
0
8,624,587
0
4
0
true
1
0
You should be using memcache. If you use the ndb (new database) library, you can automatically cache the results of queries. Obviously this won't improve your writes much, but it should significantly improve the numbers of reads you can do. You need to back it with the datastore as data can be ejected from memcache at ...
3
2
0
0
Our situation is as follows: We are working on a schoolproject where the intention is that multiple teams walk around in a city with smarthphones and play a city game while walking. As such, we can have 10 active smarthpones walking around in the city, all posting their location, and requesting data from the google app...
How to keep global variables persistent over multiple google appengine instances?
0
1.2
1
0
0
2,158
8,626,180
2011-12-24T18:25:00.000
1
0
0
1
1
python,cocos2d-python
1
10,575,373
0
1
0
true
0
1
You could fix it. The problem comes from the fact that cocos2D is built on top of Pyglet, and the stable release of pyglet does not yet support Mac OS X 64 bits architecture. You have to use the 1.2 release of pyglet or later, which by now is not released yet. A workaround is to remove any existing Pyglet install: pip ...
1
0
0
0
I installed cocos2d today on OS X Lion, but whenever I try to import cocos in the Python interpreter, I get a bunch of import errors. File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.7/lib/ python2.7/site-packages/cocos2d-0.5.0-py2.7.egg/cocos/init.py", line 105, in import_...
Removing cocos2d-python from Mac
0
1.2
1
0
0
559
8,627,414
2011-12-24T23:22:00.000
3
1
1
0
0
python,function,module
0
8,627,435
0
4
0
false
0
0
You've figured it out - you have to set signal_power's value before using it. As to what you have to set it to - it's not really a Python related question, but 1 is always a safe choice :) While you are at it, don't forget to define noise_power.
1
0
0
0
I'm stucked on the chapter 3.3 "Math functions" of "Think Python". It tells me to import math (through the interpreter). Then print math and that I should get something like this: <module 'math' from '/usr/lib/python2.5/lib-dynload/math.so'> Instead I get <module 'math' <built-in>> Anyway that's not the problem. Though...
Python's math module & "Think Python"
0
0.148885
1
0
0
529
8,628,940
2011-12-25T09:05:00.000
0
0
0
0
0
gearman,task-management,python-gearman
0
8,943,378
0
2
0
false
0
0
Gearman jobs can run in parallel or series. Instead of using single jobs, you should use concurrent jobs (one for each server).
1
1
0
0
I'm using gearman for synchronizing data on different servers. We have 1 main server and, for example, 10 local servers. Let me describe one of possible situations. Say, gearman started working, and 5 jobs are done, data on that 5 servers is synced. When doing the next job is started, say, we lost the connection with s...
How to delay/postpone Gearman job?
0
0
1
0
0
903
8,631,500
2011-12-25T20:50:00.000
0
0
0
0
0
python,selenium,webdriver,web-scraping,alert
0
8,631,520
0
6
0
false
1
0
that depends on the javascript function that handles the form submission if there's no such function try to submit the form using post
1
20
0
0
I am scraping a webpage using Selenium webdriver in Python The webpage I am working on, has a form. I am able to fill the form and then I click on the Submit button. It generates an popup window( Javascript Alert). I am not sure, how to click the popup through webdriver. Any idea how to do it ? Thanks
Click the javascript popup through webdriver
0
0
1
0
1
38,288
8,640,781
2011-12-27T03:07:00.000
0
0
1
0
1
python,linux,configure
0
8,658,970
0
2
0
false
0
0
Suse has a package manager called Yast. It would do your installation with no fuss.
1
0
0
0
I downloaded tarball of python 2.7.2 to install on Suse Linux server--it comes with 2.6 and 3.1. Untarred it (I know--wrong lingo, sorry) to a directory. When trying to run ./configure, which should create a valid makefile I can't get past the step one: the script reports that it can't find a compiler on the path. But...
Completely lost: Python configure script runs with errors
1
0
1
0
0
150
8,649,405
2011-12-27T21:20:00.000
0
0
0
0
0
python,rpc
0
8,649,530
0
3
1
false
0
0
I have been doing something similar on a larger scale (with 15 clients). I use the pexpect module to do essentially ssh commands on the remote machine (computer B). Another module to look into would be the subprocess module.
1
1
0
0
I have two computers on a network. I'll call the computer I'm working on computer A and the remote computer B. My goal is to send a command to B, gather some information, transfer this information to computer A and use this in some meaningfull way. My current method follows: Establish a connection to B with paramiko. ...
How do I transfer data between two computers ?
1
0
1
0
1
2,292
8,651,061
2011-12-28T01:50:00.000
6
0
0
0
0
python,sqlalchemy,pyramid
0
14,859,955
0
2
0
false
0
0
Your options are pyramid_beaker and dogpile.cache pyramid_beaker was written to offer beaker caching for sessions. it also lets you configure beaker cache regions, which can be used elsewhere. dogpile.cache is a replacement for beaker. it hasn't been integrated to offer session support or environment.ini based setup...
1
3
0
1
I've looked in the documentation and haven't seen (from first sight) anything about cache in Pyramid. Maybe I missed something... Or maybe there are some third party packages to help with this. For example, how to cache db query (SQLAlchemy), how to cache views? Could anyone give some link to examples or documentation?...
How to cache using Pyramid?
0
1
1
1
0
4,486
8,651,063
2011-12-28T01:51:00.000
4
1
0
0
1
python,algorithm
0
8,651,274
0
1
0
true
0
0
The issue is overshooting the setpoint temperature. If you simply run the device until the set point temperature is reached, you will overshoot, wasting energy (and possibly doing damage, depending on what the thermostat controls.) You need to "ease up to" the setpoint so that you arrive at the set point just as the de...
1
0
0
0
I am wondering exactly how a thermostat program would work and wanted to see if anyone had a better opinion on it. From what I know, there are a few control algorithms that could be used, some being Bang-Bang (On/Off), Proportional Control Algorithms, and PID Control. Looking on Wikipedia, there is a great deal of expl...
Thermostat Control Algorithms
0
1.2
1
0
0
2,614
8,651,668
2011-12-28T03:54:00.000
1
0
0
0
0
python,report,openoffice.org,openerp,openoffice-writer
0
9,046,631
0
4
0
false
1
0
First you save .odt file then connect with server and select open new report and then send it ti server with proper report name and then keep on editing your report by selecting the option modify existing report.
1
1
0
0
I am trying to create a new report with report plugin and openoffice but I don't know how to assign it in the OpenERP system. Is there someone who can give me exact steps for creation of new report and integration with openerp? Thanks in advance!
OpenERP - Report Creation
0
0.049958
1
0
0
6,171
8,662,501
2011-12-28T23:36:00.000
0
1
1
0
0
python,graph,fractals,complex-numbers
0
8,662,563
0
2
0
false
0
0
Julia set renderings are generally 2D color plots, with [x y] representing a complex starting point and the color usually representing an iteration count.
2
2
0
0
For a math fair project I want to make a program that will generate a Julia set fractal. To do this i need to plot complex numbers on a graph. Does anyone know how to do this? Remember I am using complex numbers, not regular coordinates. Thank You!
Plotting Complex Numbers in Python?
0
0
1
0
0
1,786
8,662,501
2011-12-28T23:36:00.000
2
1
1
0
0
python,graph,fractals,complex-numbers
0
8,662,525
0
2
0
false
0
0
You could plot the real portion of the number along the X axis and plot the imaginary portion of the number along the Y axis. Plot the corresponding pixel with whatever color makes sense for the output of the Julia function for that point.
2
2
0
0
For a math fair project I want to make a program that will generate a Julia set fractal. To do this i need to plot complex numbers on a graph. Does anyone know how to do this? Remember I am using complex numbers, not regular coordinates. Thank You!
Plotting Complex Numbers in Python?
0
0.197375
1
0
0
1,786
8,663,432
2011-12-29T02:33:00.000
1
0
0
0
0
python,mongodb,mapreduce
0
8,666,791
0
2
0
true
0
0
Since you have to go over "each record", you'll do one full table scan anyway, then a simple cursor (find()) + maybe only fetching few fields (_id, ip) should do it. python driver will do the batching under the hood, so maybe you can give a hint on what's the optimal batch size (batch_size) if the default is not good e...
2
3
0
0
Apologies for the longish description. I want to run a transform on every doc in a large-ish Mongodb collection with 10 million records approx 10G. Specifically I want to apply a geoip transform to the ip field in every doc and either append the result record to that doc or just create a whole other record linked to th...
How do I transform every doc in a large Mongodb collection without map/reduce?
0
1.2
1
1
0
477
8,663,432
2011-12-29T02:33:00.000
0
0
0
0
0
python,mongodb,mapreduce
0
8,677,503
0
2
0
false
0
0
Actually I am also attempting another approach in parallel (as plan B) which is to use mongoexport. I use it with --csv to dump a large csv file with just the (id, ip) fields. Then the plan is to use a python script to do a geoip lookup and then post back to mongo as a new doc on which map-reduce can now be run for c...
2
3
0
0
Apologies for the longish description. I want to run a transform on every doc in a large-ish Mongodb collection with 10 million records approx 10G. Specifically I want to apply a geoip transform to the ip field in every doc and either append the result record to that doc or just create a whole other record linked to th...
How do I transform every doc in a large Mongodb collection without map/reduce?
0
0
1
1
0
477
8,674,077
2011-12-29T22:08:00.000
0
1
0
0
1
python,html,web
0
8,674,108
0
1
0
false
1
0
I don't know anything about Python, but in PHP, in some fopen modes, if a file is trying to be made with the same name as an existing file, it will cancel the operation.
1
0
0
0
I have a problem with links on my website. Please forgive me if this is asked somewhere else, but I have no idea how to search for this. A little background on the current situation: I've created a python program that randomly generates planets for a sci-fi game. Each created planet is placed in a text file to be viewe...
Website Links to Downloadable Files Don't Seem to Update
0
0
1
0
1
45
8,676,682
2011-12-30T06:05:00.000
31
0
1
0
0
python,integer,bit
0
8,676,794
0
2
0
false
0
0
Python 2 has two integer types: int, which is a signed integer whose size equals your machine's word size (but is always at least 32 bits), and long, which is unlimited in size. Python 3 has only one integer type, which is called int but is equivalent to a Python 2 long.
1
10
0
0
So I am thinking of writing a bitboard in python or lisp. But I don't know how to ensure I would get a 64 bit integer in python. I have been reading documentation and found that mpz library returns a unsigned 32 bit integer. Is this true? If not what should I do?
getting 64 bit integer in python
0
1
1
0
0
58,013
8,683,501
2011-12-30T20:00:00.000
1
1
0
0
0
python,jython,robocode
0
18,469,631
0
1
0
false
1
0
As long as your java-class extends robocode.Robot everything is recognized as robot. It doesn't matter where you put the class.
1
3
0
0
The question is, how do you make a robot for Robocode using Python? There seem to be two options: Robocode + Jython Robocode for .NET + Iron Python There's some info for the first, but it doesn't look very robust, and none for the latter. Step by step, anyone?
Robocode + Python
0
0.197375
1
0
0
1,489
8,688,762
2011-12-31T14:51:00.000
5
0
0
0
0
python,django,sha1
0
8,688,811
0
1
0
true
1
0
You are asking the impossible. The passwords are salted and hashed. The way they're validated is by performing the same process on the re-supplied password. There's no way to 'decrypt' it.
1
0
0
0
I have a SECRET_KEY, how do i decompile a user password using python? I assume that the encryption method is sha1. thanks.
how to decompile user password in django
0
1.2
1
0
0
263
8,702,080
2012-01-02T14:39:00.000
1
1
0
0
0
python,gevent
0
8,712,328
0
1
0
true
1
0
If I've understood you right, you just need to link the second person with someone connected before. Think it's simple. The greenlet working with a person who comes first ('the first greenlet') just register somewhere it's inbound and outbound queues. The greenlet working with the second person gets this queues, unreg...
1
1
0
1
I have searched tutorials and documentation for gevent, but seems that there isn't lots of it. I have coded Python for several years, also I can code PHP + JavaScript + jQuery. So, how would I create Omeglish chat, where one random person connects and then waits for another one to connect? I have understood that Omegle...
How would I create "Omegle"-like random chat with gevent?
0
1.2
1
0
0
2,300
8,706,850
2012-01-03T00:53:00.000
1
0
0
0
0
python,google-cloud-datastore
0
8,709,167
0
3
0
false
1
0
"always(?)" indeed. Sweden = 46 looks like you mean the telephone not-necessarily-a-country code which is VARIABLE LENGTH ... for example CHINA = 86, HONG KONG (not a country) = 852, CANADA = USA = 1. Is your ID allowed to be variable length or not? If it is allowed to be variable, you would need do str(countrycode) + ...
1
0
0
0
Update: The requirement is "fixed length 9 digits" so 460 000 000 138 should be 460 000 138 I want to generate IDs on a special form such as 460 000 000 138 where 46 is the country code and the rest is the ID and this number always(?) has the same number of digits ie four pairs of threes. My input is this ID that can b...
Generating IDs how to make IDs same length using zeroes?
0
0.066568
1
0
0
171
8,707,663
2012-01-03T03:42:00.000
0
1
1
1
0
python,executable
1
8,709,784
0
5
0
false
0
0
Use shutil.copyfile(src, dst) or shutil.copy(src, dst). It may not work in case of files in the C:\Program Files\ as they are protected by administrator rights by default.
2
0
0
0
How can i copy a .exe file through python? I tried to read the file and then write the contents to another but everytime i try to open the file it say ioerror is directory. Any input is appreciated. EDIT: ok i've read through the comments and i'll edit my code and see what happens. If i still get an error i'll post my ...
how to copy an executable file with python?
0
0
1
0
0
2,980
8,707,663
2012-01-03T03:42:00.000
1
1
1
1
0
python,executable
1
8,707,865
0
5
0
false
0
0
Windows Vista and 7 will restrict your access to files installed into the Programs directories. Unless you run with UAC privileges you will never be able to open them. I hope I'm interpreting your error properly. In the future it is best to copy and paste the actual error message into your question.
2
0
0
0
How can i copy a .exe file through python? I tried to read the file and then write the contents to another but everytime i try to open the file it say ioerror is directory. Any input is appreciated. EDIT: ok i've read through the comments and i'll edit my code and see what happens. If i still get an error i'll post my ...
how to copy an executable file with python?
0
0.039979
1
0
0
2,980
8,715,435
2012-01-03T16:37:00.000
1
0
1
0
0
python,variables,environment-variables,go,share
0
8,715,483
0
2
0
true
0
0
use standard streams. use a simple printf type command to print the string to stdout. then read it with a raw_input() in python. run the two programs like so: ./output | ./read.py
2
0
0
0
i need to know how share variable between two program, basically the go program have to write a variable ,like a string, and the python program have to read this variable. Please help me, thank you in advance.
how to share variable between python and go language?
0
1.2
1
0
0
247
8,715,435
2012-01-03T16:37:00.000
1
0
1
0
0
python,variables,environment-variables,go,share
0
8,752,696
0
2
0
false
0
0
In Windows, most common way to do communication between two processes is "Named Pipe" (could also be tcp/ip, web service, etc...). A ugly but lighter way is to write the value to a file, and read it from python.
2
0
0
0
i need to know how share variable between two program, basically the go program have to write a variable ,like a string, and the python program have to read this variable. Please help me, thank you in advance.
how to share variable between python and go language?
0
0.099668
1
0
0
247
8,721,870
2012-01-04T04:03:00.000
3
0
0
0
0
python,file,sockets
0
8,722,433
0
4
0
false
0
0
ZeroMQ helps to replace sockets. You can send an entire file in one command. A ZMQ 'party' can be written in any major language and for a given ZMQ-powered software, it doesnt matter what the other end it written in. From their site: It gives you sockets that carry whole messages across various transports like in-p...
1
7
0
0
I don't know if this has been answered before(i looked online but couldn't find one), but how can i send a file (.exe if possible) over a network to another computer that is connected to the network? I tried sockets but i could only send strings and i've tried to learn ftplib but i don't understand it at all or if ftp ...
How to transfer a file between two connected computers in python?
0
0.148885
1
0
1
24,645
8,731,179
2012-01-04T17:26:00.000
-1
0
1
1
0
python,bash,redhat
0
8,732,259
0
6
0
false
0
0
This is a job for cron. Cron man, man cron!
1
2
0
0
I'm in a red hat environment. I need to move a file from server A to server B when a file is available in a folder F. THere's no constraint on the method used. Is it possible to trigger this event in python or any other scripts? It could be run as a daemon but I'm not sure how to do that. Any advices?
How to start a script based on an event?
1
-0.033321
1
0
0
176
8,736,396
2012-01-05T01:13:00.000
0
0
1
0
0
python
0
8,741,894
0
4
0
false
0
0
Like the commentators have said, find someone to talk to in your university. The answer to your question will be specific to what software is installed on the grid. If you have access to a grid, it's highly likely you also have access to a person whose job it is to answer your questions (and they will be pleased to h...
1
2
1
0
I have a two dimensional table (Matrix) I need to process each line in this matrix independently from the others. The process of each line is time consuming. I'd like to use parallel computing resources in our university (Canadian Grid something) Can I have some advise on how to start ? I never used parallel computing ...
Parallel computing
0
0
1
0
0
1,155
8,749,108
2012-01-05T20:13:00.000
8
1
1
0
1
python,import,symlink
0
41,005,775
0
2
0
false
0
0
This kind of behavior can happen if your symbolic links are not set up right. For example, if you created them using relative file paths. In this case the symlinks would be created without error but would not point anywhere meaningful. If this could be the cause of the error, use the full path to create the links and c...
1
17
0
0
I have a folder A which contains some Python files and __init__.py. If I copy the whole folder A into some other folder B and create there a file with "import A", it works. But now I remove the folder and move in a symbolic link to the original folder. Now it doesn't work, saying "No module named foo". Does anyone know...
Python: import symbolic link of a folder
0
1
1
0
0
22,941
8,772,087
2012-01-07T18:46:00.000
0
0
1
0
0
python,pickle
0
8,772,278
0
3
0
true
0
0
You can store it for as long as you want. It's just a file. However, if your data structures start becoming complicated, it can become tedious and time consuming to unpickle, update and pickle the data again. Also, it's just file access so you have to handle concurrency issues by yourself.
3
0
0
0
I'm storing a list of dictionaries in cPickle, but need to be able to add and remove to/from it occasionally. If I store the dictionary data in cPickle, is there some sort of limit on when I will be able to load it again?
how long can i store data in cPickle?
0
1.2
1
0
0
164
8,772,087
2012-01-07T18:46:00.000
0
0
1
0
0
python,pickle
0
8,772,238
0
3
0
false
0
0
cPickle is just a faster implementation of pickle. You can use it to convert a python object to its string equivalent and retrieve it back by unpickling. You can do one of the two things with a pickled object: Do not write to a file In this case, the scope of your pickled data is similar to that of any other variable...
3
0
0
0
I'm storing a list of dictionaries in cPickle, but need to be able to add and remove to/from it occasionally. If I store the dictionary data in cPickle, is there some sort of limit on when I will be able to load it again?
how long can i store data in cPickle?
0
0
1
0
0
164
8,772,087
2012-01-07T18:46:00.000
0
0
1
0
0
python,pickle
0
8,772,177
0
3
0
false
0
0
No. cPickle just writes data to files and reads it back; why would you think there would be a limit?
3
0
0
0
I'm storing a list of dictionaries in cPickle, but need to be able to add and remove to/from it occasionally. If I store the dictionary data in cPickle, is there some sort of limit on when I will be able to load it again?
how long can i store data in cPickle?
0
0
1
0
0
164