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:
Nose / Nosegae: Import problems
I have this problem and it's drivin' me nuts!
So I am developing my first real Google App Engine application and I always like to discover things while writing tests.
So I have the following setup:
I have a virtualenv with nose, nosegae, webtest and gaetestbed. It's called porksvr.... | Nose / Nosegae: Import problems | I have this problem and it's drivin' me nuts!
So I am developing my first real Google App Engine application and I always like to discover things while writing tests.
So I have the following setup:
I have a virtualenv with nose, nosegae, webtest and gaetestbed. It's called porksvr.
I activate my virtualenv like this:
... | [
"Nose-GAE has some documented issues when you're using virtualenv.\nYou might try using using nose's --without-sandbox flag.\n",
"Great so after hours of trying I actually just solved my problem right after asking this question.\nWhat fixed it was to create the virtualenv with the following switch --no-site-packa... | [
6,
2
] | [] | [] | [
"google_app_engine",
"nose",
"python"
] | stackoverflow_0003580134_google_app_engine_nose_python.txt |
Q:
How to send an e-mail from a Python script that is being run on "Google App Engine"?
How could I send an e-mail from my Python script that is being run on "Google App Engines" to one of my mail boxes?
I am just a beginner and I have never tried sending a message from a Python script. I have found this script (IN ... | How to send an e-mail from a Python script that is being run on "Google App Engine"? | How could I send an e-mail from my Python script that is being run on "Google App Engines" to one of my mail boxes?
I am just a beginner and I have never tried sending a message from a Python script. I have found this script (IN THIS TUTORIAL):
Here is the same script as a quote:
import sys, smtplib
fromaddr = raw_... | [
"Sure - just use the Mail API as outlined in the docs:\n\nPython\nJava\n\n"
] | [
10
] | [] | [] | [
"email",
"google_app_engine",
"python"
] | stackoverflow_0003595438_email_google_app_engine_python.txt |
Q:
is there a way to use im.putpixel rather than im.paste
srcImage.paste(letters['H'], (10,15))
The above code will paste the letter H on the image (srcimage). letters is dict which contains the font images..
I cannot use paste in my assignment but i can use getpixel, load, putpixel, and save.
I tried this but this i... | is there a way to use im.putpixel rather than im.paste | srcImage.paste(letters['H'], (10,15))
The above code will paste the letter H on the image (srcimage). letters is dict which contains the font images..
I cannot use paste in my assignment but i can use getpixel, load, putpixel, and save.
I tried this but this is giving error:
srcImage.putpixel((10,15),letters['H'])
Erro... | [
"I'm not familiar with PIL and the details of your assignment, so this will be pseudocode:\nfor every pixel in letter['H']:\n putpixel (at position + position in letter['H'])\n\nEssentially, get every pixel and its position in the letter, and put that pixel into the image at the position you're currently at plus... | [
0
] | [] | [] | [
"python",
"python_imaging_library"
] | stackoverflow_0003568650_python_python_imaging_library.txt |
Q:
Is there a way to find the second longest word in a sentence in Python?
I got stuck on this idea: how do I get the second longest word in a sentence ? I'm going to use it for an exit route in my code where the longest word might fail a test. Any ideas ? Thanks in advance.
A:
something like this:
second_longest =... | Is there a way to find the second longest word in a sentence in Python? | I got stuck on this idea: how do I get the second longest word in a sentence ? I'm going to use it for an exit route in my code where the longest word might fail a test. Any ideas ? Thanks in advance.
| [
"something like this:\nsecond_longest = sorted(sentence.split(), key=len)[-2]\n\nThis is a pretty naive definition of word however, since it only splits on whitespace so any punctuation will be included as part of the words. You may want to filter the sentence to remove punctuation characters first.\n"
] | [
5
] | [] | [] | [
"process",
"python",
"text",
"word"
] | stackoverflow_0003595810_process_python_text_word.txt |
Q:
start python script as background process from within a python script
My python script needs to start a background process and then continue processing to completion without waiting for a return.
The background script will process for some time and will not generate any screen output.
There is no inter-process dat... | start python script as background process from within a python script | My python script needs to start a background process and then continue processing to completion without waiting for a return.
The background script will process for some time and will not generate any screen output.
There is no inter-process data required.
I have tried using various methods subprocess, multiprocessing ... | [
"how about this:\nimport subprocess\nfrom multiprocessing import Process\n\nProcess(target=subprocess.call, args=(('ls', '-l', ), )).start()\n\nIt's not all that elegant, but it fulfils all your requirements.\n",
"Simple:\nsubprocess.Popen([\"background-process\", \"arguments\"])\n\nIf you want to check later whe... | [
3,
2,
1
] | [] | [] | [
"python"
] | stackoverflow_0003595685_python.txt |
Q:
How to put 2 lists into 1 Dictionary in Python?
So this is the situation: I have 2 lists and want to put them in a dictionary.
Content ['This is Sams Content', 'This is someone's else content']
Author ['Sam', 'Someone Else']
This is the dictionary I would like to create
Reviews [{'content': 'This is Sams Content... | How to put 2 lists into 1 Dictionary in Python? | So this is the situation: I have 2 lists and want to put them in a dictionary.
Content ['This is Sams Content', 'This is someone's else content']
Author ['Sam', 'Someone Else']
This is the dictionary I would like to create
Reviews [{'content': 'This is Sams Content', 'author' : 'Sam'} , {'content': 'This is someone's... | [
"You're looking for zip I believe. Something like this:\nreviews = [{'content': c, 'author': a} for c, a in zip(contentList, authorList)]\n\n",
"content = ['This is Sams Content', 'This is someone\\'s else content'] \nauthor = ['Sam', 'Someone Else']\n\nreviews = []\n\nfor i in range(len(author)):\n d = {\n ... | [
7,
0,
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0003595869_python.txt |
Q:
Problem building a list of class objects in python
I'm still new to python, and been stuck playing around with this for a while and would appreciate someone pointing out where I'm going wrong.
Basically I am trying to build a list that contains a number of different objects, with each object having several attribu... | Problem building a list of class objects in python | I'm still new to python, and been stuck playing around with this for a while and would appreciate someone pointing out where I'm going wrong.
Basically I am trying to build a list that contains a number of different objects, with each object having several attributes.
My attempt is simplified and shown below, basically... | [
"First, you need to create an instance of TagData, like this:\nTagData()\n\nThis is why you are getting the AttributeError, because when you use TagData.tag(...), you are really trying to call the tag method of the TagData class object, instead of setting a property of a specific instance.\nNext, you need to assign... | [
1,
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0003595890_python.txt |
Q:
Good way to Django-based website, installing prerequisites if needed
Consider a website build using python and django. In many cases it uses 3rd party modules beside standard python library - such as pytz, South, timezones or debug toolbar.
What is standard or just convenient way to deploy such application to prod... | Good way to Django-based website, installing prerequisites if needed | Consider a website build using python and django. In many cases it uses 3rd party modules beside standard python library - such as pytz, South, timezones or debug toolbar.
What is standard or just convenient way to deploy such application to production hosting with all the prerequisites (timezones, etc) installed autom... | [
"There are at least two options available. Jacob Kaplan-Moss, one of the co founders of Django has written about packaging an application using buildout and djangorecipe. There is also the versatile fabric. You should be able to tackle your problem using either of these alone or in combination with some custom scri... | [
3,
2,
1
] | [] | [] | [
"dependencies",
"deployment",
"django",
"installation",
"python"
] | stackoverflow_0003595884_dependencies_deployment_django_installation_python.txt |
Q:
Place a Button in ListCtrl - wxPython
Is is possible to place a button inside of a ListCtrl item with wxPython? Right now I have a ListCtrl that has data with a file name and size, and I want the user to be able to click a button, to download the file. If this isn't possible, is there a way to display an image in ... | Place a Button in ListCtrl - wxPython | Is is possible to place a button inside of a ListCtrl item with wxPython? Right now I have a ListCtrl that has data with a file name and size, and I want the user to be able to click a button, to download the file. If this isn't possible, is there a way to display an image in the ListCtrl, and then make it clickable so... | [
"No. You will have to use \"UltimateListControl\", a generic list implementation that can attach any kind of widget to rows. Check its demo files for examples. \nYou're probably best off grabbing the trunk code for bugfixes and other changes - I'm not sure how often Andrea updates the main zip on his site\nI've yet... | [
4
] | [] | [] | [
"python",
"user_interface",
"wxpython"
] | stackoverflow_0003595913_python_user_interface_wxpython.txt |
Q:
pyqt installation question
Im planing to do some GUI development using pyqt4 pykde and python3.1 on Kubuntu 10.4. In the research I did I found out that most of the things are available as packages in repositories and some of the packages are preinstalled. Only thing is I'm not able to figure out what to install a... | pyqt installation question | Im planing to do some GUI development using pyqt4 pykde and python3.1 on Kubuntu 10.4. In the research I did I found out that most of the things are available as packages in repositories and some of the packages are preinstalled. Only thing is I'm not able to figure out what to install and what not to. Can someone plea... | [
"The qt-designer is inside the new qtcreator (former package was qt-creator).\ninstall -doc packages as you like, also look for -examples, they are very helpful.\nfor your convenience:\naptitude install \n python31\n python-qt4 \n python-qt4-doc\n pyqt4-dev-tools\n python-kde4\n qtcreator\nFor an ... | [
1,
0
] | [] | [] | [
"linux",
"pyqt4",
"python",
"ubuntu"
] | stackoverflow_0003385013_linux_pyqt4_python_ubuntu.txt |
Q:
Automating Excel macro using python
I am using python in Linux to automate an excel. I have finished writing data into excel by using pyexcelerator package.
Now comes the real challenge. I have to add another tab to the existing sheet and that tab should contain the macro run in the first tab. All these things sh... | Automating Excel macro using python | I am using python in Linux to automate an excel. I have finished writing data into excel by using pyexcelerator package.
Now comes the real challenge. I have to add another tab to the existing sheet and that tab should contain the macro run in the first tab. All these things should be automated. I Googled a lot and fo... | [
"Excel Macros are per sheets, so, I am afraid, you need to copy the macros explicitly if you created new sheet, instead of copying existing sheet to new one.\n",
"You might find that Resolver One is better for what you want - it's a python-scriptable spreadsheet.\n",
"Maybe manipulating your .xls with Openoffic... | [
0,
0,
0
] | [] | [] | [
"automation",
"excel",
"linux",
"python"
] | stackoverflow_0002697701_automation_excel_linux_python.txt |
Q:
django weighted questionnaire?
I've been learning django off and on for a few years now and consider myself an advanced beginner, ha. I'm working on a "weighted questionnaire" (that's the best name I can give it anyway) for a client and have gone in circles about where to go with it.
The client has come up with a... | django weighted questionnaire? | I've been learning django off and on for a few years now and consider myself an advanced beginner, ha. I'm working on a "weighted questionnaire" (that's the best name I can give it anyway) for a client and have gone in circles about where to go with it.
The client has come up with a series of yes or no questions and d... | [
"What you are trying to do is basically setting up a many-to-many relationship between Question and Product and weighting this relation by adding a field to the relation (value); there's some documentation on that how to that in a django way!\nI guess you will need one more model to store the answers a user has giv... | [
2
] | [] | [] | [
"django",
"python"
] | stackoverflow_0003593756_django_python.txt |
Q:
How can I turn a list of words in a text file into a regex to filter out?
I'm trying to filter out some text for certain keywords that are found in a text file. I was thinking about just parsing the file line by line, take each word and then merge them together with a pipe "|" then using that string inside re.sub.... | How can I turn a list of words in a text file into a regex to filter out? | I'm trying to filter out some text for certain keywords that are found in a text file. I was thinking about just parsing the file line by line, take each word and then merge them together with a pipe "|" then using that string inside re.sub.
Any better more efficient ideas are welcome.
| [
"Something like the following?\nimport re\n\nwith file('keywords.txt', 'r') as k:\n kwords = sorted(k.read().strip().split(), lambda x: (len(x), x))\nsearchstring = r'\\s?\\b(' + '|'.join(kwords) + r')\\b'\nwith file('textfile.txt', 'r') as t:\n text = t.read()\nnewtext, _ = re.subn(searchstring, '', text).ls... | [
0,
0
] | [] | [] | [
"python",
"regex"
] | stackoverflow_0003595858_python_regex.txt |
Q:
python web service for massive usage
I need to develp a real production webservice with python that will be used by another client application (with another progamming language ) .
I mean in real production webservice that this webserivce is will be used on critical environment that failure of the webserivce could... | python web service for massive usage | I need to develp a real production webservice with python that will be used by another client application (with another progamming language ) .
I mean in real production webservice that this webserivce is will be used on critical environment that failure of the webserivce could cause major problems.
could someone provi... | [
"Python has been used to develop production grade web services. There are numerous framework to do that. (Django, Twisted etc). \nYou expect certain quality attributes from production grade servers like availability, scalability etc. For mission critical applications, availability becomes important. Your applicati... | [
6
] | [] | [] | [
"python",
"web_services"
] | stackoverflow_0003596094_python_web_services.txt |
Q:
python: reference "private" variables' names in an organized way
Suppose I have a class, and I want to reference some elements in the ' __dict__ (for instance, I want to copy the dict and delete the attribute that cannot be pickled), from inside the class.
Problem is, those attributes are "private" so my code ends... | python: reference "private" variables' names in an organized way | Suppose I have a class, and I want to reference some elements in the ' __dict__ (for instance, I want to copy the dict and delete the attribute that cannot be pickled), from inside the class.
Problem is, those attributes are "private" so my code ends up looking like so
class MyClasss(object):
def __init__(self):
... | [
"Consider using only a single underscore for private attributes. These are still considered private but do not get name mangled.\nclass MyClasss(object):\n def __init__(self):\n self._prv=1\n def __getstate__(self):\n ret=self.__dict__.copy()\n del ret['_prv']\n\n",
"You might try... | [
6,
1,
1,
0
] | [
"Better to use your own naming convention for those attributes, such as _prv_x, _prv_y etc. then you can use a loop to selectively remove them\nclass MyClasss(object):\n def __init__(self):\n self._prv_x=1\n self._prv_y=1\n def __getstate__(self):\n return dict((k,v) for k,v in vars... | [
-1
] | [
"obfuscation",
"private",
"python"
] | stackoverflow_0003579288_obfuscation_private_python.txt |
Q:
unsigned char* image to Python
I was able to generate python bindings for a camera library using SWIG and I am able to capture and save image using the library's inbuilt functions.
I am trying to obtain data from the camera into Python Image Library format, the library provides functions to return camera data as ... | unsigned char* image to Python | I was able to generate python bindings for a camera library using SWIG and I am able to capture and save image using the library's inbuilt functions.
I am trying to obtain data from the camera into Python Image Library format, the library provides functions to return camera data as unsigned char* .
Does anyone know h... | [
"I believe you should use the fromstring method, as described here:\nHow to read a raw image using PIL?\nAlso, there's a good article on capturing data from the camera using python and opencv which is worth reading: http://www.jperla.com/blog/post/capturing-frames-from-a-webcam-on-linux\n",
"Okay Guys, so finally... | [
1,
1,
0
] | [] | [] | [
"c++",
"pep3118",
"python",
"python_imaging_library",
"unsigned_char"
] | stackoverflow_0003586003_c++_pep3118_python_python_imaging_library_unsigned_char.txt |
Q:
How do I manually add more cookies to a session which already has cookies set in mechanize?
I have a python script which scrapes a page and receives a cookie. I want to append another cookie to the existing cookies that are being send to the server. So that on the next request I have the cookies from the original ... | How do I manually add more cookies to a session which already has cookies set in mechanize? | I have a python script which scrapes a page and receives a cookie. I want to append another cookie to the existing cookies that are being send to the server. So that on the next request I have the cookies from the original page plus ones I set manually.
Anyway of doing this? I tried addheaders in mechanize but it was i... | [
"Use the set_cookie method:\n>>> import mechanize\n>>> br=mechanize.Browser()\n\n>>> br.set_cookie?\n\nDefinition: br.set_cookie(self, cookie_string)\nDocstring:\n Request to set a cookie.\n\n Note that it is NOT necessary to call this method under ordinary\n circumstances: cookie handling is normally enti... | [
6
] | [] | [] | [
"cookies",
"mechanize",
"python"
] | stackoverflow_0003596857_cookies_mechanize_python.txt |
Q:
Will Javascript V8 kill all the other server-side dynamic languages? Ruby, Python, PHP?
That's all. It should be very nice to share the same libs on the client and on the server or not? Are JS VMs like HotRuby (http://hotruby.yukoba.jp/) a "real world" alternative or just a toy?
PS: if I ask it is because I'd like... | Will Javascript V8 kill all the other server-side dynamic languages? Ruby, Python, PHP? | That's all. It should be very nice to share the same libs on the client and on the server or not? Are JS VMs like HotRuby (http://hotruby.yukoba.jp/) a "real world" alternative or just a toy?
PS: if I ask it is because I'd like know it, please don't close this question but just share your opinion.
I'm not interested i... | [
"Simply put: no.\nTo use a bit longer explanation: Server-side javascript might put a big dent in currently used scripting languages, but it won't replace them for a few simple reasons:\n\nLegacy - there is a lot of code and libs out there already written for PHP, Python etc. Just like nobody is rushing to switch t... | [
12
] | [] | [] | [
"javascript",
"php",
"python",
"ruby"
] | stackoverflow_0003596875_javascript_php_python_ruby.txt |
Q:
Python: Get the redirect urls using cURL
I am interested in getting the intermediate URLs in a redirect chain using pycURL. So, say I have a website, Site A, which redirects to Site B, which then redirects to Site C. Regularly I would only be able to see Site A (the starting URL) and Site C (the ending URL), howev... | Python: Get the redirect urls using cURL | I am interested in getting the intermediate URLs in a redirect chain using pycURL. So, say I have a website, Site A, which redirects to Site B, which then redirects to Site C. Regularly I would only be able to see Site A (the starting URL) and Site C (the ending URL), however I am also interested in any sites that happ... | [
"Have a look to PyCurl Callbacks:\n## Callback function invoked when header data is ready\ndef header(buf):\n import sys\n sys.stdout.write(buf)\n # Returning None implies that all bytes were written\n\nc = pycurl.Curl()\nc.setopt(pycurl.URL, \"http://www.siteA.com/\")\nc.setopt(pycurl.HEADERFUNCTION, head... | [
0
] | [] | [] | [
"curl",
"pycurl",
"python"
] | stackoverflow_0003596968_curl_pycurl_python.txt |
Q:
WebTest: Testing with decorators + datastore calls
I have a Google App Engine application and my request hadnler has a decorator that does authentication. With WebTest I found out yesterday how you can set a logged in user and administrator.
Now today my authentication decorator got a little more complex. It's als... | WebTest: Testing with decorators + datastore calls | I have a Google App Engine application and my request hadnler has a decorator that does authentication. With WebTest I found out yesterday how you can set a logged in user and administrator.
Now today my authentication decorator got a little more complex. It's also checking if a user has a profile in the database and i... | [
"You should create a profile during the test, to be used by the decorator:\ndef user_ok(self):\n key_name = 'info@example.com'\n new_user = Profile(key_name=key_name)\n new_user.put()\n\n os.environ['USER_EMAIL'] = key_name\n os.environ['USER_ID'] = key_name\n os.environ['USER_IS_ADMIN'] = ''\n ... | [
2
] | [] | [] | [
"google_app_engine",
"python",
"unit_testing",
"webtest",
"wsgi"
] | stackoverflow_0003596958_google_app_engine_python_unit_testing_webtest_wsgi.txt |
Q:
GAE Datastore - Is there a next page / Are there x+1 entities?
Currently, to determine whether or not there is a next page of entities I'm using the following code:
q = Entity.all().fetch(10)
cursor = q.cursor()
extra = q.fetch(1)
has_next_page = False
if extra:
has_next_page = True
However, this is very expen... | GAE Datastore - Is there a next page / Are there x+1 entities? | Currently, to determine whether or not there is a next page of entities I'm using the following code:
q = Entity.all().fetch(10)
cursor = q.cursor()
extra = q.fetch(1)
has_next_page = False
if extra:
has_next_page = True
However, this is very expensive in terms of the time it takes to execute the 'extra' query. I n... | [
"If you fetch 11 items straight away you'll only have to fetch 1 extra item to know if there is a next page or not. And you can just display the first 10 results and use the 11th result only as a \"next page\" indicator.\n"
] | [
1
] | [] | [] | [
"database",
"google_app_engine",
"google_cloud_datastore",
"python",
"scalability"
] | stackoverflow_0003597056_database_google_app_engine_google_cloud_datastore_python_scalability.txt |
Q:
How to use new Django 1.2 readonly_fields in ModelForm
I'm trying to use the new readonly_fields in a ModelForm.
class TrainingAddForm(forms.ModelForm):
class Meta:
model = TrainingTasks
readonly_fields = ('trainee_signed','trainee_signed_date')
But this does not work. Am I missing something o... | How to use new Django 1.2 readonly_fields in ModelForm | I'm trying to use the new readonly_fields in a ModelForm.
class TrainingAddForm(forms.ModelForm):
class Meta:
model = TrainingTasks
readonly_fields = ('trainee_signed','trainee_signed_date')
But this does not work. Am I missing something or is this not possible?
| [
"As per the documentation, this is a member of admin.ModelAdmin, not forms.ModelForm. Your admin form needs to inherit from admin.ModelAdmin in order for you to have access to the readonly_fields option.\nEdit:\nI mis-read the original question, I thought you were trying to use the field within Django's supplied ad... | [
0,
0
] | [] | [] | [
"django",
"django_forms",
"python"
] | stackoverflow_0003597227_django_django_forms_python.txt |
Q:
sqlalchemy database table is locked
I am trying to select all the records from a sqlite db I have with sqlalchemy, loop over each one and do an update on it. I am doing this because I need to reformat ever record in my name column.
Here is the code I am using to do a simple test:
def loadDb(name):
... | sqlalchemy database table is locked | I am trying to select all the records from a sqlite db I have with sqlalchemy, loop over each one and do an update on it. I am doing this because I need to reformat ever record in my name column.
Here is the code I am using to do a simple test:
def loadDb(name):
sqlite3.connect(name)
eng... | [
"With SQLite, you can't update the database while you are still performing the select. You need to force the select query to finish and store all of the data, then perform your loop. I think this would do the job (untested):\ndealer = list(dealers.select().order_by(asc(dealers.c.id)).execute())\n\nAnother option ... | [
4
] | [] | [] | [
"python",
"sqlalchemy",
"sqlite"
] | stackoverflow_0003596801_python_sqlalchemy_sqlite.txt |
Q:
Locating django app resources
tl:dr
How would a hosted django app correctly transform resource paths to match any hosted location (/ or /test or /testtest)?
Full Description
Let me try to explain what I am trying to do.
I am trying to write a somewhat re-usable django app which I intend to use from within multiple... | Locating django app resources | tl:dr
How would a hosted django app correctly transform resource paths to match any hosted location (/ or /test or /testtest)?
Full Description
Let me try to explain what I am trying to do.
I am trying to write a somewhat re-usable django app which I intend to use from within multiple projects. This app is called syst... | [
"You shouldn't hardcode your urls like that, but use reverse instead!\nDjango also has a built-in template tag to reverse urls. So you could do something like \nfunction do_ajax () {\n $.getJSON ('{% url path.to.my_ajax_view %}', function (data) {\n $(\"#status\").html (data.status);\n });\n}\n\ndirect... | [
2
] | [] | [] | [
"django",
"django_urls",
"python"
] | stackoverflow_0003597363_django_django_urls_python.txt |
Q:
create a tar file in a string using python
I need to generate a tar file but as a string in memory rather than as an actual file. What I have as input is a single filename and a string containing the assosiated contents. I'm looking for a python lib I can use and avoid having to role my own.
A little more work fo... | create a tar file in a string using python | I need to generate a tar file but as a string in memory rather than as an actual file. What I have as input is a single filename and a string containing the assosiated contents. I'm looking for a python lib I can use and avoid having to role my own.
A little more work found these functions but using a memory steam obj... | [
"Use tarfile in conjunction with cStringIO:\nc = cStringIO.StringIO()\nt = tarfile.open(mode='w', fileobj=c)\n# here: do your work on t, then...:\ns = c.getvalue() # extract the bytestring you need\n\n"
] | [
15
] | [] | [] | [
"python",
"tar"
] | stackoverflow_0003597382_python_tar.txt |
Q:
Is there a way to match a set of groups in any order in a regex?
I looked through the related questions, there were quite a few but I don't think any answered this question. I am very new to Regex but I'm trying to get better so bear with me please. I am trying to match several groups in a string, but in any order... | Is there a way to match a set of groups in any order in a regex? | I looked through the related questions, there were quite a few but I don't think any answered this question. I am very new to Regex but I'm trying to get better so bear with me please. I am trying to match several groups in a string, but in any order. Is this something I should be using Regex for? If so, how? If it mat... | [
"The answer to the question in your title is \"no\" -- to match N groups \"in any order\", the regex should have an \"or\" (the | feature in the regex pattern) among the N! (N factorial) possible permutations of the groups, the product of all integers from 1 to N. That's a number which grows extremely fast -- for ... | [
2,
0
] | [] | [] | [
"c#",
"python",
"regex"
] | stackoverflow_0003597320_c#_python_regex.txt |
Q:
django-admin.py launches IDE
I just went to create a new django project and I typed django-admin.py startproject my_project into the command prompt and it opened the django-admin.py file in my ide (komodo edit).
This happens every time I run this command in any form, even if I just try django-admin.py. Any ideas ... | django-admin.py launches IDE | I just went to create a new django project and I typed django-admin.py startproject my_project into the command prompt and it opened the django-admin.py file in my ide (komodo edit).
This happens every time I run this command in any form, even if I just try django-admin.py. Any ideas what's going on and how I fix it?
... | [
"It sounds like you associated .py files with Komodo Edit instead of with python.exe. The simplest workaround is to type \"python django-admin.py ...\" to execute the admin. \nYou can look in your Explorer options to change the association. There's a right-click menu option I think called \"Open With...\" that ... | [
3
] | [] | [] | [
"django",
"django_admin",
"python"
] | stackoverflow_0003597665_django_django_admin_python.txt |
Q:
hex <-> RGB <-> HSV Color space conversion with Python
For this project I use Python's colorsys to convert RGB to HSV vice versa to be able to manipulate saturation and lightness, but I noticed that some colors yields bogus results.
For example, if I take any primary colors there's no problem:
However if I chose... | hex <-> RGB <-> HSV Color space conversion with Python | For this project I use Python's colorsys to convert RGB to HSV vice versa to be able to manipulate saturation and lightness, but I noticed that some colors yields bogus results.
For example, if I take any primary colors there's no problem:
However if I chose a random RGB color and convert it to HSV, I sometime gets b... | [
"The problem is in your dec2hex code:\ndef dec2hex(d):\n \"\"\"return a two character hexadecimal string representation of integer d\"\"\"\n r = \"%X\" % d\n return r if len(r) > 1 else r+r\n\nWhen your value is less than 16, you're duplicating it to get the value, in other words, multiplying it by 17. Yo... | [
2
] | [] | [] | [
"color_space",
"colors",
"python"
] | stackoverflow_0003597610_color_space_colors_python.txt |
Q:
avoid regex [python]
I'd like to know if it's a good idea avoid regex.
actually I have avoided it in any case and some peoples has been giving me advice that i shouldn't avoid it, since if you know what means every thing like:
[] '|' \A \B \d \D \W \w \S \Z $ * ? ...
it would be easy to read, right? but i fel... | avoid regex [python] | I'd like to know if it's a good idea avoid regex.
actually I have avoided it in any case and some peoples has been giving me advice that i shouldn't avoid it, since if you know what means every thing like:
[] '|' \A \B \d \D \W \w \S \Z $ * ? ...
it would be easy to read, right? but i fell like avoiding regex i ... | [
"No, don't avoid regular expressions. They're actually quite a nifty little tool and will save you a lot of work if you use them wisely.\nWhat you do need to avoid is trying to use it for everything, a malaise that appears to strike those new to regular expressions before they become a little more tempered and a li... | [
19,
6,
3,
1,
0
] | [
"Regular expressions are likely the right tool for extracting/validating email addresses...\nTo extract one or more email addresses from raw text:\nimport re\npat_e = re.compile(r'(?P<email>[\\w.+-]+@(?:[\\w-]+\\.)+[a-zA-Z]{2,})')\nemails = []\nfor r in pat_e.finditer(text):\n emails.append(r.group('email'))\nretu... | [
-2
] | [
"python",
"regex"
] | stackoverflow_0003597399_python_regex.txt |
Q:
How does Django's ORM manage to fetch Foreign objects when they are accessed
Been trying to figure this out for a couple of hours now and have gotten nowhere.
class other(models.Model):
user = models.ForeignKey(User)
others = other.objects.all()
o = others[0]
At this point the ORM has not asked for the o.use... | How does Django's ORM manage to fetch Foreign objects when they are accessed | Been trying to figure this out for a couple of hours now and have gotten nowhere.
class other(models.Model):
user = models.ForeignKey(User)
others = other.objects.all()
o = others[0]
At this point the ORM has not asked for the o.user object, but if I do ANYTHING that touches that object, it loads it from the dat... | [
"Django uses a metaclass (django.db.models.base.ModelBase) to customize the creation of model classes. For each object defined as a class attribute on the model (user is the one we care about here), Django first looks to see if it defines a contribute_to_class method. If the method is defined, Django calls it, al... | [
52,
1,
0
] | [] | [] | [
"django",
"orm",
"python"
] | stackoverflow_0003597762_django_orm_python.txt |
Q:
Handling Password Authentication over a Network
I'm writing a game which requires users to log in to their accounts in order to be able to play. What's the best way of transmitting passwords from client to server and storing them?
I'm using Python and Twisted, if that's of any relevance.
A:
The best way is to au... | Handling Password Authentication over a Network | I'm writing a game which requires users to log in to their accounts in order to be able to play. What's the best way of transmitting passwords from client to server and storing them?
I'm using Python and Twisted, if that's of any relevance.
| [
"The best way is to authenticate via SSL/TLS. The best way of storing passwords is to store them hashed with some complex hash like sha1(sha1(password)+salt) with salt.\n",
"If you want plug'n'play solution, use py-bcrypt for storing passwords (http://www.mindrot.org/projects/py-bcrypt/) and SSL/TLS to protect th... | [
1,
0
] | [] | [] | [
"network_programming",
"passwords",
"python",
"security"
] | stackoverflow_0003595835_network_programming_passwords_python_security.txt |
Q:
loop in python !
can anyone help me with loop i want loop that code
login_form_data = urllib.urlencode(login_form_seq)
opener = urllib2.build_opener()
site = opener.open(B, login_form_data).read()
the code allow me to login to site but site have problem and the problem is: you can't login from first time
that m... | loop in python ! | can anyone help me with loop i want loop that code
login_form_data = urllib.urlencode(login_form_seq)
opener = urllib2.build_opener()
site = opener.open(B, login_form_data).read()
the code allow me to login to site but site have problem and the problem is: you can't login from first time
that mean I have to press su... | [
"You need to handle cookies. Look at the cookielib module.\n",
"If it is a cookie handling problem, use the \"HTTPCookieProcessor\" in urllib2.\nBy applying it to your opener.\ncookieHandler = urllib2.HTTPCookieProcessor() # Needed for cookie handling\n\n# Apply the handler to an opener\nopener = urllib2.build_op... | [
2,
1,
0
] | [] | [] | [
"python"
] | stackoverflow_0003597644_python.txt |
Q:
Is it possible to compare the values of a csv and text file in python?
i have a csv file and a text file. is it possible to compare the values in both files? or should i have the values of both in a csv file to make it easier?
A:
is it possible to compare the values
in both files?
Yes. You can open them both... | Is it possible to compare the values of a csv and text file in python? | i have a csv file and a text file. is it possible to compare the values in both files? or should i have the values of both in a csv file to make it easier?
| [
"\nis it possible to compare the values\n in both files?\n\nYes. You can open them both in binary mode an compare the bytes, or in text mode and compare the characters. Neither will be particularly useful, though.\n\nor should i have the values of both in\n a csv file to make it easier?\n\nConvert them both to ... | [
3,
2,
2
] | [] | [] | [
"csv",
"python"
] | stackoverflow_0003598205_csv_python.txt |
Q:
Python's list comprehensions and other better practices
This relates to a project to convert a 2-way ANOVA program in SAS to Python.
I pretty much started trying to learn the language Thursday, so I know I have a lot of room for improvement. If I'm missing something blatantly obvious, by all means, let me know. I... | Python's list comprehensions and other better practices | This relates to a project to convert a 2-way ANOVA program in SAS to Python.
I pretty much started trying to learn the language Thursday, so I know I have a lot of room for improvement. If I'm missing something blatantly obvious, by all means, let me know. I haven't got Sage up and running yet, nor numpy, so right now... | [
"\nbyAxB= [item for sublist in response for item in sublist] Again could someone explain why?\n\nI am sure A.M. will be able to give you a good explanation. Here is my stab at it while waiting for him to turn up.\nI would approach this from left to right. Take these four words:\nfor sublist in response\n\nI hope yo... | [
6,
1,
1
] | [] | [] | [
"arrays",
"list",
"python",
"python_2.6",
"statistics"
] | stackoverflow_0003597955_arrays_list_python_python_2.6_statistics.txt |
Q:
Python Tool Windows
TL.attributes('-toolwindow', True)
I'm making a GUI in Tkinter that uses a tool window, is there anyway to make this window show up in the task bar?
A:
On most systems, you can temporarily remove the window from the screen by iconifying it. In Tk, whether or not a window is iconified is ref... | Python Tool Windows | TL.attributes('-toolwindow', True)
I'm making a GUI in Tkinter that uses a tool window, is there anyway to make this window show up in the task bar?
| [
"On most systems, you can temporarily remove the window from the screen by iconifying it. In Tk, whether or not a window is iconified is referred to as the window's state. The possible states for a window include \"normal\" and \"iconic\" (for an iconified window). There are some others too.\nthestate = window.stat... | [
2
] | [] | [] | [
"python",
"taskbar",
"tkinter",
"windows"
] | stackoverflow_0003598291_python_taskbar_tkinter_windows.txt |
Q:
Is there a way to iterate a specified number of times without introducing an unnecessary variable?
If I want to iterate n times in Java, I write:
for (i = 0; i < n; i++) {
// do stuff
}
In Python, it seems the standard way to do this is:
for x in range(n):
# do stuff
As always, Python is more concise and... | Is there a way to iterate a specified number of times without introducing an unnecessary variable? | If I want to iterate n times in Java, I write:
for (i = 0; i < n; i++) {
// do stuff
}
In Python, it seems the standard way to do this is:
for x in range(n):
# do stuff
As always, Python is more concise and more readable. But the x bothers me, as it is unnecessary, and PyDev generates a warning, since x is n... | [
"Idiomatic Python (and many other languages) would have you use _ as the temporary variable, which generally indicates to readers that the variable is intentionally unused.\nAside from that convention, the in loop-construct in Python always requires you to iterate over something and assign that value to a variable.... | [
6,
2
] | [] | [] | [
"coding_style",
"iteration",
"python"
] | stackoverflow_0003524048_coding_style_iteration_python.txt |
Q:
Qt: best way to add a context menu to the central widget?
I do not understand why in the book Rapid GUI Programming with Python and Qt, a context menu is added to a central widget by calling addActions() on the main window (self), like so (p. 180):
self.addActions(self.imageLabel,
(editInvertAction... | Qt: best way to add a context menu to the central widget? | I do not understand why in the book Rapid GUI Programming with Python and Qt, a context menu is added to a central widget by calling addActions() on the main window (self), like so (p. 180):
self.addActions(self.imageLabel,
(editInvertAction, …))
where self is a QMainWindow, and imageLabel is a QLabel ... | [
"Using self.addAction() on QMainWindow allow all QMainWindow childs (Docks, StatusBar, ToolBar, MenuBar, ...) to use theses actions, not only the central widget.\nBut the best way to get a fine-grained context menu control is to use the customContextMenuRequested signal (http://www.riverbankcomputing.co.uk/static/D... | [
1
] | [] | [] | [
"pyqt",
"python",
"qmainwindow",
"qt",
"qwidget"
] | stackoverflow_0003582554_pyqt_python_qmainwindow_qt_qwidget.txt |
Q:
non-technical benefits of having string-type immutable
I am wondering about the benefits of having the string-type immutable from the programmers point-of-view.
Technical benefits (on the compiler/language side) can be summarized mostly that it is easier to do optimisations if the type is immutable. Read here for ... | non-technical benefits of having string-type immutable | I am wondering about the benefits of having the string-type immutable from the programmers point-of-view.
Technical benefits (on the compiler/language side) can be summarized mostly that it is easier to do optimisations if the type is immutable. Read here for a related question.
Also, in a mutable string type, either y... | [
"\nWhat is the point of having some\n types immutable and others not?\n\nWithout some mutable types, you'd have to go the whole hog to pure functional programming -- a completely different paradigm than the OOP and procedural approaches which are currently most popular, and, while extremely powerful, apparently ve... | [
16,
2,
1,
1,
1,
1,
1,
1
] | [] | [] | [
"c++",
"immutability",
"java",
"python",
"string"
] | stackoverflow_0003584945_c++_immutability_java_python_string.txt |
Q:
Any way to stringify a variable id / symbol in Python?
I'm wondering if it is possible at all in python to stringify
variable id/symbol -- that is, a function that behaves as follows:
>>> symbol = 'whatever'
>>> symbol_name(symbol)
'symbol'
Now, it is easy to do it on a function or a class (if it is a
direct refe... | Any way to stringify a variable id / symbol in Python? | I'm wondering if it is possible at all in python to stringify
variable id/symbol -- that is, a function that behaves as follows:
>>> symbol = 'whatever'
>>> symbol_name(symbol)
'symbol'
Now, it is easy to do it on a function or a class (if it is a
direct reference to the object):
>>> def fn(): pass
>>> fn.func_name
'f... | [
"Here is, I'm sure you can turn it into a better form =)\ndef symbol_name(a):\n for k,v in globals().items():\n if id(a)==id(v): return k\n\nUpdate: As unbeli has noted, if you have:\na = []\nb = a\n\nThe function will not be able to show you the right name, since id(a)==id(b).\n",
"I don't think it's p... | [
4,
3,
0
] | [] | [] | [
"python"
] | stackoverflow_0003000566_python.txt |
Q:
Fastest implementation to do multiple string substitutions in Python
Is there any recommended way to do multiple string substitutions other than doing replace chaining on a string (i.e. text.replace(a, b).replace(c, d).replace(e, f)...)?
How would you, for example, implement a fast function that behaves like PHP's... | Fastest implementation to do multiple string substitutions in Python | Is there any recommended way to do multiple string substitutions other than doing replace chaining on a string (i.e. text.replace(a, b).replace(c, d).replace(e, f)...)?
How would you, for example, implement a fast function that behaves like PHP's htmlspecialchars in Python?
I compared (1) multiple replace method, (2) t... | [
"Something like the following maybe? Split the text into pieces with the first \"from\" item to be replaced, then recursively split each of those parts into sub-parts with the next \"from\" item to be replaced, and so on, until you've visited all your replacements. Then join with the \"to\" replacement item for eac... | [
7,
1,
0
] | [] | [] | [
"php",
"python",
"string"
] | stackoverflow_0003411006_php_python_string.txt |
Q:
Add/remove programs in Windows XP with Python script
I would like to add add/programs like adobe acrobat reader and other application in windows XP using Python script. Kindly looking for some help.
Thanks in advance!
Everest.
A:
Are you installing or uninstalling?
Installing:
Easy way: subprocess.Popen the ins... | Add/remove programs in Windows XP with Python script | I would like to add add/programs like adobe acrobat reader and other application in windows XP using Python script. Kindly looking for some help.
Thanks in advance!
Everest.
| [
"Are you installing or uninstalling?\nInstalling:\nEasy way: subprocess.Popen the installer.\nNearly-as-easy way: subprocess.Popen the installer, with some Windows hackery so that the user doesn't have to click anything.\nUninstalling:\nAs above.\nHard way: work out the files changed on the computer and revert them... | [
2
] | [] | [] | [
"administration",
"python",
"system",
"windows"
] | stackoverflow_0003599213_administration_python_system_windows.txt |
Q:
Changing the words keeping its meaning intact
We have a requirement in which we need to change change the words or phrases in the sentence while keeping its meaning intact. This application is going to provide suggestions to users who are involved in copy-writing.
I don't know where should I start... we have not y... | Changing the words keeping its meaning intact | We have a requirement in which we need to change change the words or phrases in the sentence while keeping its meaning intact. This application is going to provide suggestions to users who are involved in copy-writing.
I don't know where should I start... we have not yet finalized the technology but would like to do it... | [
"Just for laughs:\nimport urllib2\nimport urllib\nimport sys\nimport json\n\ndef translate(text,lang1,lang2):\n base_url='http://ajax.googleapis.com/ajax/services/language/translate?' \n langpair='%s|%s'%(lang1,lang2)\n params=urllib.urlencode( (('v',1.0),\n ('q',text.encode('utf-8... | [
14,
1,
0,
0
] | [] | [] | [
".net",
"nlp",
"python"
] | stackoverflow_0003591474_.net_nlp_python.txt |
Q:
Threading in python: retrieve return value when using target=
Possible Duplicate:
Return value from thread
I want to get the "free memory" of a bunch of servers like this:
def get_mem(servername):
res = os.popen('ssh %s "grep MemFree /proc/meminfo | sed \'s/[^0-9]//g\'"' % servername)
return res.read... | Threading in python: retrieve return value when using target= |
Possible Duplicate:
Return value from thread
I want to get the "free memory" of a bunch of servers like this:
def get_mem(servername):
res = os.popen('ssh %s "grep MemFree /proc/meminfo | sed \'s/[^0-9]//g\'"' % servername)
return res.read().strip()
since this can be threaded I want to do something li... | [
"You could create a synchronised queue, pass it to the thread function and have it report back by pushing the result into the queue, e.g.:\ndef get_mem(servername, q):\n res = os.popen('ssh %s \"grep MemFree /proc/meminfo | sed \\'s/[^0-9]//g\\'\"' % servername)\n q.put(res.read().strip())\n\n# ...\n\nimport ... | [
19,
2
] | [] | [] | [
"memory",
"multithreading",
"python"
] | stackoverflow_0002577233_memory_multithreading_python.txt |
Q:
General utility to remove/strip all comments from source code in various languages?
I am looking for a command-line tool that removes all comments from an input
file and returns the stripped output. It'd be nice it supports popular
programming languages like c, c++, python, php, javascript, html, css, etc. It
has... | General utility to remove/strip all comments from source code in various languages? | I am looking for a command-line tool that removes all comments from an input
file and returns the stripped output. It'd be nice it supports popular
programming languages like c, c++, python, php, javascript, html, css, etc. It
has to be syntax-aware as opposed to regexp-based, since the latter will catch
the pattern i... | [
"cloc, a free Perl script, can do this.\n\nRemove Comments from Source Code\nHow can you tell if cloc correctly identifies comments? One way to convince yourself cloc is doing the right thing is to use its --strip-comments option to remove comments and blank lines from files, then compare the stripped-down files to... | [
4,
3,
1,
0,
0
] | [
"You might coax GNU Source-highlight into doing this.\n"
] | [
-1
] | [
"c",
"php",
"python"
] | stackoverflow_0003349156_c_php_python.txt |
Q:
Finding the common elements of a list
Hi as per the earlier post.
Given the following list:
['Jellicle', 'Cats', 'are', 'black', 'and', 'white,', 'Jellicle', 'Cats', 'are', 'rather', 'small;', 'Jellicle', 'Cats', 'are', 'merry', 'and', 'bright,', 'And', 'pleasant', 'to', 'hear', 'when', 'they', 'caterwaul.', 'Jel... | Finding the common elements of a list | Hi as per the earlier post.
Given the following list:
['Jellicle', 'Cats', 'are', 'black', 'and', 'white,', 'Jellicle', 'Cats', 'are', 'rather', 'small;', 'Jellicle', 'Cats', 'are', 'merry', 'and', 'bright,', 'And', 'pleasant', 'to', 'hear', 'when', 'they', 'caterwaul.', 'Jellicle', 'Cats', 'have', 'cheerful', 'faces,... | [
"#uncomment to produce the word file\n##words = ['Jellicle', 'Cats', 'are', 'black', 'and', 'white,', 'Jellicle', 'Cats', 'are', 'rather', 'small;', 'Jellicle', 'Cats', 'are', 'merry', 'and', 'bright,', 'And', 'pleasant', 'to', 'hear', 'when', 'they', 'caterwaul.', 'Jellicle', 'Cats', 'have', 'cheerful', 'faces,', ... | [
7,
3,
2,
2,
1,
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0003594740_python.txt |
Q:
I can't instantiate a simple class in Python
I want to generate a Python class via a file.
This is a very simple file, named testy.py:
def __init__(self,var):
print (var)
When I try to instantiate it I get:
>>> import testy
>>> testy('1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
... | I can't instantiate a simple class in Python | I want to generate a Python class via a file.
This is a very simple file, named testy.py:
def __init__(self,var):
print (var)
When I try to instantiate it I get:
>>> import testy
>>> testy('1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
Then ,... | [
"Attempt 1 failed because you were not defining a class, just a function (which you fixed with attempt 2).\nAttempt 2 is failing because you looking at the import statement like it is a Java import statement. In Python, an import makes a module object that can be used to access items inside it. If you want use a cl... | [
2,
2,
1
] | [] | [] | [
"python"
] | stackoverflow_0003600153_python.txt |
Q:
SOAPpy, C# and object passing
I'm trying to write a SOAPpy client to my C# WebService. It is arriving as null :(
How can I get any debug from the C# SOAP parser that WebService uses?
This is what Python sends:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap... | SOAPpy, C# and object passing | I'm trying to write a SOAPpy client to my C# WebService. It is arriving as null :(
How can I get any debug from the C# SOAP parser that WebService uses?
This is what Python sends:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-EN... | [
"Not a Python answer, but soapUI is a very useful facility for debugging and automated testing of web services. I used it heavily on a C# WCF project, with a variety of clients, including Python, Boo, Java, and C#.\n"
] | [
0
] | [] | [] | [
"c#",
"python",
"soap",
"soappy",
"web_services"
] | stackoverflow_0003600225_c#_python_soap_soappy_web_services.txt |
Q:
Scroll to the end (right) in wx.ScrolledPanel
I add dynamically images to wx.ScrolledPanel. I add them sizer which is inside ScrolledPanel. I want to scroll ScrollBar automatically to the end.
It is possible?
I've read that:
self.scroll.SetupScrolling(scroll_x=True, scroll_y=False, scrollToTop=False)
Can resol... | Scroll to the end (right) in wx.ScrolledPanel | I add dynamically images to wx.ScrolledPanel. I add them sizer which is inside ScrolledPanel. I want to scroll ScrollBar automatically to the end.
It is possible?
I've read that:
self.scroll.SetupScrolling(scroll_x=True, scroll_y=False, scrollToTop=False)
Can resolve this problem, but in my application it doesn't w... | [
"self.Scroll(self.GetClientSize()[0], -1)\n\nclientSize is a tuple (x, y) of the widget's size and -1 specifies to not make any changes across the Y direction.\n"
] | [
1
] | [] | [] | [
"python",
"scroll",
"wxpython"
] | stackoverflow_0003598905_python_scroll_wxpython.txt |
Q:
Sys.path modification or more complex issue?
I have problems with importing correctly a module on appengine. My app generally uses django with app-engine-patch, but this part is task queues using only the webapp framework.
I need to import django settings for the app to work properly.
My script starts with:
import... | Sys.path modification or more complex issue? | I have problems with importing correctly a module on appengine. My app generally uses django with app-engine-patch, but this part is task queues using only the webapp framework.
I need to import django settings for the app to work properly.
My script starts with:
import os
import sys
sys.path.append('common/')
# Force ... | [
"App engine patch manipulates sys.path internally. Background tasks bypass that code, so your path will not be ready for Django calls. You have two choices:\n\nFix the paths manually. The app engine documentation (see the sub-section called \"Handling import path manipulation\") suggests factoring the path manip... | [
3,
0
] | [] | [] | [
"app_engine_patch",
"django",
"django_settings",
"google_app_engine",
"python"
] | stackoverflow_0003599387_app_engine_patch_django_django_settings_google_app_engine_python.txt |
Q:
Recognizing notes within recorded sound - Python
I'm wondering if I can extract a sequence of musical notes from a recorded sound using Python.
It is the first time I'm considering using Python for this.
Help would be truly awesome :)
A:
What you would want to do is take your audio samples, convert them into th... | Recognizing notes within recorded sound - Python | I'm wondering if I can extract a sequence of musical notes from a recorded sound using Python.
It is the first time I'm considering using Python for this.
Help would be truly awesome :)
| [
"What you would want to do is take your audio samples, convert them into the frequency domain with a Fast Fourier Transform (FFT), find the most powerful frequency in the sample, and convert that frequency into a note.\nSee FFT for Spectrograms in Python for pointers to libraries to help with the first two items. S... | [
11
] | [] | [] | [
"audio",
"python"
] | stackoverflow_0003600795_audio_python.txt |
Q:
Does MongoDB have a Ruby Shell or Python Shell in addition to the Javascript shell?
Or, does using Ruby's irb and then require 'mongo' and adding some Connect
statement essentially act like a Ruby shell... it would be great if a
Ruby shell can be possible which as convenient as the Javascript
Shell.
A:
Your id... | Does MongoDB have a Ruby Shell or Python Shell in addition to the Javascript shell? | Or, does using Ruby's irb and then require 'mongo' and adding some Connect
statement essentially act like a Ruby shell... it would be great if a
Ruby shell can be possible which as convenient as the Javascript
Shell.
| [
"Your idea is fundamentally correct. I mean, as long as the language can handle command-line interpretation and support a MongoDB driver, then you could theoretically build a new MongoDB shell.\nHowever, I regularly read through the MongoDB mailing lists and I think that you're kind of on your own for this idea rig... | [
1,
0
] | [] | [] | [
"mongodb",
"nosql",
"python",
"ruby"
] | stackoverflow_0003595948_mongodb_nosql_python_ruby.txt |
Q:
How i parse with lxml a result page with form?
I try to parse a secondary page with form . I use example code source from this link :
http://blog.ianbicking.org/2007/09/24/lxmlhtml/
On my test i use this url: http://www.infofer.ro/
Like on example , I use this values :
>>> pprint(form.form_values())
[('cboData', ... | How i parse with lxml a result page with form? | I try to parse a secondary page with form . I use example code source from this link :
http://blog.ianbicking.org/2007/09/24/lxmlhtml/
On my test i use this url: http://www.infofer.ro/
Like on example , I use this values :
>>> pprint(form.form_values())
[('cboData', '8/30/2010'),
('txtPlecare', 'Bucuresti Nord'),
('... | [
"The getroot method does not give you another \"page\", but an instance of lxml.html.HtmlElement. \nThere is no need (and no way) to parse this once more, you already have everything you need packed into the result variable.\n"
] | [
2
] | [] | [] | [
"lxml",
"python"
] | stackoverflow_0003601222_lxml_python.txt |
Q:
How to glob for iterable element
I have a python dictionary that contains iterables, some of which are lists, but most of which are other dictionaries. I'd like to do glob-style assignment similar to the following:
myiter['*']['*.txt']['name'] = 'Woot'
That is, for each element in myiter, look up all elements wit... | How to glob for iterable element | I have a python dictionary that contains iterables, some of which are lists, but most of which are other dictionaries. I'd like to do glob-style assignment similar to the following:
myiter['*']['*.txt']['name'] = 'Woot'
That is, for each element in myiter, look up all elements with keys ending in '.txt' and then set t... | [
"The best way, I think, would be not to do it -- '*' is a perfectly valid key in a dict, so myiter['*'] has a perfectly well defined meaning and usefulness, and subverting that can definitely cause problems. How to \"glob\" over keys which are not strings, including the exclusively integer \"keys\" (indices) in el... | [
5,
2,
2,
1
] | [] | [] | [
"python"
] | stackoverflow_0003601309_python.txt |
Q:
Running multiple instances of a python program efficiently & economically?
I wrote a program that calls a function with the following prototype:
def Process(n):
# the function uses data that is stored as binary files on the hard drive and
# -- based on the value of 'n' -- scans it using functions from nu... | Running multiple instances of a python program efficiently & economically? | I wrote a program that calls a function with the following prototype:
def Process(n):
# the function uses data that is stored as binary files on the hard drive and
# -- based on the value of 'n' -- scans it using functions from numpy & cython.
# the function creates new binary files and saves the resu... | [
"Check out PiCloud: http://www.picloud.com/\nimport cloud\ncloud.call(function)\n\nMaybe it's an easy solution.\n",
"Does Process access the data on the binary files directly or do you cache it in memory? Reducing the usage of I/O operations should help.\nAlso, isn't it possible to break Process into separate fun... | [
9,
1,
1
] | [] | [] | [
"cython",
"numpy",
"python"
] | stackoverflow_0003596029_cython_numpy_python.txt |
Q:
calculate distance between 2 nodes in a graph
I have directed graph stored in the following format in the database {STARTNODE, ENDNODE}. Therefore, {5,3} means there is an arrow from node 5 to node 3.
Now I need to calculate the distance between two random nodes. What is the most efficient way? By the way, the gra... | calculate distance between 2 nodes in a graph | I have directed graph stored in the following format in the database {STARTNODE, ENDNODE}. Therefore, {5,3} means there is an arrow from node 5 to node 3.
Now I need to calculate the distance between two random nodes. What is the most efficient way? By the way, the graph is has loops.
Thanks a lot!
| [
"As you can see here\nIf you have unweighted edges you can use BFS\nIf you have non-negative edges you can use Dijkstra\nIf you have negative or positive edges you most use Bellman-Ford\n",
"If by distance we mean the minimum number of hops, then you could use Guido van Rossum's find_shortest_path function:\ndef ... | [
13,
5,
5,
4,
0
] | [] | [] | [
"python"
] | stackoverflow_0003601180_python.txt |
Q:
What is the meaning of error code 24 on Linux?
I'm running a Java program through a Python script on Linux, but the program crashes without outputting any error messages. The os.system command that executes the Java program outputs an error code of 24. What does this mean?
A:
On my system this is found in /us... | What is the meaning of error code 24 on Linux? | I'm running a Java program through a Python script on Linux, but the program crashes without outputting any error messages. The os.system command that executes the Java program outputs an error code of 24. What does this mean?
| [
"On my system this is found in /usr/include/asm-generic/errno-base.h:\n#define EMFILE 24 /* Too many open files */\n\nThis means your process has exceeded the limit on C/system file descriptors. Generally the limit is around 1024, there may be a bug in that some file descriptors are not being closed. (This wo... | [
7,
2
] | [] | [] | [
"error_code",
"java",
"linux",
"python"
] | stackoverflow_0003602160_error_code_java_linux_python.txt |
Q:
Facebook stream API error works in Browser but not Server-side
If I enter this URL in a browser it returns to me the valid XML data that I am interested in scraping.
http://www.facebook.com/ajax/stream/profile.php?__a=1&profile_id=36343869811&filter=2&max_time=0&try_scroll_load=false&_log_clicktype=Filter%20Stori... | Facebook stream API error works in Browser but not Server-side | If I enter this URL in a browser it returns to me the valid XML data that I am interested in scraping.
http://www.facebook.com/ajax/stream/profile.php?__a=1&profile_id=36343869811&filter=2&max_time=0&try_scroll_load=false&_log_clicktype=Filter%20Stories%20or%20Pagination&ajax_log=0
However, if I do it from the server... | [
"I tried the above url in both chrome and firefox. It works on chrome but fails on firefox. On chrome, I am signed into facebook while on Firefox, I am not. \nThis could be the reason for this discrepancy. You will need to provide authentication in your urllib2 based script that you have posted.\nThere is a existin... | [
2
] | [] | [] | [
"facebook",
"python",
"scraper"
] | stackoverflow_0003602438_facebook_python_scraper.txt |
Q:
Why won't recursive generator work?
I have a class where each instance is basically of a bunch of nested lists, each
of which holds a number of integers or another list containing integers, or a
list of lists, etc., like so:
class Foo(list):
def __init__(self):
self.extend(
list(1), list(... | Why won't recursive generator work? | I have a class where each instance is basically of a bunch of nested lists, each
of which holds a number of integers or another list containing integers, or a
list of lists, etc., like so:
class Foo(list):
def __init__(self):
self.extend(
list(1), list(2), list(3), range(5), [range(3), range(2... | [
"It works if you change return kids(x) to return kids(self)\n",
"Here's a function that is a simpler version of your _walk method that does what you want on an arbitrary iterable. The internal kids function is not required.\ndef walk(xs):\n for x in xs:\n try:\n for y in walk(x):\n ... | [
1,
1
] | [] | [] | [
"generator",
"python",
"recursion"
] | stackoverflow_0003602550_generator_python_recursion.txt |
Q:
Wrap a function in python supplying an additional boolean
I'm porting some code from Perl to Python, and one of the functions I am moving does the following:
sub _Run($verbose, $cmd, $other_stuff...)
{
...
}
sub Run
{
_Run(1, @_);
}
sub RunSilent
{
_Run(0, @_);
}
so to do it Python, I naively thought I co... | Wrap a function in python supplying an additional boolean | I'm porting some code from Perl to Python, and one of the functions I am moving does the following:
sub _Run($verbose, $cmd, $other_stuff...)
{
...
}
sub Run
{
_Run(1, @_);
}
sub RunSilent
{
_Run(0, @_);
}
so to do it Python, I naively thought I could do the following:
def _Run(verbose, cmd, other_stuff...)
... | [
"The * can be used for passing (positional) arguments too.\ndef Run(*args):\n return _Run(True, *args)\n\nNote that, with only this, you can't call the function with keyword arguments. To support them one need to include the ** as well:\ndef Run(*args, **kwargs):\n return _Run(True, *args, **kwargs)\n\n\nActually... | [
5,
3
] | [] | [] | [
"python",
"wrapper"
] | stackoverflow_0003602938_python_wrapper.txt |
Q:
Making python files executable in Ubuntu
In windows to make one of my codes execute all I have to do is double click on the file. However, I can't seem to figure out how to do a similar task in Ubuntu.
A:
Make sure you have #!/usr/bin/env python as the first line of your script, then in your shell do:
chmod +x ... | Making python files executable in Ubuntu | In windows to make one of my codes execute all I have to do is double click on the file. However, I can't seem to figure out how to do a similar task in Ubuntu.
| [
"Make sure you have #!/usr/bin/env python as the first line of your script, then in your shell do:\nchmod +x file.py\n./file.py\n\n",
".pyw files are just .py files that have been renamed so that Windows file associations will launch them with the console-free Python interpreter instead of the regular one.\nTo ge... | [
7,
4,
0
] | [] | [] | [
"python",
"ubuntu",
"windows_7"
] | stackoverflow_0003603287_python_ubuntu_windows_7.txt |
Q:
Why are my forms not returning field errors?
Recently I upgraded my django server. Going from 1.2 to a new version. The forms exhibit a strange behavior. When a field is left blank the whole page simply refreshes, rather than showing errors like I remember. What could cause this? What ought I do to fix it?
{%e... | Why are my forms not returning field errors? | Recently I upgraded my django server. Going from 1.2 to a new version. The forms exhibit a strange behavior. When a field is left blank the whole page simply refreshes, rather than showing errors like I remember. What could cause this? What ought I do to fix it?
{%extends "baseAUTH.html" %}
{% block title %}
... | [
"I found the issue. I reverted some changes back and found the point where I broke it. In the following function I tried to abstract\ndef FormToEmail(request, token, title, subject, message, reciever, attachlist):\n\n if request.method == 'POST':\n sender = AddSender(request)\n reciever.append(se... | [
0
] | [] | [] | [
"django",
"django_forms",
"python"
] | stackoverflow_0003602258_django_django_forms_python.txt |
Q:
Can python's mechanize use localhost sites?
Can Mechanize access sites being locally hosted by Apache?
A:
Yes. It can use any URL available so long as it is reachable. Just make sure it's properly formatted!
A:
How about trying it out? Well, seriously, I used twill (a wrapper around mechanize) on localhost, a... | Can python's mechanize use localhost sites? | Can Mechanize access sites being locally hosted by Apache?
| [
"Yes. It can use any URL available so long as it is reachable. Just make sure it's properly formatted!\n",
"How about trying it out? Well, seriously, I used twill (a wrapper around mechanize) on localhost, and it worked. It just wants to make a http connection without knowing where it is. Is this the answer you... | [
0,
0
] | [] | [] | [
"mechanize",
"python"
] | stackoverflow_0003603883_mechanize_python.txt |
Q:
windows/python manipulate versioninfo during runtime
I have multiple python processes running in their console output windows. I can set their console title via win32api.SetConsoleTitle(). Thats nice, but it would be even nicer to set some versioninfo strings (like description/company name/version) during runtime ... | windows/python manipulate versioninfo during runtime | I have multiple python processes running in their console output windows. I can set their console title via win32api.SetConsoleTitle(). Thats nice, but it would be even nicer to set some versioninfo strings (like description/company name/version) during runtime as that would allow me to easier differentiate between the... | [
"Version Information are stored as a resource in the executable. You cannot change them during runtime.\n"
] | [
0
] | [] | [] | [
"console",
"python",
"winapi",
"windows"
] | stackoverflow_0003542426_console_python_winapi_windows.txt |
Q:
Regular expression matching anything greater than eight letters in length, in Python
Despite attempts to master grep and related GNU software, I haven't come close to mastering regular expressions. I do like them, but I find them a bit of an eyesore all the same.
I suppose this question isn't difficult for some, b... | Regular expression matching anything greater than eight letters in length, in Python | Despite attempts to master grep and related GNU software, I haven't come close to mastering regular expressions. I do like them, but I find them a bit of an eyesore all the same.
I suppose this question isn't difficult for some, but I've spent hours trying to figure out how to search through my favorite book for words ... | [
"You don't need regex for this.\nresult = [w for w in vocab if len(w) >= 8]\n\nbut if regex must be used:\nrx = re.compile('^.{8,}$')\n# ^^^^ {8,} means 8 or more.\nresult = [w for w in vocab if rx.match(w)]\n\nSee http://www.regular-expressions.info/repeat.html for detail on the {a,b} syntax.\n",
... | [
36,
18,
8,
4,
0
] | [] | [] | [
"python",
"regex"
] | stackoverflow_0003604105_python_regex.txt |
Q:
Python: Find out what method on derived class called base class method
Hope the title isn't to confusing wasn't sure how I should put it. I wonder if it's possible for the base class to know which method of the derived class called one of it's methods.
Example:
class Controller(object):
def __init__(self):
... | Python: Find out what method on derived class called base class method | Hope the title isn't to confusing wasn't sure how I should put it. I wonder if it's possible for the base class to know which method of the derived class called one of it's methods.
Example:
class Controller(object):
def __init__(self):
self.output = {}
def output(self, s):
method_that_called_... | [
"There is a somewhat magical way to do what you are looking for using introspection on the call stack. But that isn't portable since not all implementations of Python have the necessary functions. It's probably not a good design decision to use introspection either. \nBetter, I think, to be explicit:\nclass Control... | [
4,
1
] | [] | [] | [
"python"
] | stackoverflow_0003604206_python.txt |
Q:
"None not in" vs "not None in"
Unless I'm crazy if None not in x and if not None in x are equivalent. Is there a preferred version? I guess None not in is more english-y and therefore more pythonic, but not None in is more like other language syntax. Is there a preferred version?
A:
They compile to the same byte... | "None not in" vs "not None in" | Unless I'm crazy if None not in x and if not None in x are equivalent. Is there a preferred version? I guess None not in is more english-y and therefore more pythonic, but not None in is more like other language syntax. Is there a preferred version?
| [
"They compile to the same bytecode, so yes they are equivalent.\n>>> import dis\n>>> dis.dis(lambda: None not in x)\n 1 0 LOAD_CONST 0 (None)\n 3 LOAD_GLOBAL 1 (x)\n 6 COMPARE_OP 7 (not in)\n 9 RETURN_VALUE\n>>> dis.dis(lambd... | [
14,
7
] | [] | [] | [
"logic",
"python",
"syntax"
] | stackoverflow_0003604222_logic_python_syntax.txt |
Q:
Are there an GUI libraries for Python that allow you to compile to an EXE (windows) and APP(Mac)?
I'm working on an application that I need to be cross-platform. I'd like to use Python for it, and am looking for GUI toolkits that make interface programming simple and easy. After a slight hunt, I found PythonCard... | Are there an GUI libraries for Python that allow you to compile to an EXE (windows) and APP(Mac)? | I'm working on an application that I need to be cross-platform. I'd like to use Python for it, and am looking for GUI toolkits that make interface programming simple and easy. After a slight hunt, I found PythonCard. This looks like it fits the bill perfectly, but I'm not sure if it will be possible to compile this ... | [
"Use PyInstaller to distribute an app using PyQt or WxPython gui toolkits. From the website:\n\nPyInstaller is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, and Mac OS X.\n\nAs for gui toolkits, PyInstaller is documented to work with Qt3, Qt4, and WxPython.\... | [
4,
4,
0,
0,
0,
0
] | [] | [] | [
"distribution",
"python",
"user_interface"
] | stackoverflow_0003604113_distribution_python_user_interface.txt |
Q:
if you don't use scaffolding, is ruby on rails still good for rapid development?
If you take out the scaffolding feature where it creates the model/controller, and CRUD pages for you, is ruby on rails still any faster to market than say, django?
It seems very similiar to be if you take away that step...(even thoug... | if you don't use scaffolding, is ruby on rails still good for rapid development? | If you take out the scaffolding feature where it creates the model/controller, and CRUD pages for you, is ruby on rails still any faster to market than say, django?
It seems very similiar to be if you take away that step...(even though I believe django has similar auto-gen capabilities)
I am reading the starting guide ... | [
"I have never seen Rails scaffold-generated view code used in a production app. The chances that it's going to create the look that you want is nearly zero. I use the generators for models and controllers all the time, as they are very useful.\nTo your question of frameworks:\nIf you know Python better, use Django.... | [
4,
2,
1
] | [] | [] | [
"django",
"python",
"ruby_on_rails"
] | stackoverflow_0003604205_django_python_ruby_on_rails.txt |
Q:
How can I randomize this text generator even further?
I'm working on a random text generator -without using Markov chains- and currently it works without too many problems -actually generates a good amount of random sentences by my criteria but I want to make it even more accurate to prevent as many sentence repea... | How can I randomize this text generator even further? | I'm working on a random text generator -without using Markov chains- and currently it works without too many problems -actually generates a good amount of random sentences by my criteria but I want to make it even more accurate to prevent as many sentence repeats as possible-. Firstly, here is my code flow:
Enter a se... | [
"There is nothing random about your algorithm at all. It should always be deterministic.\nI'm not quite sure what you want to do here. If it is to generate random words, just use a dictionary and the random module. If you want to grab random sentences from the Gutenberg project, use the random module to pick a wor... | [
0
] | [] | [] | [
"nltk",
"python",
"text"
] | stackoverflow_0003596744_nltk_python_text.txt |
Q:
Python ConfigParser persist configuration to file
I have a configuration file (feedbar.cfg), having the following content:
[last_session]
last_position_x=10
last_position_y=10
After I run the following python script:
#!/usr/bin/env python
import pygtk
import gtk
import ConfigParser
import os
pygtk.require('2.0')... | Python ConfigParser persist configuration to file | I have a configuration file (feedbar.cfg), having the following content:
[last_session]
last_position_x=10
last_position_y=10
After I run the following python script:
#!/usr/bin/env python
import pygtk
import gtk
import ConfigParser
import os
pygtk.require('2.0')
class FeedbarConfig():
""" Configuration class for F... | [
"Edit2: The reason why your code is not working is because FeedbarConfig must inherit from object to be a new-style class. Properties do not work with classic classes.:\nSo the solution is to use\nclass FeedbarConfig(object)\n\n\nEdit: Does JAXB read XML files and convert them to objects? If so, you may want to loo... | [
3,
2
] | [] | [] | [
"configparser",
"python"
] | stackoverflow_0003604254_configparser_python.txt |
Q:
Calling a Perl module from Python
my question is the inverse of this one. In particular, I've dozens of existing modules written in Perl, some are object oriented and others just export a group of functions. Now since I have to write certain scripts in python but still would like to call those Perl modules, I'm wo... | Calling a Perl module from Python | my question is the inverse of this one. In particular, I've dozens of existing modules written in Perl, some are object oriented and others just export a group of functions. Now since I have to write certain scripts in python but still would like to call those Perl modules, I'm wondering
1) if it is achievable, and
2)... | [
"\nhttp://wiki.python.org/moin/PyPerl\nhttp://www.boriel.com/files/perlfunc.py\n\n"
] | [
6
] | [] | [] | [
"call",
"module",
"perl",
"python"
] | stackoverflow_0003604388_call_module_perl_python.txt |
Q:
Making __import__ get the dynamically added methods
At my work place there is a script (kind of automation system) that loads and runs our application tests from an XML file.
In the middle of the process the script calls __import__(testModule) which loads the module from its file.
The problem starts when I tried a... | Making __import__ get the dynamically added methods | At my work place there is a script (kind of automation system) that loads and runs our application tests from an XML file.
In the middle of the process the script calls __import__(testModule) which loads the module from its file.
The problem starts when I tried adding a feature by dynamically adding functions to the te... | [
"You need to be aware that reloading a module won't magically replace old instances. Even if you do reload, only new objects will use the new code! \nThe only way to replace code during runtime is to wrap everything in a proxy object! You can sometimes do this, ie for specific, self-contained modules, but in most c... | [
2,
1
] | [] | [] | [
"metaprogramming",
"python"
] | stackoverflow_0003604611_metaprogramming_python.txt |
Q:
Python/Numpy error: NULL result without error in PyObject_Call
I've never seen this error before, and none of the hits on Google seem to apply. I've got a very large NumPy array that holds Boolean values. When I try writing the array using numpy.dump(), I get the following error:
SystemError: NULL result without e... | Python/Numpy error: NULL result without error in PyObject_Call | I've never seen this error before, and none of the hits on Google seem to apply. I've got a very large NumPy array that holds Boolean values. When I try writing the array using numpy.dump(), I get the following error:
SystemError: NULL result without error in PyObject_Call
The array is initialized with all False values... | [
"That message comes directly from the CPython interpreter (see abstract.c method PyObject_Call). You may get a better response on a Python or NumPy mailing list regarding that error message because it looks like a problem in C code. \nWrite a simple example to demonstrating the problem and you should be able to nar... | [
1,
1
] | [] | [] | [
"numpy",
"python"
] | stackoverflow_0003576430_numpy_python.txt |
Q:
x or y: acceptable idiom, or obfuscation?
I have to extract values from a variable that may be None, with some defaults in mind. I first wrote this code:
if self.maxTiles is None:
maxX, maxY = 2, 2
else:
maxX, maxY = self.maxTiles
Then I realized I could shorten it to:
maxX, maxY = self.maxTiles if self.m... | x or y: acceptable idiom, or obfuscation? | I have to extract values from a variable that may be None, with some defaults in mind. I first wrote this code:
if self.maxTiles is None:
maxX, maxY = 2, 2
else:
maxX, maxY = self.maxTiles
Then I realized I could shorten it to:
maxX, maxY = self.maxTiles if self.maxTiles is not None else (2, 2)
But then I rea... | [
"About, specifically,\nself.maxTiles if self.maxTiles is not None else (2, 2)\n\nI've found that \"double negatives\" of the general form if not A: B else: C (whether as statements or expressions) can be quite confusing / misleading; this isn't literally an if not .. else, but moving the not doesn't make the \"doub... | [
6,
4,
4,
3,
1,
0
] | [] | [] | [
"coding_style",
"idioms",
"obfuscation",
"python"
] | stackoverflow_0003604726_coding_style_idioms_obfuscation_python.txt |
Q:
How do I modify a dict locally as to not effect the global variable in python
How do I create a dictionary in python that is passed to a function so it would look like this:
def foobar(dict):
dict = tempdict # I want tempdict to not point to dict, but to be a different dict
#logic that modifies tempdict
... | How do I modify a dict locally as to not effect the global variable in python | How do I create a dictionary in python that is passed to a function so it would look like this:
def foobar(dict):
dict = tempdict # I want tempdict to not point to dict, but to be a different dict
#logic that modifies tempdict
return tempdict
How do I do this?
| [
"You need to copy dict to tempdict.\ndef foobar(d):\n temp = d.copy()\n # your logic goes here\n return temp\n\ncopy makes a shallow copy of the dict (i.e. copying its values, but not its values' values).\n% python\nPython 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) \n[GCC 4.4.3] on linux2\nType \"help\", \"... | [
4
] | [] | [] | [
"dictionary",
"python"
] | stackoverflow_0003605075_dictionary_python.txt |
Q:
Python PyGTK. What's this component?
I'm trying to write a simple GTD-style todo list app with python and gtk to learn python. I want a container that can select an individual list from a lot of choices. It would be something like the list of notebooks area in tomboy. Not a combobox.
As you can probably tell I'... | Python PyGTK. What's this component? | I'm trying to write a simple GTD-style todo list app with python and gtk to learn python. I want a container that can select an individual list from a lot of choices. It would be something like the list of notebooks area in tomboy. Not a combobox.
As you can probably tell I'm a beginner and the terminology is probab... | [
"It sounds like you just want a listbox, unless you're describing something more complex than I'm picturing.\nWikipedia has a list of GUI widgets that you may find informative.\n",
"You mean a widget to filter a large collection into multiple subsets / views? \nI would guess you have to implement this yourself - ... | [
1,
0,
0
] | [] | [] | [
"gtk",
"python",
"user_interface"
] | stackoverflow_0003604357_gtk_python_user_interface.txt |
Q:
google-app-engine-django loading fixtures
I'm having troubles loading fixtures on GAE with google-app-engine-django. I receive an error that says "DeserializationError: Invalid model identifier: 'fcl.User'"
./manage.py loaddata users
I'm trying to load a fixture that has the following data:
- model: fcl.User
... | google-app-engine-django loading fixtures | I'm having troubles loading fixtures on GAE with google-app-engine-django. I receive an error that says "DeserializationError: Invalid model identifier: 'fcl.User'"
./manage.py loaddata users
I'm trying to load a fixture that has the following data:
- model: fcl.User
fields:
firstname: test
lastname: t... | [
"Turns out the issue was caused because I wasn't declaring my model correctly in models.py\nWhen using google-app-engine-django, each model should be a subclass of:\n\nappengine_django.db.BaseModel\n\nafter fixing this, it works. I also needed to put a valid pk: value in my fixture.\n"
] | [
1
] | [] | [] | [
"django",
"django_fixtures",
"fixtures",
"google_app_engine",
"python"
] | stackoverflow_0003597332_django_django_fixtures_fixtures_google_app_engine_python.txt |
Q:
Reading Python source code to improve programming skills
I am trying improve my programming skills reading other peoples code, but I'd like to know what's the best source code to read?
EDIT
I have read some books:
How to Think Like a Computer Scientist
Learning Python, Fourth Edition
Expert Python Programming
Cor... | Reading Python source code to improve programming skills | I am trying improve my programming skills reading other peoples code, but I'd like to know what's the best source code to read?
EDIT
I have read some books:
How to Think Like a Computer Scientist
Learning Python, Fourth Edition
Expert Python Programming
Core Python Programming
I am not new to programming, I am just t... | [
"I would recommend finding an open source program that seems interesting and start contributing. This would require you to read and understand code well enough to improve it. Most open source hosting sites will let you find projects by what language they are written in. For example Github.\nYou can also check out... | [
7,
5,
3,
2,
0,
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0003605337_python.txt |
Q:
Regular expression with [ or ( in python
I need to extract IP address in the form
prosseek.amer.corp.com [10.0.40.147]
or
prosseek.amer.corp.com (10.0.40.147)
with Python. How can I get the IP for either case with Python? I started with something like
site = "prosseek.amer.corp.com"
m = re.search("%s.*[\(\[](... | Regular expression with [ or ( in python | I need to extract IP address in the form
prosseek.amer.corp.com [10.0.40.147]
or
prosseek.amer.corp.com (10.0.40.147)
with Python. How can I get the IP for either case with Python? I started with something like
site = "prosseek.amer.corp.com"
m = re.search("%s.*[\(\[](\d+\.\d+\.\d+\.\d+)" % site, r)
but it doesn'... | [
"You don't need to escape meta-characters (*, (, ), ., ...) in character groups (except ], unless it is the first character in the character group; [][]+ would match a sequence of square brackets.)\nAnother tip when it comes to Python is to use r'...'-style strings. With them, backslashes has no special meaning. r'... | [
3,
1,
1,
1,
0,
0
] | [] | [] | [
"python",
"regex"
] | stackoverflow_0003602225_python_regex.txt |
Q:
How to decode Get/Post Request headers into tuples using Cherry Py?
Ok. I've been told by at least one really helpful individual who believes that its easy to decode and parse a GET/POST request header from within CherryPy. I've been here: http://www.cherrypy.org/wiki/BuiltinTools#tools.decode but it doesn't g... | How to decode Get/Post Request headers into tuples using Cherry Py? | Ok. I've been told by at least one really helpful individual who believes that its easy to decode and parse a GET/POST request header from within CherryPy. I've been here: http://www.cherrypy.org/wiki/BuiltinTools#tools.decode but it doesn't give you an example. Can someone direct me to a more helpful example?
| [
"I guess there are two parts embedded to your question:\n1) How to get the headers \ncherrypy.request.headers is a dict, you can extract information like any other dictionary\n2) How to use the decoding / encoding support provided in tools.decode\n@tools.decode(encoding='ISO-88510-1') \ndef decodingFunction(self, d... | [
2
] | [] | [] | [
"cherrypy",
"http_headers",
"python"
] | stackoverflow_0003605443_cherrypy_http_headers_python.txt |
Q:
Help me with py2exe
I made my program, and tested it in Command Prompt(by entering in the directory). Then I made a set up file, and put the setup file and my program in the same folder.
My setup file:
from distutils.core import setup
import py2exe
setup(console=['C:\Python26\test\testprogram.py'])
I went to run... | Help me with py2exe | I made my program, and tested it in Command Prompt(by entering in the directory). Then I made a set up file, and put the setup file and my program in the same folder.
My setup file:
from distutils.core import setup
import py2exe
setup(console=['C:\Python26\test\testprogram.py'])
I went to run the setup program in com... | [
"The setup file is used to build / install files for distribution. you need to provide command to setup.py : \"./setup.py command\"\nGo through, http://wiki.python.org/moin/Distutils/Tutorial and others on google search to understand it.\nPy2Exe is an additional command to DistUtils, that creates standalone distrib... | [
2
] | [] | [] | [
"exe",
"py2exe",
"python"
] | stackoverflow_0003605755_exe_py2exe_python.txt |
Q:
Why does my remote MongoDB connection require authentication on every query?
After fighting with different things here and there, I was finally able to get BottlePY running on Apache and run a MongoDB powered site. I am used to running Django apps, so I will be relating to that a bit in my question.
The Problem
Ev... | Why does my remote MongoDB connection require authentication on every query? | After fighting with different things here and there, I was finally able to get BottlePY running on Apache and run a MongoDB powered site. I am used to running Django apps, so I will be relating to that a bit in my question.
The Problem
Every time a page is loaded via BottlePY, the connection to the MongoDB database loc... | [
"This just ended up to be a weird thing between Bottle and MongoHQ. No real solution was found, but I couldn't recreate it with other frameworks. Any other ideas are appreciated.\n",
"does your apache xxx.conf contain something like:\nWSGIDaemonProcess project user=mysite group=www-data processes=5 threads=1\n WS... | [
1,
0
] | [] | [] | [
"bottle",
"mongodb",
"pymongo",
"python"
] | stackoverflow_0003456267_bottle_mongodb_pymongo_python.txt |
Q:
GAE datastore date property auto produce date of 1970
I have datastore Model bellow:
class ThisCategory(search.SearchableModel):
ancestor = db.ListProperty(db.Key, default=[])
no_ancestor = db.BooleanProperty(default=True)
name = db.StringProperty()
description = db.TextProperty()
last_modified... | GAE datastore date property auto produce date of 1970 | I have datastore Model bellow:
class ThisCategory(search.SearchableModel):
ancestor = db.ListProperty(db.Key, default=[])
no_ancestor = db.BooleanProperty(default=True)
name = db.StringProperty()
description = db.TextProperty()
last_modified = db.TimeProperty(auto_now=True) #<----- (1970-01-01 15:36... | [
"A TimeProperty is just a DateTime object with the date part set to 0 (which means 1970-01-01).\nThe idea is that when you use a TimeProperty you ignore the date part.\nIf you want to use the Date information too, then you want a DateTimeProperty. The DateTimeProperty's auto_now will properly set both the date and... | [
6
] | [] | [] | [
"google_app_engine",
"google_cloud_datastore",
"python"
] | stackoverflow_0003605869_google_app_engine_google_cloud_datastore_python.txt |
Q:
Opening a website frame or image in python
So i am fairly fluent with python and have used urllib2 and Cookies a lot for website automation. I just stumbled upon the "webbrowser" module which can open a url in your default browser. Im wondering if its possible to select just one object from that url and open that ... | Opening a website frame or image in python | So i am fairly fluent with python and have used urllib2 and Cookies a lot for website automation. I just stumbled upon the "webbrowser" module which can open a url in your default browser. Im wondering if its possible to select just one object from that url and open that up. Specifically i want to open a "captcha" so t... | [
"It's not possible with the webbrowser module. All webbrowser does is provide a simple way to identify the default web browser and feed a URL to it.\nIf you want to render just a portion of a page, you need something that can either take arbitrary HTML fragments or can inject some Javascript after loading a page to... | [
4
] | [] | [] | [
"browser",
"cookies",
"python",
"urllib2"
] | stackoverflow_0003605832_browser_cookies_python_urllib2.txt |
Q:
How can I add a test method to a group of Django TestCase-derived classes?
I have a group of test cases that all should have exactly the same test done, along the lines of "Does method x return the name of an existing file?"
I thought that the best way to do it would be a base class deriving from TestCase that the... | How can I add a test method to a group of Django TestCase-derived classes? | I have a group of test cases that all should have exactly the same test done, along the lines of "Does method x return the name of an existing file?"
I thought that the best way to do it would be a base class deriving from TestCase that they all share, and simply add the test to that class. Unfortunately, the testing ... | [
"You could use a mixin by taking advantage that the test runner only runs tests inheriting from unittest.TestCase (which Django's TestCase inherits from.) For example:\nclass SharedTestMixin(object):\n # This class will not be executed by the test runner (it inherits from object, not unittest.TestCase.\n # I... | [
31,
4
] | [] | [] | [
"django",
"python",
"subclassing",
"unit_testing"
] | stackoverflow_0003605936_django_python_subclassing_unit_testing.txt |
Q:
Constructing objects in __init__
I've seen code that looks something like this:
class MyClass:
def __init__(self, someargs):
myObj = OtherClass()
myDict = {}
...code to setup myObj, myDict...
self.myObj = myObj
self.myDict = myDict
My first thought when I saw this was: ... | Constructing objects in __init__ | I've seen code that looks something like this:
class MyClass:
def __init__(self, someargs):
myObj = OtherClass()
myDict = {}
...code to setup myObj, myDict...
self.myObj = myObj
self.myDict = myDict
My first thought when I saw this was: Why not just use self.myObj and self.m... | [
"It's faster and more readable to construct the object and then attach it to self.\nclass Test1(object):\n def __init__(self):\n d = {}\n d['a'] = 1\n d['b'] = 2\n d['c'] = 3\n self.d = d\n\nclass Test2(object):\n def __init__(self):\n self.d = {}\n self.d['a']... | [
8,
3,
1,
0,
0
] | [] | [] | [
"constructor",
"python"
] | stackoverflow_0003605766_constructor_python.txt |
Q:
Is it possible to change the color of one individual pixel in Python?
I need python to change the color of one individual pixel on a picture, how do I go about that?
A:
To build upon the example given in Gabi Purcaru's link, here's something cobbled together from the PIL docs.
The simplest way to reliably modi... | Is it possible to change the color of one individual pixel in Python? | I need python to change the color of one individual pixel on a picture, how do I go about that?
| [
"To build upon the example given in Gabi Purcaru's link, here's something cobbled together from the PIL docs.\nThe simplest way to reliably modify a single pixel using PIL would be:\nx, y = 10, 25\nshade = 20\n\nfrom PIL import Image\nim = Image.open(\"foo.png\")\npix = im.load()\n\nif im.mode == '1':\n value = ... | [
25
] | [] | [] | [
"pixel",
"python",
"python_imaging_library"
] | stackoverflow_0003596433_pixel_python_python_imaging_library.txt |
Q:
What would be the simplest way to daemonize a python script in Linux?
What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
A:
See Stevens and also this lengthy thread on activestate which I found perso... | What would be the simplest way to daemonize a python script in Linux? | What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
| [
"See Stevens and also this lengthy thread on activestate which I found personally to be both mostly incorrect and much to verbose, and I came up with this:\nfrom os import fork, setsid, umask, dup2\nfrom sys import stdin, stdout, stderr\n\nif fork(): exit(0)\numask(0) \nsetsid() \nif fork(): exit(0)\n\nstdout.flush... | [
21,
4,
2,
1,
0
] | [] | [] | [
"daemon",
"python",
"scripting"
] | stackoverflow_0000115974_daemon_python_scripting.txt |
Q:
True = False == True
Possible Duplicate:
Why can't Python handle true/false values as I expect?
False = True should raise an error in this case.
False = True
True == False
True
True + False == True?
if True + False:
print True
True
True Again?
if str(True + False) + str(False + False) == '10':
print T... | True = False == True |
Possible Duplicate:
Why can't Python handle true/false values as I expect?
False = True should raise an error in this case.
False = True
True == False
True
True + False == True?
if True + False:
print True
True
True Again?
if str(True + False) + str(False + False) == '10':
print True
True
LOL
if True + F... | [
"False is just a global variable, you can assign to it. It will, however, break just about everything if you do so.\nNote that this behavior has been removed in python3k\nPython 3.1 (r31:73578, Jun 27 2009, 21:49:46) \n>>> False = True\n File \"<stdin>\", line 1\nSyntaxError: assignment to keyword\n\nalso, int(Fal... | [
12,
7
] | [] | [] | [
"python"
] | stackoverflow_0003606333_python.txt |
Q:
Hide password when checking config file in git
Possible Duplicates:
What is the best practice for dealing with passwords in github?
How can I track system-specific config files in a repo/project?
Hi,
I would like to hide
DATABASE_NAME = ''
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
Line 13 t... | Hide password when checking config file in git |
Possible Duplicates:
What is the best practice for dealing with passwords in github?
How can I track system-specific config files in a repo/project?
Hi,
I would like to hide
DATABASE_NAME = ''
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
Line 13 to 17 of the default Django settings.py file when ch... | [
"You could also have an extra settings file which holds passwords and just import them in your main settings.py\nFor example:\nsettings.py\nDATABASE_PASSWORD = ''\n\ntry:\n from dev_settings import *\nexcept ImportError:\n pass\n\ndev_settings.py\nDATABASE_PASSWORD = 'mypassword'\n\nAnd keep dev_settings.py out... | [
21,
5,
1,
1
] | [] | [] | [
"django",
"git",
"github",
"python"
] | stackoverflow_0003605866_django_git_github_python.txt |
Q:
Python how to format currency string
I have three floats that I want to output as a 2 decimal places string.
amount1 = 0.1
amount2 = 0.0
amount3 = 1.87
I want to output all of them as a string that looks like 0.10, 0.00, and 1.87 respectively.
How do I do that efficiently?
A:
An alternative to directly formatti... | Python how to format currency string | I have three floats that I want to output as a 2 decimal places string.
amount1 = 0.1
amount2 = 0.0
amount3 = 1.87
I want to output all of them as a string that looks like 0.10, 0.00, and 1.87 respectively.
How do I do that efficiently?
| [
"An alternative to directly formatting them is the locale stdlib module\n>>> import locale\n>>> locale.setlocale(locale.LC_ALL, '')\n'en_US.utf8'\n>>> locale.currency(123.2342343234234234)\n'$123.23'\n>>> locale.currency(123.2342343234234234, '') # the second argument controls the symbol\n'123.23'\n\nThis is nice ... | [
5
] | [] | [] | [
"python",
"string"
] | stackoverflow_0003606517_python_string.txt |
Q:
Google App Engine Python WebApp framework supported self.error() codes
I know we can return errors to requests by calling self.error(http_error_code_here). However, there are some error codes that don't seem to be supported. "Unsupported error code" comes out when I use error code 510.
I used http://en.wikipedia.o... | Google App Engine Python WebApp framework supported self.error() codes | I know we can return errors to requests by calling self.error(http_error_code_here). However, there are some error codes that don't seem to be supported. "Unsupported error code" comes out when I use error code 510.
I used http://en.wikipedia.org/wiki/List_of_HTTP_status_codes as a reference for the error codes I am us... | [
"You'll find the supported status codes in \ngoogle_appengine/google/appengine/ext/webapp/__init__.py\n\naround line 270.\n__HTTP_STATUS_MESSAGES = {\n 100: 'Continue',\n 101: 'Switching Protocols',\n 200: 'OK',\n 201: 'Created',\n 202: 'Accepted',\n 203: 'Non-Authoritative Information',\n 204: 'No Content',... | [
3
] | [] | [] | [
"google_app_engine",
"http_error",
"python",
"webob"
] | stackoverflow_0003606300_google_app_engine_http_error_python_webob.txt |
Q:
Installing Python SSL module on Windows Vista
I'm running GAE SDK on a Windows Vista laptop. It keeps reminding me to install the SSL module. I've been having great difficulty on how to do that.
I've downloaded the SSL module.
I've done 'python setup.py install' in cmd, but it just says "python is not recognized a... | Installing Python SSL module on Windows Vista | I'm running GAE SDK on a Windows Vista laptop. It keeps reminding me to install the SSL module. I've been having great difficulty on how to do that.
I've downloaded the SSL module.
I've done 'python setup.py install' in cmd, but it just says "python is not recognized as an internal..."
I've added C:\Python2.5.2 to my P... | [
"On the command line, run set path and confirm that c:\\Python2.5.2 is in your path?\nOr, just run c:\\Python2.5.2\\python setup.py install\nAlso by the way I would recommend that you use 2.5.4 for app engine development, as that is the version google use in production.\nThe following question also has some info wh... | [
2,
0,
0
] | [] | [] | [
"google_app_engine",
"python",
"ssl"
] | stackoverflow_0003606743_google_app_engine_python_ssl.txt |
Q:
Validate Certificate using Python
I want to access a web service over HTTPS.
I have been given a client certificate (p12 file) in order to access it.
Previously we were using basic authentication.
Using python I am unsure how to access it.
I want to use httplib2
h = Http()
#h.add_credentials("testuser", "testpass"... | Validate Certificate using Python | I want to access a web service over HTTPS.
I have been given a client certificate (p12 file) in order to access it.
Previously we were using basic authentication.
Using python I am unsure how to access it.
I want to use httplib2
h = Http()
#h.add_credentials("testuser", "testpass")
#h.add_certificate(keyfile, certfile,... | [
"The answer to my question was IN my question\nh.add_certificate(keyfile, certfile, '')\n\nI had a pkcs12 file, I just needed to extract out the key and cert from the p12 file.\nopenssl pkcs12 -in file.p12 -out key.pem -nodes -nocerts\nopenssl pkcs12 -in file.p12 -out cert.pem -nodes -nokeys\n\n"
] | [
2
] | [] | [] | [
"openssl",
"python",
"ssl_certificate"
] | stackoverflow_0003600527_openssl_python_ssl_certificate.txt |
Q:
Python regex with unicode characters bug?
Long story short:
>>> re.compile(r"\w*").match(u"Français")
<_sre.SRE_Match object at 0x1004246b0>
>>> re.compile(r"^\w*$").match(u"Français")
>>> re.compile(r"^\w*$").match(u"Franais")
<_sre.SRE_Match object at 0x100424780>
>>>
Why doesn't it match the string with unico... | Python regex with unicode characters bug? | Long story short:
>>> re.compile(r"\w*").match(u"Français")
<_sre.SRE_Match object at 0x1004246b0>
>>> re.compile(r"^\w*$").match(u"Français")
>>> re.compile(r"^\w*$").match(u"Franais")
<_sre.SRE_Match object at 0x100424780>
>>>
Why doesn't it match the string with unicode characters with ^ and $ in the regex? As far... | [
"You need to specify the UNICODE flag, otherwise \\w is just equivalent to [a-zA-Z0-9_], which does not include the character 'ç'.\n>>> re.compile(r\"^\\w*$\", re.U).match(u\"Fran\\xe7ais\")\n<_sre.SRE_Match object at 0x101474168>\n\n"
] | [
5
] | [] | [] | [
"character_properties",
"match",
"python",
"regex",
"unicode"
] | stackoverflow_0003607323_character_properties_match_python_regex_unicode.txt |
Q:
Abort a running task in Celery within django
I would like to be able to abort a task that is running from a Celery queue (using rabbitMQ). I call the task using
task_id = AsyncBoot.apply_async(args=[name], name=name, connect_timeout=3)
where AsyncBoot is a defined task.
I can get the task ID (assuming that is th... | Abort a running task in Celery within django | I would like to be able to abort a task that is running from a Celery queue (using rabbitMQ). I call the task using
task_id = AsyncBoot.apply_async(args=[name], name=name, connect_timeout=3)
where AsyncBoot is a defined task.
I can get the task ID (assuming that is the long string that apply_async returns) and store ... | [
"apply_async returns an AsyncResult instance, or in this case an AbortableAsyncResult. Save the task_id and use that to instantiate a new AbortableAsyncResult later, making sure you supply the backend optional argument if you're not using the default_backend.\nabortable_async_result = AsyncBoot.apply_async(args=[na... | [
11,
4
] | [] | [] | [
"celery",
"celery_task",
"django",
"python",
"rabbitmq"
] | stackoverflow_0003576512_celery_celery_task_django_python_rabbitmq.txt |
Q:
Uninstall and Install Programs in windows using python script
Possible Duplicate:
Add/remove programs in Windows XP with Python script
I am a newbie in python and basically do windows sysadmin tasks and sometimes write batch script. However i am trying to learn python by implementing the scripts in windows tasks... | Uninstall and Install Programs in windows using python script |
Possible Duplicate:
Add/remove programs in Windows XP with Python script
I am a newbie in python and basically do windows sysadmin tasks and sometimes write batch script. However i am trying to learn python by implementing the scripts in windows tasks. The actual task i want to do is a follows: To remove acrobat rea... | [
"To call a function as if you had entered it on the command line, use subprocess.Popen. There are various scripting functions (copy, remove) in the os and shutil modules.\n"
] | [
0
] | [] | [] | [
"administration",
"python",
"system",
"windows"
] | stackoverflow_0003607640_administration_python_system_windows.txt |
Q:
How to edit a StringListProperty value in Google App Engine?
I would like to edit the value of a StringListProperty variable on App Engine. Is it possible? I don't see any sign of editable field for a StringListProperty variable right inside the DataViewer panel.
A:
You need to edit it programmatically. Not all ... | How to edit a StringListProperty value in Google App Engine? | I would like to edit the value of a StringListProperty variable on App Engine. Is it possible? I don't see any sign of editable field for a StringListProperty variable right inside the DataViewer panel.
| [
"You need to edit it programmatically. Not all property types can be edited in the data viewer.\n"
] | [
2
] | [] | [] | [
"google_app_engine",
"python"
] | stackoverflow_0003607201_google_app_engine_python.txt |
Q:
Smart way to find out string encoding?
I wonder whether it is possible to find what is the encoding of string? I know that it may be impossible for some strings (e.g. that do not have non-ASCII characters). Maybe it is possible to obtain a list of encodings that may be correct (possible) for a given string?
I'm lo... | Smart way to find out string encoding? | I wonder whether it is possible to find what is the encoding of string? I know that it may be impossible for some strings (e.g. that do not have non-ASCII characters). Maybe it is possible to obtain a list of encodings that may be correct (possible) for a given string?
I'm looking for some other way than trying to deco... | [
"Chardet does a educated guess. Read the FAQ before you use it!\n"
] | [
15
] | [] | [] | [
"character_encoding",
"encoding",
"python"
] | stackoverflow_0003608954_character_encoding_encoding_python.txt |
Q:
Where's the Python 2.6.6 Mac OS X Installer Disk Image?
Python 2.6.6 was released on August 24, 2010. However, there isn't a Mac OS X Installer Disk Image. Is there a Mac OS X Installer Disk Image available for Python 2.6.6?
A:
[ORIGINAL: Unfortunately, the official python.org OS X installer for 2.6.6 is not yet... | Where's the Python 2.6.6 Mac OS X Installer Disk Image? | Python 2.6.6 was released on August 24, 2010. However, there isn't a Mac OS X Installer Disk Image. Is there a Mac OS X Installer Disk Image available for Python 2.6.6?
| [
"[ORIGINAL: Unfortunately, the official python.org OS X installer for 2.6.6 is not yet available. I expect it should be available soon.]\nUPDATE: As of 2010-08-31, it is available here.\nThe installer image you mention in your own answer is one produced by a daily testing buildbot, not by the python.org core devel... | [
1,
1,
0
] | [] | [] | [
"installation",
"python",
"python_2.6"
] | stackoverflow_0003604669_installation_python_python_2.6.txt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.