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:
How to embed the Python interpreter in a Qt app?
Is there a straightforward way to embed the Python interpreter in a Qt application? I am hoping for a cross-platform solution if possible.
A:
This is the purpose of PythonQt. It supports Windows, Linux, and Mac OS.
| How to embed the Python interpreter in a Qt app? | Is there a straightforward way to embed the Python interpreter in a Qt application? I am hoping for a cross-platform solution if possible.
| [
"This is the purpose of PythonQt. It supports Windows, Linux, and Mac OS.\n"
] | [
3
] | [] | [] | [
"python",
"qt"
] | stackoverflow_0002742636_python_qt.txt |
Q:
dropEvent not being called on custom view in PyQt4?
I'm trying to create a custom QTableView that will respond to drag and drop actions. So far, I have something like the following:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class FooTableView(QTableView):
def __init__(self, parent = None):
... | dropEvent not being called on custom view in PyQt4? | I'm trying to create a custom QTableView that will respond to drag and drop actions. So far, I have something like the following:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class FooTableView(QTableView):
def __init__(self, parent = None):
QTableView.__init__(self, parent)
self.setAccept... | [
"Ok, I think I figured it out. The event must be accepted in dragEnterEvent in order for it to make it to dropEvent.\n"
] | [
0
] | [] | [] | [
"drag_and_drop",
"pyqt4",
"python"
] | stackoverflow_0002742368_drag_and_drop_pyqt4_python.txt |
Q:
How do I use a ListProperty(users.user) in a djangoforms.ModelForm on Google AppEngine?
I have been looking around a bit for info on how to do this. Essentially I have a Model:
class SharableUserAsset(db.Model):
name = StringProperty()
users = ListProperty(users.User)
My questions are:
What is the best way t... | How do I use a ListProperty(users.user) in a djangoforms.ModelForm on Google AppEngine? | I have been looking around a bit for info on how to do this. Essentially I have a Model:
class SharableUserAsset(db.Model):
name = StringProperty()
users = ListProperty(users.User)
My questions are:
What is the best way to associate users to this value where they are not authenticated, visa vi invite from contact... | [
"\nIn a query, comparing a list property\n to a value performs the test against\n the list members: list_property =\n value tests if the value appears\n anywhere in the list\n\nhttp://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#ListProperty\nSo to find all the SharableUserAssets... | [
1
] | [] | [] | [
"google_app_engine",
"python",
"single_sign_on"
] | stackoverflow_0002742864_google_app_engine_python_single_sign_on.txt |
Q:
Creating a simple command line interface (CLI) using a python server (TCP sock) and few scripts
I have a Linux box and I want to be able to telnet into it (port 77557) and run few required commands without having to access to the whole Linux box. So, I have a server listening on that port, and echos the entered co... | Creating a simple command line interface (CLI) using a python server (TCP sock) and few scripts | I have a Linux box and I want to be able to telnet into it (port 77557) and run few required commands without having to access to the whole Linux box. So, I have a server listening on that port, and echos the entered command on the screen. (for now)
Telnet 192.168.1.100 77557
Trying 192.168.1.100...
Conne... | [
"Twisted's web server does something kinda-sorta like what you're looking to do. The general approach used is to have a loadable python file define an object of a specific name in the loaded module's global namespace. Upon loading the module, the server checks for this object, makes sure that it derives from the pr... | [
0,
0
] | [] | [] | [
"command_line",
"python"
] | stackoverflow_0002739056_command_line_python.txt |
Q:
What Python based Dashboard options exist?
I want to create a Dashboard on each server to show it's health and the results of some daily processing. I plan to hook up shell scripts and Python programs to collect the data.
Instead of writing a web-based interface, I thought it would be good to use a python based we... | What Python based Dashboard options exist? | I want to create a Dashboard on each server to show it's health and the results of some daily processing. I plan to hook up shell scripts and Python programs to collect the data.
Instead of writing a web-based interface, I thought it would be good to use a python based web dashboard that could render the results in var... | [
"Have you tried ZenOSS , it is written in python and you can extend it using python.\n"
] | [
0
] | [] | [] | [
"dashboard",
"health_monitoring",
"monitoring",
"python",
"ruby"
] | stackoverflow_0002742097_dashboard_health_monitoring_monitoring_python_ruby.txt |
Q:
How to change User-Agent on Google App Engine UrlFetch service?
Is it possible to change User-Agent of Google App Engine UrlFetch service?
A:
Ok found it, it's possible since SDK 1.2.1 was released (Issue 342).
You just have to specify the User-Agent header:
urlfetch.fetch(url, headers = {'User-Agent': "MyApplic... | How to change User-Agent on Google App Engine UrlFetch service? | Is it possible to change User-Agent of Google App Engine UrlFetch service?
| [
"Ok found it, it's possible since SDK 1.2.1 was released (Issue 342).\nYou just have to specify the User-Agent header:\nurlfetch.fetch(url, headers = {'User-Agent': \"MyApplication_User-Agent\"}) \n\n"
] | [
11
] | [] | [] | [
"google_app_engine",
"python"
] | stackoverflow_0002743521_google_app_engine_python.txt |
Q:
Calculating time until 1st or 15th of the month in python
I'm trying to write a little budget program in python. This is my first program I'm writing to learn python. The first step is to calculate how many days until either the 1st or 15th (paydays) depending on today's date. Can someone help me out a little?
A:... | Calculating time until 1st or 15th of the month in python | I'm trying to write a little budget program in python. This is my first program I'm writing to learn python. The first step is to calculate how many days until either the 1st or 15th (paydays) depending on today's date. Can someone help me out a little?
| [
"Interesting question, and here's a complete solution. I'll start with my function definition, I've put this in a file named payday.py:\ndef nexypayday(fromdate=None):\n \"\"\"\n @param fromdate: An instance of datetime.date that is the day to go from. If\n not specified, todays date is us... | [
6,
2,
2,
0,
0
] | [] | [] | [
"datetime",
"python"
] | stackoverflow_0002742329_datetime_python.txt |
Q:
To stop returning through SSH using Pexpect
I am trying to use pexpect to ssh into a computer but I do not want to return back to the original computer. The code I have is:
#!/usr/bin/python2.6
import pexpect, os
def ssh():
# Logs into computer through SSH
ssh_newkey = 'Are you sure you want to continue... | To stop returning through SSH using Pexpect | I am trying to use pexpect to ssh into a computer but I do not want to return back to the original computer. The code I have is:
#!/usr/bin/python2.6
import pexpect, os
def ssh():
# Logs into computer through SSH
ssh_newkey = 'Are you sure you want to continue connecting'
# my ssh command line
p=pexp... | [
"The process that launches ssh is never going to leave the computer it runs on. When you ssh into another computer, you start a new process there. That process is an entirely separate thing, a separate program to run. If you want to do anything on the remote machine, you have to either send the commands to execute ... | [
1,
0
] | [] | [] | [
"pexpect",
"python",
"ssh"
] | stackoverflow_0002736659_pexpect_python_ssh.txt |
Q:
Programmatically check whether a drive letter is a shared/network drive
Is there a way to check whether a drive letter stands for a shared drive/network drive or a local disc in python? I guess there is some windows api function that gives me that info, but I can't find it. Perhaps there is even a method already i... | Programmatically check whether a drive letter is a shared/network drive | Is there a way to check whether a drive letter stands for a shared drive/network drive or a local disc in python? I guess there is some windows api function that gives me that info, but I can't find it. Perhaps there is even a method already integrated in python?
What I am looking for is something with this or similar ... | [
"The GetDriveType function in win32file module may help you - it's a wrapper for the GetDriveType WINAPI function.\nimport win32file\nisNetworkDrive = win32file.GetDriveType(\"Z:\\\\\") == win32file.DRIVE_REMOTE\n\nYou'd be able to enumerate all with the GetLogicalDriveStrings() function in the win32api module, the... | [
13
] | [] | [] | [
"drive_letter",
"network_drive",
"python",
"winapi"
] | stackoverflow_0002743716_drive_letter_network_drive_python_winapi.txt |
Q:
Performing non-blocking requests? - Django
I have been playing with other frameworks, such as NodeJS, lately.
I love the possibility to return a response, and still being able to do further operations.
e.g.
def view(request):
do_something()
return HttpResponse()
do_more_stuff() #not possible!!!
Maybe Djan... | Performing non-blocking requests? - Django | I have been playing with other frameworks, such as NodeJS, lately.
I love the possibility to return a response, and still being able to do further operations.
e.g.
def view(request):
do_something()
return HttpResponse()
do_more_stuff() #not possible!!!
Maybe Django already offers a way to perform operations a... | [
"not out of the box as you've already returned out of the method. You could use something like Celery which would pass the do_more_stuff task onto a queue and then have it run do_more_stuff() outside of http request / response flow.\n",
"Django lets you accomplish this with Signals, more information can be found... | [
10,
9,
2
] | [] | [] | [
"asynchronous",
"django",
"nonblocking",
"python"
] | stackoverflow_0002743331_asynchronous_django_nonblocking_python.txt |
Q:
python iterators and thread-safety
I have a class which is being operated on by two functions. One function creates a list of widgets and writes it into the class:
def updateWidgets(self):
widgets = self.generateWidgetList()
self.widgets = widgets
the other function deals with the widgets in some way:
def w... | python iterators and thread-safety | I have a class which is being operated on by two functions. One function creates a list of widgets and writes it into the class:
def updateWidgets(self):
widgets = self.generateWidgetList()
self.widgets = widgets
the other function deals with the widgets in some way:
def workOnWidgets(self):
for widget in sel... | [
"updateWidgets() doesn't alter self.widgets in place (which would have been a problem) but rather replaces it with a new list. The references to the old one are kept at least until the for loop in workOnWidgets() has finished, so this should not be a problem.\nSimplified, what you're doing is kind of like this:\n>>... | [
4
] | [] | [] | [
"atomic",
"iterator",
"multithreading",
"python",
"thread_safety"
] | stackoverflow_0002744036_atomic_iterator_multithreading_python_thread_safety.txt |
Q:
setting the header of a response in python / django
This is my code:
template = loader.get_template('blog/post.html')
c = Context(parameterDict)
return HttpResponse(template.render(c))
I am using this to render data into a template(contained in parameterDict).
The problem is that parameterDict contains certain U... | setting the header of a response in python / django | This is my code:
template = loader.get_template('blog/post.html')
c = Context(parameterDict)
return HttpResponse(template.render(c))
I am using this to render data into a template(contained in parameterDict).
The problem is that parameterDict contains certain UTF characters like ®. This is causing a problem in my tem... | [
"Is the content of parameterDict unicode?\nparameterDict = {'title':u'® by blah'}\n\nreturn render_to_response('blog/post.html',\n parameterDict,\n context_instance=RequestContext(request))\n\n"
] | [
0
] | [] | [] | [
"httpresponse",
"python",
"templates",
"utf_8"
] | stackoverflow_0002744134_httpresponse_python_templates_utf_8.txt |
Q:
Minimal Python build for my application's scripting needs?
what are your advices on building a very minimalistic version of Python(2.x) for my application's scripting needs.
My main motive here is to keep the foot print (both memory and disk wise) as low as possible so that my native application won't suffer from... | Minimal Python build for my application's scripting needs? | what are your advices on building a very minimalistic version of Python(2.x) for my application's scripting needs.
My main motive here is to keep the foot print (both memory and disk wise) as low as possible so that my native application won't suffer from any major performance hit. Even the Python DLL size is in consi... | [
"Have you tried Tiny Python?\n"
] | [
7
] | [
"You can use only the dll\n"
] | [
-1
] | [
"python",
"python_embedding",
"scripting"
] | stackoverflow_0000356452_python_python_embedding_scripting.txt |
Q:
OpenCV Python and a webcam
I'm working with OpenCV on a BeagleBoard with Ubuntu and OpenCV 1.1 interfaced via Python. I'm trying to set something up to capture a feed from a UVC compatible webcam (Logitech C250). I have tested the webcam with luvcview, and it works, but only if I set the input format to YUV. If I ... | OpenCV Python and a webcam | I'm working with OpenCV on a BeagleBoard with Ubuntu and OpenCV 1.1 interfaced via Python. I'm trying to set something up to capture a feed from a UVC compatible webcam (Logitech C250). I have tested the webcam with luvcview, and it works, but only if I set the input format to YUV. If I run it in 'normal' mode I am get... | [
"I've cracked this partly. If you compile OpenCV with the flag WITH_JPEG=OFF then the camera will not try to use MJPEG.\n"
] | [
1
] | [] | [] | [
"beagleboard",
"linux",
"opencv",
"python",
"webcam"
] | stackoverflow_0002682313_beagleboard_linux_opencv_python_webcam.txt |
Q:
Dynamic Spacer in ReportLab
I'm automatically generating a PDF-file with Platypus that has dynamic content.
This means that it might happen that the length of the text content (which is directly at the bottom of the pdf-file) may vary.
However, it might happen that a page break is done in cases where the content i... | Dynamic Spacer in ReportLab | I'm automatically generating a PDF-file with Platypus that has dynamic content.
This means that it might happen that the length of the text content (which is directly at the bottom of the pdf-file) may vary.
However, it might happen that a page break is done in cases where the content is too long.
This is because i use... | [
"I sniffed around in the reportlab library a bit and found the following:\nBasically, I decided to use a frame into which the flowables will be printed. f._aH returns the height of the Frame (we could also calculate this by hand). Subtracting the heights of the other two flowables, which we get through wrap, we get... | [
3,
0
] | [] | [] | [
"python",
"reportlab"
] | stackoverflow_0002722386_python_reportlab.txt |
Q:
Django admin: Add a "remove file" field for Image- or FileFields
I was hunting around the Internet for a way to easily allow users to blank out imagefield/filefields they have set in the admin.
I found this: http://www.djangosnippets.org/snippets/894/.
What was really interesting to me here was the code posted in ... | Django admin: Add a "remove file" field for Image- or FileFields | I was hunting around the Internet for a way to easily allow users to blank out imagefield/filefields they have set in the admin.
I found this: http://www.djangosnippets.org/snippets/894/.
What was really interesting to me here was the code posted in the comment by rfugger:
remove_the_file = forms.BooleanField(required=... | [
"Never use super(self.__class__, self)! Try the following example:\nclass A(object):\n def m(self):\n super(self.__class__, self).m()\n\nclass B(A): pass\n\nB().m()\n\nIt will fail with the same error:\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\n File \"<stdin>\", line 4... | [
3,
0
] | [] | [] | [
"django",
"django_admin",
"django_forms",
"django_models",
"python"
] | stackoverflow_0002657149_django_django_admin_django_forms_django_models_python.txt |
Q:
Django: Unicode Filenames with ASCII headers?
I have a list of strangely encoded files: 02 - Charlie, Woody and You/Study #22.mp3 which I suppose isn't so bad but there are a few particular characters which Django OR nginx seem to be snagging on.
>>> test = u'02 - Charlie, Woody and You/Study #22.mp3'
>>> test
u'0... | Django: Unicode Filenames with ASCII headers? | I have a list of strangely encoded files: 02 - Charlie, Woody and You/Study #22.mp3 which I suppose isn't so bad but there are a few particular characters which Django OR nginx seem to be snagging on.
>>> test = u'02 - Charlie, Woody and You/Study #22.mp3'
>>> test
u'02 - Charlie, Woody and You\uff0fStudy #22.mp3'
I a... | [
"Although / is an unusual and undesirable character, your script will break for any non-ASCII character.\nresponse['X-Accel-Redirect'] = url\n\nurl is Unicode (and it isn't a URL, it's a filepath). Response headers are bytes. You'll need to encode it.\nresponse['X-Accel-Redirect'] = url.encode('utf-8')\n\nthat's as... | [
8
] | [] | [] | [
"ascii",
"django",
"nginx",
"python",
"unicode"
] | stackoverflow_0002732268_ascii_django_nginx_python_unicode.txt |
Q:
Python: Plot some data (matplotlib) without GIL
my problem is the GIL of course. While I'm analysing data it would be nice to present some plots in between (so it's not too boring waiting for results)
But the GIL prevents this (and this is bringing me to the point of asking myself if Python was such a good idea in... | Python: Plot some data (matplotlib) without GIL | my problem is the GIL of course. While I'm analysing data it would be nice to present some plots in between (so it's not too boring waiting for results)
But the GIL prevents this (and this is bringing me to the point of asking myself if Python was such a good idea in the first place).
I can only display the plot, wait ... | [
"This is not a problem from matplotlib or the GIL.\nIn matplotlib You can open as many figures as you want and have them in the screen while your application continues doing other things. \nYou must use matplotlib in interactive mode. This probably is your problem.\nfrom matplotlib import interactive\ninteractive(... | [
6,
3,
3,
2
] | [] | [] | [
"gil",
"matplotlib",
"parallel_processing",
"python"
] | stackoverflow_0002744530_gil_matplotlib_parallel_processing_python.txt |
Q:
Is there anyway to get pdb and Mac Terminal to play nicely?
When debugging my django apps I use pdb for interactive debugging with pdb.set_trace().
However, when I amend a file the local django webserver restarts and then I cant see what I type in the terminal, until I type reset.
Is there anyway for this to happe... | Is there anyway to get pdb and Mac Terminal to play nicely? | When debugging my django apps I use pdb for interactive debugging with pdb.set_trace().
However, when I amend a file the local django webserver restarts and then I cant see what I type in the terminal, until I type reset.
Is there anyway for this to happen automatically? It can be real annoying, having to cancel the ru... | [
"OK - this works for me I created a ~/.pdbrc and added\n\nimport os\n os.system(\"stty sane\")\n\nNow each time pdb is run it sets the line settings back to sane.\nIf I fall out to the terminal then I still have to do it manually - but it solves having to quit runserver and reset all the time.\n",
"Try to [q]ui... | [
8,
1,
1
] | [] | [] | [
"django",
"macos",
"pdb",
"python",
"terminal"
] | stackoverflow_0002735828_django_macos_pdb_python_terminal.txt |
Q:
Basic Python: Exception raising and local variable scope / binding
I have a basic "best practices" Python question. I see that there are already StackOverflow answers tangentially related to this question but they're mired in complicated examples or involve multiple factors.
Given this code:
#!/usr/bin/python
de... | Basic Python: Exception raising and local variable scope / binding | I have a basic "best practices" Python question. I see that there are already StackOverflow answers tangentially related to this question but they're mired in complicated examples or involve multiple factors.
Given this code:
#!/usr/bin/python
def test_function():
try:
a = str(5)
raise
b = str(6)... | [
"\nDoes python have an elegant way to\n handle this?\n\nTo avoid exceptions from printing unbound names, the most elegant way is not to print them; the second most elegant is to ensure the names do get bound, e.g. by binding them at the start of the function (the placeholder None is popular for this purpose).\n\nI... | [
10,
6,
2,
1
] | [] | [] | [
"exception_handling",
"python",
"scope"
] | stackoverflow_0002744820_exception_handling_python_scope.txt |
Q:
Python - 2 Questions: Editing a variable in a function and changing the order of if else statements internally/during runtime
First of all, I should explain what I'm trying to do first.
I'm creating a dungeon crawler-like game, and I'm trying to program the movement of computer characters/monsters in the map. The ... | Python - 2 Questions: Editing a variable in a function and changing the order of if else statements internally/during runtime | First of all, I should explain what I'm trying to do first.
I'm creating a dungeon crawler-like game, and I'm trying to program the movement of computer characters/monsters in the map. The map is basically a Cartesian coordinate grid.
The locations of characters are represented by tuples of the x and y values, (x,y).
T... | [
"Re 2., I would change your relatively-big if/elif tree to a simple loop:\nprioritylist = ('r','u','d','l')\nfor direction in prioritylist:\n if move(direction, location): break\n\nless repetitious, easier to extend in the future if you want to allow diagonal steps or whatever -- and automatically \"follows the pr... | [
3,
0
] | [] | [] | [
"python"
] | stackoverflow_0002745547_python.txt |
Q:
Sorting objects in Python
I want to sort objects using by one of their attributes. As of now, I am doing it in the following way
USpeople.sort(key=lambda person: person.utility[chosenCar],reverse=True)
This works fine, but I have read that using operator.attrgetter() might be a faster way to achieve this sort. Fi... | Sorting objects in Python | I want to sort objects using by one of their attributes. As of now, I am doing it in the following way
USpeople.sort(key=lambda person: person.utility[chosenCar],reverse=True)
This works fine, but I have read that using operator.attrgetter() might be a faster way to achieve this sort. First, is this correct? Assuming ... | [
"No, attrgetter will not be any faster than the lambda - it's really just another way of doing the same thing.\nYou may have been confused by a recommendation to use key instead of cmp, which is indeed significantly faster, but you're already doing that.\n",
"to access chosenCar item you'd have to use:\n>>> P.uti... | [
2,
1,
1
] | [] | [] | [
"python",
"sorting"
] | stackoverflow_0002743773_python_sorting.txt |
Q:
How can I tell whether screen is running?
I am trying to run a Python program to see if the screen program is running. If it is, then the program should not run the rest of the code. This is what I have and it's not working:
#!/usr/bin/python
import os
var1 = os.system ('screen -r > /root/screenlog/screen.log')
... | How can I tell whether screen is running? | I am trying to run a Python program to see if the screen program is running. If it is, then the program should not run the rest of the code. This is what I have and it's not working:
#!/usr/bin/python
import os
var1 = os.system ('screen -r > /root/screenlog/screen.log')
fd = open("/root/screenlog/screen.log")
content... | [
"from subprocess import Popen, PIPE\n\ndef screen_is_running():\n out = Popen(\"screen -list\",shell=True,stdout=PIPE).communicate()[0]\n return not out.startswith(\"This room is empty\")\n\n"
] | [
2
] | [
"Maybe the error message that you redirect on the first os.system call is written on the standard error instead of the standard output. You should try replacing this line with:\nvar1 = os.system ('screen -r 2> /root/screenlog/screen.log')\n\nNote the 2> to redirect standard error to your file.\n"
] | [
-1
] | [
"gnu_screen",
"linux",
"python"
] | stackoverflow_0002745711_gnu_screen_linux_python.txt |
Q:
Python keyword arguments
I have several layers of function calls, passing around a common dictionary of key word arguments:
def func1(**qwargs):
func2(**qwargs)
func3(**qwargs)
I would like to supply some default arguments in some of the subsequent function calls, something like this:
def func1(**qwargs):... | Python keyword arguments | I have several layers of function calls, passing around a common dictionary of key word arguments:
def func1(**qwargs):
func2(**qwargs)
func3(**qwargs)
I would like to supply some default arguments in some of the subsequent function calls, something like this:
def func1(**qwargs):
func2(arg = qwargs.get("a... | [
"Just build and use another dict for the purpose of calling func2, leaving the original alone for the later call to func3:\ndef func1(**qwargs):\n d = dict(arg=default)\n d.update(qwqargs)\n func2(**d)\n func3(**qwargs)\n\nThis is if you want a setting for arg in qwargs to override the default. Otherwi... | [
2,
1
] | [] | [] | [
"keyword_argument",
"python"
] | stackoverflow_0002745703_keyword_argument_python.txt |
Q:
Best way to parse XMPP-like XML streams?
I am working on a server application which receives data over a TCP socket in an XMPP-like XML format, i.e. every child of the <root> element essentially represents one separate request (stanza). The connection is closed as soon as </root> is received.
I do know that I must... | Best way to parse XMPP-like XML streams? | I am working on a server application which receives data over a TCP socket in an XMPP-like XML format, i.e. every child of the <root> element essentially represents one separate request (stanza). The connection is closed as soon as </root> is received.
I do know that I must use a stream parser like SAX, somehow. Though... | [
"You'll want to use a push based parser that emits SAX events. Basically you want a parser that you can call pushChunk(data) with a partial bit of data, and have it an event handler for the first-level child end tag event that generates your stanzas. That can then be sent to application processing logic.\nIf you wa... | [
3,
1
] | [] | [] | [
"network_protocols",
"python",
"stream",
"xml",
"xmpp"
] | stackoverflow_0002741642_network_protocols_python_stream_xml_xmpp.txt |
Q:
SQLAlchemy - SQLite for testing and Postgresql for development - How to port?
I want to use sqlite memory database for all my testing and Postgresql for my development/production server.
But the SQL syntax is not same in both dbs. for ex: SQLite has autoincrement, and Postgresql has serial
Is it easy to port the ... | SQLAlchemy - SQLite for testing and Postgresql for development - How to port? | I want to use sqlite memory database for all my testing and Postgresql for my development/production server.
But the SQL syntax is not same in both dbs. for ex: SQLite has autoincrement, and Postgresql has serial
Is it easy to port the SQL script from sqlite to postgresql... what are your solutions?
If you want me to ... | [
"My suggestion would be: don't. The capabilities of Postgresql are far beyond what SQLite can provide, particularly in the areas of date/numeric support, functions and stored procedures, ALTER support, constraints, sequences, other types like UUID, etc., and even using various SQLAlchemy tricks to try to smooth t... | [
19,
12,
4
] | [] | [] | [
"postgresql",
"python",
"sqlalchemy",
"sqlite"
] | stackoverflow_0002716847_postgresql_python_sqlalchemy_sqlite.txt |
Q:
Check if command had some trouble in Python?
I have this command
h = urllib.urlopen("http://google.com/")
How can I check if it retrieves me some error, internet down or something I don't expect?
For example, something like
if error
print 'ERROR'
Thank you
A:
urllib.urlopen is deprecated as it was removed in P... | Check if command had some trouble in Python? | I have this command
h = urllib.urlopen("http://google.com/")
How can I check if it retrieves me some error, internet down or something I don't expect?
For example, something like
if error
print 'ERROR'
Thank you
| [
"urllib.urlopen is deprecated as it was removed in Python 3.0. Use urllib2.urlopen instead and in the documentation it says:\n\nRaises URLError on errors.\n\nSo do:\ntry:\n h = urllib2.urlopen(\"http://google.com/\")\nexcept urllib2.URLError as e:\n # do something with the exception e.g.\n print 'Error:', ... | [
9,
3,
1,
0
] | [] | [] | [
"python"
] | stackoverflow_0002745968_python.txt |
Q:
Porting library from Java to Python
I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idi... | Porting library from Java to Python | I'm about to port a smallish library from Java to Python and wanted some advice (smallish ~ a few thousand lines of code). I've studied the Java code a little, and noticed some design patterns that are common in both languages. However, there were definitely some Java-only idioms (singletons, etc) present that are ge... | [
"If it were me, I'd consider doing the work by hand. A couple thousand lines of code isn't a lot of code, and by rewriting it yourself (rather than translating it automatically), you'll be in a position to decide how to take advantage of Python idioms appropriately. (FWIW, I worked Java almost exclusively for 9 yea... | [
9,
6,
5,
3,
3,
2,
0
] | [] | [] | [
"java",
"python"
] | stackoverflow_0000448095_java_python.txt |
Q:
Adding string to end of URL
To practise some more bits of python I've been having a go at the challenges on pythonchallenge.com
In brief, this challenge as a first step requires one to load an html page from a url with a number at the end. The page contains a single line of text which has in it a number. That numb... | Adding string to end of URL | To practise some more bits of python I've been having a go at the challenges on pythonchallenge.com
In brief, this challenge as a first step requires one to load an html page from a url with a number at the end. The page contains a single line of text which has in it a number. That number is used to replace the existin... | [
"http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=['72758']\n ^^ ^^\n\nThe problem is here I think. findall() return a list:\n\nre.findall(pattern, string[, flags])\nReturn all non-overlapping matches of pattern in string, as a list of stri... | [
1
] | [] | [] | [
"httplib2",
"python",
"string",
"url_rewriting"
] | stackoverflow_0002746271_httplib2_python_string_url_rewriting.txt |
Q:
PyDev and Django: PyDev breaking Django shell?
I've set up a new project, and populated it with simple models. (Essentially I'm following the tut.)
When I run python manage.py shell on the command line, it works fine:
>python manage.py shell
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Int... | PyDev and Django: PyDev breaking Django shell? | I've set up a new project, and populated it with simple models. (Essentially I'm following the tut.)
When I run python manage.py shell on the command line, it works fine:
>python manage.py shell
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or... | [
"The error is about not being open the database file. So I'd guess that the path to the database in your settings.py is a relative path, and PyDev starts the shell with a different current directory than you normally use.\nIf this is the case, change the DATABASE_NAME setting to an absolute path and it should work.... | [
3
] | [] | [] | [
"django",
"pydev",
"python"
] | stackoverflow_0002746342_django_pydev_python.txt |
Q:
Django custom template tag with 'parser.compile_filter(tokens[2])' doesn't work
I tried to implement the solution proposed by T. Stone on my question "how-do-i-pass-a-lot-of-parameters-to-views-in-django" ([link text][1]).
I can't manage to get any result. It's difficult to find information about the compile_filte... | Django custom template tag with 'parser.compile_filter(tokens[2])' doesn't work | I tried to implement the solution proposed by T. Stone on my question "how-do-i-pass-a-lot-of-parameters-to-views-in-django" ([link text][1]).
I can't manage to get any result. It's difficult to find information about the compile_filter(), but as far as I understand cls(queryset=parser.compile_filter(tokens[2]), templa... | [
"Mark...\nCouple of things: I was in a rush the other day when I posted that code for you. Within the render method variables need to be resolved as such...\ndef render(self, context):\n qs = self.queryset.resolve(context)\n return render_to_string(self.template, { 'queryset': qs } )\n\nAlso, in your templa... | [
1
] | [] | [] | [
"django",
"python",
"templatetags"
] | stackoverflow_0002746255_django_python_templatetags.txt |
Q:
django - How to cross check ModelAdmin and its inlines?
I have two models (ModelParent and ModelChild) with same m2m fields on Subject model.
ModelChild has a foreign key on ModelParent and ModelChild is defined as inline for ModelParent on admin page.
### models.py ###
class Subject(Models.Model):
pass
... | django - How to cross check ModelAdmin and its inlines? | I have two models (ModelParent and ModelChild) with same m2m fields on Subject model.
ModelChild has a foreign key on ModelParent and ModelChild is defined as inline for ModelParent on admin page.
### models.py ###
class Subject(Models.Model):
pass
class ModelParent(models.Model):
subjects_parent = ManyTo... | [
"I have inherited a new class named ModelAdminWithInline from admin.ModelAdmin and modified methods add_view(...) and change_view(...) to call function is_cross_valid(self, form, formsets), where you can validate all the forms together.\nBoth functions had:\n#...\nif all_valid(formsets) and form_validated:\n#...\n\... | [
6,
2
] | [] | [] | [
"django",
"django_admin",
"django_forms",
"python"
] | stackoverflow_0002720383_django_django_admin_django_forms_python.txt |
Q:
Django: Change models without clearing all data?
I have some models I'm working with in a new Django installation. Is it possible to change the fields without losing app data?
I tried changing the field and running python manage.py syncdb. There was no output from this command.
Renavigating to admin pages for edit... | Django: Change models without clearing all data? | I have some models I'm working with in a new Django installation. Is it possible to change the fields without losing app data?
I tried changing the field and running python manage.py syncdb. There was no output from this command.
Renavigating to admin pages for editing the changed models caused TemplateSyntaxErrors as ... | [
"Django does not ever alter an existing database column. Syncdb will create tables, but it does not do 'migrations' as found in Rails, for instance. If you need something like that, check out Django South. \nSee the docs for syndb:\n\nSyncdb will not alter existing tables\nsyncdb will only create tables for models ... | [
20,
8,
6
] | [] | [] | [
"django",
"python"
] | stackoverflow_0002746818_django_python.txt |
Q:
How do I overwrite a file currently being read by Python
I am not too sure the best way to word this, but what I want to do, is read a pdf file, make various modifications, and save the modified pdf over the original file. As of now, I am able to save the modified pdf to a separate file, but I am looking to repla... | How do I overwrite a file currently being read by Python | I am not too sure the best way to word this, but what I want to do, is read a pdf file, make various modifications, and save the modified pdf over the original file. As of now, I am able to save the modified pdf to a separate file, but I am looking to replace the original, not create a new file.
Here is my current cod... | [
"You can always rename the temporary output file to the old file:\nimport os\nf = open('input.pdf', 'rb')\n# do stuff to temp.pdf\nf.close()\nos.rename('temp.pdf', 'input.pdf')\n\n",
"You said you tried to close() the stream but got errors? You could delete the PdfFileReader objects to ensure nobody still has ac... | [
8,
3,
1
] | [] | [] | [
"input",
"overwrite",
"pdf",
"python"
] | stackoverflow_0002746758_input_overwrite_pdf_python.txt |
Q:
Django: Difficulty loading data
Here are some models I am trying to load data for:
class School(models.Model):
name = models.CharField(max_length=200)
def __unicode__(self):
return self.name
class RequirementSet(models.Model):
offeringSchool = models.ForeignKey(School)
name = models.CharF... | Django: Difficulty loading data | Here are some models I am trying to load data for:
class School(models.Model):
name = models.CharField(max_length=200)
def __unicode__(self):
return self.name
class RequirementSet(models.Model):
offeringSchool = models.ForeignKey(School)
name = models.CharField(max_length=200)
def __unico... | [
"The JSON format is not allowed to have comments. Remove the // data.json line and it should work.\n"
] | [
3
] | [] | [] | [
"django",
"json",
"python"
] | stackoverflow_0002747094_django_json_python.txt |
Q:
Twisted connectionLost Event
I use the twisted.words.protocols.jabber.client.XMPPClientFactory . Do you know how I can callback a function when the connection gets lost (for example WiFi-connection is down)?
thank you for your help!
A:
You can either add a bootstrap for xmlstream.STREAM_END_EVENT or set a defer ... | Twisted connectionLost Event | I use the twisted.words.protocols.jabber.client.XMPPClientFactory . Do you know how I can callback a function when the connection gets lost (for example WiFi-connection is down)?
thank you for your help!
| [
"You can either add a bootstrap for xmlstream.STREAM_END_EVENT or set a defer to clientConnectionLost.\nfrom twisted.words.protocols.jabber import client\nfrom twisted.words.protocols.jabber import jid\nfrom twisted.words.protocols.jabber import xmlstream\n\nj = jid.JID(\"name@example.org/bla\")\np = \"some pass\"\... | [
1
] | [] | [] | [
"python",
"twisted",
"twisted.words",
"xmpp"
] | stackoverflow_0002321468_python_twisted_twisted.words_xmpp.txt |
Q:
Joining different models in Django
Let's say I have this data model:
class Workflow(models.Model):
...
class Command(models.Model):
workflow = models.ForeignKey(Workflow)
...
class Job(models.Model):
command = models.ForeignKey(Command)
...
Suppose somewhere I want to loop through all the Workflow obj... | Joining different models in Django | Let's say I have this data model:
class Workflow(models.Model):
...
class Command(models.Model):
workflow = models.ForeignKey(Workflow)
...
class Job(models.Model):
command = models.ForeignKey(Command)
...
Suppose somewhere I want to loop through all the Workflow objects, and for each workflow I want to lo... | [
"The other way around it's easy since you can do\nall_jobs = Job.objects.select_related().all()\n\nAnd any job.command or job.command.workflow won't produce additional query.\nNot sure if it's possible with a Workflow query.\n",
"I think the only way you could do that would be using django.db.connection and write... | [
1,
0
] | [] | [] | [
"django",
"django_models",
"python"
] | stackoverflow_0002746580_django_django_models_python.txt |
Q:
how to exit recursive math formula and still get an answer
i wrote this python code, which from wolfram alpha says that its supposed to return the factorial of any positive value (i probably messed up somewhere), integer or not:
from math import *
def double_factorial(n):
if int(n) == n:
n = int(n)
... | how to exit recursive math formula and still get an answer | i wrote this python code, which from wolfram alpha says that its supposed to return the factorial of any positive value (i probably messed up somewhere), integer or not:
from math import *
def double_factorial(n):
if int(n) == n:
n = int(n)
if [0,1].__contains__(n):
return 1
a =... | [
"You defined f in terms of g and g in terms of f. But you don't just have a circular definition with no base point to start the recursion. You have something worse. The definition of f is actually the definition of g inverted. f is precisely undoing what g did and vice versa. If you're trying to implement gamma you... | [
1,
0
] | [] | [] | [
"math",
"python"
] | stackoverflow_0002747390_math_python.txt |
Q:
Producing an view of a text's revision history in Python
I have two versions of a piece of text and I want to produce an HTML view of its revision similar to what Google Docs or Stack Overflow displays. I need to do this in Python. I don't know what this technique is called but I assume that it has a name and ho... | Producing an view of a text's revision history in Python | I have two versions of a piece of text and I want to produce an HTML view of its revision similar to what Google Docs or Stack Overflow displays. I need to do this in Python. I don't know what this technique is called but I assume that it has a name and hopefully there is a Python library that can do it.
Version 1:
... | [
"Google Diff Merge Patch has a pretty good diff implementation in pure python.\n",
"You can use wdiff. I don't know if there's a Python implementation:\n$ wdiff oldfile newfile\nWilliam Henry \"Bill\" Gates III (born October 28, 1955)[2] is [-an American-] {+a+} business magnate, philanthropist, and chairman[3] ... | [
1,
0,
0
] | [] | [] | [
"diff",
"history",
"python",
"revision"
] | stackoverflow_0002747600_diff_history_python_revision.txt |
Q:
Is it possible to get sqlalchemy to create a composite primary key with an integer part without making it an IDENTITY type?
I'm using sqlalchemy 6.0. The SQL Server T-SQL dialect seems to want to make any integer that's part of my primary key into an identity. That may be ok if the integer field were the primary k... | Is it possible to get sqlalchemy to create a composite primary key with an integer part without making it an IDENTITY type? | I'm using sqlalchemy 6.0. The SQL Server T-SQL dialect seems to want to make any integer that's part of my primary key into an identity. That may be ok if the integer field were the primary key, but mine is a composite and this isn't going to work for me. Is there a way to suppress this behavior?
Here's a demonstration... | [
"I got bit by the same problem. The solution is to add autoincrement=False to the int primary key column constructor:\nColumn(u'int_part', Integer, primary_key=True, nullable=False,\n autoincrement=False)\n\nOtherwise, sqlalchemy assumes it should make it an identity column.\n"
] | [
12
] | [] | [] | [
"python",
"sql_server",
"sqlalchemy"
] | stackoverflow_0002374243_python_sql_server_sqlalchemy.txt |
Q:
Why do dicts of defaultdict(int)'s use so much memory? (and other simple python performance questions)
I do understand that querying a non-existent key in a defaultdict the way I do will add items to the defaultdict. That is why it is fair to compare my 2nd code snippet to my first one in terms of performance.
imp... | Why do dicts of defaultdict(int)'s use so much memory? (and other simple python performance questions) | I do understand that querying a non-existent key in a defaultdict the way I do will add items to the defaultdict. That is why it is fair to compare my 2nd code snippet to my first one in terms of performance.
import numpy as num
from collections import defaultdict
topKeys = range(16384)
keys = range(8192)
table = dic... | [
"Python ints are internally represented as C longs (it's actually a bit more complicated than that), but that's not really the root of your problem.\nThe biggest overhead is your usage of dicts. (defaultdicts and dicts are about the same in this description). dicts are implemented using hash tables, which is nice b... | [
9,
2,
1
] | [] | [] | [
"memory",
"performance",
"python",
"runtime"
] | stackoverflow_0002747511_memory_performance_python_runtime.txt |
Q:
Forking Multiple Apps Under Python Subprocess
I have been looking through Google and SO for something that could help me solve this but I have run into a block. I am a bit new to Python but I am looking for a way to run multiple apps that will continuously run in the background.
For example, I need 4 apps to start... | Forking Multiple Apps Under Python Subprocess | I have been looking through Google and SO for something that could help me solve this but I have run into a block. I am a bit new to Python but I am looking for a way to run multiple apps that will continuously run in the background.
For example, I need 4 apps to start up with a param -appnum set to a different value. ... | [
"A simple way to start might be to use os.popen(), like this:\nimport os\n\nsubprogs = [None] * 4\nfor i in range(4):\n subprogs[i] = os.popen(\"app -appnum \" + i, \"r\")\n\nFrom here, you can read from each subprog[i] just like a file, capturing the output of the app program.\nNote that although the documentat... | [
1
] | [] | [] | [
"python",
"subprocess"
] | stackoverflow_0002747921_python_subprocess.txt |
Q:
Confusion on C++ Python extensions. Things like getting C++ values for python values
I'm wanted to convert some of my python code to C++ for speed but it's not as easy as simply making a C++ function and making a few function calls. I have no idea how to get a C++ integer from a python integer object. I have an in... | Confusion on C++ Python extensions. Things like getting C++ values for python values | I'm wanted to convert some of my python code to C++ for speed but it's not as easy as simply making a C++ function and making a few function calls. I have no idea how to get a C++ integer from a python integer object. I have an integer which is an attribute of an object that I want to use. I also have integers which ar... | [
"May I make a sincere suggestion here? Instead of throwing a hundred lines of code at yourself when trying something new like this, first try the simplest test case possible. Try getting a C++ extension to work that does nothing but pass back the value 123. (Picking 0 or 1 might accidentally work, so I chose an eas... | [
2,
1
] | [] | [] | [
"api",
"c++",
"module",
"python"
] | stackoverflow_0002747955_api_c++_module_python.txt |
Q:
Mako "Missing parentheses in %def"
In trying to add a cached section to a Mako template, I get the error listed in the above question. Adding () to the end gets rid of the error, but I see no content on my page. Any help is appreciated!
<%def name="test" cached="True" cache_timeout="60" cache_type="file">
Test... | Mako "Missing parentheses in %def" | In trying to add a cached section to a Mako template, I get the error listed in the above question. Adding () to the end gets rid of the error, but I see no content on my page. Any help is appreciated!
<%def name="test" cached="True" cache_timeout="60" cache_type="file">
Test
/%def>
| [
"My problem was that I was not aware that <%def> defines a function. If I use the parenthesis and call the function via ${test()} right after definition, it works as expected.\n"
] | [
0
] | [
"Shouldn't you be using parantheses while defining the def test.\nAlso if the \"cached\" etc. are parameters then I think your \nyour definition should be something like below:\n\n<%def name=\"test(cached='True',cache_timeout='60',cache_type='file')\"> \n Test \n/%def> \n\n\nAlso see the Mako documentation\n"
] | [
-1
] | [
"mako",
"pylons",
"python"
] | stackoverflow_0002742600_mako_pylons_python.txt |
Q:
Pyglet OpenGL drawing anti-aliasing
I've been looking around for a way to anti-alias lines in OpenGL, but none of them seem to work... here's some example code:
import pyglet
from pyglet.gl import * ... | Pyglet OpenGL drawing anti-aliasing | I've been looking around for a way to anti-alias lines in OpenGL, but none of them seem to work... here's some example code:
import pyglet
from pyglet.gl import *
window = pyglet.window.Win... | [
"Allow Pyglet to use an extra sample buffer might help. Change your window line to this:\nconfig = pyglet.gl.Config(sample_buffers=1, samples=4)\nwindow = pyglet.window.Window(config=config, resizable=True) \n\nThis works for me.\n",
"It's a bit hard to say for sure. The first thing is probably to change your hin... | [
13,
8
] | [] | [] | [
"antialiasing",
"opengl",
"pyglet",
"pyopengl",
"python"
] | stackoverflow_0002747784_antialiasing_opengl_pyglet_pyopengl_python.txt |
Q:
What is the best way to translate this recursive python method into Java?
In another question I was provided with a great answer involving generating certain sets for the Chinese Postman Problem.
The answer provided was:
def get_pairs(s):
if not s: yield []
else:
i = min(s)
for j in s - set... | What is the best way to translate this recursive python method into Java? | In another question I was provided with a great answer involving generating certain sets for the Chinese Postman Problem.
The answer provided was:
def get_pairs(s):
if not s: yield []
else:
i = min(s)
for j in s - set([i]):
for r in get_pairs(s - set([i, j])):
yield [(i... | [
"In order to translate a generator function to Java you have to reimplement it as a Iterable+Iterator. E.g.:\ndef foo(x):\n for i in xrange(10):\n yield x * i\n...\nfor x in foo(5):\n print(x)\n\nBecomes (warning: code is not tested):\nimport java.util.Iterator;\nimport java.util.Iterable;\n\nclass Foo imp... | [
2,
1,
0
] | [] | [] | [
"java",
"python",
"set",
"yield"
] | stackoverflow_0002725542_java_python_set_yield.txt |
Q:
Creating a spam list with a web crawler in python
Hey guys, I'm not trying to do anything malicious here, I just need to do some homework. I'm a fairly new programmer, I'm using python 3.0, and I having difficulty using recursion for problem-solving. I've been stuck on this question for quite a while. Here's the
A... | Creating a spam list with a web crawler in python | Hey guys, I'm not trying to do anything malicious here, I just need to do some homework. I'm a fairly new programmer, I'm using python 3.0, and I having difficulty using recursion for problem-solving. I've been stuck on this question for quite a while. Here's the
Assignment:
Write a recursive method spam(url, n) that ... | [
"Think about how recursion works. What you want is for your function to be able to call itself in some cases. In this case, you need to add a parameter for the recursion level to your function, and then you need to figure out what it should do in the various cases?\nAt the most basic level, what should it do with n... | [
2,
1
] | [] | [] | [
"python"
] | stackoverflow_0002748444_python.txt |
Q:
Is this a good approach to execute a list of operations on a data structure in Python?
I have a dictionary of data, the key is the file name and the value is another dictionary of its attribute values. Now I'd like to pass this data structure to various functions, each of which runs some test on the attribute and ... | Is this a good approach to execute a list of operations on a data structure in Python? | I have a dictionary of data, the key is the file name and the value is another dictionary of its attribute values. Now I'd like to pass this data structure to various functions, each of which runs some test on the attribute and returns True/False.
One approach would be to call each function one by one explicitly from t... | [
"I'd say a better and much more Pythonic approach would be to define a decorator to indicate which functions you want to use:\nclass MyFunc(object):\n funcs = []\n def __init__(self, func):\n self.funcs.append(func)\n\n@MyFunc\ndef foo():\n return 5\n\n@MyFunc\ndef bar():\n return 10\n\ndef quux(... | [
6,
1
] | [] | [] | [
"coding_style",
"python"
] | stackoverflow_0002748280_coding_style_python.txt |
Q:
Python: Activate F6 Key after certain Interval
How to activate the F6 key every x seconds for the active window,
x being whatever number I enter, and the program stops with the hit of like ctrl+z or something.
What would be a good way to do this?
A:
Looks like this might do what you need: http://www.rutherfurd... | Python: Activate F6 Key after certain Interval | How to activate the F6 key every x seconds for the active window,
x being whatever number I enter, and the program stops with the hit of like ctrl+z or something.
What would be a good way to do this?
| [
"Looks like this might do what you need: http://www.rutherfurd.net/python/sendkeys/ \nI haven't tried to personally and my initial response was going to be that you're most likely going to need to look into Win32 APIs, but a quick google search turned that up.\n"
] | [
1
] | [] | [] | [
"python"
] | stackoverflow_0002748616_python.txt |
Q:
What causes the Openid error: Received "invalidate_handle" from server
I'm new to openid, and I am getting an "invalidate_handle" and I have no idea what to do to fix it.
I'm using django_authopenid
[Thu Apr 29 14:13:28 2010] [error] Generated checkid_setup request to https://www.google.com/accounts/o8/ud with ass... | What causes the Openid error: Received "invalidate_handle" from server | I'm new to openid, and I am getting an "invalidate_handle" and I have no idea what to do to fix it.
I'm using django_authopenid
[Thu Apr 29 14:13:28 2010] [error] Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication AOxxxxxxxxOX5-V9oDc3-btHhFxzAcccccccccc2RTHgh
[Thu Apr 29 14:1... | [
"openid.invalidate_handle is the Provider's way of saying that your RP is sending an association that does not exist or has expired. The RP is supposed to respond by deleting that association handle so it isn't reused in the future. If you're always getting invalidate_handles in the response, then the RP you're u... | [
2
] | [] | [] | [
"django",
"django_authopenid",
"openid",
"python"
] | stackoverflow_0002739886_django_django_authopenid_openid_python.txt |
Q:
How can I make a siren noise in Python?
I'm trying to make a siren sound in python with beeps, but had no success..
I'm trying something like
winsound.Beep(700,500)
winsound.Beep(710,500)
winsound.Beep(720,500)
...
It's a better way to do it? And play it?
Without external files...
Thx
A:
Record a high quality s... | How can I make a siren noise in Python? | I'm trying to make a siren sound in python with beeps, but had no success..
I'm trying something like
winsound.Beep(700,500)
winsound.Beep(710,500)
winsound.Beep(720,500)
...
It's a better way to do it? And play it?
Without external files...
Thx
| [
"Record a high quality siren as a WAV file (Audacity is a nice tool for this task, and might even provide the right mix of sound generators for this) and use PlaySound.\nwinsound.PlaySound('siren.wav', winsound.SND_FILENAME)\n\nYou could also bundle it into the script as a string to avoid having a separate file:\ns... | [
3,
2
] | [] | [] | [
"audio",
"python"
] | stackoverflow_0002748702_audio_python.txt |
Q:
In Python, how can I find the index of the first item in a list that is NOT some value?
Python's list type has an index(x) method. It takes a single parameter x, and returns the (integer) index of the first item in the list that has the value x.
Basically, I need to invert the index(x) method. I need to get the in... | In Python, how can I find the index of the first item in a list that is NOT some value? | Python's list type has an index(x) method. It takes a single parameter x, and returns the (integer) index of the first item in the list that has the value x.
Basically, I need to invert the index(x) method. I need to get the index of the first value in a list that does NOT have the value x. I would probably be able to ... | [
"Exiting at the first match is really easy: instead of computing a full list comprehension (then tossing away everything except the first item), use next over a genexp. Assuming for example that you want -1 when no item satisfies the condition of being != x,\nreturn next((i for i, v in enumerate(L) if v != x), -1)... | [
17,
5,
4,
1
] | [
"A silly itertools-based solution:)\nimport itertools as it, operator as op, functools as ft\n\ndef index_ne(item, sequence):\n sequence= iter(sequence)\n counter= it.count(-1) # start counting at -1\n pairs= it.izip(sequence, counter) # pair them\n get_1st= it.imap(op.itemgetter(0), pairs) # drop the u... | [
-1
] | [
"indexing",
"list",
"methods",
"python"
] | stackoverflow_0002748235_indexing_list_methods_python.txt |
Q:
Efficient way to build a MySQL update query in Python
I have a class variable called attributes which lists the instance variables I want to update in a database:
attributes = ['id', 'first_name', 'last_name', 'name', 'name_url',
'email', 'password', 'password_salt', 'picture_id']
Each of the class ... | Efficient way to build a MySQL update query in Python | I have a class variable called attributes which lists the instance variables I want to update in a database:
attributes = ['id', 'first_name', 'last_name', 'name', 'name_url',
'email', 'password', 'password_salt', 'picture_id']
Each of the class attributes are updated upon instantiation.
I would like to ... | [
"class Ic(object):\n attributes = ['id', 'first_name', 'last_name', 'name', 'name_url',\n 'email', 'password', 'password_salt', 'picture_id']\n\n def __init__(self): ...\n\n # and other methods that set all the attributes on self\n\n def updater(self):\n sqlbase = 'UPDATE members SET %s WHERE wh... | [
3,
0
] | [] | [] | [
"mysql",
"pylons",
"python"
] | stackoverflow_0002746232_mysql_pylons_python.txt |
Q:
Modern, Non-trivial, Pygame Tutorials?
What are some 'good', non-trivial Pygame tutorials?
I realize good is relative. As an example, a good one (to me) is the one that describes how to use pygame.camera. It's
recent
uses a modern PyGame (1.9)
non-trivial, in that it shows how to use it the module for a real a... | Modern, Non-trivial, Pygame Tutorials? | What are some 'good', non-trivial Pygame tutorials?
I realize good is relative. As an example, a good one (to me) is the one that describes how to use pygame.camera. It's
recent
uses a modern PyGame (1.9)
non-trivial, in that it shows how to use it the module for a real application.
I'd like to find others. A lot... | [
"(Shameless plug) - a 4-part tutorial that starts here. It builds a non-trivial 2D game-like simulation complete with quite a few features, using a modern version of Pygame.\n\n(source: thegreenplace.net) \n(editor comment: In particular, this tutorial covers:\n\nthe 'centering trick' for smoothing rotation\nsimpl... | [
7,
1
] | [] | [] | [
"pygame",
"python"
] | stackoverflow_0001617038_pygame_python.txt |
Q:
Alternative pygame resources
I have been trying to access the pygame website for a few weeks now, and I can't get to it. I doubt it's down, so I have to conclude that it's blocked because I am in China. I have no idea why. Anyways, I want the pygame documentation, but all the download links I fond lead back to pyg... | Alternative pygame resources | I have been trying to access the pygame website for a few weeks now, and I can't get to it. I doubt it's down, so I have to conclude that it's blocked because I am in China. I have no idea why. Anyways, I want the pygame documentation, but all the download links I fond lead back to pygame.org (which I does not even beg... | [
"I'll upload the pygame source here http://www.cse.unsw.edu.au/~cma/pygame-1.9.1release.zip\nUnzip it and there's a folder called 'docs' all the documentation is in there. \n",
"Here is Seul mirror maybe it will work :), if not you can always install any Linux on VM, and than download PyGame from repos.\n"
] | [
16,
0
] | [] | [] | [
"pygame",
"python"
] | stackoverflow_0001997679_pygame_python.txt |
Q:
Is TDD broken in Python?
Assume we have a class UserService with attribute current_user. Suppose it is used in AppService class.
We have AppService covered with tests. In test setup we stub out current_user with some mock value:
UserService.current_user = 'TestUser'
Assume we decide to rename current_user to acti... | Is TDD broken in Python? | Assume we have a class UserService with attribute current_user. Suppose it is used in AppService class.
We have AppService covered with tests. In test setup we stub out current_user with some mock value:
UserService.current_user = 'TestUser'
Assume we decide to rename current_user to active_user. We rename it in UserS... | [
"The problem really is not in TDD, nor Python. First of all, TDD does not give you a proof that when all your tests pass, your application is good. Imagine e.g. multiplyBy2() function, which can be tested with input 1,2,3 and output 2,4,8 and now imagine, you implemented multiplyBy2 as squaring. All your tests pass... | [
2,
1,
0
] | [] | [] | [
"mocking",
"python",
"refactoring",
"tdd",
"unit_testing"
] | stackoverflow_0002741593_mocking_python_refactoring_tdd_unit_testing.txt |
Q:
Best deployment strategy for Python google app engine
I wonder if there are any best practices/patterns for deploying python apps on Google app engine specifically Django. The best practice should be combination of existing best practices viz. Fabric, Paver, Buildout etc. Also please share best practice patterns f... | Best deployment strategy for Python google app engine | I wonder if there are any best practices/patterns for deploying python apps on Google app engine specifically Django. The best practice should be combination of existing best practices viz. Fabric, Paver, Buildout etc. Also please share best practice patterns for developing (I could not get virtualenv running with Djan... | [
"For many projects, you shouldn't need any deployment process at all. If you're using App Engine Patch or Django-Nonrel, they should take care of everything for you.\nFor other needs, check out this article on buildout and this set of buildout recipes.\n"
] | [
2
] | [] | [] | [
"deployment",
"google_app_engine",
"python"
] | stackoverflow_0002743806_deployment_google_app_engine_python.txt |
Q:
xml to Python data structure using lxml
How can I convert xml to Python data structure using lxml?
I have searched high and low but can't find anything.
Input example
<ApplicationPack>
<name>Mozilla Firefox</name>
<shortname>firefox</shortname>
<description>Leading Open Source internet browser.</description>... | xml to Python data structure using lxml | How can I convert xml to Python data structure using lxml?
I have searched high and low but can't find anything.
Input example
<ApplicationPack>
<name>Mozilla Firefox</name>
<shortname>firefox</shortname>
<description>Leading Open Source internet browser.</description>
<version>3.6.3-1</version>
<license name... | [
">>> from lxml import etree\n>>> treetop = etree.fromstring(anxmlstring)\n\nconverts the xml in the string to a Python data structure, and so does\n>>> othertree = etree.parse(somexmlurl)\n\nwhere somexmlurl is the path to a local XML file or the URL of an XML file on the web.\nThe Python data structure these funct... | [
5,
0
] | [] | [] | [
"data_structures",
"lxml",
"python",
"xml"
] | stackoverflow_0002747712_data_structures_lxml_python_xml.txt |
Q:
Solution for distributing MANY simple network tasks?
I would like to create some sort of a distributed setup for running a ton of small/simple REST web queries in a production environment. For each 5-10 related queries which are executed from a node, I will generate a very small amount of derived data, which will ... | Solution for distributing MANY simple network tasks? | I would like to create some sort of a distributed setup for running a ton of small/simple REST web queries in a production environment. For each 5-10 related queries which are executed from a node, I will generate a very small amount of derived data, which will need to be stored in a standard relational database (such ... | [
"Have you looked at Celery?\n"
] | [
1
] | [] | [] | [
"cluster_analysis",
"grid",
"open_source",
"python"
] | stackoverflow_0002749078_cluster_analysis_grid_open_source_python.txt |
Q:
Equivalent of PHP "echo something; exit();" with Python/Django?
Sometimes the best way to debug something is to print some stuff to the page, and exit(), how can I do this in a Python/Django site?
e.g. in PHP:
echo $var;
exit();
Thanks
A:
Put this in your view function:
from django.http import HttpResponse
retu... | Equivalent of PHP "echo something; exit();" with Python/Django? | Sometimes the best way to debug something is to print some stuff to the page, and exit(), how can I do this in a Python/Django site?
e.g. in PHP:
echo $var;
exit();
Thanks
| [
"Put this in your view function:\nfrom django.http import HttpResponse\nreturn HttpResponse(str(var))\n\n",
"I just wanted to give an alternative answer: Simply use print statements and serve your django site with python manage.py runserver\nIn this case the print statements show up in your shell, and your site c... | [
17,
14,
3
] | [
"If you don't want to crash mod_wsgi on print's do this in your wsgi file\nsys.stdout = sys.stderr\n\nprints will then be sent to the error_log\n"
] | [
-1
] | [
"django",
"python"
] | stackoverflow_0002747554_django_python.txt |
Q:
How can I reorder an mbox file chronologically?
I have a single spool mbox file that was created with evolution, containing a selection of emails that I wish to print. My problem is that the emails are not placed into the mbox file chronologically. I would like to know the best way to place order the files from fi... | How can I reorder an mbox file chronologically? | I have a single spool mbox file that was created with evolution, containing a selection of emails that I wish to print. My problem is that the emails are not placed into the mbox file chronologically. I would like to know the best way to place order the files from first to last using bash, perl or python. I would like ... | [
"This is how you could do it in python:\n#!/usr/bin/python2.5\nfrom email.utils import parsedate\nimport mailbox\n\ndef extract_date(email):\n date = email.get('Date')\n return parsedate(date)\n\nthe_mailbox = mailbox.mbox('/path/to/mbox')\nsorted_mails = sorted(the_mailbox, key=extract_date)\nthe_mailbox.upd... | [
14,
2
] | [
"What's the point in rewriting the mbox whereas you can reorder the mails in memory when loading up the mailbox? Which time is the one you want to order on? Receive date? Sent date? Anyway, all the Ruby/Python/Perl modules for playing with mboxes can do that.\n"
] | [
-5
] | [
"email",
"mbox",
"python",
"sorting"
] | stackoverflow_0000368003_email_mbox_python_sorting.txt |
Q:
Why are closures broken within exec?
In Python 2.6,
>>> exec "print (lambda: a)()" in dict(a=2), {}
2
>>> exec "print (lambda: a)()" in globals(), {'a': 2}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
File "<string>", line 1, in <lambda>
NameErro... | Why are closures broken within exec? | In Python 2.6,
>>> exec "print (lambda: a)()" in dict(a=2), {}
2
>>> exec "print (lambda: a)()" in globals(), {'a': 2}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
File "<string>", line 1, in <lambda>
NameError: global name 'a' is not defined
>>> exec... | [
"When you pass a string to exec or eval, it compiles that string to a code object before considering globals or locals. So when you say:\neval('lambda: a', ...)\n\nit means:\neval(compile('lambda: a', '<stdin>', 'eval'), ...)\n\nThere's no way for compile to know that a is a freevar, so it compiles it to a global r... | [
26
] | [] | [] | [
"closures",
"exec",
"python"
] | stackoverflow_0002749655_closures_exec_python.txt |
Q:
cannot output a json encoded dict containing accents (noob inside)
here is a fairly simple example wich is driving me nuts since a couple of days. Considering the following script:
# -*- coding: utf-8 -*
from json import dumps as json_dumps
machaine = u"une personne émérite"
print(machaine)
output = {}
output[1]... | cannot output a json encoded dict containing accents (noob inside) | here is a fairly simple example wich is driving me nuts since a couple of days. Considering the following script:
# -*- coding: utf-8 -*
from json import dumps as json_dumps
machaine = u"une personne émérite"
print(machaine)
output = {}
output[1] = machaine
jsonoutput = json_dumps(output)
print(jsonoutput)
The resul... | [
"The encoding is correct. Load it back in and print it, and you'll see the correct output:\n>>> import json\n>>> jsoninput = json.loads(jsonoutput)\n>>> print jsoninput\n{u'1': u'une personne \\xe9m\\xe9rite'}\n>>> print jsoninput['1']\nune personne émérite\n\n",
"To clarify Marcelo Cantos's answer: json.dumps() ... | [
3,
2
] | [] | [] | [
"json",
"python",
"utf_8"
] | stackoverflow_0002750156_json_python_utf_8.txt |
Q:
pythonpath issue? "python2.5: can't open file 'dev_appserver.py': [Errno 2] No such file or directory"
I added this line to my .bashrc (Ubuntu 9.10):
export PYTHONPATH=/opt/google_appengine/
And then I ran the dev_appserver through python2.5 on Ubuntu like this:
$ python2.5 dev_appserver.py guestbook/
python2.5: ... | pythonpath issue? "python2.5: can't open file 'dev_appserver.py': [Errno 2] No such file or directory" | I added this line to my .bashrc (Ubuntu 9.10):
export PYTHONPATH=/opt/google_appengine/
And then I ran the dev_appserver through python2.5 on Ubuntu like this:
$ python2.5 dev_appserver.py guestbook/
python2.5: can't open file 'dev_appserver.py': [Errno 2] No such file or directory
As you can see, it can't find dev_a... | [
"Python doesn't observe PYTHONPATH when looking for a script you name on the command line. You either need to supply the complete path to dev_appserver.py, or modify the first line of dev_appserver.py (and other tools) to start with \"#!/usr/bin/env python2.5\".\n",
"When doing\n$ python2.5 dev_appserver.py guest... | [
4,
1
] | [] | [] | [
"google_app_engine",
"python",
"pythonpath",
"ubuntu_9.10"
] | stackoverflow_0002750496_google_app_engine_python_pythonpath_ubuntu_9.10.txt |
Q:
Representing geographical points/polygons in Python/Django
I'm building a website in Django, and I want one of my datatypes to be a geographical polygon. I want to mark points on a map (say, in Google Maps) and then store the resulting polygon in the database.
Is there any way to do it that will save me the work ... | Representing geographical points/polygons in Python/Django | I'm building a website in Django, and I want one of my datatypes to be a geographical polygon. I want to mark points on a map (say, in Google Maps) and then store the resulting polygon in the database.
Is there any way to do it that will save me the work of typing all the longitudes and latitudes manually?
I guess I'... | [
"You're lucky, Django has maybe the best GIS support of all web frameworks:\nGeoDjango\n"
] | [
4
] | [] | [] | [
"django",
"gis",
"google_maps",
"mapping",
"python"
] | stackoverflow_0002751189_django_gis_google_maps_mapping_python.txt |
Q:
DSA module in Python
Does anyone know of a pure DSA module in Python for signing messages?
A:
Python Cryptography Toolkit has this module
Chilkat (this may be a pure module check with chilkat - commercially licensed )
A:
If OpenSSL has the functionality you are looking for, try pyOpenSSL.
A:
Unfortunately, ... | DSA module in Python | Does anyone know of a pure DSA module in Python for signing messages?
| [
"Python Cryptography Toolkit has this module\nChilkat (this may be a pure module check with chilkat - commercially licensed )\n",
"If OpenSSL has the functionality you are looking for, try pyOpenSSL.\n",
"Unfortunately, you might have to use a wrapper to some non-Python implementation, like pyOpenSSL. I'm not ... | [
1,
1,
0
] | [] | [] | [
"cryptography",
"python"
] | stackoverflow_0002729468_cryptography_python.txt |
Q:
How do I check for Existence of a Record in GAE
I am trying to create a simple view in Django & GAE, which will check if the user has a profile entity and prints a different message for each case. I have the program below, but somehow GAE always seem to return a object. My program is below
import datetime
from dj... | How do I check for Existence of a Record in GAE | I am trying to create a simple view in Django & GAE, which will check if the user has a profile entity and prints a different message for each case. I have the program below, but somehow GAE always seem to return a object. My program is below
import datetime
from django.http import HttpResponse, HttpResponseRedirect
f... | [
"I am afraid you forgot to execute the query. Try the get() method. It returns the first result, or None if the query returned no results.\nprofile = db.GqlQuery(\"SELECT * FROM Profile WHERE account = :1\",\n users.get_current_user()).get()\n\n"
] | [
2
] | [] | [] | [
"django",
"django_models",
"google_app_engine",
"python"
] | stackoverflow_0002751345_django_django_models_google_app_engine_python.txt |
Q:
Is www.example.com/post/21/edit a RESTful URI? I think I know the answer, but have another question
I'm almost afraid to post this question, there has to be an obvious answer I've overlooked, but here I go:
Context: I am creating a blog for educational purposes (want to learn python and web.py). I've decided that ... | Is www.example.com/post/21/edit a RESTful URI? I think I know the answer, but have another question | I'm almost afraid to post this question, there has to be an obvious answer I've overlooked, but here I go:
Context: I am creating a blog for educational purposes (want to learn python and web.py). I've decided that my blog have posts, so I've created a Post class. I've also decided that posts can be created, read, upda... | [
"Another RESTful approach is to use the query string for modifiers: /post/52?edit=1\nAlso, don't get too hung up on the purity of the REST model. If your app doesn't fit neatly into the model, break the rules. \n",
"There is no such thing as a RESTful URI. It is false concept as URIs should be completely opaque... | [
4,
3,
2,
0
] | [] | [] | [
"python",
"rest",
"web.py"
] | stackoverflow_0002750341_python_rest_web.py.txt |
Q:
Sending Data as Instances using Python Sockets
I'm working on the networking part of a 2 player game (similar to tetris), and I'm trying to pass the game grid from client to server and vice versa. However, when I tried using send(grid) I get a TypeError: send() argument 1 must be string or read-only buffer, not in... | Sending Data as Instances using Python Sockets | I'm working on the networking part of a 2 player game (similar to tetris), and I'm trying to pass the game grid from client to server and vice versa. However, when I tried using send(grid) I get a TypeError: send() argument 1 must be string or read-only buffer, not instance.
Is there anyway to circumvent this, or do I... | [
"Unless you're in total control over both the client and server software, you should hesitate to use pickle to transmit data back and forth. Pickle is great if you're sure the data you're unpickling is trustworthy, but if it might have been tampered with, it is insecure. See Why Python Pickle is Insecure, or the s... | [
6,
1
] | [] | [] | [
"python",
"sockets"
] | stackoverflow_0002751098_python_sockets.txt |
Q:
Figure out if element is present in multi-dimensional array in python
I am parsing a log containing nicknames and hostnames. I want to end up with an array that contains the hostname and the latest used nickname.
I have the following code, which only creates a list over the hostnames:
hostnames = []
# while(parsi... | Figure out if element is present in multi-dimensional array in python | I am parsing a log containing nicknames and hostnames. I want to end up with an array that contains the hostname and the latest used nickname.
I have the following code, which only creates a list over the hostnames:
hostnames = []
# while(parsing):
# nick = nick_on_current_line
# host = host_on_current_line
if... | [
"Use a dictionary instead of a list. Use the hostname as the key and the username as the value.\n",
"Just use a dictionary instead.\nnames = {}\n\nwhile(parsing):\n nick = nick_on_current_line\n host = host_on_current_line \n\n names[host] = nick\n\n",
"if host in zip(*hostnames)[0]:\n\nor\nif host i... | [
4,
3,
2
] | [] | [] | [
"arrays",
"multidimensional_array",
"python"
] | stackoverflow_0002751471_arrays_multidimensional_array_python.txt |
Q:
In Python, is there an easy way to edit xml in place?
Suppose I want to edit a node in xml and edit one of its attributes. I want to be able to do a simple file diff to just see one row changed. Dumping the xml using prettyprint changes the whole xml structure.
A:
Well then don't use prettyprint.
In xml.dom.min... | In Python, is there an easy way to edit xml in place? | Suppose I want to edit a node in xml and edit one of its attributes. I want to be able to do a simple file diff to just see one row changed. Dumping the xml using prettyprint changes the whole xml structure.
| [
"Well then don't use prettyprint.\nIn xml.dom.minidom for example, if you do\ndoc = xml.dom.minidom.parse(inputfile)\ndo_something_with(doc)\noutputfile.write(doc.toxml(\"utf-8\").decode(\"utf-8\"))\n\nall the structure/whitespace etc. will remain unchanged.\n",
"Consider NOT using \"a simple file diff\". See thi... | [
1,
0
] | [] | [] | [
"python",
"xml"
] | stackoverflow_0002751451_python_xml.txt |
Q:
Make qwidget in new window in PyQt4
I'm trying to make a class that extends qwidget, that pops up a new window, I must be missing something fundamental,
class NewQuery(QtGui.QWidget):
def __init__(self, parent):
QtGui.QMainWindow.__init__(self,parent)
self.setWindowTitle('Add New Query')
grid = QtGui.QGrid... | Make qwidget in new window in PyQt4 | I'm trying to make a class that extends qwidget, that pops up a new window, I must be missing something fundamental,
class NewQuery(QtGui.QWidget):
def __init__(self, parent):
QtGui.QMainWindow.__init__(self,parent)
self.setWindowTitle('Add New Query')
grid = QtGui.QGridLayout()
label = QtGui.QLabel('blah')
... | [
"follow the advice that @ChristopheD gave you and try this instead\nfrom PyQt4 import QtGui\n\nclass NewQuery(QtGui.QWidget):\n def __init__(self, parent=None):\n super(NewQuery, self).__init__(parent)\n self.setWindowTitle('Add New Query')\n grid = QtGui.QGridLayout()\n label = QtGui... | [
2,
1
] | [] | [] | [
"pyqt4",
"python",
"qwidget"
] | stackoverflow_0002751691_pyqt4_python_qwidget.txt |
Q:
chatbot using twisted and wokkel
I am writing a chatbot using Twisted and wokkel and everything seems to be working except that bot periodically logs off. To temporarily fix that I set presence to available on every connection initialized. Does anyone know how to prevent going offline? (I assume if i keep sending ... | chatbot using twisted and wokkel | I am writing a chatbot using Twisted and wokkel and everything seems to be working except that bot periodically logs off. To temporarily fix that I set presence to available on every connection initialized. Does anyone know how to prevent going offline? (I assume if i keep sending available presence every minute or so ... | [
"If you're using XMPP, as I assume is the case given your mention of wokkel, then, per RFC 3921, the applicable standard, you do need periodic exchanges of presence information (indeed, that's a substantial overhead of XMPP, and solutions to it are being researched, but that's the state of the art as of now). Esse... | [
3
] | [] | [] | [
"chatbot",
"python",
"twisted",
"xmpp"
] | stackoverflow_0002751918_chatbot_python_twisted_xmpp.txt |
Q:
Python grab class in class definition
I don't even know how to explain this, so here is the code I'm trying.
from couchdb.schema import Document, TextField
class Base(Document):
type = TextField(default=self.__name__)
#self doesn't work, how do I get a reference to Base?
class User(Base):
pass
#Us... | Python grab class in class definition | I don't even know how to explain this, so here is the code I'm trying.
from couchdb.schema import Document, TextField
class Base(Document):
type = TextField(default=self.__name__)
#self doesn't work, how do I get a reference to Base?
class User(Base):
pass
#User.type be defined as TextField(default="Te... | [
"The class object does not (yet) exist while the class body is executing, so there is no way for code in the class body to get a reference to it (just as, more generally, there is no way for any code to get a reference to any object that does not exist). Test2.__name__, however, already does what you're specifical... | [
3,
0
] | [] | [] | [
"python",
"reflection"
] | stackoverflow_0002752184_python_reflection.txt |
Q:
Emacs shell output buffer height
i have the following in my .emacs file(thanks to SOer nikwin), which evaluates the current buffer content and displays the output in another buffer.
(defun shell-compile ()
(interactive)
(save-buffer)
(shell-command (concat "python " (buffer-file-name))))
(add-hook 'python... | Emacs shell output buffer height | i have the following in my .emacs file(thanks to SOer nikwin), which evaluates the current buffer content and displays the output in another buffer.
(defun shell-compile ()
(interactive)
(save-buffer)
(shell-command (concat "python " (buffer-file-name))))
(add-hook 'python-mode-hook
(lambda () (loca... | [
"This expands the source code buffer by 20 lines whenever its height is less than or equal to half the frame's height. Pretty crude, but it may serve your purpose.\n(defun shell-compile ()\n (interactive)\n (save-buffer)\n (shell-command (concat \"python \" (buffer-file-name)))\n (if (<= (* 2 (window-height)) (... | [
1,
0
] | [] | [] | [
"emacs",
"python"
] | stackoverflow_0002748880_emacs_python.txt |
Q:
Python's JSON module doesn't use __get__?
When I serialize a list of objects with a custom __get__ method, __get__ is not called and the raw (unprocessed by custom __get__) value from __set__ is used. How does Python's json module iterate over an item?
Note: if I iterate over the list before serializing, the corr... | Python's JSON module doesn't use __get__? | When I serialize a list of objects with a custom __get__ method, __get__ is not called and the raw (unprocessed by custom __get__) value from __set__ is used. How does Python's json module iterate over an item?
Note: if I iterate over the list before serializing, the correct value returned by __get__ is used.
| [
"It checks whether the object is certain values, or isinstances of list, tuple, or dicts...\nIt provides a method for what to do if all this fails, and documents how to do this:\n\nimport simplejson\nclass IterEncoder(simplejson.JSONEncoder):\n def default(self, o):\n try:\n iterable = iter(o)\n except ... | [
1,
0
] | [] | [] | [
"json",
"python"
] | stackoverflow_0002238847_json_python.txt |
Q:
Python line file iteration and strange characters
I have a huge gzipped text file which I need to read, line by line. I go with the following:
for i, line in enumerate(codecs.getreader('utf-8')(gzip.open('file.gz'))):
print i, line
At some point late in the file, the python output diverges from the file. This... | Python line file iteration and strange characters | I have a huge gzipped text file which I need to read, line by line. I go with the following:
for i, line in enumerate(codecs.getreader('utf-8')(gzip.open('file.gz'))):
print i, line
At some point late in the file, the python output diverges from the file. This is because lines are getting broken due to weird speci... | [
"Try again with no codec. The following reproduces your problem when using codec, and the absence of the problem without it:\nimport gzip \nimport os \nimport codecs \n\ndata = gzip.open(\"file.gz\", \"wb\") \ndata.write('foo\\x1d\\x1cbar\\nbaz') \ndata.close() \n\nprint list(codecs.getreader('utf-8')(gzip.open('fi... | [
5,
1
] | [] | [] | [
"codec",
"gzip",
"line_breaks",
"python"
] | stackoverflow_0002737894_codec_gzip_line_breaks_python.txt |
Q:
Appengine (python) returns empty for valid queries
EDIT: Figured it out. For whatever reason the field in the index was called strWord instead of wordStr. I didn't notice because of the similarities. The file was auto generated, so I must have called the field that in a previous development version.
I've got an ap... | Appengine (python) returns empty for valid queries | EDIT: Figured it out. For whatever reason the field in the index was called strWord instead of wordStr. I didn't notice because of the similarities. The file was auto generated, so I must have called the field that in a previous development version.
I've got an app with around half a million 'records', each of which on... | [
"When this has happened to me it's because I've been using a TextField, which cannot be queried (but confusingly just gets ignored). Try switching to StringField.\n"
] | [
0
] | [] | [] | [
"google_app_engine",
"python"
] | stackoverflow_0002752008_google_app_engine_python.txt |
Q:
Which version of Python should be used?
I'm starting a new Python web project. With most frameworks, everyone rushes to the latest version, however, it seems that this is not as true for Python 3.x.
Which version of Python should brand new projects use?
A:
A lot of 3rd party Python modules still require Python 2... | Which version of Python should be used? | I'm starting a new Python web project. With most frameworks, everyone rushes to the latest version, however, it seems that this is not as true for Python 3.x.
Which version of Python should brand new projects use?
| [
"A lot of 3rd party Python modules still require Python 2.x (numpy, scipy for example). If you will use any of those, or if you don't yet know what modules you need and want to keep your options open then stick with Python 2.x for now.\nIf you know that all the modules you need work with Python 3.x then go with tha... | [
3,
2,
1,
1,
0
] | [] | [] | [
"python"
] | stackoverflow_0002751250_python.txt |
Q:
Python GUI Scraper hanging issues
I wrote a scraper using python a while back, and it worked fine in the command line. I have made a GUI for the application now, but I am having trouble with one issue. When I attempt to update text inside the gui (e.g. 'fetching URL 12/50'), I am unable seeing as the function wi... | Python GUI Scraper hanging issues | I wrote a scraper using python a while back, and it worked fine in the command line. I have made a GUI for the application now, but I am having trouble with one issue. When I attempt to update text inside the gui (e.g. 'fetching URL 12/50'), I am unable seeing as the function within the scraper is grabbing 100+ links... | [
"I'd suggest to use QNetworkAccessManager for a non-blocking way of downloading the websites. It's a different approach, so you will probably rewrite the handling part of your application. Instead of waiting until the page is downloaded so that you can parse it, you have multiple smaller functions, connected via si... | [
2,
2
] | [] | [] | [
"beautifulsoup",
"pyqt4",
"python",
"screen_scraping",
"urllib2"
] | stackoverflow_0002752518_beautifulsoup_pyqt4_python_screen_scraping_urllib2.txt |
Q:
Why would one build supervisord inside of a buildout?
I've seen buildout recipes that build supervisor into the buildout, I suppose to control the daemons inside. However, it seems to me that one would still need something in /etc/init.d ( for example ) to run said supervisor instance on boot.
So, why build sup... | Why would one build supervisord inside of a buildout? | I've seen buildout recipes that build supervisor into the buildout, I suppose to control the daemons inside. However, it seems to me that one would still need something in /etc/init.d ( for example ) to run said supervisor instance on boot.
So, why build supervisor inside the buildout? Why not install it system wid... | [
"When we create a buildout for a customer, we want that buildout to run on arbitrary hosting environments with minimal dependencies, all satisfiable with system packages. By including supervisord in the buildout, we eliminate the need for it to be installed system-wide and can tweak it's parameters finely, without ... | [
9
] | [] | [] | [
"buildout",
"python",
"supervisord"
] | stackoverflow_0002752433_buildout_python_supervisord.txt |
Q:
Why does Python Array Module Process Strings and Lists Differently?
I'm having trouble understanding the result of the following statements:
>>> from array import array
>>> array('L',[0xff,0xff,0xff,0xff])
array('L', [255L, 255L, 255L, 255L])
>>> from array import array
>>> array('L','\xff\xff\xff\xff')
Traceback... | Why does Python Array Module Process Strings and Lists Differently? | I'm having trouble understanding the result of the following statements:
>>> from array import array
>>> array('L',[0xff,0xff,0xff,0xff])
array('L', [255L, 255L, 255L, 255L])
>>> from array import array
>>> array('L','\xff\xff\xff\xff')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueErr... | [
"You are running this on a 64-bit build of Python, on which array treats type code 'L' as a 64-bit unsigned integer.\n>>> array('L','\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff')\narray('L', [18446744073709551615L])\n\nThe documentation isn't very clear. All it says is that 'L' is at least four bytes.\n",
"In the fi... | [
3,
1
] | [] | [] | [
"arrays",
"python",
"python_module",
"type_conversion"
] | stackoverflow_0002752913_arrays_python_python_module_type_conversion.txt |
Q:
What is a good SOAP client library for python on App Engine?
I have read that SUDS doesn't work on App Engine.
http://osdir.com/ml/fedora-suds-list/2010-03/msg00004.html
Can anyone confirm or refute this? Can you suggest an alternative for calling SOAP services from App Engine's python runtime?
A:
Have you trie... | What is a good SOAP client library for python on App Engine? | I have read that SUDS doesn't work on App Engine.
http://osdir.com/ml/fedora-suds-list/2010-03/msg00004.html
Can anyone confirm or refute this? Can you suggest an alternative for calling SOAP services from App Engine's python runtime?
| [
"Have you tried ElementSoap? It seems like a good option.\n",
"http://code.google.com/p/google-api-adwords-python-lib/\nThis is a soap library from Google. I have not had time to test it,\n"
] | [
3,
1
] | [] | [] | [
"google_app_engine",
"python",
"soap"
] | stackoverflow_0002557461_google_app_engine_python_soap.txt |
Q:
Need to constantly monitor serial data in Python
Right now I am using an Arduino to send data from an analog sensor to COM4. I am trying to make a python script that continuously monitors that data and looks for a certain parameter.
I tried something like this but it isn't alerting me correctly
import serial
from ... | Need to constantly monitor serial data in Python | Right now I am using an Arduino to send data from an analog sensor to COM4. I am trying to make a python script that continuously monitors that data and looks for a certain parameter.
I tried something like this but it isn't alerting me correctly
import serial
from Tkinter import *
import tkMessageBox
port = "COM4"
se... | [
"If the serial package you are using is pySerial, take note of the definition of the Serial.read() method:\n\nread(size=1)\nParameter: size – Number of bytes to read.\nReturns: Bytes read from the port.\nRead size bytes from the serial port. If a timeout is set it may return less characters as requested. With no ... | [
3,
0,
0
] | [] | [] | [
"python",
"serial_port"
] | stackoverflow_0002752809_python_serial_port.txt |
Q:
plotting stem with a continuous line
I need to plot a stem plot of my signal using python and matplotlib.
I saw the example and the code but the line connecting the black big dot and the x-axis is not a continous line. Do you know whether is possible and how to get a straight line instead?
#!/usr/bin/env python
fr... | plotting stem with a continuous line | I need to plot a stem plot of my signal using python and matplotlib.
I saw the example and the code but the line connecting the black big dot and the x-axis is not a continous line. Do you know whether is possible and how to get a straight line instead?
#!/usr/bin/env python
from pylab import *
x = linspace(0.1, 2*pi,... | [
"Change '-.' to '-':\nmarkerline, stemlines, baseline = stem(x, cos(x), '-')\n\nThe final argument indicates the line style.\n"
] | [
4
] | [] | [] | [
"matplotlib",
"python"
] | stackoverflow_0002753107_matplotlib_python.txt |
Q:
Python - Finding unicode/ascii problems
I am csv.reader to pull in info from a very long sheet. I am doing work on that data set and then I am using the xlwt package to give me a workable excel file.
However, I get this error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 34: ordinal not i... | Python - Finding unicode/ascii problems | I am csv.reader to pull in info from a very long sheet. I am doing work on that data set and then I am using the xlwt package to give me a workable excel file.
However, I get this error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 34: ordinal not in range(128)
My question to you all is, how ... | [
"The answer is quite simple actually : As soon as you read your data from your file, convert it to unicode using the encoding of your file, and handle the UnicodeDecodeError exception :\ntry:\n # decode using utf-8 (use ascii if you want)\n unicode_data = str_data.decode(\"utf-8\")\nexcept UnicodeDeco... | [
3,
1,
0,
0
] | [] | [] | [
"python"
] | stackoverflow_0002753022_python.txt |
Q:
Which template technology should I use with CherryPy?
I'm in the process of building a web application using cherrypy.
What template technology do you recommend I use?
A:
If you mean a templating engine, I've had some success using mako with cherrypy. They just seem to play nicely together.
Mako is extremely ea... | Which template technology should I use with CherryPy? | I'm in the process of building a web application using cherrypy.
What template technology do you recommend I use?
| [
"If you mean a templating engine, I've had some success using mako with cherrypy. They just seem to play nicely together.\nMako is extremely easy to get started with and customize, which is, I assume, also two of your major reasons for choosing cherrypy. The cherrypy official tutorial also uses mako, and you can s... | [
5,
5,
4,
3,
2,
0
] | [] | [] | [
"cherrypy",
"python",
"template_engine",
"templates"
] | stackoverflow_0000993029_cherrypy_python_template_engine_templates.txt |
Q:
How to make shell output redirect (>) write while script is still running?
I wrote a short script that never terminates. This script continuously generates output that I have to check on every now and then. I'm running it on a lab computer through SSH, and redirecting the output to a file in my public_html folder ... | How to make shell output redirect (>) write while script is still running? | I wrote a short script that never terminates. This script continuously generates output that I have to check on every now and then. I'm running it on a lab computer through SSH, and redirecting the output to a file in my public_html folder on that machine.
python script.py > ~/public_html/results.txt
However, the resu... | [
"You need to flush the output sys.stdout.flush() (or smth) if you want to see it immediately. See this\n",
"stdout is buffered, if not connected to terminal. \nYou can change this policy to line-buffering via stdbuf\nstdbuf -oL python script.py > ~/public_html/results.txt\n\nSo you don't have to flush in your Py... | [
16,
7,
1
] | [] | [] | [
"bash",
"command_line",
"linux",
"python",
"shell"
] | stackoverflow_0002753350_bash_command_line_linux_python_shell.txt |
Q:
Has Twisted changed its dependencies?
I'm currently working on a Python/Twisted project which is to be distributed and tested on Planetlab. For some reason my code was working on friday and now that I wanted to test a minor change it refuses to work at all:
Traceback (most recent call last):
File "acn_a4/src/nod... | Has Twisted changed its dependencies? | I'm currently working on a Python/Twisted project which is to be distributed and tested on Planetlab. For some reason my code was working on friday and now that I wanted to test a minor change it refuses to work at all:
Traceback (most recent call last):
File "acn_a4/src/node.py", line 6, in <module>
from twisted... | [
"One of your own files, /home/cdecker/dev/acn/acn_a4/src/operator.py shadows Python's builtin operator module. You should rename your own operator.py to something else. \nYou can see the problem here:\nFile \"/usr/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-i686.egg/twisted/python/compat.py\", line 146, ... | [
10,
1
] | [] | [] | [
"python",
"twisted"
] | stackoverflow_0002753552_python_twisted.txt |
Q:
symlink files newer than X age, then later remove symlink once file ages?
i have a large number of files/folders coming in each day that are being sorted automatically to a wide variety of folders. I'm looking for a way to automatically find these files/folders and create symlinks to them all within an "incoming" ... | symlink files newer than X age, then later remove symlink once file ages? | i have a large number of files/folders coming in each day that are being sorted automatically to a wide variety of folders. I'm looking for a way to automatically find these files/folders and create symlinks to them all within an "incoming" folder. Searching for file age should be sufficient for finding the files, howe... | [
"Use incron to create the symlink, then find -L in cron to break it.\n",
"Not quite sure what you want the symlinks to but here's a first shot:\nfind /incoming -mtime -5 -user nr -exec ln -s '{}' /usr/local/symlinks ';'\n\nFinds anything in /incoming owned by nr less than 5 days old and links it into /usr/local/s... | [
2,
1
] | [] | [] | [
"bash",
"linux",
"python",
"scripting",
"unix"
] | stackoverflow_0002752915_bash_linux_python_scripting_unix.txt |
Q:
App Engine Django Form Uniqueness Validation?
Is there a simpler way to use uniqueness validation with Django Forms in AppEngine?
I understand that performance would be problem if we keep an uniqueness constraint but since the amount of data being added is very small performance is not a big concern, rather develo... | App Engine Django Form Uniqueness Validation? | Is there a simpler way to use uniqueness validation with Django Forms in AppEngine?
I understand that performance would be problem if we keep an uniqueness constraint but since the amount of data being added is very small performance is not a big concern, rather development time is a concern here.
Any help is appreciat... | [
"You can use keys for uniqueness:\n\nThe complete key of an entity,\nincluding the path, the kind and the\nname or numeric ID, is unique and\nspecific to that entity. The complete\nkey is assigned when the entity is\ncreated in the datastore, and none of\nits parts can change...\nEvery entity has an identifier. An\... | [
1
] | [] | [] | [
"django_forms",
"google_app_engine",
"python"
] | stackoverflow_0002753623_django_forms_google_app_engine_python.txt |
Q:
Python 2.4 inline if statements
I am setting up an existing django project on a dreamhost web server, so far I have got everything to work correctly. However I developed under python 2.5 and dreamhost by default uses python 2.4. The following line seems gives a syntax error because of the if keyword:
'parent': c.p... | Python 2.4 inline if statements | I am setting up an existing django project on a dreamhost web server, so far I have got everything to work correctly. However I developed under python 2.5 and dreamhost by default uses python 2.4. The following line seems gives a syntax error because of the if keyword:
'parent': c.parent.pk if c.parent is not None else... | [
"Yes, this kind of inline if was added with 2.5, released almost 4 years ago. You can update your Dreamhost version like this\n",
"http://www.diveintopython.net/power_of_introspection/and_or.html\n(1 and [a] or [b])[0]\n'parent': (c.parent is not None and [c.parent.pk] else [None])[0]\n\n"
] | [
4,
2
] | [] | [] | [
"django",
"dreamhost",
"python",
"python_2.4",
"python_2.5"
] | stackoverflow_0002753664_django_dreamhost_python_python_2.4_python_2.5.txt |
Q:
Programatically importing a file and creating an instance of a class in Python
I have a (python) list of strings which refer to python source files and subsequently classes within those files which I want to import and then create an instance of the classes within the files (everything follows a strict naming conv... | Programatically importing a file and creating an instance of a class in Python | I have a (python) list of strings which refer to python source files and subsequently classes within those files which I want to import and then create an instance of the classes within the files (everything follows a strict naming convention, making this theoretically possible), in Ruby I would do something like:
requ... | [
"Please see Dynamic Module Loading in Python:\n\nIf you have a need to import a module\n in python and, for whatever reason,\n you will not know the name of the\n module until run-time, python provides\n the built-in __import__ function.\n\n"
] | [
3
] | [] | [] | [
"metaprogramming",
"python"
] | stackoverflow_0002753916_metaprogramming_python.txt |
Q:
Complex form widgets in Django
I am looking for good helper libraries to generate a rather complex form in Django.
Dynamic field dependencies: Say if option a is selected certain fields are shown/hidden and subset of these are mandatory depending on option selection.
Add more: On clicking "Add more" button that c... | Complex form widgets in Django | I am looking for good helper libraries to generate a rather complex form in Django.
Dynamic field dependencies: Say if option a is selected certain fields are shown/hidden and subset of these are mandatory depending on option selection.
Add more: On clicking "Add more" button that clones some widget.
This is somethi... | [
"I've used a heavily customized Formset to make a rather complicated form with complicated user permission dependencies. This involved subclassing django.forms.formsets.BaseFormSet, overriding __init__, add_fields, is_valid, and save, and of course using a customized Form. The end-product was a bit hairy, but I'm s... | [
3,
2
] | [] | [] | [
"django",
"forms",
"jquery",
"python"
] | stackoverflow_0002689739_django_forms_jquery_python.txt |
Q:
Using JRuby/Jython for Ruby/Python interoperability?
Quite-probably a silly question, as I don't know much about Java/Jython/JRuby/bytecode, but..
I stumbled across _why's unholy again today.. It allows you to output Python bytecode from Ruby code.. Basically allowing them to produce the same bytecode..
Jython out... | Using JRuby/Jython for Ruby/Python interoperability? | Quite-probably a silly question, as I don't know much about Java/Jython/JRuby/bytecode, but..
I stumbled across _why's unholy again today.. It allows you to output Python bytecode from Ruby code.. Basically allowing them to produce the same bytecode..
Jython outputs Java bytecode, as does JRuby.. Since these both compi... | [
"No, that won't work. At least not the way you think it would.\nInteroperability between Jython and JRuby works the same way as between CPython and YARV: they both run on the same platform, so they can communicate with each other using that platform.\nIn the case of CPython and YARV, that platform is C/POSIX, so th... | [
7,
5
] | [] | [] | [
"bytecode",
"jruby",
"jython",
"python",
"ruby"
] | stackoverflow_0002752979_bytecode_jruby_jython_python_ruby.txt |
Q:
Have I checked every consecutive subset of this list?
I'm trying to solve problem 50 on Project Euler. Don't give me the answer or solve it for me, just try to answer this specific question.
The goal is to find the longest sum of consecutive primes that adds to a prime below one million. I wrote a sieve to find al... | Have I checked every consecutive subset of this list? | I'm trying to solve problem 50 on Project Euler. Don't give me the answer or solve it for me, just try to answer this specific question.
The goal is to find the longest sum of consecutive primes that adds to a prime below one million. I wrote a sieve to find all the primes below n, and I have confirmed that it is corre... | [
"Your code is correct. I ran it and it does generate the number 953, so the problem is probably with your prime generating function. There should be 78498 primes below a million - you may want to check if you get that result.\nThat said, your code will take a long time to run, since it will call check() 3,080,928,7... | [
5,
0
] | [] | [] | [
"list",
"primes",
"proof",
"python"
] | stackoverflow_0002754003_list_primes_proof_python.txt |
Q:
Node.js as a custom (streaming) upload handler for Django
I want to build an upload-centric app using Django. One way to do this is with nginx's upload module (nonblocking) but it has its problems. Node.js is supposed to be a good candidate for this type of application. But how can I make node.js act as an upload_... | Node.js as a custom (streaming) upload handler for Django | I want to build an upload-centric app using Django. One way to do this is with nginx's upload module (nonblocking) but it has its problems. Node.js is supposed to be a good candidate for this type of application. But how can I make node.js act as an upload_handler() for Django? I'm not sure where to look for examples?
| [
"Okay I'm not like an expert on the subject or anything, but the way I think I understand it, nginx is a proxy that runs in front of the webserver that serves your django app, right?\nYou could build a simple node.js server that does the same - listen on port 80, wait until the request is completely sent to the ser... | [
2,
0
] | [] | [] | [
"django",
"javascript",
"node.js",
"python",
"uploading"
] | stackoverflow_0002403280_django_javascript_node.js_python_uploading.txt |
Q:
Do i have to store mails in db?
Are received mails stored somewhere in google app engine app or have i to store it with separated db class?
A:
No, you don't need to store mails in the datastore. Incoming emails generate http requests and you just need to associate script handlers to email addresses. See the doc... | Do i have to store mails in db? | Are received mails stored somewhere in google app engine app or have i to store it with separated db class?
| [
"No, you don't need to store mails in the datastore. Incoming emails generate http requests and you just need to associate script handlers to email addresses. See the documentation.\n"
] | [
3
] | [] | [] | [
"google_app_engine",
"python"
] | stackoverflow_0002754427_google_app_engine_python.txt |
Q:
how to make site show different language(chinese and english) on google-app-engine
if you using django ,you can use the "LC_MESSAGES -->django.po"
but has any way to do this on gae ?
and how to ..
thanks
and if i only want to use django's this features, how can i import it?
A:
Try this snippet:
urls.py:
from dj... | how to make site show different language(chinese and english) on google-app-engine | if you using django ,you can use the "LC_MESSAGES -->django.po"
but has any way to do this on gae ?
and how to ..
thanks
and if i only want to use django's this features, how can i import it?
| [
"Try this snippet:\nurls.py:\nfrom django.conf import settings\ntry:\n settings.configure()\nexcept:\n pass\nsettings.LANGUAGE_CODE = 'zh-tw'\nsettings.USE_I18N = True\nappdir = os.path.abspath( os.path.dirname( __file__ ) )\nsettings.LOCALE_PATHS = ( \n os.path.join( appdir, 'locale' ),\n )\nfrom django.u... | [
1,
0
] | [] | [] | [
"django",
"google_app_engine",
"python"
] | stackoverflow_0002752333_django_google_app_engine_python.txt |
Q:
How do I configure multiple Ubuntu Python installations to avoid App Engine's SSL error?
I have Karmic Koala which has Python 2.6 installed by default.
However I can't run any Python App Engine projects because they require Python 2.5 and python ssl.
To install ssl I installed python2.5-dev first while following s... | How do I configure multiple Ubuntu Python installations to avoid App Engine's SSL error? | I have Karmic Koala which has Python 2.6 installed by default.
However I can't run any Python App Engine projects because they require Python 2.5 and python ssl.
To install ssl I installed python2.5-dev first while following some instructions I found elsewhere.
sudo apt-get install libssl-dev
sudo apt-get install pytho... | [
"You should be able to simply install Ubuntu's standard copy of Python 2.5. The SSL module isn't a requirement - as the warning message says, it's necessary if you want to do certificate validation, but that's all.\nThe error you're getting with a missing 'HTTPSHandler' is probably due to installing a version of Py... | [
2,
2
] | [] | [] | [
"google_app_engine",
"python",
"ssl",
"ubuntu_9.10"
] | stackoverflow_0002748963_google_app_engine_python_ssl_ubuntu_9.10.txt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.