Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
4,505,097
2010-12-22T00:01:00.000
2
0
0
0
python,wxpython,wxwidgets
4,510,733
4
false
0
1
In addition to what these fellows are saying, you might also want to try EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW. I think these are fired when you move the mouse into and out of the frame widget, although I don't think the frame has to be in focus for those events to fire. @ Hugh - thanks for the readership!
3
1
0
With wxPython, how does one trigger an event whenever the whole window goes into/out of focus? To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the f...
wxPython Whole Window Focus Event
0.099668
0
0
2,304
4,505,097
2010-12-22T00:01:00.000
2
0
0
0
python,wxpython,wxwidgets
4,505,382
4
false
0
1
as WxPerl programmer i know there is EVT_SET_FOCUS( EVT_KILL_FOCUS( if you initialize this event by listening to the frame as first parameter it should work as in Perl since the API is almost the same
3
1
0
With wxPython, how does one trigger an event whenever the whole window goes into/out of focus? To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the f...
wxPython Whole Window Focus Event
0.099668
0
0
2,304
4,505,097
2010-12-22T00:01:00.000
5
0
0
0
python,wxpython,wxwidgets
4,521,758
4
true
0
1
The correct answer for this case is to use an EVT_ACTIVATE handler bound to the frame. There will be an event whenever the frame is activated (brought into the foreground relative to other windows currently open) or deactivated. You can use the event object's GetActive method to tell which just happened.
3
1
0
With wxPython, how does one trigger an event whenever the whole window goes into/out of focus? To elaborate, I'm building a serial terminal GUI and would like to close down the connection whenever the user doesn't have my application selected, and re-open the connection whenever the user brings my app back into the f...
wxPython Whole Window Focus Event
1.2
0
0
2,304
4,505,170
2010-12-22T00:20:00.000
0
0
0
0
python,mysql,database,optimization,csv
4,505,300
5
false
0
0
How about some key-value storages like MongoDB
3
2
0
I have a CSV file which is about 1GB big and contains about 50million rows of data, I am wondering is it better to keep it as a CSV file or store it as some form of a database. I don't know a great deal about MySQL to argue for why I should use it or another database framework over just keeping it as a CSV file. I am b...
50 million+ Rows of Data - CSV or MySQL
0
1
0
1,161
4,505,170
2010-12-22T00:20:00.000
3
0
0
0
python,mysql,database,optimization,csv
4,505,218
5
true
0
0
I would say that there are a wide variety of benefits to using a database over a CSV for such large structured data so I would suggest that you learn enough to do so. However, based on your description you might want to check out non-server/lighter weight databases. Such as SQLite, or something similar to JavaDB/Derby....
3
2
0
I have a CSV file which is about 1GB big and contains about 50million rows of data, I am wondering is it better to keep it as a CSV file or store it as some form of a database. I don't know a great deal about MySQL to argue for why I should use it or another database framework over just keeping it as a CSV file. I am b...
50 million+ Rows of Data - CSV or MySQL
1.2
1
0
1,161
4,505,170
2010-12-22T00:20:00.000
1
0
0
0
python,mysql,database,optimization,csv
4,505,180
5
false
0
0
Are you just going to slurp in everything all at once? If so, then CSV is probably the way to go. It's simple and works. If you need to do lookups, then something that lets you index the data, like MySQL, would be better.
3
2
0
I have a CSV file which is about 1GB big and contains about 50million rows of data, I am wondering is it better to keep it as a CSV file or store it as some form of a database. I don't know a great deal about MySQL to argue for why I should use it or another database framework over just keeping it as a CSV file. I am b...
50 million+ Rows of Data - CSV or MySQL
0.039979
1
0
1,161
4,506,008
2010-12-22T03:47:00.000
1
0
1
0
python
4,506,023
4
true
0
0
The common Python platforms all support directory and file names of 32 characters or more, but I personally feel that if you find yourself breaking 11 characters often that you need to rethink things.
4
4
0
PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a...
How important is it to use short names for Python packages and modules?
1.2
0
0
356
4,506,008
2010-12-22T03:47:00.000
0
0
1
0
python
4,509,044
4
false
0
0
Long names make it easy to make stupid typing mistakes later on. Any modern computer shouldn't have a problem with long filenames, but it's good practice to pick short, descriptive names. Abbreviations are your friend, especially when you like knowing what a function does off the bat,etc.
4
4
0
PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a...
How important is it to use short names for Python packages and modules?
0
0
0
356
4,506,008
2010-12-22T03:47:00.000
1
0
1
0
python
4,506,409
4
false
0
0
The issue is with old(er) file systems (used before Windows 95 and fat16) that don't support names larger than, say, 32 characters (it varies with the file system). It's only an issue if your scripts need to run on old computers.
4
4
0
PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a...
How important is it to use short names for Python packages and modules?
0.049958
0
0
356
4,506,008
2010-12-22T03:47:00.000
2
0
1
0
python
4,506,026
4
false
0
0
If you need to make sure your code works on DOS, use 8 characters. :p Otherwise, it's a free world. But nobody likes to type insanely long strings. (See powershell = fail). So use your best judgement, and be reasonable.
4
4
0
PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry a...
How important is it to use short names for Python packages and modules?
0.099668
0
0
356
4,510,903
2010-12-22T15:50:00.000
5
0
0
0
python,message-queue,gearman
4,745,861
3
true
0
0
As far as i have been able to tell from the docs and using gearman with PHP, the only way to clear the job queue is to restart to the gearmand job server. If you are using persistent job queues, you will also need to empty whatever you are using as the persistent storage, if this is DB storage, you will need to empty t...
1
10
0
Is it possible to empty a job queue on a Gearman server? I am using the python driver for Gearman, and the documentation does not have any information about emptying queues. I would imagine that this functionality should exist, possibly, with a direct connection to the Gearman server.
Is it possible to empty a job queue on a Gearman server
1.2
0
1
11,464
4,512,329
2010-12-22T18:23:00.000
0
0
0
0
python,django,geolocation,geoip
9,200,451
2
false
1
0
Have it such that whenever you add a city to your database, a piece of code is run (off-line) that calculates the closest city to every city that you have. You can have each city point to another city as its closest city with a foreignkey. Now that you have everything pre-calculated, whenever there is a live request, w...
1
4
0
I have a website with a limited number of cities in the database, and need to show the user the nearest city to his current location. I can get the location by MaxMind API, but I want to get the nearest city in my database to user city. For example, if I have these cities in the database: Los Angeles, San Francisco and...
Best way to get user nearest city? Python/Django
0
0
0
4,549
4,512,445
2010-12-22T18:36:00.000
0
0
1
1
python,setuptools,external-dependencies
4,703,614
2
false
0
0
Depending on what you need wget for, have you considered writing your own wget-equivalent in python, using the urllib or urllib2 modules? Then you'll have something that is both cross-platform and under your control, and you'll break your dependency on wget. Look at the urlretrieve method.
1
1
0
I'm trying to make a distributable egg with setuptools and my program depends on wget being present, which obviously isn't available in PyPi. I have a little script which checks for the presence of wget, asking the user to install it and returning -1 if it isn't installed, or returning 0 if it is installed. I'd like...
How to specify a condition on which to complete installation with python setuptools
0
0
0
203
4,513,083
2010-12-22T19:47:00.000
3
0
0
0
javascript,python,unicode,escaping
4,513,304
2
false
1
0
eventually what I did is changed the client side from escape(text) to urlEncodeComponent(text) and then in the python side used: request.encoding = 'UTF-8' text = unicode(request.GET.get('text', None)) Not sure this is the best thing to do, but it works in English and Hebrew
1
0
0
what is the right way to do it if the URL has some unicode chars in it, and is escaped in the client side using javascript ( escape(text) )? For example, if my url is: domain.com/?text=%u05D0%u05D9%u05DA%20%u05DE%u05DE%u05D9%u05E8%u05D9%u05DD%20%u05D0%u05EA%20%u05D4%u05D8%u05E7%u05E1%u05D8%20%u05D4%u05D6%u05D4 I tried:...
How to convert unicode escape sequence URL to python unicode?
0.291313
0
1
1,994
4,514,198
2010-12-22T22:13:00.000
4
0
0
0
python,django,django-urls,subdomain
4,514,284
1
true
1
0
This is definitely possible - you'll need to tweak your configuration files so that subdomain requests are sent to that URL instead of the root of your app, and then you should be good to go (use request.get_host() to retrieve the domain you're being called at).
1
2
0
I have a Django project and I wanted to map a URL to handle subdomains. If there is a subdomain then it should call a function with the subdomain as a parameter. Is this possible? If not then what would be the best way to tell what the subdomain of a request is? Thanks
Django Subdomain URL Dispatch
1.2
0
0
1,219
4,514,389
2010-12-22T22:41:00.000
0
0
0
0
iphone,python,android
4,514,409
5
false
1
1
Python is a good beginning language, but you need to ensure that you do more than just course work. Why not just run through tutorials on Android development right off the bat? If you are worried about wasting time by not using Java immediately, then why not just start there?
2
1
0
Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing languag...
Beginner's Language app
0
0
0
352
4,514,389
2010-12-22T22:41:00.000
1
0
0
0
iphone,python,android
4,514,481
5
false
1
1
Learn to program first before learning how to develop for the iPhone. That will give you a much better chance at success. Python a perfectly good language for learning to program, especially in the context of an Intro to CS course environment. But any intro programming language environment will do (even one designed...
2
1
0
Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites. I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing languag...
Beginner's Language app
0.039979
0
0
352
4,515,135
2010-12-23T01:20:00.000
4
0
1
0
.net,clr,ironpython,dynamic-language-runtime,boo
4,516,036
2
true
0
0
The DLR basically brings 3 things to the party: An extended set of expression trees (first introduced w/ LINQ) that enable compiling complete programs. These provide a much easier way to generate code than generating IL directly - it gets rid of many cases of being able to generate invalid IL and turns many more cas...
1
5
0
I'm just starting to try to learn more about the .Net VM underpinnings, and am immediately thrown off by something. I know there's this new thing called the DLR that allows for all the dynamic stuff in C# and the running of the IronX languages. But now I'm reading about this language called Boo, and apparently it has...
The DLR, Boo, and the JVM
1.2
0
0
658
4,516,007
2010-12-23T05:06:00.000
-1
0
0
0
python,opencv,computer-vision
4,516,073
4
false
0
0
Perhaps the documentation is wrong and you have to use cv.cvSize instead of cv.CvSize ? Also, do a dir(cv) to find out the methods available to you.
3
7
1
I have installed the official python bindings for OpenCv and I am implementing some standard textbook functions just to get used to the python syntax. I have run into the problem, however, that CvSize does not actually exist, even though it is documented on the site... The simple function: blah = cv.CvSize(inp.width...
CvSize does not exist?
-0.049958
0
0
7,873
4,516,007
2010-12-23T05:06:00.000
8
0
0
0
python,opencv,computer-vision
6,534,684
4
false
0
0
It seems that they opted to eventually avoid this structure altogether. Instead, it just uses a python tuple (width, height).
3
7
1
I have installed the official python bindings for OpenCv and I am implementing some standard textbook functions just to get used to the python syntax. I have run into the problem, however, that CvSize does not actually exist, even though it is documented on the site... The simple function: blah = cv.CvSize(inp.width...
CvSize does not exist?
1
0
0
7,873
4,516,007
2010-12-23T05:06:00.000
0
0
0
0
python,opencv,computer-vision
5,974,122
4
false
0
0
The right call is cv.cvSize(inp.width/2, inp.height/2). All functions in the python opencv bindings start with a lowercased c even in the highgui module.
3
7
1
I have installed the official python bindings for OpenCv and I am implementing some standard textbook functions just to get used to the python syntax. I have run into the problem, however, that CvSize does not actually exist, even though it is documented on the site... The simple function: blah = cv.CvSize(inp.width...
CvSize does not exist?
0
0
0
7,873
4,516,459
2010-12-23T06:42:00.000
0
0
0
1
python,wxpython,application-settings
4,516,525
3
false
0
0
On linux, there's really not a standard way. A lot of programs, especially newer python programs I've seen, use ~/.config/appname/. Of course the older ones like bash, vi, etc just add a hidden file in ~/. It depends, what kind of settings are these? Those are obviously user run programs. System programs generally sto...
2
4
0
I'm writing an application in python (using wxPython for the gui) and I'm looking for a platform independent way to decide where to store application settings files. On linux systems, where is it customary to store application settings files? How about on Mac, and Windows (all modern versions)? Ideally I'd like t...
Where should settings files be stored?
0
0
0
366
4,516,459
2010-12-23T06:42:00.000
6
0
0
1
python,wxpython,application-settings
4,520,533
3
true
0
0
wxPython has your back. You want wx.StandardPaths. There's a good example included with the wxPython demo.
2
4
0
I'm writing an application in python (using wxPython for the gui) and I'm looking for a platform independent way to decide where to store application settings files. On linux systems, where is it customary to store application settings files? How about on Mac, and Windows (all modern versions)? Ideally I'd like t...
Where should settings files be stored?
1.2
0
0
366
4,517,265
2010-12-23T09:11:00.000
3
1
0
0
python,twitter,python-twitter
4,518,740
1
true
0
0
Twitter doesn't preserve the date a friendship or follow is created, and it doesn't return it in the API. Going forward you can query friends/ids and followers/id every day and record any new relationships with the current date in a database.
1
1
0
is there a way to get the date of friendship creation for both my friends and followers in twitter? especially for python-twitter....
can i get date of friendship in twitter?
1.2
0
1
316
4,517,397
2010-12-23T09:26:00.000
1
0
0
1
python,pylons
4,517,414
2
true
0
0
Don't use print statements, use the logging module. We can't help you without knowing the setup of the server.
2
1
0
I am running Pylons on my local machine with paster, and on a Debian server using WSGI. I want to add some print statements to debug a problem: am not a Pylons or Python expert. On my local machine this works fine: print statements go to the terminal. On the server, the statements don't print to the log files: instead ...
Print statements on server give IOError: failed to write data
1.2
0
0
1,041
4,517,397
2010-12-23T09:26:00.000
3
0
0
1
python,pylons
4,517,657
2
false
0
0
It's wrong for a WSGI application to use sys.stdout or sys.stderr. If you want to spit debug to a server error log, use environ['wsgi.errors'].write().
2
1
0
I am running Pylons on my local machine with paster, and on a Debian server using WSGI. I want to add some print statements to debug a problem: am not a Pylons or Python expert. On my local machine this works fine: print statements go to the terminal. On the server, the statements don't print to the log files: instead ...
Print statements on server give IOError: failed to write data
0.291313
0
0
1,041
4,520,476
2010-12-23T16:13:00.000
0
0
0
0
wxpython
4,520,749
1
false
1
0
Ctrl+C > Ctrl+x > Ctrl+v Basic window command.
1
1
0
How to make copy,cut and paste in popup menu???
Copy,Cut and Paste
0
0
0
532
4,520,851
2010-12-23T17:01:00.000
5
0
0
1
python,emacs,osx-leopard
4,520,888
1
true
0
0
While in python-mode, hit C-c ! or do an M-x py-shell RET. Should work with defaults.
1
2
0
I have emacs and python working on OSX, but I'd like to get a python interpreter working in a split window so I can view output as I code. Is this possible? thanks
How to set up Python interpreter in Emacs on OS X?
1.2
0
0
506
4,521,124
2010-12-23T17:38:00.000
2
0
0
0
python,django
4,521,206
1
true
1
0
No. See 'supported modules' in the Pyjamas docs.
1
2
0
I need to write a small web app that does xml parsing on the client browser I am considering pyjamas as the front end framework and django for the backend. I understand that with pyjamas one can code in python and javascript is automatically generated my question is: can I use external python libraries such as pyxml to...
using pyxml library pyjamas
1.2
0
0
222
4,521,258
2010-12-23T18:03:00.000
3
0
1
0
python,django,pydev,virtualenv
31,399,986
4
false
1
0
Window -> Preferences -> PyDev -> Editor -> Code Analysis -> Undefined -> Undefined Variable From Import -> Ignore Then try to close and reopen eclipse again, which worked for me.
3
1
0
I'm using virtualenv for Django project. From command line I can import modules hashlib and zipfile. But PyDev is reporting unresolved import for those two. (os, sys and email are working). When I copy zipfile.py and zipfile.pyc (and same for hashlib) to virtualenv lib's folder I can import modules, but I get errors th...
PyDev Undefined variable from import error
0.148885
0
0
11,564
4,521,258
2010-12-23T18:03:00.000
0
0
1
0
python,django,pydev,virtualenv
61,027,786
4
false
1
0
Right Click on your module name >> Py Dev >> Remove Error Markers All my red cross false errors from editors vanished!
3
1
0
I'm using virtualenv for Django project. From command line I can import modules hashlib and zipfile. But PyDev is reporting unresolved import for those two. (os, sys and email are working). When I copy zipfile.py and zipfile.pyc (and same for hashlib) to virtualenv lib's folder I can import modules, but I get errors th...
PyDev Undefined variable from import error
0
0
0
11,564
4,521,258
2010-12-23T18:03:00.000
1
0
1
0
python,django,pydev,virtualenv
4,521,311
4
false
1
0
I'd start by removing / re-adding the PyDev Interpreter. I've also seen instances where, on my initial launch of Eclipse the PyDev plugin will fail to load some of my modules (most commonly the wx module) and give me a raft of unresolved import errors. Restarting Eclipse (from the file menu, not closing and reopening...
3
1
0
I'm using virtualenv for Django project. From command line I can import modules hashlib and zipfile. But PyDev is reporting unresolved import for those two. (os, sys and email are working). When I copy zipfile.py and zipfile.pyc (and same for hashlib) to virtualenv lib's folder I can import modules, but I get errors th...
PyDev Undefined variable from import error
0.049958
0
0
11,564
4,521,460
2010-12-23T18:35:00.000
1
0
0
0
python,django,web-hosting
4,521,483
4
false
1
0
Yes, but if they only support Python via CGI then your application will be very, very slow. Best is WSGI, then FastCGI, then mod_python.
2
0
0
I'm trying to learn python/django, these are installed on my desktop computer and all the examples run fine. My question is: If a webhosting service supports python (2.4), does the webhosting service supports django by default? Thanks guys.
Does any webhosting service that supports python also supports django?
0.049958
0
0
323
4,521,460
2010-12-23T18:35:00.000
0
0
0
0
python,django,web-hosting
4,521,513
4
false
1
0
Not necessarily.Many web hosting companies(shared) claim to offer django but this is a big lie.Case in point,a2hosting claims to have django but don't offer it;its disallowed.I tried to compile my own python and install django and found out that that path is also closed. Django is memory intensive and will only work on...
2
0
0
I'm trying to learn python/django, these are installed on my desktop computer and all the examples run fine. My question is: If a webhosting service supports python (2.4), does the webhosting service supports django by default? Thanks guys.
Does any webhosting service that supports python also supports django?
0
0
0
323
4,522,026
2010-12-23T19:56:00.000
3
0
1
1
python,file-io,line-endings
4,522,035
2
true
0
0
It's a non-issue, Python is smart like that. It handles line endings across platforms very well.
1
2
0
I am writing a small script that will need to read and write to text files on Windows and Linux and perhaps Mac even. The script will be used by users on all perhaps all of these platforms (Windows for sure) and interchangeably - so a user who wrote to a file X on Windows, may read the file on Linux with the script. Wh...
Line endings and reading and writing to text files
1.2
0
0
573
4,522,218
2010-12-23T20:24:00.000
12
0
0
0
pygtk,python
4,522,244
2
true
0
0
Define functions or classes for your business logic in one module, and define your presentation in another, using those functions to get your presentation. You should almost entirely be using functions and classes from the main module in the GUI module. You should do the same thing for your CLI. That way, you can have ...
1
14
0
What would be the best way of separating program logic to the GUI code? I wanted different GUI (GTK, KDE, CLI) code using the same program logic. I was thinking of using different python module (winecellar-common, winecellar-gtk, winecellar-cli) not sure how I would do this and if its the best way. *EDITED* Just to add...
Python - Separate program logic and GUI code?
1.2
0
0
4,986
4,522,434
2010-12-23T21:00:00.000
0
0
0
1
python,xml,google-app-engine,beautifulsoup,blobstore
4,522,924
4
false
1
0
It really sounds like App Engine is not the right platform for this project.
1
2
0
I'm working on an google app engine app that will have to deal with some largish ( <100 MB) XML files uploaded from a form that will exceed GAE's limits -- either taking longer than 30 seconds to upload the file, or exceeding the 10 MB request size. The current solution I'm envisioning is to upload the file to the blob...
Parsing parts of a Large XML File in App Engine using Blobstore?
0
0
0
630
4,522,748
2010-12-23T21:59:00.000
1
0
1
0
python,3d,scene
51,314,225
2
false
0
0
I would recommend Panda3D. It supports everything in the list, and is "high-level" too. The manual describes how to achieve everything needed.
1
40
0
I'm looking for an easy to use 3D scene renderer for Python. All I'm looking for is to be able to: Load a 3D scene model Render it using an orthographic camera Export the image so I can perform analysis So far the software I've found is either too low-level (like basic OpenGL bindings) or too complex (like Ogre). Any...
3D Scene Renderer for Python
0.099668
0
0
40,229
4,522,964
2010-12-23T22:36:00.000
0
1
0
0
python,audio,comparison,wav
4,523,066
2
false
0
0
If you're trying to compare something like, what words people are saying, this would have to be a fairly complex piece of code. You could directly compare them at a frequency/wave level, but you'll very rarely if ever get a match.
1
0
0
I need a python library or module or whatever that can compare a .wav file to microphone input without too too much code. Sample code would be cool too. TY!
python library to compare a .wav with mic input?
0
0
0
1,653
4,523,267
2010-12-23T23:38:00.000
1
0
0
0
python,ubuntu,numpy,virtualization,xen
4,523,953
1
true
0
0
Yes. The optimizations run in userland and so shouldn't cause any PV traps.
1
1
1
I am working on a project built on NumPy, and I would like to take advantage of some of NumPy's optional architecture-specific optimizations. If I install NumPy on a paravirtualized Xen client OS (Ubuntu, in this case - a Linode), can I take advantage of those optimizations?
NumPy Under Xen Client System
1.2
0
0
99
4,525,562
2010-12-24T09:58:00.000
1
1
0
0
python
4,525,588
3
false
0
0
You cant' upload python files and use it on any webhosting. You can use them if the host allows it. Some frameworks are Django or Pylons.
2
0
0
I'm PHP/MySQL developper I studied python well as a desktop programming two years ago but I don't use it on the web how can I use python to build dynamic web sites and easily uploads these sites to any hosting providers
how can I use python to build dynamic web sites?
0.066568
0
1
529
4,525,562
2010-12-24T09:58:00.000
1
1
0
0
python
4,525,568
3
true
0
0
there are many web frameworks such as Django & web2py , you should check them out
2
0
0
I'm PHP/MySQL developper I studied python well as a desktop programming two years ago but I don't use it on the web how can I use python to build dynamic web sites and easily uploads these sites to any hosting providers
how can I use python to build dynamic web sites?
1.2
0
1
529
4,526,762
2010-12-24T14:11:00.000
1
0
1
0
python,text,repeat
4,526,793
4
false
0
0
I would suggest looking at the NLTK toolkit. This is open source and intended for natural language teaching. as well as higher level NLP functions, it has a lot of tokenizing type of functions and collections.
2
3
0
I have a problem and I have no idea how to solve it. Please, give a piece of advice. I have a text. Big, big text. The task is to find all the repeated phrases which lenght is 3(contain of three words) in the text.
repeated phrases in the text Python
0.049958
0
0
5,180
4,526,762
2010-12-24T14:11:00.000
2
0
1
0
python,text,repeat
4,526,836
4
false
0
0
the crudest way would be to read text in a string. Do a string.split() and get individual words in a list. You could then slice list per three words, and use collections.defaultdict(int) for keeping the count. d = collections.defaultdict(int) d[phrase]+=1 as I said, its very crude. But should certainly get you started
2
3
0
I have a problem and I have no idea how to solve it. Please, give a piece of advice. I have a text. Big, big text. The task is to find all the repeated phrases which lenght is 3(contain of three words) in the text.
repeated phrases in the text Python
0.099668
0
0
5,180
4,526,906
2010-12-24T14:51:00.000
5
0
0
0
python,mootools,javascript,google-closure
4,527,494
2
false
1
0
This shouldn't be the accepted answer, but it may help a little. I've had to make a similar choice recently -- but for me it was between YUI3 and JQuery. My main priority was agility and modularity, which tipped me toward YUI3. Though a few things make me think a little every day about my choice: Code Assist in Ecl...
1
5
0
I am in a process to select javascript library for our new web application. This app is not very UI heavy but has forms, reports, search, calendars, tabs and target multiple countries like most web apps. We are a tiny team. Biggest concern is maintainability and readability of the code. We are Python programmers. Aft...
Choosing MooTools over Google closure?
0.462117
0
0
909
4,527,313
2010-12-24T16:28:00.000
1
1
1
0
python,parsing,objdump
7,283,510
2
false
0
0
The BEST solution would be to build objdump from source and make a python or other language swig wrapper that gets the output directly. You CAN do it with string parsing, but that's often buggy(read as implemented poorly). It is definitely possible to do the string parsing properly...I have a utility that relies on t...
1
3
0
I was wondering if someone here had written/uses a script which parses the output of objdump and extracts opcodes from it? I have a very very trivial implementation but I'm looking for something better. The problem I am facing with this script is simply that it does simple string parsing; this is more of a utility scri...
parsing objdump output
0.099668
0
0
4,442
4,527,958
2010-12-24T19:11:00.000
0
0
1
0
python,windows,linux,virtualenv
70,587,915
6
false
1
0
In windows: Press Windows (or Windows+R) and then type “cmd”: Run the Command Prompt in normal mode. cd C:\Users\user\Desktop\UserProjectName> pip install virtualenv For Create a venv run this virtualenv -p python3 venv Activate virtualenv venv\Scripts\activate It will look like this (venv) C:\Users\user\Desktop\Use...
2
60
0
I'm using VirtualEnv on Windows XP. I'm wondering if I have my brain wrapped around it correctly: I ran virtualenv ENV and it created C:\WINDOWS\system32\ENV. I then changed my PATH variable to include C:\WINDOWS\system32\ENV\Scripts instead of C:\Python27\Scripts. Then, I checked out Django into C:\WINDOWS\system32\EN...
Python virtualenv questions
0
0
0
107,968
4,527,958
2010-12-24T19:11:00.000
3
0
1
0
python,windows,linux,virtualenv
55,598,306
6
false
1
0
on Windows I have python 3.7 installed and I still couldn't activate virtualenv from Gitbash with ./Scripts/activate although it worked from Powershell after running Set-ExecutionPolicy Unrestricted in Powershell and changing the setting to "Yes To All". I don't like Powershell and I like to use Gitbash, so to activate...
2
60
0
I'm using VirtualEnv on Windows XP. I'm wondering if I have my brain wrapped around it correctly: I ran virtualenv ENV and it created C:\WINDOWS\system32\ENV. I then changed my PATH variable to include C:\WINDOWS\system32\ENV\Scripts instead of C:\Python27\Scripts. Then, I checked out Django into C:\WINDOWS\system32\EN...
Python virtualenv questions
0.099668
0
0
107,968
4,528,403
2010-12-24T21:28:00.000
9
0
1
0
python,del
4,528,431
2
false
0
0
Any code that's well organized in functions, classes and methods doesn't need del except in exceptional circumstances. Aim to build your apps well factored from the start by using more functions and methods, avoid reusing variable names, etc. The use of a del statement is OK - it doesn't lead to any trouble, I use it ...
1
30
0
I tend to use it whenever I am working on a prototype script, and: Use a somewhat common variable (such as fileCount), and Have a large method (20+ lines), and Do not use classes or namespaces yet. In this situation, in order to avoid potential variable clash, I delete the bugger as soon as I am done with it. I know,...
In Python, is use of `del` statement a code smell?
1
0
0
6,554
4,528,915
2010-12-25T01:02:00.000
1
0
0
0
python
4,528,928
3
false
1
0
I don't know if Python natively supports XPath, but if it does, you should do some research on that subject. Another alternative solution would be regular expressions.
1
1
0
After reading this forum I am not sure which method is best to extract sections of data into a CSV file I.e. Python/Beautiful Soup/html2text. Because of the large number of files, I want to try and write a script I can run within the Terminal. Output: One CSV file, with lines of text and five columns of data. e.g. firs...
Best method of extracting text from multiple html files into one CSV file
0.066568
0
0
2,299
4,529,042
2010-12-25T02:01:00.000
1
0
0
0
javascript,python,websocket
4,529,059
1
true
0
0
You need to read up on socket programming in general. Reading some data from a websocket does not mean you've received everything the other side wanted to send. Ideally you'd prefix your messages with a header that contains the size of the payload. Then after you read the header (say, terminated with LF, or being a fix...
1
1
0
I'm still trying to figure out WebSockets. I'm sending over data from the javascript client to the python server as JSON strings, but they arrive fragmented. How can I make sure I've received the entire message before I start to parse it?
How do I make sure a message gets to its destination using WebSockets?
1.2
0
1
102
4,529,913
2010-12-25T09:37:00.000
1
1
0
0
python,google-app-engine,load-testing
4,536,343
4
false
1
0
You can get a free linux micro instance from EC2 and then run ab (apache benchmark) with lots of requests. You can change number of requests, concurrent requests and you can even launch multiple EC2 instances from different data centers.
2
2
0
I am building a GAE site that uses AJAX/JSON for almost all its tasks including building the UI elements, all interactions and client-server requests. What is a good way to test it for highloads so that I could have some statistics about how much resources 1000 average users per some period of time would take. I think ...
How to test my GAE site for performance
0.049958
0
1
193
4,529,913
2010-12-25T09:37:00.000
0
1
0
0
python,google-app-engine,load-testing
4,547,737
4
false
1
0
If you have the budget for it, a professional load testing tool will save you a lot of time and produce more accurate results. Some of those tools handle AJAX apps better than others. I will naturally recommend our product (Web Performance Load Tester) and one of our engineers will help you get it working with your si...
2
2
0
I am building a GAE site that uses AJAX/JSON for almost all its tasks including building the UI elements, all interactions and client-server requests. What is a good way to test it for highloads so that I could have some statistics about how much resources 1000 average users per some period of time would take. I think ...
How to test my GAE site for performance
0
0
1
193
4,529,991
2010-12-25T10:17:00.000
0
0
0
0
python,wxpython
4,530,426
2
false
0
1
If you are using the native controls, which wx tends to use, then you probably can't.
2
2
0
I have a wx.FileDialog (with the wx.FD_OPEN flag) & I would like to know if I can (& how) I could change the button in the bottom right of the FileDialog from "Open" to "Create" or "Delete", etc. What I am doing is I have a button with the text "Delete Portfolio", when pressed it opens a FileDialog & allows the user to...
wxPython: Change a buttons text in a wx.FileDialog
0
0
0
691
4,529,991
2010-12-25T10:17:00.000
1
0
0
0
python,wxpython
4,539,977
2
false
0
1
Yeah, I agree with Arafangion. wxPython uses the native widgets and can only manipulate them in whatever way that native widgets allow. You would need to create a custom dialog to do this.
2
2
0
I have a wx.FileDialog (with the wx.FD_OPEN flag) & I would like to know if I can (& how) I could change the button in the bottom right of the FileDialog from "Open" to "Create" or "Delete", etc. What I am doing is I have a button with the text "Delete Portfolio", when pressed it opens a FileDialog & allows the user to...
wxPython: Change a buttons text in a wx.FileDialog
0.099668
0
0
691
4,530,183
2010-12-25T11:51:00.000
0
0
1
1
python,google-app-engine,virtualenv,pip
4,530,218
2
false
1
0
If you use easy_install instead of pip you can run it with the --install-dir argument to specify a non-default installation directory.
1
0
0
Usually I would use virtualenv and pip for deployment of web applications. With Google App Engine this doesn't work, because all import statement are relative to directory of the application. The most common approach I saw was to simply copy the packages from site-packages to the directory of the application. This invo...
Python Eggs on Google App Engine
0
0
0
883
4,530,323
2010-12-25T12:58:00.000
1
1
0
0
python,perl,email
4,530,368
4
false
0
0
"reveive" is not a word. I'm really not sure if you mean "receive" or "retrieve". If you mean "receive" then you probably do want an SMTP server, despite your claim. An SMTP server running on a computer is responsible for listening for network requests from other SMTP servers that wish to deliver mail to that computer...
1
1
0
I've checked so many articles, but can't find one for server to server email receiving. I want to write a program or some code just acts as an email receiver, not SMTP server or something else. Let's suppose I have a domain named example.com, and a gmail user user@gmail.com sends me an email to admin@example.com, or a ...
How to receive an email on server? Better using Python or Perl
0.049958
0
1
2,845
4,530,763
2010-12-25T16:21:00.000
0
1
1
0
python,matlab,module,import
4,531,603
2
false
0
0
I also consider myself a MATLAB user who is converting to Python. "ipython -pylab" (from a unix shell or mac terminal shell) does a pretty good job of setting up the variables and functions I use for MATLAB-type computing. Also - although I found it a pain to install on my mac - I like Spyder for its resemblance to ...
1
4
0
Coming from a Matlab background, I wanted to write small functions in python, and test them individually in the interpreter. However, every time I start the interpreter, I have to import all the modules. In contrast, with matlab all you do is give it the path to the directory and you can execute any matlab function thr...
Automatically import all modules in the current directory into python interactive interpreter
0
0
0
890
4,530,901
2010-12-25T17:02:00.000
3
0
0
0
python,pyqt,pygame
4,562,183
3
true
0
1
if you want just a simple animation and want to finish your game fast. use the pyqt's scene view. refer to (Rapid GUI programming using python and pyqt) book if you want to learn more about scene view.
2
1
0
my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so ...
what framework to use for python card game?
1.2
0
0
2,261
4,530,901
2010-12-25T17:02:00.000
0
0
0
0
python,pyqt,pygame
4,562,270
3
false
0
1
Both pygame and pyqt will work for what you want to do, but I'd recommend pyqt: you'll be able to use standard widgets (like listboxes, textboxes, menus, buttons, ...). I've never worked with pyqt myself, but I image that drag 'n drop is something built-in, which will be really useful for a card game. With pygame on th...
2
1
0
my question is quite simple, but I can't move on until I solve it. I want to develop a card game, something like Magic the Gathering. I suppose there will be just a little of animation, but much work with images, image transformation and special rendering - some kind of things, that every unit has now attack plus 2 so ...
what framework to use for python card game?
0
0
0
2,261
4,531,564
2010-12-25T20:25:00.000
4
0
1
0
python,multithreading,events,queue
4,531,579
1
true
0
0
One way is to have a queue for each thread, and the function that broadcasts the information is responsible for inserting the message into the queue of every thread. This is similar to the way message queues work in Windows, for example. Each thread that does GUI operations has an associated message queue, independent ...
1
4
0
I need to send information to every thread that's running in my program, and every thread has to process that information. I can't do it using a regular queue, because that way once one thread removes the data from the queue all the other threads won't be able to see it anymore. What's the best way of achieving this?
Send one-way message to all threads in Python
1.2
0
0
1,838
4,531,805
2010-12-25T21:49:00.000
1
0
1
1
python,django,ubuntu,virtualenv,virtualenvwrapper
4,531,826
2
true
0
0
Well, is virtualev installed in the same python as virtualenvwrapper? It requires installing virtualenv separately.
2
1
0
can't get virtualenvwrapper to work on Ubuntu 10.10 desktop. mkvirtualenv test_env returns: ERROR: virtualenvwrapper could not find virtualenv in your path I followed the install instructions to the letter. Any ideas?
virtualenvwrapper on Ubuntu 10.10 - Python
1.2
0
0
1,599
4,531,805
2010-12-25T21:49:00.000
3
0
1
1
python,django,ubuntu,virtualenv,virtualenvwrapper
12,169,613
2
false
0
0
I got that same message when installing virtualenvwrapper using the MacPorts package manager (version py27-virtualenvwrapper @3.2_0). I had virtualenv installed, also via MacPorts. The only way I could get it to work was adding the bash environmental: export VIRTUALENVWRAPPER_VIRTUALENV=virtualenv-2.7 to my .profile f...
2
1
0
can't get virtualenvwrapper to work on Ubuntu 10.10 desktop. mkvirtualenv test_env returns: ERROR: virtualenvwrapper could not find virtualenv in your path I followed the install instructions to the letter. Any ideas?
virtualenvwrapper on Ubuntu 10.10 - Python
0.291313
0
0
1,599
4,532,008
2010-12-25T22:51:00.000
0
0
0
0
python,image,pyglet
5,832,879
3
false
0
1
It seems there is no easy way to do this in pyglet. So I've given up on using pyglet.
1
1
0
I'm new to pyglet. I'd like to change a pixel from black to white at each on_draw iteration. So after 1000 iterations, there should be exactly 1000 white pixels in the window. However, I'd like to avoid calling 1000 draw operations in on_draw for that. So I'd like to create an image, do an RGB putpixel on the image, an...
putpixel with pyglet
0
0
0
1,298
4,532,147
2010-12-25T23:36:00.000
9
0
1
0
python,syntax,python-2.x
4,532,152
3
false
0
0
This redirects print to a file (in this case, dbfile). the >> is just a special syntax used for this.
1
17
0
I was wondering what does print >> dbfile, key mean in python. What is the >> supposed to do?
Meaning of >> in print statement
1
0
0
3,502
4,533,229
2010-12-26T08:41:00.000
0
0
1
0
python,ide,windows-applications
4,533,239
3
false
0
0
I like WingIDE for python. There is an eclipse version too.
1
6
0
I am used to Windows application development using C# .Net. Now that I got interested in Python I need to know the best way to create a Windows application that has stuffs like minimizing to System tray, nice ide like visual studio that has GUI way of developing apps. Any suggestions pls?
Windows application using Python
0
0
0
13,732
4,533,879
2010-12-26T12:52:00.000
3
0
0
0
python
4,534,157
2
false
0
0
It is unreasonable to except that someone will post a complete solution for your problem. Here are the steps, just start by trying to complete them, post questions if you get stuck. very generally speaking: Get the content of the site (use the urllib2 to fetch the page) Parse the recaptcha image link and download the ...
1
3
0
I'm trying to write a simple program that logs on to a site, does something and logs out. The problem is that the login form has three inputs: username, password and a recaptcha. I input all of them manually. The problem is I don't know how to display the captcha image or how to send the text. Can someone explain how t...
Handling reCaptcha forms?
0.291313
0
1
799
4,533,884
2010-12-26T12:53:00.000
-1
0
1
0
python
4,533,891
4
false
0
0
No, it is not. On the other hand, you can use xreadlines to have faster code.
3
6
0
I got downvoted for an answer using file.readlines. The critic said that using readlines is crap code (along with other very rude statements). Is it so bad?
Is using readlines in Python bad code?
-0.049958
0
0
6,336
4,533,884
2010-12-26T12:53:00.000
9
0
1
0
python
4,533,893
4
false
0
0
I assume that the problem was the fact that readlines() loads the whole file into memory, which - theoretically - can be a lot. A lazy approach (iterating over the file and reading progressively as needed) is indeed better in terms of memory usage. Not sure about efficiency, though.
3
6
0
I got downvoted for an answer using file.readlines. The critic said that using readlines is crap code (along with other very rude statements). Is it so bad?
Is using readlines in Python bad code?
1
0
0
6,336
4,533,884
2010-12-26T12:53:00.000
6
0
1
0
python
4,533,900
4
true
0
0
No, readlines is fine. You just have to remember, that the whole file is stored in memory at one point.
3
6
0
I got downvoted for an answer using file.readlines. The critic said that using readlines is crap code (along with other very rude statements). Is it so bad?
Is using readlines in Python bad code?
1.2
0
0
6,336
4,534,684
2010-12-26T17:14:00.000
0
0
0
0
python,mongodb
50,201,839
4
false
1
0
There is no stable support for mongodb using django framework. I tried using mongoengine, but unlike models, provided for admin in django framework, there is no support for mongoengine. Correct if I am wrong.
1
17
0
I'm looking to write a small web app to utilise a dataset I already have stored in a MongoDB collection. I've been writing more Python than other languages lately and would like to broaden my repertoire and write a Python web app. It seems however that most if not all of the current popular Python web development fram...
Python Web Framework with best Mongo support
0
1
0
9,196
4,535,359
2010-12-26T20:47:00.000
5
0
0
0
python,arrays,matlab,syntax
4,535,370
1
true
0
0
someArray[:,0,0] is the Python NumPy equivalent of MATLAB's someArray(:,1,1). I've never figured out how to do it in pure Python, the colon slice operation is a total mystery to me with lists-of-lists.
1
4
1
What is the equivalent to someArray(:,1,1) in python from Matlab? In python someArray[:][0][0] produces a different value
Colon difference in Matlab and Python
1.2
0
0
793
4,535,540
2010-12-26T21:45:00.000
14
0
0
1
python,django,asynchronous,celery,cython
4,536,676
2
true
1
0
Celery would be perfect for this. Since what you're doing is relatively simple (read: you don't need complex rules about how tasks should be routed), you could probably get away with using the Redis backend, which means you don't need to setup/configure RabbitMQ (which, in my experience, is more difficult). I use Redis...
1
8
0
I have a bunch of Django requests which executes some mathematical computations ( written in C and executed via a Cython module ) which may take an indeterminate amount ( on the order of 1 second ) of time to execute. Also the requests don't need to access the database and are all independent of each other and Django. ...
Django Asynchronous Processing
1.2
0
0
9,924
4,535,895
2010-12-26T23:43:00.000
0
0
1
0
python,version,global-variables
4,535,921
3
false
0
1
Personally, I wouldn't do it manually this way. I'd save my code in Subversion and let it maintain the revision numbers for me.
1
5
0
I have a PyQt application that reads and writes data files. I am including a 'version number' in each file written. This is a simple number similar to: 1.2 or something (major and minor versions). I am doing this so that I can change the format of these data files in future versions and then still correctly parse the...
Python: Best practice for including a version number in an app?
0
0
0
3,932
4,536,195
2010-12-27T01:33:00.000
0
1
1
0
python
4,536,240
5
false
0
0
I don't know about Python specifically, but I found that interview questions which involve recursion are a very effective filter. I have asked candidates to produce all the permutations of a string (and think about how to test it), and I have been asked to pseudo-code the Longest Common Subsequence.
1
19
0
I'm trying to come up with a good coding problem to ask interview candidates to solve with Python. They'll have an hour to work on the problem, with an IDE and access to documentation (we don't care what people have memorized). I'm not looking for a tough algorithmic problem - there are other sections of the interview...
Python coding test problem for interviews
0
0
0
46,812
4,536,346
2010-12-27T02:46:00.000
0
0
0
0
javascript,jquery,python,css,django
4,536,356
2
false
1
0
I usually just pass in the selected tab in the context in each view that utilizes the tabs, and select the tab in a common header based on that value.
1
0
0
I've been trying to create a tabbed interface using Django. The current effort (which works fine) is having each template have the header hard-coded in, with the selected tab given the "selected" CSS attribute. Of course, this is a massive violation of DRY and I'm looking to remedy it. My current idea is adding a jQuer...
Creating a Better Tabbed Interface in Django
0
0
0
719
4,537,422
2010-12-27T08:18:00.000
1
0
0
1
python,streaming,hadoop,mapreduce,iteration
11,489,099
4
false
0
0
You needn't write another job. You can put the same job in a loop ( a while loop) and just keep changing the parameters of the job, so that when the mapper and reducer complete their processing, the control starts with creating a new configuration, and then you just automatically have an input file that is the output o...
1
3
1
I've written a simple k-means clustering code for Hadoop (two separate programs - mapper and reducer). The code is working over a small dataset of 2d points on my local box. It's written in Python and I plan to use Streaming API. I would like suggestions on how best to run this program on Hadoop. After each run of mapp...
Iterative MapReduce
0.049958
0
0
3,152
4,537,434
2010-12-27T08:21:00.000
0
0
1
0
python,web-services,rest,ruby-on-rails-3
4,537,518
2
false
0
0
Via the CRUD interface, seems the obvious solution.
2
0
0
i have a application which use rails to do the CRUD operation,it's handy now i want to write a crawler use python,after that i want to save the data to db, so my question is how to python communicate with ror program?
how to communicate with ror program in python
0
0
0
148
4,537,434
2010-12-27T08:21:00.000
1
0
1
0
python,web-services,rest,ruby-on-rails-3
4,537,524
2
false
0
0
I don't have any idea about python or rails (only grails :) but the easiest solution (if you don't want the python script to touch the DB) would be to implement a controller action for the REST PUT method in your rails application and call it from your python crawler with the crawled data. Now, all the rails controller...
2
0
0
i have a application which use rails to do the CRUD operation,it's handy now i want to write a crawler use python,after that i want to save the data to db, so my question is how to python communicate with ror program?
how to communicate with ror program in python
0.099668
0
0
148
4,537,975
2010-12-27T10:14:00.000
4
1
1
0
python,module
4,537,989
2
true
0
0
You can add it to the search path by adding the directory to the environment variable PYTHONPATH or by adding it to sys.path in your Python script. Both work; if they don't, then you're using the wrong path.
2
2
0
I meet a problem when I try to install module omniORB&omniORBpy to a system, I don't have the root permission so I use --prefix to installed them to my user dir. my question is : how can I make python load this module? I try add my user path to sys.path, but it still doesn't work. Br, J.K.
add a python module with out root permission
1.2
0
0
1,009
4,537,975
2010-12-27T10:14:00.000
1
1
1
0
python,module
4,540,025
2
false
0
0
I usually use the --user option instead of --prefix, since it installs it in ${HOME}/.local/lib/pythonx/site-packages and thus it does not require to add the path to sys.path. I think this option is available only for python 2.6 + but I am not sure. If you have to install it in an other place, then you have no choice a...
2
2
0
I meet a problem when I try to install module omniORB&omniORBpy to a system, I don't have the root permission so I use --prefix to installed them to my user dir. my question is : how can I make python load this module? I try add my user path to sys.path, but it still doesn't work. Br, J.K.
add a python module with out root permission
0.099668
0
0
1,009
4,540,089
2010-12-27T16:24:00.000
1
0
0
1
python,django,wsgi,uwsgi,gevent
4,540,187
1
false
1
0
almost all wsgi servers do that. I'm not sure what you mean. gunicorn paste cherrypy twisted.web apache with mod_wsgi werkzeug ...
1
0
0
I need to find a stable wsgi server that won't stop processing requests when client disconnect. I'm not sure if uWSGI or gunicorn would fit this criteria. Forgot to add this: I am also trying to return a response before the request gets processed. Any ideas?
WSGI server that processes request despite client disconnecting? - Python
0.197375
0
0
672
4,541,603
2010-12-27T20:29:00.000
-1
0
1
0
python,distutils
4,541,879
4
true
0
0
Having subpackages for server and client code (foo.server and foo.client) seems the best approach to me, Why? No single user (except you the developer) will ever use both sides. They're completely separate. but then how do you handle your distutils setup if you don't want the server code to be shipped along with t...
2
2
0
Suppose you have a client/server application, say a webserver component and a qt gui. How do you layout your python code? Packages foo.server and foo.client? Packages fooserver and fooclient, with both importing from foocommon? Everything together with no clear distinction? Having subpackages for server and client co...
Python client/server project code layout
1.2
0
0
513
4,541,603
2010-12-27T20:29:00.000
0
0
1
0
python,distutils
4,541,657
4
false
0
0
I like namespaces, so yes. foo.client and foo.server and foo.common and foo.anythingelsethatcanbeusedseparately. But it's all a matter of taste, really. And I'd release them as separate packages, and yes, I'd use Distribute.
2
2
0
Suppose you have a client/server application, say a webserver component and a qt gui. How do you layout your python code? Packages foo.server and foo.client? Packages fooserver and fooclient, with both importing from foocommon? Everything together with no clear distinction? Having subpackages for server and client co...
Python client/server project code layout
0
0
0
513
4,541,629
2010-12-27T20:34:00.000
4
0
1
0
python,datetime
4,541,679
9
false
0
0
datetime.datetime.now() - datetime.timedelta(0, 15 * 60) timedelta is a "change in time". It takes days as the first parameter and seconds in the second parameter. 15 * 60 seconds is 15 minutes.
1
154
0
I need to create a DateTime object that represents the current time minus 15 minutes.
How to create a DateTime equal to 15 minutes ago?
0.088656
0
0
159,763
4,541,853
2010-12-27T21:07:00.000
2
0
1
0
python,asynchronous,callback,twisted,deferred
4,541,923
4
false
0
0
Sort of, but there is no concurrency in this type of event processing. No new callback will be called until the code gets back to the event loop. So the chain of callbacks is synchronous. It's only asynchronous in the event loop. This is one caveat of this type of programming, the handlers most execute quickly, and get...
1
6
0
I'm trying to figure out how can i make my code more asynchronous using twisted. A function returns a deferred object then i add a list of callbacks the first callback will be called after the deferred function provides some result through deferred_obj.callback then, in the chain of callbacks, the first callback will ...
twisted deferred/callbacks and asynchronous execution
0.099668
0
0
11,007
4,542,014
2010-12-27T21:38:00.000
0
0
1
1
python
4,542,064
4
false
0
0
First, I'm not a Mac user, so I don't know a couple of specifics (default PATH, etc). Also, a bit of clarity - when you use the installer, it lets you customize the installation to install in a specific location - do you know where that is. If you didn't select a location, it defaults to /usr/local/bin. From Terminal,...
2
2
0
I have Python 2.6.1 which came on the Mac I have, but I'd recently downloaded and installed the disk image of 3.1.3 and I'd like to have it available in Terminal, how can I do this? For instance when I do $ python -V in Terminal I get 2.6.1. Thanks for any help.
Updated Python from disk image, want to make it available in terminal
0
0
0
151
4,542,014
2010-12-27T21:38:00.000
1
0
1
1
python
4,542,091
4
false
0
0
The default Python version in Mac OS X needs to stay the default Python version, or things will break. You want to install it alongside with Python 2. This is most likely exactly what happened, but you start Python 3 with python3.
2
2
0
I have Python 2.6.1 which came on the Mac I have, but I'd recently downloaded and installed the disk image of 3.1.3 and I'd like to have it available in Terminal, how can I do this? For instance when I do $ python -V in Terminal I get 2.6.1. Thanks for any help.
Updated Python from disk image, want to make it available in terminal
0.049958
0
0
151
4,542,344
2010-12-27T22:39:00.000
8
0
1
0
python,multithreading,variables,dictionary,locking
4,542,436
3
true
0
0
I think you misundertood this whole thread safety thing. It's not so much about variables (or variable variables - those are terrible anyway, and are just as pointless - not to say harmful - here as in every other case) but about -- for example, there are many nasty nasty ways threading can go wrong; they all come from...
1
16
0
When it comes to threading, I know you have to make sure you're not editing a variable at the same time another thread is editing it, as your changes can be lost (when incrementing a counter, for example) Does the same apply to dictionaries? Or is a dictionary a collection of variables? If every thread were to lock the...
Modifying a Python dictionary from different threads
1.2
0
0
15,760
4,542,718
2010-12-27T23:50:00.000
0
0
0
1
python,shell,emacs,ipython
4,556,760
2
false
0
0
I found a partial answer to Q1: Python-mode provides C-c C-c which can send a buffer to an already-opened Python shell (similarly C-c C-| can send a region to the shell), and if ipython.el is installed, then default python shell is set to IPython. Unfortunately, this only works for python scripts, and not for IPython ...
1
6
0
Update: The question still lacks a satisfactory answer. I would like to "send" code snippets to a IPython interpreter in Emacs 23.2 (Linux). Assuming that I have already started an IPython shell in a buffer in Emacs (e.g. using Python-mode.el and IPython.el), is there a way of selecting a region in a different buffer ...
IPython in Emacs. Quick code evaluation
0
0
0
3,753
4,543,604
2010-12-28T04:14:00.000
0
0
0
0
python,windows,web-applications
4,543,622
10
false
1
0
Pylons is extremely easy to use once you get some simple configuration set up, you'll have to have a good idea of what you want though.
4
13
0
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming fram...
Recommended python library/framework for local web app?
0
0
0
7,559
4,543,604
2010-12-28T04:14:00.000
0
0
0
0
python,windows,web-applications
4,544,013
10
false
1
0
Django comes with a built-in web server that allows you to fully test your application locally (via localhost:8080 or something of the sort). As a matter of fact, I've used it more than once to run a complete web-application locally prior to deploying it to a server. I see no reason you can't use it for your own local ...
4
13
0
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming fram...
Recommended python library/framework for local web app?
0
0
0
7,559
4,543,604
2010-12-28T04:14:00.000
0
0
0
0
python,windows,web-applications
4,544,175
10
false
1
0
chances are, you want an admin interface for basic CRUD operations on some database tables. Then Django is your best choice.
4
13
0
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming fram...
Recommended python library/framework for local web app?
0
0
0
7,559
4,543,604
2010-12-28T04:14:00.000
0
0
0
0
python,windows,web-applications
4,544,317
10
false
1
0
Any framework will do this. Django certainly will do, but since you want something smaller, I'd recommend will BFG/Pyramid, which is very lightweight, extremely extensible and flexible and fun to use. But there are loads of others, and as mentioned, the built in wsgiref is as lightweight as you get. :-)
4
13
0
I want to create a simple LOCAL web app in Python. The web server and "back-end" code will run on the same system (initially, Windows system) as the UI. I doubt it matters, but the UI will be a typical webish combo of Google Chrome, HTML, CSS, JavaScript, and jQuery. There are a TON of Python-based web programming fram...
Recommended python library/framework for local web app?
0
0
0
7,559
4,544,630
2010-12-28T08:15:00.000
-1
0
1
0
python,list
4,544,640
3
false
0
0
No, but you could use a dictionary (hash table) to achieve the same thing.
1
19
0
Is there a way to make an automatically growing list in Python? What I mean is to make a list that would grow when an index that does not yet exist is referenced. Basically the behaviour of Ruby arrays. Thanks in advance!
Automatically growing lists in Python
-0.066568
0
0
17,197
4,545,977
2010-12-28T12:21:00.000
-1
0
1
0
python,unicode,internationalization,detection
4,546,544
7
false
0
0
If you only have a limited number of possible languages, you could use a set of dictionaries (possibly only including the most common words) of each language and then check the words in your input against the dictionaries.
1
15
0
I'm faced with a situation where I'm reading a string of text and I need to detect the language code (en, de, fr, es, etc). Is there a simple way to do this in python?
Python - can I detect unicode string language code?
-0.028564
0
0
13,996
4,546,086
2010-12-28T12:38:00.000
0
0
0
0
python,urllib2,fetch,http-status-code-403,httplib2
4,570,621
3
false
0
0
:) Am trying to get quotes from NSE too ! like pythonFoo says you need additional headers. Hower only Accept is sufficient. The user-agent can say python ( stay true ! )
1
0
0
I am trying to fetch data from a webpage using urllib2. The page is visible on the browser but through the script I keep getting HTTPError: HTTP Error 403: Forbidden I also tried mimicking a browser request by changing the user-agent string but no success. Any ideas on this?
Python fetch data 403
0
0
1
893
4,547,096
2010-12-28T15:24:00.000
1
0
1
0
python,multithreading,multiprocessing
4,547,398
1
true
0
0
It really depends on the structure of your code and high level architecture of your system. If you think that whatever you are using greenlets for can be done using multiprocessing module in the Python Standard library, then you can do that. I think, if you post specific instances than you can get the specific ways to ...
1
0
0
I have some code which depends on Greenlets, and need to remove this dependency. Can anyone explain to me exactly what I'll need to do? They would preferably be replaced with threads or (better yet) processes from the multiprocessing module, but anything that relies solely on the Python standard library would be suff...
Removing code dependency on Greenlets
1.2
0
0
194
4,547,256
2010-12-28T15:49:00.000
15
0
1
0
python
4,547,270
3
true
0
0
No, you give it a name: for i in range(10): ... If you want to iterate over elements of a collection in such a way that you get both the element and its index, the Pythonic way to do it is for i,v in enumerate(l): print i,v (where l is a list or any other object implementing the sequence protocol.)
1
4
0
Is there any default Counter Variable in For loop?
Python - Default Counter Variable in For loop
1.2
0
0
15,048
4,548,000
2010-12-28T17:37:00.000
7
0
1
0
python,go
4,548,146
1
true
0
0
It's highly unlikely that you'll find a way to do such a conversion with output that is actually useful. Go is very new, and if anything it would make more sense for someone to convert the other way around.
1
3
0
Is there any program to automatically convert Go source code to Python source code?
Is there any automated conversion from Go to Python?
1.2
0
0
9,994