content stringlengths 85 101k | title stringlengths 0 150 | question stringlengths 15 48k | answers list | answers_scores list | non_answers list | non_answers_scores list | tags list | name stringlengths 35 137 |
|---|---|---|---|---|---|---|---|---|
Q:
Django: Is it reasonable to use objects as dictionary keys?
Is it reasonable to use objects as keys to a dictionary in django? I have done so and it works. But I am wondering if this is best practice, or if it is going to make difficulties I don't foresee right now.
I am working on a project which deals with educ... | Django: Is it reasonable to use objects as dictionary keys? | Is it reasonable to use objects as keys to a dictionary in django? I have done so and it works. But I am wondering if this is best practice, or if it is going to make difficulties I don't foresee right now.
I am working on a project which deals with educational standards. I have dictionaries with a structure along th... | [
"Mutable objects shouldn't really be used as dictionary keys. That said, this works because the base model class defines __hash__ in terms of the model's primary key, which is unlikely to change. But I would prefer to use the pk directly as the key.\n",
"It depends how you want to use them. I'd suggest a simpler ... | [
13,
3
] | [
"Assuming the objects implement a good hash function I'd say that there's nothing wrong with using objects as keys, but that is just my personal opinion.\n",
"It would be better to use string representation since, when you will need to do looks up you will need to write out all that stuff, which will be a pain, p... | [
-1,
-1
] | [
"dictionary",
"django",
"key",
"python"
] | stackoverflow_0007042530_dictionary_django_key_python.txt |
Q:
Python: base class for all other classes
In Python, what is the base class for all other classes (real Base), that all other classes inherit from?
A:
All new style classes inherit from object.
New-style classes were introduced in Python 2.2 to unify classes and types. Here there is a nice description of what a n... | Python: base class for all other classes | In Python, what is the base class for all other classes (real Base), that all other classes inherit from?
| [
"All new style classes inherit from object.\nNew-style classes were introduced in Python 2.2 to unify classes and types. Here there is a nice description of what a new style class is. – Paolo Moretti\n",
"It is object. At least in 2.7 and 3.1.\n>>> class A():\n... pass\n... \n>>> isinstance(A, object)\nTrue\n... | [
4,
1
] | [] | [] | [
"python"
] | stackoverflow_0007042606_python.txt |
Q:
Twitter - Follow followers of a user using python
I am trying to automate a few things for my twitter account,
Is it possible to follow the followers of a selected user via a python script ?
A:
Yes, it is possible, you even can rely on third party applications that can do this for you: http://pypi.python.org/py... | Twitter - Follow followers of a user using python | I am trying to automate a few things for my twitter account,
Is it possible to follow the followers of a selected user via a python script ?
| [
"Yes, it is possible, you even can rely on third party applications that can do this for you: http://pypi.python.org/pypi/twitter/1.6.1\nThe other solution is to rely on their API and make the correct HTTP calls there by yourself.\n"
] | [
1
] | [] | [] | [
"python",
"twitter"
] | stackoverflow_0007040744_python_twitter.txt |
Q:
Python String Formatting
I am reading from an informix database on windows server via python and pyobdc.
Retrieving a row with decimal values I get something like this:
[(Decimal("0.99"), ), (Decimal("0.0"), ), (Decimal("113.84"), ),.....]
It is no problem to get rid of the Word decimal but I cant figure out ... | Python String Formatting | I am reading from an informix database on windows server via python and pyobdc.
Retrieving a row with decimal values I get something like this:
[(Decimal("0.99"), ), (Decimal("0.0"), ), (Decimal("113.84"), ),.....]
It is no problem to get rid of the Word decimal but I cant figure out how to delete all the braces a... | [
"You can just calculate sum of Decimal objects, they have __sum__ method.\n>>> from decimal import Decimal\n>>> a = [(Decimal(\"0.99\"), ), (Decimal(\"0.0\"), ), (Decimal(\"113.84\"), )]\n>>> sum(i[0] for i in a) #Because they're in a tuple\nDecimal('114.83')\n\n",
"Your problem isn't that you have the Decimal(\"... | [
3,
1
] | [] | [] | [
"format",
"python",
"string"
] | stackoverflow_0007042663_format_python_string.txt |
Q:
PIL's colour space conversion YCbCr -> RGB
The algorithm used by PIL v1.1.7 gives 'washed out' looking results. When converting the same source data using ffmpeg it looks correct. Using mplayer gives identical results to ffmpeg (perhaps they use the same library underneath). This leads me to believe PIL may be ... | PIL's colour space conversion YCbCr -> RGB | The algorithm used by PIL v1.1.7 gives 'washed out' looking results. When converting the same source data using ffmpeg it looks correct. Using mplayer gives identical results to ffmpeg (perhaps they use the same library underneath). This leads me to believe PIL may be stuffing up the colour space conversions. The c... | [
"If you look at Wikipedia's definitions, you can see that there are two conflicting definitions for YCbCr. The ITU-R BT.601 definition compresses the values to the range 16-235 to provide footroom and headroom, while the JPEG version uses the full range 0-255. If you were to decode values in the BT.601 space using ... | [
9
] | [] | [] | [
"c",
"python",
"python_imaging_library",
"rgb",
"yuv"
] | stackoverflow_0007041172_c_python_python_imaging_library_rgb_yuv.txt |
Q:
Sensing password protected sites when using urllib in python
Hi I have a long series of urls of images (eg. site.com/pic.jpg) which I am retrieving in order for my program (in Python v2.6). I'm using urllib.urlretreive(). Sometimes the url prompts me for a username and password. So I placed urllib.urlretreive() in... | Sensing password protected sites when using urllib in python | Hi I have a long series of urls of images (eg. site.com/pic.jpg) which I am retrieving in order for my program (in Python v2.6). I'm using urllib.urlretreive(). Sometimes the url prompts me for a username and password. So I placed urllib.urlretreive() in a try/except to avoid those urls but I still need to insert a fak... | [
"If the site has HTTP authentication, you need to add a header to your request to insert a username and password (fake or otherwise). Here's how you can do this using urllib2.\nimport base64\nimport urllib2\n\nheaders = {'Authorization': 'Basic ' + base64.encodestring('[username]:[password]')}\nreq = urllib2.Reques... | [
2
] | [] | [] | [
"error_handling",
"python",
"urllib"
] | stackoverflow_0007042867_error_handling_python_urllib.txt |
Q:
Using python map to replace all floats in a list with rounded floats of type str
I have a function that takes a list of floats and returns the same list of floats except they have exactly 4 digits after the decimal, as strings
Currently it is simply
for i in range(len(floats)):
floats[i] = "%.4f" %floats[i]
W... | Using python map to replace all floats in a list with rounded floats of type str | I have a function that takes a list of floats and returns the same list of floats except they have exactly 4 digits after the decimal, as strings
Currently it is simply
for i in range(len(floats)):
floats[i] = "%.4f" %floats[i]
Which does the job.
But can I do this using the map function (since http://wiki.python.... | [
"map is only faster if you use built-in functions (or at least it was when I read about it once ;)). You could use list comprehension though:\npattern = \"%.4f\"\nfloats = [pattern % i for i in floats]\n\nNote that map and list comprehension will create a new list, whereas the for loop won't. This might be relevant... | [
4,
2,
0
] | [] | [] | [
"list",
"optimization",
"python"
] | stackoverflow_0007042780_list_optimization_python.txt |
Q:
How to compute the similarity between lists of features?
I have users and resources. Each resource is described by a set of features and each user is related to a different set of resources. In my particular case, the resources are web pages, and the features information about the location of the visit, the time o... | How to compute the similarity between lists of features? | I have users and resources. Each resource is described by a set of features and each user is related to a different set of resources. In my particular case, the resources are web pages, and the features information about the location of the visit, the time of the visit, the number of visit etc, which are tied to a spec... | [
"If each user is represented as a set of document-interaction vectors you can define the similarity of a pair of users as the similarity of the pair of document-interaction vector sets that represent the users. \nYou say you can get a similarity matrix of the documents. Then assume that user U1 visited documents D1... | [
1,
0,
0
] | [] | [] | [
"machine_learning",
"numpy",
"python"
] | stackoverflow_0007042150_machine_learning_numpy_python.txt |
Q:
Python+gtk fullscreen window cover (or toggle) another fullscreen application
Anyway to make a python GTK window cover or remove from fullscreen another window that is already on fullscreen mode?
My scenario is that I have a app in fullscreen mode (firefox) and when I call window.fullscreen() the window dont cover... | Python+gtk fullscreen window cover (or toggle) another fullscreen application | Anyway to make a python GTK window cover or remove from fullscreen another window that is already on fullscreen mode?
My scenario is that I have a app in fullscreen mode (firefox) and when I call window.fullscreen() the window dont cover the firefox window, and remains in second plane.
| [
"Using gtk.gdk.Window.set_keep_above will tell the window manager to raise your window above other windows and keep it on top, unless other windows also have keep-above set. Some users won't like that behavior because it can make it difficult to get to or raise other windows. An alternative is to send messages to... | [
0
] | [] | [] | [
"gtk",
"python"
] | stackoverflow_0007019826_gtk_python.txt |
Q:
php exec fails when python imports a file
I have this code in php:
$var = "something";
$result = exec("python /somePath/someFile.py $var");
print $result;
and my someFile.py is like this:
import functions as f
x = f.removeSpace("hey there")
print x
Now, without the import functions everything is ok, but when... | php exec fails when python imports a file | I have this code in php:
$var = "something";
$result = exec("python /somePath/someFile.py $var");
print $result;
and my someFile.py is like this:
import functions as f
x = f.removeSpace("hey there")
print x
Now, without the import functions everything is ok, but when I try to import another module then php screws... | [
"I had a problem like this recently. It turned out that PHP's exec wasn't passing environment variables through to the program it executed, so Python wasn't seeing $PYTHONPATH, and didn't know where to import the module from.\nI don't know how to fix that from PHP, but in our case, symlinking the imported package t... | [
2,
1,
0
] | [] | [] | [
"exec",
"php",
"python"
] | stackoverflow_0007043549_exec_php_python.txt |
Q:
Idiomatic way to aggregate modules into a single "facade" module
I want to combine a list of known modules (bar, baz, qux) from different packages into a single module that my application can access as a facade (foo).
I also want bar, baz, and qux to have control over what it "exports", while foo will have no know... | Idiomatic way to aggregate modules into a single "facade" module |
I want to combine a list of known modules (bar, baz, qux) from different packages into a single module that my application can access as a facade (foo).
I also want bar, baz, and qux to have control over what it "exports", while foo will have no knowledge of the contents of these modules and will simply "re-export" th... | [
"This is pretty much the only reasonable use case for import *, in my opinion. I think the way you've done it is fine. If you didn't have __all__ defined in the other modules then I'd still suggest importing the names you want from each explicitly.\n"
] | [
3
] | [] | [] | [
"python"
] | stackoverflow_0007043754_python.txt |
Q:
Django Apache - Run script as Root
My django project calls a python file at a scheduled time using "at" scheduler. This is executed within my models.py
command = 'echo "python /path/to/script.py params" | /usr/bin/at -t [time] &> path/to/at.log'
status = os.system(command)
Where [time] is schedule time.
It works ... | Django Apache - Run script as Root | My django project calls a python file at a scheduled time using "at" scheduler. This is executed within my models.py
command = 'echo "python /path/to/script.py params" | /usr/bin/at -t [time] &> path/to/at.log'
status = os.system(command)
Where [time] is schedule time.
It works perfectly when I run it within Django De... | [
"Use cron or celery for scheduled tasks. If you need to run something as root, it'd make sense to re-write your script as a simple daemon and run that as root, you can pass commands to it pretty easily with zeromq.\n"
] | [
2
] | [] | [] | [
"apache",
"django",
"mod_wsgi",
"python"
] | stackoverflow_0007043846_apache_django_mod_wsgi_python.txt |
Q:
how to call a c-function expecting a pointer to a structure with ctypes?
I face the following problem. In C I wrote the following:
#include <stdio.h>
typedef struct {
double *arr;
int length;
} str;
void f(str*);
int main (void){
double x[3] = {0.1,0.2,0.3};
str aa;
aa.length = 3;
aa.arr = x;
f(&a... | how to call a c-function expecting a pointer to a structure with ctypes? | I face the following problem. In C I wrote the following:
#include <stdio.h>
typedef struct {
double *arr;
int length;
} str;
void f(str*);
int main (void){
double x[3] = {0.1,0.2,0.3};
str aa;
aa.length = 3;
aa.arr = x;
f(&aa);
return 0;
}
void f(str *ss){
int i;
printf("%d\n",ss->length);
... | [
"Your fields are reversed. Try:\nclass pystruc (ctypes.Structure):\n _fields_=[\n (\"arr\",ptrToDouble)\n (\"length\",ctypes.c_int),\n ]\n\n"
] | [
3
] | [] | [] | [
"ctypes",
"pointers",
"python",
"structure"
] | stackoverflow_0007040576_ctypes_pointers_python_structure.txt |
Q:
Create a 'single-serving site' with python
I want to make a Python script available as a service on the net. The script, which is my first 'proper' Python program, takes a txt file as argument and writes an image into the work directory. So:
How difficult is it for somebody who is new to Python and web developmen... | Create a 'single-serving site' with python | I want to make a Python script available as a service on the net. The script, which is my first 'proper' Python program, takes a txt file as argument and writes an image into the work directory. So:
How difficult is it for somebody who is new to Python and web development?
How much work is it?
Do I need a framework (D... | [
"\nIt's not too difficult. Actually, it sounds like a good first project.\nThat too subjective to answer. An hour to days.\nNo, you don't need one, but I'd use one if I were you. They abstract away some of the stuff you really don't care about, and you'll learn a tool you can use again in the future.\nPlenty. If yo... | [
1,
0,
0,
0
] | [] | [] | [
"python",
"web_frameworks",
"web_services"
] | stackoverflow_0006980366_python_web_frameworks_web_services.txt |
Q:
How do generate random numbers, while avoiding numbers already used
How do i generate random numbers but have the numbers avoid numbers already used.
I have a TXT file with thousands of sets of numbers and i need to generate a series of random numbers while avoiding these.
IE, TXT - 0102030405
my random number ne... | How do generate random numbers, while avoiding numbers already used | How do i generate random numbers but have the numbers avoid numbers already used.
I have a TXT file with thousands of sets of numbers and i need to generate a series of random numbers while avoiding these.
IE, TXT - 0102030405
my random number needs to avoid this number.
on a side note, how can i split up the TXT 10... | [
"You could load up all previously found random numbers into a dictionary, then just check whether new_random in dictionary, and if it is try a new random number.\nFor the second party, say your ten digit number is stored in variable ten_digits.\nten_digits = '1234567890'\n\nyou can break this up into 5 two digit nu... | [
1,
1,
0,
0
] | [] | [] | [
"generator",
"numbers",
"python",
"random"
] | stackoverflow_0007033542_generator_numbers_python_random.txt |
Q:
Compiling java from python
I'm writing a script to compile a .java file from within python
But the error
import subprocess
def compile_java(java_file):
cmd = 'javac ' + java_file
proc = subprocess.Popen(cmd, shell=True)
compile_java("Test.java")
Error:
javac is not recognized as an internal or external... | Compiling java from python | I'm writing a script to compile a .java file from within python
But the error
import subprocess
def compile_java(java_file):
cmd = 'javac ' + java_file
proc = subprocess.Popen(cmd, shell=True)
compile_java("Test.java")
Error:
javac is not recognized as an internal or external command windows 7
I know how t... | [
"proc = subprocess.Popen(cmd, shell=True, env = {'PATH': '/path/to/javac'})\n\nor \ncmd = '/path/to/javac/javac ' + java_file \nproc = subprocess.Popen(cmd, shell=True)\n\n",
"You can also send arguments as well: \n variableNamePython = subprocess.Popen([\"java\", \"-jar\", \"lib/JavaTest.jar\", var... | [
9,
1
] | [] | [] | [
"compilation",
"java",
"javac",
"python"
] | stackoverflow_0007016249_compilation_java_javac_python.txt |
Q:
Python interpreted code optimisation
Consider the following code snippet:
dict [name] = 0
dict [name] += 1
dict [name] += 1
Does the python interpreter automatically recognise the repeated references to the dictionary value and use a cached local reference instead?, somewhat akin to the aliasing optimisations of ... | Python interpreted code optimisation | Consider the following code snippet:
dict [name] = 0
dict [name] += 1
dict [name] += 1
Does the python interpreter automatically recognise the repeated references to the dictionary value and use a cached local reference instead?, somewhat akin to the aliasing optimisations of C/C++, becoming something like so:
value =... | [
"You can run it through the disassembler to find out:\nimport dis\n\ndef test():\n name = 'test'\n tdict = {}\n tdict[name] = 0\n tdict[name] += 1\n tdict[name] += 1\n\ndis.dis(test)\n\nRunning this we get:\n 13 0 LOAD_CONST 1 ('test')\n 3 STORE_FAST ... | [
28,
9,
1,
1
] | [] | [] | [
"interpreter",
"optimization",
"python"
] | stackoverflow_0007044515_interpreter_optimization_python.txt |
Q:
Py2EXE failing to create Executable
I'm trying to create an executable for a Python Project I'm working on.
I've been creating executable for a while, and today when I made a minor change to the program and tried to create the executable, it failed.
I'm using the latest version of Python(x,y), with a full installa... | Py2EXE failing to create Executable | I'm trying to create an executable for a Python Project I'm working on.
I've been creating executable for a while, and today when I made a minor change to the program and tried to create the executable, it failed.
I'm using the latest version of Python(x,y), with a full installation.
The error I'm getting is:
*** copy ... | [
"Are you accessing the project over a network drive?\nI encountered this same problem when trying to use py2exe on a virtualbox virtual machine, with the source files located on a \"virtualbox shared folder\". The error itself, it seems, occurs when read() tries to grab too big a chuck of data on a network drive:\n... | [
1
] | [] | [] | [
"py2exe",
"python"
] | stackoverflow_0006984043_py2exe_python.txt |
Q:
Add a String as an Item to a tableWidget in QT/Python
I have an array with strings and I want to add each string in a different row and the same column of a tableWidget.
I'm using the function setItem to change the desired field, but I get the error QTableWidget.setItem(int, int, QTableWidgetItem): argument 3 has ... | Add a String as an Item to a tableWidget in QT/Python | I have an array with strings and I want to add each string in a different row and the same column of a tableWidget.
I'm using the function setItem to change the desired field, but I get the error QTableWidget.setItem(int, int, QTableWidgetItem): argument 3 has unexpected type 'str'.
I've searched a little and I think I... | [
"The QTableWidgetItem constructor accepts a string as an argument. In your case, you just need to change your fifth line to (assuming parameter is a list of strings)\nself.tableWidget.setItem(i, 0, QtGui.QTableWidgetItem(parameter[i]))\n\n",
"You get the error because setItem takes in QTableWidgetItem* as input ... | [
6,
0
] | [] | [] | [
"python",
"qt",
"qtablewidget",
"qtablewidgetitem",
"string"
] | stackoverflow_0007043467_python_qt_qtablewidget_qtablewidgetitem_string.txt |
Q:
Problem with the ipy.vim script
I'm trying to use the ipy.vim script to set up a small python dev environment, but I'm running into a connection problem. When I type ipy_vimserver.setup("demo") I get this error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.p... | Problem with the ipy.vim script | I'm trying to use the ipy.vim script to set up a small python dev environment, but I'm running into a connection problem. When I type ipy_vimserver.setup("demo") I get this error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
... | [
"Problem:\nLook at the last line of the stack trace: error: [Errno 98] Address already in use\nExplanation:\nA nice explanation of \"Address already in use\" error can be found here: \"Bind: Address Already in Use\"\nPossible Solution:\nAs I have not tried ipy.vim setup myself, from networking point of view, a quic... | [
0,
0,
0
] | [] | [] | [
"ipython",
"python",
"vim"
] | stackoverflow_0005835043_ipython_python_vim.txt |
Q:
Plotting directly to movie with numpy and mencoder
So, this should be a comment to this thread, but it's apparently closed, so here it goes. I've been playing around quite successfully with matplotlib and numpy and mencoder, as has been suggested around here. I have since adopted Voki Codder buffer to stdin soluti... | Plotting directly to movie with numpy and mencoder | So, this should be a comment to this thread, but it's apparently closed, so here it goes. I've been playing around quite successfully with matplotlib and numpy and mencoder, as has been suggested around here. I have since adopted Voki Codder buffer to stdin solution, which speeds the whole process up considerably. The ... | [
"I think you're getting confused on what the uint32 represents. It's 4 bands of uint8 integers. \nIf you have floating point data, and want to represent it in grayscale, you don't want to rescale it to a full 32 bit range, you want to rescale it to an 8-bit range, and repeat that for the red, green, and blue bands... | [
5
] | [] | [] | [
"matplotlib",
"mencoder",
"numpy",
"python",
"video_processing"
] | stackoverflow_0007042190_matplotlib_mencoder_numpy_python_video_processing.txt |
Q:
Grouping model objects in Django
I have an app with 2 models: Product and Photo, each of which corresponds to a MySQL table (drived by MyISAM).
Product is a ForeignKey field of Photo. Several Photo objects may share a single Product object.
Now, the question: I need Photo objects to be further subgrouped into sets... | Grouping model objects in Django | I have an app with 2 models: Product and Photo, each of which corresponds to a MySQL table (drived by MyISAM).
Product is a ForeignKey field of Photo. Several Photo objects may share a single Product object.
Now, the question: I need Photo objects to be further subgrouped into sets representing the same real world obje... | [
"Seems like your approach is decent so far. I considered a manytomany field from product to photos, but it doesn't sound like its needed. You could add an 'aspect' column that relates to a list of 'choices' on the photo table. Also remember django will let you query both ways:\nPhoto.objects.filter(product__id=1)\n... | [
1
] | [] | [] | [
"database_design",
"django",
"python"
] | stackoverflow_0007044400_database_design_django_python.txt |
Q:
HTTPSimpleServer - How to close/terminate it?
I recently learned I could run a server with this command:
sudo python -m HTTPSimpleServer
My question: how do I terminate this server when done with it?
A:
Type Control-C. Simple as that.
A:
You might want to check the HttpServer class in this servlet module for... | HTTPSimpleServer - How to close/terminate it? | I recently learned I could run a server with this command:
sudo python -m HTTPSimpleServer
My question: how do I terminate this server when done with it?
| [
"Type Control-C. Simple as that.\n",
"You might want to check the HttpServer class in this servlet module for a modification that allows the server to be quit. If the handler raises a SystemExit exception, the server will break from its serving.\n\nclass HttpServer(socketserver.ThreadingMixIn, http.server.HTTPSe... | [
5,
0
] | [] | [] | [
"macos",
"python",
"terminal"
] | stackoverflow_0007045371_macos_python_terminal.txt |
Q:
Is it possible to retrieve messages from SQS while they're invisible?
Is it possible to retrieve messages from an SQS queue during their visibility timeout if you don't have the message id? I.e. something along the lines of "get invisible messages" or "get messages currently being processed".
I'm working with larg... | Is it possible to retrieve messages from SQS while they're invisible? | Is it possible to retrieve messages from an SQS queue during their visibility timeout if you don't have the message id? I.e. something along the lines of "get invisible messages" or "get messages currently being processed".
I'm working with large timeouts and sometimes I'd like to be able to inspect the queue to see wh... | [
"As far as I know there is no way of doing this. Seeing as your processing code should only take what it needs off the queue and nothing more it doesn't seem like you would ever need to do this. Do your jobs actually take 5hrs to complete? I assume based on \"I'm working with large timeouts\" they do but if not you... | [
2
] | [] | [] | [
"amazon_sqs",
"amazon_web_services",
"boto",
"parallel_processing",
"python"
] | stackoverflow_0007044319_amazon_sqs_amazon_web_services_boto_parallel_processing_python.txt |
Q:
PyPDF's PdfFileReader() having problems reading file, file not callable
So here is my import:
from pyPdf import PdfFileWriter, PdfFileReader
Here is were I write my pdf:
filenamer = filename + '.pdf'
pdf = PdfPages(filenamer)
(great naming convention, I know!)
I write some things to it.
I close it here:
pdf.clos... | PyPDF's PdfFileReader() having problems reading file, file not callable | So here is my import:
from pyPdf import PdfFileWriter, PdfFileReader
Here is were I write my pdf:
filenamer = filename + '.pdf'
pdf = PdfPages(filenamer)
(great naming convention, I know!)
I write some things to it.
I close it here:
pdf.close()
Here is where I try and read it:
input1 = PdfFileReader(file(filenamer, ... | [
"It looks like you've assigned an open file to the name file, and then you can't use the builtin any more.\n"
] | [
4
] | [] | [] | [
"file_io",
"pypdf",
"python"
] | stackoverflow_0007045606_file_io_pypdf_python.txt |
Q:
PyQt, trying to make LCD qt widget countdown
I have a project I'm working on where I have to program an elevator "simulator". I am using python and pyqt for the first time and having some difficulty.
At the moment I have 2 classes, one is the elevator class, other is the liftUI class which has a QLCDNumber widget.... | PyQt, trying to make LCD qt widget countdown | I have a project I'm working on where I have to program an elevator "simulator". I am using python and pyqt for the first time and having some difficulty.
At the moment I have 2 classes, one is the elevator class, other is the liftUI class which has a QLCDNumber widget. I have the elevator class set up to send the cur... | [
"I think you want to decrement curFloor don't you? Your while statement is while floorNum <= curFloor:. If you decrement floorNum, that statement will always be true.\n",
"In addition to the other problems mentioned here, your code is changing the number displayed in the UI without any time in between steps (an... | [
1,
1
] | [] | [] | [
"countdown",
"lcd",
"pyqt",
"python",
"qt"
] | stackoverflow_0007040896_countdown_lcd_pyqt_python_qt.txt |
Q:
Insert Numpy array into Mysql Database
Starting with anwser of this:
Using Numpy to create Yahoo finance price table
import numpy as np
import pylab as pl
import urllib
url = "http://ichart.yahoo.com/table.csv?a=2&c=2011&b=30&e=7&d=7&g=d&f=2011&s=msft&ignore=.csv"
f = urllib.urlopen(url)
title = f.readline().stri... | Insert Numpy array into Mysql Database | Starting with anwser of this:
Using Numpy to create Yahoo finance price table
import numpy as np
import pylab as pl
import urllib
url = "http://ichart.yahoo.com/table.csv?a=2&c=2011&b=30&e=7&d=7&g=d&f=2011&s=msft&ignore=.csv"
f = urllib.urlopen(url)
title = f.readline().strip().split(",")
data = np.loadtxt(f, dtype=np... | [
">>> import sqlalchemy as sa\n>>> import numpy as np\n>>> import time, datetime\n>>> import urllib\n\nconversions to and from date formats.\n>>> datestr2timestamp = lambda d: time.mktime(time.strptime(d,\"%Y-%m-%d\"))\n>>> def npvector_to_sadict(vector):\n... row = dict(zip((\"open\", \"high\", \"low\", \"close... | [
2,
1
] | [] | [] | [
"arrays",
"database",
"mysql",
"numpy",
"python"
] | stackoverflow_0007043158_arrays_database_mysql_numpy_python.txt |
Q:
Authorization in pylons
I use pylons for develop of my project. What lib I can use to authorization users? I know about authkit, but he not supported now.
A:
Not related to Pylons specifically, I usually use repoze.who for authentication and repoze.what for authorization.
http://docs.repoze.org/who
http://docs.r... | Authorization in pylons | I use pylons for develop of my project. What lib I can use to authorization users? I know about authkit, but he not supported now.
| [
"Not related to Pylons specifically, I usually use repoze.who for authentication and repoze.what for authorization.\nhttp://docs.repoze.org/who\nhttp://docs.repoze.org/what\n",
"Here's an excellent tutorial on how to use repoze.who/repoze.what. Which in my opinion is the best way to go. repoze.who/what tutorial\n... | [
2,
1
] | [] | [] | [
"pylons",
"python"
] | stackoverflow_0007037153_pylons_python.txt |
Q:
Explain pythonic table[n:m] where m does not mean x-th element
I do this mistake again and again, range(3)[1:2] does not return [1,2] but [1]. Could someone explain the logic twist here? Why are m and n not referring to x-th element with the same logic?
A:
Slices and ranges are a pair of numbers: the first eleme... | Explain pythonic table[n:m] where m does not mean x-th element | I do this mistake again and again, range(3)[1:2] does not return [1,2] but [1]. Could someone explain the logic twist here? Why are m and n not referring to x-th element with the same logic?
| [
"Slices and ranges are a pair of numbers: the first element to include, and then the first element not to include. By doing this, you get a few nice benefits. First, the length of the slice is end-start. Second, the slices [x:y] and [y:z] will fit nicely together without duplicating y.\nA recent thread challengi... | [
8,
4,
2
] | [] | [] | [
"python"
] | stackoverflow_0007045838_python.txt |
Q:
PyQT - How to implement Syntax Highlighting?
I want to write a little IDE for Cython using PyQT, but I don't have any idea how to implement Syntax Highlighting.
I know how to parse the Python-source, but I don't know how I can set the color for different words within the Textfield in PyQT.
I could use HTML for thi... | PyQT - How to implement Syntax Highlighting? | I want to write a little IDE for Cython using PyQT, but I don't have any idea how to implement Syntax Highlighting.
I know how to parse the Python-source, but I don't know how I can set the color for different words within the Textfield in PyQT.
I could use HTML for this, but how does it work in realtime ? I mean when ... | [
"Have you considered using QScintilla?\n\"As well as features found in standard text editing components, QScintilla includes features especially useful when editing and debugging source code. These include support for syntax styling, error indicators, code completion and call tips.\"\n",
"I would recommend checki... | [
5,
1
] | [] | [] | [
"cython",
"ide",
"pyqt",
"python",
"syntax_highlighting"
] | stackoverflow_0007043185_cython_ide_pyqt_python_syntax_highlighting.txt |
Q:
Django: Allowing only one booleanfield to be True
Having a such model, I want to make sure only one Photo for each album to have a cover. This will be used as InlineModelAdmin to the Album model.
class Photo(models.Model):
is_cover = models.BooleanField( default=False)
album = models.ForeignKey('Album')
... | Django: Allowing only one booleanfield to be True | Having a such model, I want to make sure only one Photo for each album to have a cover. This will be used as InlineModelAdmin to the Album model.
class Photo(models.Model):
is_cover = models.BooleanField( default=False)
album = models.ForeignKey('Album')
image = ImageField(upload_to='uploads')
How can this... | [
"Which photo is on the cover of the album should be a property of the album, not the Photo.\nInstead of using a boolean property in your Photos, use a reference to a Photo in your Album.\nAnswer to Comment: Assuming that 'inline model' means what I assume it to be in my comment, you will probably have to provide yo... | [
5
] | [] | [] | [
"django",
"python"
] | stackoverflow_0007046208_django_python.txt |
Q:
Problematic Parallel Distributive Processing using Python Libraries or any language
I've been sitting on this idea of working on a "networked intelligence" to look into some interesting ideas on the nature of intelligence and computers. I've decided to go about doing this by designing small robotic agents that wil... | Problematic Parallel Distributive Processing using Python Libraries or any language | I've been sitting on this idea of working on a "networked intelligence" to look into some interesting ideas on the nature of intelligence and computers. I've decided to go about doing this by designing small robotic agents that will utilize PDP across some medium, (i.e. wifi/IR or something, to be decided), to enable t... | [
"Interesting idea, remins me on sensor networks.\nYou may find that an ardunio is a little underpowered for what you want. Perhaps it would be more efficient and easier to send the data back to a PC for processing.\nIf you want to continue with the ardunio idea, you could implement MapReduce which is a fairly simpl... | [
0
] | [] | [] | [
"arduino",
"pdp",
"python",
"robotics"
] | stackoverflow_0007045073_arduino_pdp_python_robotics.txt |
Q:
Creating a matrix of options using itertools
I am trying to produce a matrix of True and False values, which shows all the permutations for a given number of choices. So for 5 choices you would have the following output.
F F F F F
T F F F F
T T F F F
T T T F F
...
F T F F F
...
I have been looking at using itert... | Creating a matrix of options using itertools | I am trying to produce a matrix of True and False values, which shows all the permutations for a given number of choices. So for 5 choices you would have the following output.
F F F F F
T F F F F
T T F F F
T T T F F
...
F T F F F
...
I have been looking at using itertool's permutations and combinations, but these wor... | [
"Use itertools.product:\nitertools.product([False,True],repeat=5)\n\nexample of itertools.product([False,True],repeat=2):\n(False, False)\n(False, True)\n(True, False)\n(True, True)\n\n",
"You seem to want the n-dimensional cartesian product of [False, True].\n>>> print list(itertools.product(*(itertools.repeat((... | [
8,
4,
2
] | [] | [] | [
"python",
"python_itertools"
] | stackoverflow_0007046178_python_python_itertools.txt |
Q:
Performance of NumPy for algorithms concerning individual elements of an array
I'm interested in the performance of NumPy, when it comes to algorithms that check whether a condition is True for an element and its affiliations (e.g. neighbouring elements) and assign a value according to the condition.
An example m... | Performance of NumPy for algorithms concerning individual elements of an array | I'm interested in the performance of NumPy, when it comes to algorithms that check whether a condition is True for an element and its affiliations (e.g. neighbouring elements) and assign a value according to the condition.
An example may be: (I make this up now)
I generate a 2d array of 1's and 0's, randomly.
Then ... | [
"Maybe http://www.scipy.org/Cookbook/GameOfLifeStrides helps you.\n",
"It looks like your are doing some kind of image processing, you can try scipy.ndimage. \nfrom scipy.ndimage import convolve\nimport numpy as np\nnp.random.seed(0)\nx = np.random.randint(0,2,(5,5))\n\nprint x\n\nw = np.ones((3,3), dtype=np.int8... | [
1,
1
] | [] | [] | [
"numpy",
"python"
] | stackoverflow_0007038939_numpy_python.txt |
Q:
Can't get Scrapy to follow links
I am trying to scrape a website but I can't get scrapy to follow links and I don't get any Python errors and I see nothing going on with Wireshark. I thought it could be the regex but I tried ".*" to try to follow any link but it doesn't work either. The method "parse" does work th... | Can't get Scrapy to follow links | I am trying to scrape a website but I can't get scrapy to follow links and I don't get any Python errors and I see nothing going on with Wireshark. I thought it could be the regex but I tried ".*" to try to follow any link but it doesn't work either. The method "parse" does work though but I need to follow "sinopsis.as... | [
"\nWhen writing crawl spider rules, avoid using parse as callback, since\n the CrawlSpider uses the parse method itself to implement its logic.\n So if you override the parse method, the crawl spider will no longer\n work.\n\nhttp://readthedocs.org/docs/scrapy/en/latest/topics/spiders.html\n"
] | [
8
] | [] | [] | [
"python",
"regex",
"scrapy",
"screen_scraping"
] | stackoverflow_0007045883_python_regex_scrapy_screen_scraping.txt |
Q:
Recode missing data Numpy
I am reading in census data using the matplotlib cvs2rec function - works fine gives me a nice ndarray.
But there are several columns where all the values are '"none"" with dtype |04. This is cuasing problems when I lode into Atpy "TypeError: object of NoneType has no len()". Something l... | Recode missing data Numpy | I am reading in census data using the matplotlib cvs2rec function - works fine gives me a nice ndarray.
But there are several columns where all the values are '"none"" with dtype |04. This is cuasing problems when I lode into Atpy "TypeError: object of NoneType has no len()". Something like '9999' or other missing wou... | [
"Here is a solution to this problem, although if your data is a record array you should only apply this operation to your column, rather than the whole array:\nimport numpy as np\n# initialise some data with None in it\na = np.array([1, 2, 3, None])\na = np.where(a == np.array(None), 9999, a)\n\nNote that you need ... | [
3,
0
] | [] | [] | [
"arrays",
"missing_data",
"numpy",
"python"
] | stackoverflow_0007011591_arrays_missing_data_numpy_python.txt |
Q:
temperature probes, voltage probes, etc. .dll
I am working on a program in python to monitor temperature of cpu and various other things including motherboard voltages.
I have tried using wmi, and acpi to read the probes, and have had no luck. this has been discussed here: http://www.python-forum.org/pythonforum... | temperature probes, voltage probes, etc. .dll | I am working on a program in python to monitor temperature of cpu and various other things including motherboard voltages.
I have tried using wmi, and acpi to read the probes, and have had no luck. this has been discussed here: http://www.python-forum.org/pythonforum/viewtopic.php?f=1&t=26726
I am now trying to read... | [
"The temperature probe and others is hardware and bios dependant. Try looking at the bios screen, if the CPU temp is displayed there wmi will give it to you, else try upgrading bios or try a new motherboard\nHonestly if in this day and age your server is not recording temperature at bios your motherboard is too ch... | [
0
] | [] | [] | [
"python",
"windows"
] | stackoverflow_0006573499_python_windows.txt |
Q:
How to link Python common variables like variable objects between classes?
I have a question regarding variable linking between objects. Because I'm learning Python programming by myself, I may have bad habits…
I am programming a module which will save me a lot of labor by managing by itself the standard configpar... | How to link Python common variables like variable objects between classes? | I have a question regarding variable linking between objects. Because I'm learning Python programming by myself, I may have bad habits…
I am programming a module which will save me a lot of labor by managing by itself the standard configparser module. I just have to pass to it as an argument, the list of the applicatio... | [
"I really didn't looked your code, but the common way to achieve this is using a list(or another mutable container) as a wrapper. \n>>> def a(n):\n... n = 5\n... \n>>> def b(n):\n... n[0] = 5\n... \n>>> k = 3\n>>> a(k)\n>>> k\n3\n>>> k = [3]\n>>> b(k)\n>>> k[0]\n5\n\n",
"As you suspected, numbers and stri... | [
0,
0,
0
] | [] | [] | [
"arguments",
"oop",
"pass_by_reference",
"python"
] | stackoverflow_0007046620_arguments_oop_pass_by_reference_python.txt |
Q:
Python console prints output differently than sypder console
I have a python code that takes measurements off of a HP LCR Meter and collects the data for us in various ways. I recently created a GUI for imputing initial conditions for employees not comfortable modifying variables in the code. Everything works exce... | Python console prints output differently than sypder console | I have a python code that takes measurements off of a HP LCR Meter and collects the data for us in various ways. I recently created a GUI for imputing initial conditions for employees not comfortable modifying variables in the code. Everything works except for 1 thing. WE use the latest python xy so python version 2.6.... | [
"Reason why you get continuous messages in your console, is that system logs use same output-stream than your app. \nSpyder is nice program, which just embeds IPython or Python(backup) console in QT window, you can use similar solution - just use Qt4 to draw window, which includes IPython console \nWhat you need to... | [
2
] | [] | [] | [
"pyqt",
"python",
"qt"
] | stackoverflow_0007043667_pyqt_python_qt.txt |
Q:
Set Image to Fill PyGTK
I'm using Python 2.7, PyGTK 2.24, and Glade 2.8.0. I'm trying to set an image to (stretch to) fill all of the given space, but I cannot find the properties to do that. Furthermore, I may need to shrink images to fit sometimes as well.
How do I do those two things in Glade?
A:
Glade does ... | Set Image to Fill PyGTK | I'm using Python 2.7, PyGTK 2.24, and Glade 2.8.0. I'm trying to set an image to (stretch to) fill all of the given space, but I cannot find the properties to do that. Furthermore, I may need to shrink images to fit sometimes as well.
How do I do those two things in Glade?
| [
"Glade does not allow for stretching images. This must be done in code, by scaling the pixbuf, creating a pixmap and mask from it, and then creating the image from the pixmap.\n"
] | [
0
] | [] | [] | [
"glade",
"image",
"pygtk",
"python"
] | stackoverflow_0006795169_glade_image_pygtk_python.txt |
Q:
python module installed and recognized, but unable to import it on my code or python 2.7.1 interpreter on Ubuntu
I'm stuck trying to get a python C module up and running. I'm installing deltaLDA module from Here. I followed the instructions as specified in REAMDE file. As usual, I wrote:
sudo python setup.py insta... | python module installed and recognized, but unable to import it on my code or python 2.7.1 interpreter on Ubuntu | I'm stuck trying to get a python C module up and running. I'm installing deltaLDA module from Here. I followed the instructions as specified in REAMDE file. As usual, I wrote:
sudo python setup.py install
Everything went as expected I guess, I get this output:
running build
running build_ext
building 'delt... | [
"First try\n>>> import deltaLDA\n\nIf that works review the docs or see dir(deltaLDA) as @arunkumar says, if not post your sys.path, your egg-info details please\n"
] | [
1
] | [] | [] | [
"installation",
"lda",
"module",
"python"
] | stackoverflow_0007046372_installation_lda_module_python.txt |
Q:
Fixed income data online
I am looking for a resource to download fixed income data online, much like there is access to stock data from yahoo. At the very least I'd like the treasury bonds.
I use python, but any help would be appreciated.
A:
Treasury bond price history is usually proprietary (Tradeweb, Bloomberg... | Fixed income data online | I am looking for a resource to download fixed income data online, much like there is access to stock data from yahoo. At the very least I'd like the treasury bonds.
I use python, but any help would be appreciated.
| [
"Treasury bond price history is usually proprietary (Tradeweb, Bloomberg, CRSP), but yield history is published. \nFor example:\nhttp://www.federalreserve.gov/pubs/feds/2006/\nNumber 2006-28: The U.S. Treasury Yield Curve: 1961 to the Present. Refet S. Gurkaynak, Brian Sack, and Jonathan H. Wright. This is accompan... | [
2,
1
] | [
"Try Bloomberg.\n"
] | [
-1
] | [
"finance",
"google_finance",
"python",
"stock"
] | stackoverflow_0002493732_finance_google_finance_python_stock.txt |
Q:
Getting unicode from a urllib request
I am running the following code trying to find particular information in some HTML. I am having an encoding/decoding problem, however, that I cannot resolve.
import urllib
req = urllib.urlopen('http://securities.stanford.edu/1046/AAI00_01/')
html = req.read()
type(html)
# <... | Getting unicode from a urllib request | I am running the following code trying to find particular information in some HTML. I am having an encoding/decoding problem, however, that I cannot resolve.
import urllib
req = urllib.urlopen('http://securities.stanford.edu/1046/AAI00_01/')
html = req.read()
type(html)
# <type 'str'>
html.upper().find('HTML')
# -... | [
"If you're trying to convert from the str you have to a unicode, you want to use html.decode, not encode. \nOlder, bad advice: Also, since you seem to have a BOM at the beginning there, you probably \nwant to use 'utf_8_sig' as the encoding, which will strip the BOM on decode.\nNew, better advice: Actually, from se... | [
1
] | [] | [] | [
"python",
"urllib"
] | stackoverflow_0007046944_python_urllib.txt |
Q:
How do you use the standard library in IronPython?
I'll prefix this question with: No, Setting IRONPYTHONPATH is not the answer.
Anyway...
I was planning on using IronPython as a replacement for Powershell for a project, but I've been stumped before I've even started.
The very first thing I tried to do was use os.... | How do you use the standard library in IronPython? | I'll prefix this question with: No, Setting IRONPYTHONPATH is not the answer.
Anyway...
I was planning on using IronPython as a replacement for Powershell for a project, but I've been stumped before I've even started.
The very first thing I tried to do was use os.path, resulting in:
Traceback (most recent call last):
... | [
"I find that for ensuring that everything works for non-developer third parties, it's usually better to use pyc.py to create DLL's and and executable. I routinely create a DLL of the python standard modules and reference that in code. See my previous answer at this question IronPython: EXE compiled using pyc.py c... | [
2,
1,
1
] | [] | [] | [
"c#",
"ironpython",
"python"
] | stackoverflow_0007005597_c#_ironpython_python.txt |
Q:
List of dictionaries and pyparsing
I'm using pyparsing to construct dictionaries that get appended to a list. When I do this the dictionaries get wrapped in an extra list and there is also an empty dict appended. I have no clue how to fix this. What I want is [{},{},{}]. I am getting [([{}],{})] Why the code from ... | List of dictionaries and pyparsing | I'm using pyparsing to construct dictionaries that get appended to a list. When I do this the dictionaries get wrapped in an extra list and there is also an empty dict appended. I have no clue how to fix this. What I want is [{},{},{}]. I am getting [([{}],{})] Why the code from getDict give me what I want and not getD... | [
"In Python, just because something looks like a list containing a list and a dict, doesn't mean that's what it is. Python objects implement a __repr__ method that will display an informative string, but this is sometimes misleading. In the case of pyparsing, the parseString method returns an object of type ParseR... | [
7
] | [] | [] | [
"pyparsing",
"python"
] | stackoverflow_0007045757_pyparsing_python.txt |
Q:
python when to use copy.copy
I think I'm starting to understand python, but I still have trouble with a basic question. When to use copy.copy?
>>>a=5
>>>b=a
>>>a=6
>>>print b
5
Ok makes sense. But in what circumstances does saying b=a form some kind of 'link' between a and b such that modifying a would then m... | python when to use copy.copy | I think I'm starting to understand python, but I still have trouble with a basic question. When to use copy.copy?
>>>a=5
>>>b=a
>>>a=6
>>>print b
5
Ok makes sense. But in what circumstances does saying b=a form some kind of 'link' between a and b such that modifying a would then modify b? This is what I don't get... | [
"Basically, b = a points b to wherever a points, and nothing else.\nWhat you're asking about is mutable types. Numbers, strings, tuples, frozensets, booleans, None, are immutable. Lists, dictionaries, sets, bytearrays, are mutable.\nIf I make a mutable type, like a list:\n>>> a = [1, 2] # create an object in memor... | [
31,
4
] | [] | [] | [
"python"
] | stackoverflow_0007046971_python.txt |
Q:
How do I read a jpg or png from the windows clipboard in python and vice versa?
I have an image (jpg, png, etc.) in the windows clipboard. I'd like to save it to a file. win32clipboard would seem to be the answer, but every example I can find deals with text.
copy an image to the clipboard, then
import win32clipb... | How do I read a jpg or png from the windows clipboard in python and vice versa? | I have an image (jpg, png, etc.) in the windows clipboard. I'd like to save it to a file. win32clipboard would seem to be the answer, but every example I can find deals with text.
copy an image to the clipboard, then
import win32clipboard
win32clipboard.OpenClipboard()
data = win32clipboard.GetClipboardData()
with ope... | [
"I would just use Pillow:\nfrom PIL import ImageGrab\nim = ImageGrab.grabclipboard()\nim.save('somefile.png','PNG')\n\n",
"You need to pass a parameter to GetClipboardData specifying the format of the data you're looking for. You can use EnumClipboardFormats to see the formats that are available - when I copy som... | [
36,
7,
5,
4
] | [] | [] | [
"python",
"pywin32"
] | stackoverflow_0007045264_python_pywin32.txt |
Q:
Can anyone help me understand Python variable scoping?
I wrote a test program that looked like this:
#!/usr/bin/python
def incrementc():
c = c + 1
def main():
c = 5
incrementc()
main()
print c
I'd think that since I called incrementc within the body of main, all variables from main would pass to i... | Can anyone help me understand Python variable scoping? | I wrote a test program that looked like this:
#!/usr/bin/python
def incrementc():
c = c + 1
def main():
c = 5
incrementc()
main()
print c
I'd think that since I called incrementc within the body of main, all variables from main would pass to incrementc. But when I run this program I get
Traceback (mos... | [
"You're thinking of dynamic scoping. The problem with dynamic scoping is that the behavior of incrementc would depend on previous function calls, which makes it very difficult to reason about the code. Instead most programming languages (also Python) use static scoping: c is visible only within main.\nTo accomplish... | [
6,
3,
2
] | [
"Global variables are bad.\nJust like friends and enemys. Keep your friends close but keep your enemys even closer.\nThe function main last a local variable c, assignment the value 5\nYou then call the function inc..C. The c from main is now out of scope so you are trying to use a value of c that is not in scope - ... | [
-1
] | [
"function",
"python"
] | stackoverflow_0007047133_function_python.txt |
Q:
replacement of the python facebook API?
as stated in bug #17429, official support for the python api is ending, does anyone know of a up-to-date facebook api for python? or should I look for another language or web framework?
A:
[...] does anyone know of a up-to-date facebook api for python?
Facepy might be wha... | replacement of the python facebook API? | as stated in bug #17429, official support for the python api is ending, does anyone know of a up-to-date facebook api for python? or should I look for another language or web framework?
| [
"\n[...] does anyone know of a up-to-date facebook api for python?\n\nFacepy might be what you're looking for.\n",
"According to that ticket support for SDK ends. The whole facebook API is language/technology agnostic and just a regular OAuth-based RESTful one\n",
"While I develop Facebook apps in PHP (still su... | [
3,
2,
0
] | [
"Django Facebook is mature:\nhttps://github.com/tschellenbach/Django-facebook\nThere's nothing language/framework agnostic about the facebook API.\nThe open graph api has it's own syntax.\nOauth takes care of authentication, but you still need to convert the output data to something your app can work with.\n"
] | [
-1
] | [
"api",
"django",
"facebook",
"python"
] | stackoverflow_0006657932_api_django_facebook_python.txt |
Q:
Only one python program running (like Firefox)?
When I open Firefox, then run the command:
firefox http://somewebsite
the url opens in a new tab of Firefox (same thing happens with Chromium as well). Is there some way to replicate this behavior in Python? For example, calling:
processStuff.py file/url
then calli... | Only one python program running (like Firefox)? | When I open Firefox, then run the command:
firefox http://somewebsite
the url opens in a new tab of Firefox (same thing happens with Chromium as well). Is there some way to replicate this behavior in Python? For example, calling:
processStuff.py file/url
then calling:
processStuff.py anotherfile
should not start two... | [
"The way Firefox does it is: the first instance creates a socket file (or a named pipe on Windows). This serves both as a way for the next instances of Firefox to detect and communicate with the first instance, and forward it the URL before dying. A socket file or named pipe being only accessible from processes run... | [
24,
8,
2,
2,
1
] | [] | [] | [
"firefox",
"google_chrome",
"process",
"python"
] | stackoverflow_0006992427_firefox_google_chrome_process_python.txt |
Q:
How do I alphabetize a file in Python?
I am trying to get a list of presidents alphabetized by last name, even though the file that it is being drawn is currently listed first name, last name, date in office, and date out of office.
Here is what I have, any help on what I need to do with this. I have searched arou... | How do I alphabetize a file in Python? | I am trying to get a list of presidents alphabetized by last name, even though the file that it is being drawn is currently listed first name, last name, date in office, and date out of office.
Here is what I have, any help on what I need to do with this. I have searched around for some answers, and most of them are be... | [
"What you should do is put the presidents in a list, sort that list, and then print out the resulting list.\nBefore your for loop add:\npresidents = []\n\nHave this code inside the for loop after you pull out the names/dates \npresident = (last_name, first_name, start_date, end_date)\npresidents.append(president)\n... | [
2,
0,
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0007035643_python.txt |
Q:
Attribute error on twisted
This question has already given me the reason WHY this error is happening now I want to know how to solve this issue.
Here is the code for main.py
from twisted.internet import reactor
import pygame
from networking import run, construct_factory
class GameEngine(object):
def __init__... | Attribute error on twisted | This question has already given me the reason WHY this error is happening now I want to know how to solve this issue.
Here is the code for main.py
from twisted.internet import reactor
import pygame
from networking import run, construct_factory
class GameEngine(object):
def __init__(self, client):
pygame.i... | [
"This seems like a case where your question is your answer. Remove your existing GameEngine instantiation code and change your GameClientFactory to have a buildProtocol like this:\ndef buildProtocol(self, address):\n proto = ClientFactory.buildProtocol(self, address)\n GameEngine(proto).spin()\n return pr... | [
2
] | [] | [] | [
"pygame",
"python",
"twisted"
] | stackoverflow_0007046842_pygame_python_twisted.txt |
Q:
web2py request.args(0) permissions
I'm working on a project,
this project must have many users, each user can create for examples many support tickets and he could see them and edit them, but he is not allowed to access any other ticket, which not belong to him
so for example :
def edit_ticket():
record = db.... | web2py request.args(0) permissions | I'm working on a project,
this project must have many users, each user can create for examples many support tickets and he could see them and edit them, but he is not allowed to access any other ticket, which not belong to him
so for example :
def edit_ticket():
record = db.e_ticket(request.args(0),active=True) or... | [
"it shouldn't be: \ndb.e_ticket(request.args(0),user_id==auth.user_id,active==True) \nbut \ndb.e_ticket(request.args(0),user_id=auth.user_id,active=True) - \nbecause here we're passing function arguments and not query conditions\n",
"web2py has buildin user access control. please reference the web2py book: \nuser... | [
1,
0,
0
] | [] | [] | [
"database",
"permissions",
"python",
"web2py"
] | stackoverflow_0007017144_database_permissions_python_web2py.txt |
Q:
Globally poll which files are being dragged in Windows API?
I'm wondering if it's possible to globally poll which (if any) files are currently being dragged in Windows using the Windows API, independently of any particular window.
For example, I'm doing some stuff with networking where, when the user drags a file... | Globally poll which files are being dragged in Windows API? | I'm wondering if it's possible to globally poll which (if any) files are currently being dragged in Windows using the Windows API, independently of any particular window.
For example, I'm doing some stuff with networking where, when the user drags a file to the edge of the screen, it notifies a separate computer that ... | [
"You want to hook DoDragDrop.\n"
] | [
1
] | [] | [] | [
"com",
"drag_and_drop",
"python",
"winapi",
"windows"
] | stackoverflow_0007046513_com_drag_and_drop_python_winapi_windows.txt |
Q:
write a class in python that accepts parameteres
I am writing a simple class that will basically accept 3 parameters, execute a series of commands and return the result.
Now the problem is that i am not clear about how to write a proper class in Python (i use C++ mainly); so is kinda weird for me to figure out wha... | write a class in python that accepts parameteres | I am writing a simple class that will basically accept 3 parameters, execute a series of commands and return the result.
Now the problem is that i am not clear about how to write a proper class in Python (i use C++ mainly); so is kinda weird for me to figure out what and how to write the class.
I have 3 parameters: nam... | [
"I think what you are looking for is the function definition thats like this def __init__(self, name=\"\", classId=\"\", objectType=\"\", *args, **kwargs):.\nWhat this defines besides the 3 known arguments (name, classId, objectType) is args which is a list of addtional arguments passed to the function, and kwargs ... | [
3,
0
] | [] | [] | [
"python"
] | stackoverflow_0007047679_python.txt |
Q:
Checking if a datetime object in mongodb is in UTC format or not from python
In mongodb, a field called joining_date appears as
"Sun Dec 19 2010 05:35:55 GMT+0000 (UTC)"
This as you see is a UTC date .
But the same field when accessed from pymongo appears as
datetime.datetime(2010, 12, 19, 5, 35, 55, 286000)
F... | Checking if a datetime object in mongodb is in UTC format or not from python | In mongodb, a field called joining_date appears as
"Sun Dec 19 2010 05:35:55 GMT+0000 (UTC)"
This as you see is a UTC date .
But the same field when accessed from pymongo appears as
datetime.datetime(2010, 12, 19, 5, 35, 55, 286000)
From python i need to check that the date is in utc format or not.
Problem: I get ... | [
"datetime objects returned by pymongo always represent a time in UTC, just as dates stored in MongoDB are always stored as (that is, assumed to be in) UTC.\npymongo can convert your datetimes automatically to be time zone aware if you set the tz_info flag to True when creating your Connection. You can then use date... | [
11,
1
] | [] | [] | [
"datetime",
"pymongo",
"python",
"pytz"
] | stackoverflow_0006846851_datetime_pymongo_python_pytz.txt |
Q:
Extracting bitmap data from an NSImage in python
I'm constructing wx.MemoryDC using the data from the NSImage, but the resulting code is very sluggish. It seems to me that TIFFRepresentation -> ImageFromStream step is the one that slows things down. Is there any way to avoid this step (all this streaming), and ini... | Extracting bitmap data from an NSImage in python | I'm constructing wx.MemoryDC using the data from the NSImage, but the resulting code is very sluggish. It seems to me that TIFFRepresentation -> ImageFromStream step is the one that slows things down. Is there any way to avoid this step (all this streaming), and initialize MemoryDC directly from the NSImage data? Here ... | [
"Try using:\nbitmap = wx.BitmapFromBuffer(...)\n\ninstead of ImageFromStream.\n",
"Answering my own question: interface to NSIimage is inherently slow, the only workable solution is to avoid it altogether.\n"
] | [
2,
1
] | [] | [] | [
"appkit",
"nsimage",
"python",
"wxpython"
] | stackoverflow_0005086126_appkit_nsimage_python_wxpython.txt |
Q:
Subprocess communicate: order matters?
So I'm trying to effectively create a "branch" in a pipe from subprocess. The idea is to load a file with Popen into a pipe's stdout. Then, I can send that stdout to two (or more) stdin's. This works, more or less. The problem comes when the process needs to see an EOF. ... | Subprocess communicate: order matters? | So I'm trying to effectively create a "branch" in a pipe from subprocess. The idea is to load a file with Popen into a pipe's stdout. Then, I can send that stdout to two (or more) stdin's. This works, more or less. The problem comes when the process needs to see an EOF. As far as I can tell, this happens when you ... | [
"I can't see any reason why it would be different for any one of the processes. In any case, closing the stdin pipes will cause Python to send the EOF, ending the processes:\n...\n\nwhile True:\n # print 'hi'\n buf = os.read(inSub.stdout.fileno(),10000)\n if buf == '': break\n for proc in queue:\n ... | [
1
] | [] | [] | [
"pipe",
"python",
"subprocess"
] | stackoverflow_0007047872_pipe_python_subprocess.txt |
Q:
Unexpected mathematical output
I am trying to count my eggs in an exercise in Learning Python the Hard Way. The formula for counting the eggs is:
print (3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
and the suggested answer is 7.
I am getting 6.75 and have no idea why, I think I am putting it in correctly but I could be wr... | Unexpected mathematical output | I am trying to count my eggs in an exercise in Learning Python the Hard Way. The formula for counting the eggs is:
print (3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
and the suggested answer is 7.
I am getting 6.75 and have no idea why, I think I am putting it in correctly but I could be wrong. The way it is shown above is ex... | [
"In python 2.x, the / operator did integer division. In python 3, the result of the / is a float regardless of the input types. Use the // operator to perform integer division.\n",
"Python 3 is non-backwards-compatible with Python 2. Use the version of Python that your book is based on for least confusion. As o... | [
12,
0
] | [] | [] | [
"python"
] | stackoverflow_0007048031_python.txt |
Q:
scipy.stats.spearmanr: Warning: divide by zero encountered in divide
I use scipy.stats.spearmanr(a,b) and I get:
Warning: divide by zero encountered in divide
The operation ends correctly, but the warning is displayed. Both a and b are "normal" data, (no "zero-only" vectors etc.). Any idea what is the cause, or h... | scipy.stats.spearmanr: Warning: divide by zero encountered in divide | I use scipy.stats.spearmanr(a,b) and I get:
Warning: divide by zero encountered in divide
The operation ends correctly, but the warning is displayed. Both a and b are "normal" data, (no "zero-only" vectors etc.). Any idea what is the cause, or how to suspend the warning?
EDIT:
This is the offending line in spearmanr:
... | [
"division by zero is by design, rs=1 on diagonal. This happens for any values.\nHowever, in scipy 0.9 this error has been silenced locally within the spearmanr function. \nThe corresponding sourceline contains \nnp.seterr(divide='ignore') # rs can have elements equal to 1\n"
] | [
4
] | [] | [] | [
"python",
"scipy"
] | stackoverflow_0007039123_python_scipy.txt |
Q:
The % function in Python
I'm working on the exercises in Learning Python the Hard Way and I am wondering what the % function does. I am getting the wrong answer when i count my eggs and hoping understanding this will help me understand what I'm doing wrong.
A:
I can't really tell why your code is broken because ... | The % function in Python | I'm working on the exercises in Learning Python the Hard Way and I am wondering what the % function does. I am getting the wrong answer when i count my eggs and hoping understanding this will help me understand what I'm doing wrong.
| [
"\nI can't really tell why your code is broken because you haven't shown anybody what your code is. Please post samples and links next time. \nPython % is used in two places, one is mathematical (the modulo operator), and the other has to do with formatting text. I'm going to assume \"counting eggs\" means the math... | [
12,
2
] | [] | [] | [
"python"
] | stackoverflow_0007048132_python.txt |
Q:
Running python through fastCGI for nginx
I am looking to run standalone python scripts through fcgi for use with nginx, but I have no idea where to start with spawning the processes. Currently, I have PHP successfully with nginx+fcgi, but I'm unsure if/how I can do the same with python. Any suggestions on where to... | Running python through fastCGI for nginx | I am looking to run standalone python scripts through fcgi for use with nginx, but I have no idea where to start with spawning the processes. Currently, I have PHP successfully with nginx+fcgi, but I'm unsure if/how I can do the same with python. Any suggestions on where to start?
| [
"See the python docs section on FCGI. Basically, with Python, you use the WSGI interface on top of an fcgi server which talks to the web server (the fcgi client).\nSee Python + FastCGI for a couple of Python fcgi servers.\nEdit: \nThis nginx wiki page explains exactly how to set up Python with nginx using fcgi. \nT... | [
28
] | [] | [] | [
"fastcgi",
"nginx",
"python"
] | stackoverflow_0007048057_fastcgi_nginx_python.txt |
Q:
why in python map() and multiprocessing.Pool.map() got different answers?
I had a strange problem. I have a file of the format:
START
1
2
STOP
lllllllll
START
3
5
6
STOP
and I want to read the lines between START and STOP as blocks, and use my_f to process each block.
def block_generator(file):
with open(file) a... | why in python map() and multiprocessing.Pool.map() got different answers? | I had a strange problem. I have a file of the format:
START
1
2
STOP
lllllllll
START
3
5
6
STOP
and I want to read the lines between START and STOP as blocks, and use my_f to process each block.
def block_generator(file):
with open(file) as lines:
for line in lines:
if line == 'START':
block=... | [
"How about:\nimport itertools\n\ndef grouper(n, iterable, fillvalue=None):\n # Source: http://docs.python.org/library/itertools.html#recipes\n \"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx\"\n return itertools.izip_longest(*[iter(iterable)]*n,fillvalue=fillvalue)\n\ndef block_generator(file):\n with open... | [
2,
1
] | [] | [] | [
"map",
"multiprocessing",
"python"
] | stackoverflow_0007047918_map_multiprocessing_python.txt |
Q:
Python: Scour a folder of files for a specific string, then list all the files containing it
I have a directory of ~100 plaintext files that I wish to search for a pre-defined string via a Python script. All file names of the files in said directory that contain this string will then be output into a CSV text file... | Python: Scour a folder of files for a specific string, then list all the files containing it | I have a directory of ~100 plaintext files that I wish to search for a pre-defined string via a Python script. All file names of the files in said directory that contain this string will then be output into a CSV text file. How would I approach this best, and what classes would be useful for this?
| [
"Have a look at these links. \nPython Input Output\nPython CSV\nCommon String Operations\n",
"please refer to these two answer of mine, may be this would help you.\nmultiple search and replace in python\nregex search replace in batch\n"
] | [
1,
0
] | [] | [] | [
"file",
"python"
] | stackoverflow_0007048330_file_python.txt |
Q:
The last line of this python program uses both " and ' but I don't know why
Ok on this link it shows the last line of output that has ' around everything except the third sentence and I do not know why. This bothered me at the beginning and thought it was just a weird mistake but its on the "extra credit" so now I... | The last line of this python program uses both " and ' but I don't know why | Ok on this link it shows the last line of output that has ' around everything except the third sentence and I do not know why. This bothered me at the beginning and thought it was just a weird mistake but its on the "extra credit" so now I am even more curious.
| [
"This is because the %r formatter prints the argument in the form you may use in source code, which, for strings, means that it is quote-delimited and escaped. For boolean values, this is just True or False. To print the string as it is, use %s instead.\n>>> print '%s' % '\"Hello, you\\'re\"' \n\"Hello, you... | [
7,
1
] | [] | [] | [
"python"
] | stackoverflow_0007048491_python.txt |
Q:
Terminate thread immediately when some variable set to true
how to terminate the thread when some variable value set to true?
import threading
class test(threading.Thread):
def __init__(self):
self.stopThread = False
self.start():
def start(self):
while not self.stopThread:
... | Terminate thread immediately when some variable set to true | how to terminate the thread when some variable value set to true?
import threading
class test(threading.Thread):
def __init__(self):
self.stopThread = False
self.start():
def start(self):
while not self.stopThread:
callOtherFunction //which takes alomst 30 sec to ex... | [
"This question was answered here:\nIs there any way to kill a Thread in Python?\nThe bottom line is that, if you can help it, you should avoid killing a thread this way. However, if you must, there are some tricks you can try.\nAlso, to be thread-safe, you should make self.stopThread a threading.Event() and use set... | [
1
] | [] | [] | [
"multithreading",
"python"
] | stackoverflow_0007048490_multithreading_python.txt |
Q:
Sqlalchemy: get python class from sqlalchemy.schema.MetaData
I'm trying to prepopulate lists of objects associateds. So for a specific mapped class, I list all tables with :
ExampleClass is my mapped python class, for example.
name = ExampleClass.__name__
tables = [x for x in ExampleClass.metadata.tables.keys() if... | Sqlalchemy: get python class from sqlalchemy.schema.MetaData | I'm trying to prepopulate lists of objects associateds. So for a specific mapped class, I list all tables with :
ExampleClass is my mapped python class, for example.
name = ExampleClass.__name__
tables = [x for x in ExampleClass.metadata.tables.keys() if x != name ]
So, I got the tables name but how can I get the cla... | [
"I found this way passing the table name param found in list tables\ndef __find_class(self, table):\n for x in mapperlib._mapper_registry.items():\n if x[0].mapped_table.name == table:\n return x[0].class_\n\n"
] | [
1
] | [] | [] | [
"python",
"sqlalchemy"
] | stackoverflow_0006700626_python_sqlalchemy.txt |
Q:
working inside the boundaries denoted by 'None' inside a list
I have an input list for example :
mylist = [('a', [(2, 4), (0, 5)]), ('b', [(3, 9), (1, 1)]), ("'", None), ('c', [(1,7), (2, 8)])]
I have to carry out comparisons between the values in the list. The item like (2,4) denotes a range. The 'None' entry ... | working inside the boundaries denoted by 'None' inside a list | I have an input list for example :
mylist = [('a', [(2, 4), (0, 5)]), ('b', [(3, 9), (1, 1)]), ("'", None), ('c', [(1,7), (2, 8)])]
I have to carry out comparisons between the values in the list. The item like (2,4) denotes a range. The 'None' entry in the list is like a boundary. The comparisons take place within t... | [
"You can group items by testing their second values is None or not, using itertools.groupby.\n>>> import itertools\n>>> mylist\n[('a', [(2, 4), (0, 5)]), ('b', [(3, 9), (1, 1)]), (\"'\", None), ('c', [(1, 7), (2, 8)])]\n>>> grp = itertools.groupby(mylist, lambda i: i[1] is None)\n>>> res = [tuple(i[1]) for i in grp... | [
2,
1
] | [] | [] | [
"python"
] | stackoverflow_0007034505_python.txt |
Q:
Nodejs: Where or How to write complicated business logic?
Recently I got introduced to node.js and cool packages like express and jade. I have few questions consistently knocking my door:
If I pick node.js to build my next website, I will be using JavaScript to write my server-side complicated logic? but I don't t... | Nodejs: Where or How to write complicated business logic? | Recently I got introduced to node.js and cool packages like express and jade. I have few questions consistently knocking my door:
If I pick node.js to build my next website, I will be using JavaScript to write my server-side complicated logic? but I don't think you can compare JavaScript with Java or Python to write se... | [
"Not quite sure what most of these folks are talking about.\nA \"vast ocean of libraries\" is something the community is actively working on. Check this: http://search.npmjs.org/#/_analytics -- there were 8 packages published yesterday\nIts not going to solve your software design for you. As for where and how to wr... | [
29,
4,
3,
2,
2,
0
] | [] | [] | [
"java",
"node.js",
"python"
] | stackoverflow_0007033844_java_node.js_python.txt |
Q:
How can I parse multiple (unknown) date formats in python?
I have a bunch of excel documents I am extracting dates from. I am trying to convert these to a standard format so I can put them in a database. Is there a function I can throw these strings at and get a standard format back? Here is a small sample of my d... | How can I parse multiple (unknown) date formats in python? | I have a bunch of excel documents I am extracting dates from. I am trying to convert these to a standard format so I can put them in a database. Is there a function I can throw these strings at and get a standard format back? Here is a small sample of my data:
The good thing is I know it is always Month/Day
10/02/09
07... | [
"The third-party module dateutil has a function parse that operates similarly to PHP's strtotime: you don't need to specify a particular date format, it just tries a bunch of its own.\n>>> from dateutil.parser import parse\n>>> parse(\"10/02/09\", fuzzy=True)\ndatetime.datetime(2009, 10, 2, 0, 0) # default to be i... | [
22,
16,
10,
4
] | [] | [] | [
"date",
"parsing",
"python"
] | stackoverflow_0007048828_date_parsing_python.txt |
Q:
Detecting the presence of IDLE / How to tell if __file__ isn't set
I had a script that needed the use of __file__, and so I learned that IDLE doesn't set this. Is there a way from my script that I can detect the presence of IDLE?
A:
if '__file__' not in globals():
# __file__ is not set
if you want to do so... | Detecting the presence of IDLE / How to tell if __file__ isn't set | I had a script that needed the use of __file__, and so I learned that IDLE doesn't set this. Is there a way from my script that I can detect the presence of IDLE?
| [
"if '__file__' not in globals():\n # __file__ is not set\n\nif you want to do something special if __file__ isn't set. Or,\ntry:\n __file__\nexcept NameError:\n # __file__ is not set\n raise\n\nif you want to do something then raise an error anyway, or\nglobal __file__\n__file__ = globals().get('__file_... | [
6
] | [] | [] | [
"python",
"python_idle"
] | stackoverflow_0007049481_python_python_idle.txt |
Q:
build my project to installer for non python enviroment(both windows and linux)
my directroty sturcture is
/src (the source code directory including images)
/src/main.py (main script)
/src/subprojectfile/ (it consist of other several project file include __init__.py)
In my project I am using google procolbuffer... | build my project to installer for non python enviroment(both windows and linux) | my directroty sturcture is
/src (the source code directory including images)
/src/main.py (main script)
/src/subprojectfile/ (it consist of other several project file include __init__.py)
In my project I am using google procolbuffer,pygtk and other common python package like sys,time,thread etc..
I want to build an ... | [
"For windows you can use py2exe and for Linux have a look at freeze.\n",
"For an alternative approach you might check out PyInstaller. It doesn't produce a proper installer, but rather standalone executables without external dependencies.\n"
] | [
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0007049677_python.txt |
Q:
Java vs Python on Google Apps Engine
Possible Duplicate:
Choosing Java vs Python on Google App Engine
What is more comfortable way of creating and deploying app for GAE?
I am trying to create a web service and after some reasearch I decided that Google App Engine could be a good fit. I did a little bit of progra... | Java vs Python on Google Apps Engine |
Possible Duplicate:
Choosing Java vs Python on Google App Engine
What is more comfortable way of creating and deploying app for GAE?
I am trying to create a web service and after some reasearch I decided that Google App Engine could be a good fit. I did a little bit of programming in Java as well as Python, but I am... | [
"Use whichever you prefer, it's pretty much a subjective decision.\nIt used to be that the Python API was more complete and robust, since it was first, but I don't think that's true any longer.\n"
] | [
4
] | [] | [] | [
"google_app_engine",
"java",
"python",
"real_time"
] | stackoverflow_0007049885_google_app_engine_java_python_real_time.txt |
Q:
How to retrieve from python dict where key is only partially known?
I have a dict that has string-type keys whose exact values I can't know (because they're generated dynamically elsewhere). However, I know that that the key I want contains a particular substring, and that a single key with this substring is defi... | How to retrieve from python dict where key is only partially known? | I have a dict that has string-type keys whose exact values I can't know (because they're generated dynamically elsewhere). However, I know that that the key I want contains a particular substring, and that a single key with this substring is definitely in the dict.
What's the best, or "most pythonic" way to retrieve t... | [
"There is an option to write the second version with the performance attributes of the first one.\nUse a generator expression instead of list comprehension:\nvalue = next(v for (k,v) in some_dict.iteritems() if 'substring' in k)\n\nThe expression inside the parenthesis will return an iterator which you will then as... | [
10,
1,
1,
1,
0
] | [] | [] | [
"dictionary",
"key",
"python",
"substring"
] | stackoverflow_0007049253_dictionary_key_python_substring.txt |
Q:
Django many-to-many field copy
I have a Django model with 2 many-to-many fields. When the model is saved from the admin interface I need to check if the second field is blank and if it is blank then I need the items from the first fielded copied to the second. How can I do this?
UPDATE
Matthew's answer seems like ... | Django many-to-many field copy | I have a Django model with 2 many-to-many fields. When the model is saved from the admin interface I need to check if the second field is blank and if it is blank then I need the items from the first fielded copied to the second. How can I do this?
UPDATE
Matthew's answer seems like it would work great but I can't get ... | [
"The signal to be use is not post_save, rather m2m_changed, that is sent much after the model is saved to the database.\n@models.signals.m2m_changed(sender=MyModel.second_m2m.through)\ndef duplicate_other_on_this_if_empty(sender, instance, action, reverse, model, pk_set, **kwargs):\n # just before adding a possi... | [
4,
3,
0,
0
] | [] | [] | [
"django",
"django_models",
"many_to_many",
"python"
] | stackoverflow_0006971063_django_django_models_many_to_many_python.txt |
Q:
Encounter GAE error whilst pushing to dev
i m new to GAE and i got the following error. Wonder is it due to the app.yaml file?
"ERROR 2011-08-13 18:39:57,723 dev_appserver_main.py:579] Fatal error when loa
ding application configuration:
Invalid object:
Unknown url handler type.
<URLMap
secure=default
s... | Encounter GAE error whilst pushing to dev | i m new to GAE and i got the following error. Wonder is it due to the app.yaml file?
"ERROR 2011-08-13 18:39:57,723 dev_appserver_main.py:579] Fatal error when loa
ding application configuration:
Invalid object:
Unknown url handler type.
<URLMap
secure=default
static_files=None
auth_fail_action=redirect
... | [
"The error message says \nin \"app\\app.yaml\", line 24, column 19\"\n\nand\nscript=None\n\nWhile the app.yaml you show both has the script set and doesn't have 24 lines.\nSo either you didn't show your whole app.yaml or that's not the app.yaml that dev_appserver.py is seeing. Try searching for another one and maki... | [
1
] | [] | [] | [
"google_app_engine",
"python",
"yaml"
] | stackoverflow_0007049979_google_app_engine_python_yaml.txt |
Q:
Python/AppEngine: Get client browser information
How can I get client browser information (type, version, etc.) using Python/AppEngine?
A:
From the User-Agent header:
user_agent_string = self.request.headers['user-agent']
http://code.google.com/appengine/docs/python/tools/webapp/requestclass.html#Request_headers... | Python/AppEngine: Get client browser information | How can I get client browser information (type, version, etc.) using Python/AppEngine?
| [
"From the User-Agent header:\nuser_agent_string = self.request.headers['user-agent']\nhttp://code.google.com/appengine/docs/python/tools/webapp/requestclass.html#Request_headers\n"
] | [
5
] | [] | [] | [
"browser",
"google_app_engine",
"python"
] | stackoverflow_0007050206_browser_google_app_engine_python.txt |
Q:
Python library for string formatting with custom placeholders
I am searching for a Python library for string formatting with custom placeholders. What I mean is that I would like to be able to define a string like "%f %d %3c" where for example %f would be then replaced with some filename, %d with a directory name ... | Python library for string formatting with custom placeholders | I am searching for a Python library for string formatting with custom placeholders. What I mean is that I would like to be able to define a string like "%f %d %3c" where for example %f would be then replaced with some filename, %d with a directory name and %3c with a counter with three digits. Or something. It does not... | [
"There is string.Template, but it doesn't provide exactly what you want:\n>>> from string import Template\n>>> t = Template(\"$filename $directory $counter\")\n>>> t.substitute(filename=\"file.py\", directory=\"/home\", counter=42)\n'file.py /home 42'\n>>> t.substitute(filename=\"file2.conf\", directory=\"/etc\", c... | [
2
] | [] | [] | [
"python",
"string_formatting",
"string_interpolation"
] | stackoverflow_0007050336_python_string_formatting_string_interpolation.txt |
Q:
Do I need to learn about objects, or can I save time and just learn dictionaries?
OK to be short =)
I'm noob yes. -.- but I'm convinced i don't need to learn everything.. and that a specific field of knowledge suited to my project may save me time..?
I'm going to build a game that i have designed but not begun con... | Do I need to learn about objects, or can I save time and just learn dictionaries? | OK to be short =)
I'm noob yes. -.- but I'm convinced i don't need to learn everything.. and that a specific field of knowledge suited to my project may save me time..?
I'm going to build a game that i have designed but not begun constructing.
I'm going to learn everything i need to to get my project finished.
however ... | [
"Any Python project of any size will become unmanageable without objects.\nIs it possible to use modules as your objects instead of classes? Yes, if you really want to. (In Python, a module is what you call a single file.)\nHowever, even if you aren't creating user-defined classes, you still need to learn how to us... | [
9,
2
] | [] | [] | [
"oop",
"python"
] | stackoverflow_0007049637_oop_python.txt |
Q:
Trying to duplicate a list and modify one version of it in Python 2
I want to duplicate a list and modify the duplicate, but when I try this, I end up modifying the original as well.
A highly simplified version of my problem:
list = [2,3,6,8,9,6,7,4,56,8,9,6,7,8]
new_list = list
new_list[2] = 'n'
print list
pri... | Trying to duplicate a list and modify one version of it in Python 2 | I want to duplicate a list and modify the duplicate, but when I try this, I end up modifying the original as well.
A highly simplified version of my problem:
list = [2,3,6,8,9,6,7,4,56,8,9,6,7,8]
new_list = list
new_list[2] = 'n'
print list
print new_list
I only want to change item 2 of the new list, but when I try... | [
"To make a new copy of your list, try:\nnewList = list(oldList)\n\nOr more cryptic concise via slicing:\nnewlist = oldList[:]\n\nJust assigning oldList to newList will result in two names pointing to the same object, like so:\n\nGeneric object copying functions are provided by the copy module. (Image taken from: ht... | [
3,
1,
1,
0
] | [] | [] | [
"indexing",
"list",
"python",
"python_2.x",
"variables"
] | stackoverflow_0007050562_indexing_list_python_python_2.x_variables.txt |
Q:
C file splitting in Python?
I'm working for my thesis on C files. I need to split a C header to manipulate then the singles words composing it. I have to split lines by all these characters:
Spaces and tabs
New lines ; or \n
Single line comments and multiline comments // /* */
Pointers *
Array brackets [] or [dim... | C file splitting in Python? | I'm working for my thesis on C files. I need to split a C header to manipulate then the singles words composing it. I have to split lines by all these characters:
Spaces and tabs
New lines ; or \n
Single line comments and multiline comments // /* */
Pointers *
Array brackets [] or [dimension]
So, for example, if I ha... | [
"Perhaps you should consider toying with pycparser. (Without knowing what you're actually doing, I can't really say more than that, sorry)\n",
"You have grammar parser that are done for the job you want. You can find a list of them here :\nhttp://wiki.python.org/moin/LanguageParsing\nIt will make your life easier... | [
4,
1
] | [
"You can use re.split to get what you want:\nc_code = \"\"\"\n/* This is a\n multiline comment.\n*/\n\ntypedef int rocket;\n\n// This is a single line comment.\ntypedef double* pi[10];\n\"\"\"\n\nimport re\n\ndef split_c(c_code):\n tok_re = r\"(\\n)|\\s|(;|/\\*|//|\\*/|\\*|\\[\\d*\\])\"\n return [t for t in... | [
-1
] | [
"c",
"header",
"python",
"split",
"string"
] | stackoverflow_0006974246_c_header_python_split_string.txt |
Q:
How should I handle anonymous user input?
I'd like the users of my web application to not have to register a user account before they can vote. I've seen websites where I could freely vote up or down on what ever I want without having to register. How is this handled? How can I prevent the same person from voting ... | How should I handle anonymous user input? | I'd like the users of my web application to not have to register a user account before they can vote. I've seen websites where I could freely vote up or down on what ever I want without having to register. How is this handled? How can I prevent the same person from voting infinite amounts of times?
I'm using Python and... | [
"Don't rely on facebook login, as users without facebook will not be able to vote.\nAs there is no real way to be sure that an unregistered user will not vote twice (he can connect himself from another computer, or whatever), you have to define yourself what is the criteria you want to use to check his identity.\nY... | [
2,
1
] | [] | [] | [
"anonymous",
"django",
"facebook",
"python",
"user_input"
] | stackoverflow_0007050945_anonymous_django_facebook_python_user_input.txt |
Q:
Python coding standards/best practices
In python do you generally use PEP 8 -- Style Guide for Python Code as your coding standards/guidelines? Are there any other formalized standards that you prefer?
A:
"In python do you generally use PEP 8 -- Style Guide for Python Code as your coding standards/guidelines? A... | Python coding standards/best practices | In python do you generally use PEP 8 -- Style Guide for Python Code as your coding standards/guidelines? Are there any other formalized standards that you prefer?
| [
"\n\"In python do you generally use PEP 8 -- Style Guide for Python Code as your coding standards/guidelines? Are there any other formalized standards that you prefer?\"\n\nAs mentioned by you follow PEP 8 for the main text, and PEP 257 for docstring conventions\nAlong with Python Style Guides, I suggest that you r... | [
156,
15,
8,
5,
5,
4,
2,
1
] | [] | [] | [
"coding_style",
"python"
] | stackoverflow_0000356161_coding_style_python.txt |
Q:
Why doesn't coverage.py properly measure Django's runserver command?
I should know the answer to this, but I don't: if you try to measure the coverage of a Django project like this:
coverage run manage.py runserver
you get coverage measurement that misses all of your actual code. Something early on in the proce... | Why doesn't coverage.py properly measure Django's runserver command? | I should know the answer to this, but I don't: if you try to measure the coverage of a Django project like this:
coverage run manage.py runserver
you get coverage measurement that misses all of your actual code. Something early on in the process is stopping the measurement, or all the real work happens in a new cont... | [
"Do you get the same problem if you run as follows?\ncoverage run manage.py runserver --noreload\n\nWithout --noreload, another process is started behind the scenes. One process runs the server, the other looks for code changes and restarts the server when changes are made. The chances are, you're doing the coverag... | [
27
] | [] | [] | [
"coverage.py",
"django",
"python"
] | stackoverflow_0007051070_coverage.py_django_python.txt |
Q:
Fill out HTML-InputFields which are not located in a form with Python mechanize
I want to fill out a HTML input field with mechanize which looks like this:
<input type="text" id="xy" name="xyz" [and some others] />
The problem: It is not located in a form, so br.select_form(...) don't work. How can I gain access ... | Fill out HTML-InputFields which are not located in a form with Python mechanize | I want to fill out a HTML input field with mechanize which looks like this:
<input type="text" id="xy" name="xyz" [and some others] />
The problem: It is not located in a form, so br.select_form(...) don't work. How can I gain access to this field? Selecting the global form and br['xyz'] don't work, too. There is also... | [
"Seems like javascript puts the form/fields on the page, Mechanize doesn't handle javascript, see this answer for more details and an alternative solution How to properly use mechanize to scrape AJAX sites\n"
] | [
0
] | [] | [] | [
"forms",
"html",
"mechanize",
"python"
] | stackoverflow_0007050087_forms_html_mechanize_python.txt |
Q:
Parameter Naming conventions for function in python
This isn't a big deal of a question but it bothers me, so I decided to ask for inspiration.
Assume a function defined like this:
def store(book=None, author=None):
pass
When calling this function like this:
book = Book()
author = Author()
store(book=book, au... | Parameter Naming conventions for function in python | This isn't a big deal of a question but it bothers me, so I decided to ask for inspiration.
Assume a function defined like this:
def store(book=None, author=None):
pass
When calling this function like this:
book = Book()
author = Author()
store(book=book, author=author)
do I have to fear sideeffects because of bo... | [
"You have no side effects to fear. It's no different semantically than it would be if you had just called \nstore(book, author)\n\nThe values are stored in new variables inside the function's scope, subject to all the normal python scoping rules. \nKeyword arguments do free you to use other, more specific variable ... | [
4,
3,
2,
1
] | [] | [] | [
"function",
"naming_conventions",
"parameters",
"python"
] | stackoverflow_0007051608_function_naming_conventions_parameters_python.txt |
Q:
How to escape unicode characters to symbol entitiy names in python?
What I want to achieve is
Í -> í
ø -> ø
ñ -> ñ
...
Is there a standard way for this in python or do I have to create my own dictionary and use it to escaape the characters manually?
I found a lot of hints for the other way ar... | How to escape unicode characters to symbol entitiy names in python? | What I want to achieve is
Í -> í
ø -> ø
ñ -> ñ
...
Is there a standard way for this in python or do I have to create my own dictionary and use it to escaape the characters manually?
I found a lot of hints for the other way around here on SO but none which answers my querstion.
| [
"You're looking for htmlentitydefs:\nIn [217]: import htmlentitydefs\n\nIn [224]: ['&'+htmlentitydefs.codepoint2name[ord(x)]+';' for x in u'Íøñ']\nOut[224]: ['Í', 'ø', 'ñ']\n\n",
"Try this:\nimport htmlentitydefs\n\ndef EscapeUnicode(character):\n return \"&%s;\" % htmlentitydefs.codepoint... | [
3,
1
] | [] | [] | [
"escaping",
"python"
] | stackoverflow_0007051791_escaping_python.txt |
Q:
Finding unused Django code to remove
I've started working on a project with loads of unused legacy code in it. I was wondering if it might be possible to use a tool like coverage in combination with a crawler (like the django-test-utils one) to help me locate code which isn't getting hit which we can mark with de... | Finding unused Django code to remove | I've started working on a project with loads of unused legacy code in it. I was wondering if it might be possible to use a tool like coverage in combination with a crawler (like the django-test-utils one) to help me locate code which isn't getting hit which we can mark with deprecation warnings. I realise that someth... | [
"You can run the development server under coverage if you use the --noreload switch:\ncoverage run ./manage.py runserver --noreload\n\n",
"pylint is great tool for static code analysis (among others things it will detect unused imports, variables or arguments).\n\nhttp://nedbatchelder.com/blog/200806/pylint.html\... | [
11,
9
] | [] | [] | [
"code_coverage",
"coverage.py",
"django",
"python"
] | stackoverflow_0007050380_code_coverage_coverage.py_django_python.txt |
Q:
Expose an underlying struct as a member of a custom type within a Python extension
This question is a slight spin on a previous question: Accessing the underlying struct of a PyObject
Except in my version I want to know how to expose the fields of the Point struct as members of my new type.
I have looked everywher... | Expose an underlying struct as a member of a custom type within a Python extension | This question is a slight spin on a previous question: Accessing the underlying struct of a PyObject
Except in my version I want to know how to expose the fields of the Point struct as members of my new type.
I have looked everywhere I could think, read numerous example Python extensions and read many tutorials, docs, ... | [
"I would highly recommend reading http://docs.python.org/release/2.6/_sources/extending/newtypes.txt, specifically the section on \"Providing finer control over data attributes\".\nAfter reading this, it appears it is possible to do this by defining a collection of setter/getters for the specific members in the Poi... | [
2
] | [] | [] | [
"c",
"python",
"struct"
] | stackoverflow_0007043432_c_python_struct.txt |
Q:
Prebuilt GVim 7.3. binaries with +python support
Apart from compiling GVim, is there anywhere where one can downlod the binaries with +python support already included?
Edit :: Apologies for forgotting again. I'm looking for Windows binaries.
A:
Okey, problem solved.
On www.vim.org when downloading Vim one must t... | Prebuilt GVim 7.3. binaries with +python support | Apart from compiling GVim, is there anywhere where one can downlod the binaries with +python support already included?
Edit :: Apologies for forgotting again. I'm looking for Windows binaries.
| [
"Okey, problem solved.\nOn www.vim.org when downloading Vim one must take the OLE version, along with the runtimefiles archive. Upon unzipping try for example\n:python print('Whatcha doing Doc?')\nand see what error it will give. You should see something along the lines of ... yadda yadda python27.dll. There's your... | [
14,
2
] | [] | [] | [
"python",
"vim",
"windows_xp"
] | stackoverflow_0007050605_python_vim_windows_xp.txt |
Q:
Problem with sys.argv[1] when unittest module is in a script
I have a script that does various things and access paramenters using sys.argv but when the script gets to the unittest part of the code it says there is no module for this. The script that I have is:
class MyScript():
def __init__(self):
se... | Problem with sys.argv[1] when unittest module is in a script | I have a script that does various things and access paramenters using sys.argv but when the script gets to the unittest part of the code it says there is no module for this. The script that I have is:
class MyScript():
def __init__(self):
self.value = sys.argv[1]
def hello(self):
print self.va... | [
"The problem is that unittest.main() wants your precious argv for its own use! It uses either the argv you give it as a function parameter, or sys.argv if you don't give it argv explicitly, and tries to load tests named the arguments you give. In this case, this means it's looking for either a submodule called Hell... | [
19,
9,
1
] | [
"Python gives you all of the information it can, and unless you want to post the whole set of things you're trying to test we can only guess at what you're trying to accomplish. The error says there's no attribute named \"Hello\", so maybe the modules you're trying to test should get such a variable, function, or ... | [
-1
] | [
"argv",
"python",
"sys",
"unit_testing"
] | stackoverflow_0002812218_argv_python_sys_unit_testing.txt |
Q:
IDE for PHP and Python Windows
I used to use netbeans for a while and really liked it.
But now, I wan't to expand my toolbox with Python, and Netbeans dropped support for Django, also Python support seems to suck in NB 7.0.
So I am looking for recommendations on IDE or Text Editor for Windows with support:
Pyth... | IDE for PHP and Python Windows | I used to use netbeans for a while and really liked it.
But now, I wan't to expand my toolbox with Python, and Netbeans dropped support for Django, also Python support seems to suck in NB 7.0.
So I am looking for recommendations on IDE or Text Editor for Windows with support:
Python (possibly with Django)
PHP
HTML, ... | [
"http://www.jetbrains.com/pycharm/ would be my first choice. JetBrains does a great job with making the editor valuable to you for more than just text entry. The different IDEs JetBrains offers are all basically the same even if they are configured for a slightly different language set. \nEclipse is an option, it h... | [
3,
1,
0,
0,
0
] | [] | [] | [
"ide",
"php",
"python"
] | stackoverflow_0007051282_ide_php_python.txt |
Q:
How to use a negative lookbehind
Basically, I am changing any and all hexadecimal values with a blue hue to its red hue counterpart in a given stylesheet (i.e. #00f is changed to #ff0000 (my function outputs six character hexadecimal values excluding the #)).
It was not a problem creating a regular expression to m... | How to use a negative lookbehind | Basically, I am changing any and all hexadecimal values with a blue hue to its red hue counterpart in a given stylesheet (i.e. #00f is changed to #ff0000 (my function outputs six character hexadecimal values excluding the #)).
It was not a problem creating a regular expression to match hexadecimal colors (I'm not conce... | [
"I think that what you need is either one of the following solutions or the other\nss = ''' background: #f09 url('images#06F'); \n background=#00f url('images #889'); \n background:#E4aaa0 url('images#890'); \n background: #fff #dddddd; '''\n\nprint ss\nimport re\n\nthree = '(?:[0-9A-Fa-f]{3})'\n\nregx ... | [
0
] | [] | [] | [
"negative_lookbehind",
"python",
"regex"
] | stackoverflow_0007051749_negative_lookbehind_python_regex.txt |
Q:
List index out of range on the Django App while running the development server
I just got a new job working for a website and I am trying to get a development server working on my work computer. I've copied all the configurations and what not and I am still getting errors.
When I try to display the front page I ge... | List index out of range on the Django App while running the development server | I just got a new job working for a website and I am trying to get a development server working on my work computer. I've copied all the configurations and what not and I am still getting errors.
When I try to display the front page I get
list index out of range
The exception is being raised
python2.6/site-packages/Dja... | [
"The traceback tells you what the problem is. The homepage is trying to display the top Schedule - but you don't have any in your database. You need to create some. \n",
"Have you tried running it locally in different ways?\nI have seen my Django code react differently in different server environs (e.g. mod_wsgi ... | [
4,
1
] | [] | [] | [
"django",
"django_views",
"python"
] | stackoverflow_0007052261_django_django_views_python.txt |
Q:
File-like operations without the file?
I'm working on an automation tool that will copy a series of commands to a file on a remote system and then ssh to the remote system and execute that file. I'm looking at the docs for paramiko, which has the needed sftp and ssh command capabilities I'll need.
However, I'm not... | File-like operations without the file? | I'm working on an automation tool that will copy a series of commands to a file on a remote system and then ssh to the remote system and execute that file. I'm looking at the docs for paramiko, which has the needed sftp and ssh command capabilities I'll need.
However, I'm noticing that the paramiko.SFTPClient.put() met... | [
"Simply open the file and write to it:\nfrom __future__ import with_statement \nimport contextlib\n\nwith contextlib.closing(sftpClient.open('file.name', 'w')) as f:\n f.write('myData')\n\n",
"I believe what you are looking for is StringIO.\n",
"I'm not familiar with paramiko, but you could use the tempfil... | [
3,
0,
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0007052627_python.txt |
Q:
How do I specify token ordering in pyparsing?
Suppose I'm parsing the following line:
The quick brown fox jumps over the lazy dog
I'd like to parse this as:
Words('The quick brown fox') + Literal('jumps') + Words('over the lazy dog')
My current pyparsing definition is:
some_words = OneOrMore(Word(alphas))
jum... | How do I specify token ordering in pyparsing? | Suppose I'm parsing the following line:
The quick brown fox jumps over the lazy dog
I'd like to parse this as:
Words('The quick brown fox') + Literal('jumps') + Words('over the lazy dog')
My current pyparsing definition is:
some_words = OneOrMore(Word(alphas))
jumps = Literal('jumps')
sentence = some_words ... | [
"You are already thinking like the parser, since you understand that OneOrMore(Word(alphas)) keeps going, even to reading the word \"jumps\". Now turn that around and write the parser to do things the way you think.\nFor every word up to \"jumps\", how do you know that it should be added to the leading set of word... | [
5
] | [] | [] | [
"parsing",
"pyparsing",
"python"
] | stackoverflow_0007052287_parsing_pyparsing_python.txt |
Q:
Producing a picture of DFA that recognizes given regexps
Is there a tool that will accept a list of regexps and produce a picture of the minimal DFA that will recognize these regexps, each into its corresponding final state?
It should look something like this: http://i.imgur.com/Vxw9X.jpg
The picture is taken from... | Producing a picture of DFA that recognizes given regexps | Is there a tool that will accept a list of regexps and produce a picture of the minimal DFA that will recognize these regexps, each into its corresponding final state?
It should look something like this: http://i.imgur.com/Vxw9X.jpg
The picture is taken from Stanford compilers class, probably made by the teacher himsel... | [
"I can't remember if it does exactly what you want, but JFLAP Will let you enter a regular expression and then convert to a NFA/DFA.\n"
] | [
2
] | [] | [] | [
"compiler_construction",
"dfa",
"python",
"regex"
] | stackoverflow_0007052767_compiler_construction_dfa_python_regex.txt |
Q:
My signals are being ignored!
So I developed a UI in Glade and am coding the program in Python. For some reason, all of my signals are being ignored! Though I've connected them correctly (I think), clicking on the buttons does absolutely nothing!
Below is the code that I'm using to load the ui and connect the sign... | My signals are being ignored! | So I developed a UI in Glade and am coding the program in Python. For some reason, all of my signals are being ignored! Though I've connected them correctly (I think), clicking on the buttons does absolutely nothing!
Below is the code that I'm using to load the ui and connect the signals. Can anyone see WHY they might ... | [
"I'm not completely sure that this is the answer, but I know that a number of PyGTK objects cannot send signals themselves - gtk.Image and gtk.Label are two such examples. The solution is to place the widget inside of an event box (gtk.EventBox) and link the events to that.\nI do not know if this is the case with t... | [
0
] | [] | [] | [
"gtk",
"pygtk",
"python"
] | stackoverflow_0006438459_gtk_pygtk_python.txt |
Q:
How to truncate the values of a 2D numpy array
I have a two-dimensional numpy array(uint16), how can I truncate all values above a certain barrier(say 255) to that barrier? The other values must stay the same. Using a nested loop seems to be ineffecient and clumsy.
A:
actually there is a specific method for this... | How to truncate the values of a 2D numpy array | I have a two-dimensional numpy array(uint16), how can I truncate all values above a certain barrier(say 255) to that barrier? The other values must stay the same. Using a nested loop seems to be ineffecient and clumsy.
| [
"actually there is a specific method for this, 'clip':\nimport numpy as np\nmy_array = np.array([[100, 200], [300, 400]],np.uint16)\nmy_array.clip(0,255) # clip(min, max)\n\noutput:\narray([[100, 200],\n [255, 255]], dtype=uint16)\n\n",
"import numpy as np\nmy_array = np.array([[100, 200], [300, 400]],np.ui... | [
21,
7,
6
] | [] | [] | [
"numpy",
"python"
] | stackoverflow_0007052776_numpy_python.txt |
Q:
Unable to import module
I'd like to learn Python since it looks nice and I want to work with GTK. My previous experience with programming is Java and C# hardly a pain in the backside to deal with errors. However I am having problems with pythons py2exe and understand how to debug this problem. From what I can u... | Unable to import module | I'd like to learn Python since it looks nice and I want to work with GTK. My previous experience with programming is Java and C# hardly a pain in the backside to deal with errors. However I am having problems with pythons py2exe and understand how to debug this problem. From what I can understand it probably a setup... | [
"Very easy to fix! In your setup.py file, you should have a line something like this:\noptions = {\n 'py2exe': {\n 'packages':'encodings',\n 'includes': '<module names>',\n }\n },\n\nIn order to fix the error, simply add \"gio\... | [
1
] | [] | [] | [
"py2exe",
"pygtk",
"python"
] | stackoverflow_0006611949_py2exe_pygtk_python.txt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.