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
3,916,553
2010-10-12T15:50:00.000
-5
1
0
0
python,garbage-collection,root,performance
3,919,321
3
false
0
1
If your problem really is the garbage collection, try explicitly freeing your objects when you're done with them using del(). In general, this doesn't sound like a garbage collection problem, unless we're talking about terabytes of memory. I agree with S.Lott... profile your app, then bring code snippets and the result...
1
18
0
I have a problem with my python application, and I think it's related to the python garbage collection, even if I'm not sure... The problem is that my application takes a lot of time to exit and to switch to one function to the next one. In my application I handle very large dictionaries, containing thousands of large ...
Python garbage collection can be that slow?
-1
0
0
13,216
3,916,787
2010-10-12T16:15:00.000
1
0
1
0
python,ironpython,razor
3,916,880
3
false
0
0
I was at a talk by one of the guys working on IronPython and IronRuby. The general sentiment he seemed to express is that IronPython is not as up to the task of building modern ASP.NET MVC sites as IronRuby or C# are. That said, this could have changed since then. But you're comparing apples to oranges here. IronPython...
3
2
0
I have a little bit of experience with the new Razor syntax, but none with Iron Python. I was wondering do both meet the same needs? Is one favored by Microsoft over the other (or will be)? Appreciate your thoughts, as I'm toying with the idea of learning Iron Python, but if Razor can meet the same need, I probably w...
Iron Python vs Razor
0.066568
0
0
1,405
3,916,787
2010-10-12T16:15:00.000
5
0
1
0
python,ironpython,razor
3,916,814
3
false
0
0
Razor is a view engine for ASP.NET MVC 3 - so i believe it has nothing to do with the space that IronPython occupies if im wrong then i have certainly missed something
3
2
0
I have a little bit of experience with the new Razor syntax, but none with Iron Python. I was wondering do both meet the same needs? Is one favored by Microsoft over the other (or will be)? Appreciate your thoughts, as I'm toying with the idea of learning Iron Python, but if Razor can meet the same need, I probably w...
Iron Python vs Razor
0.321513
0
0
1,405
3,916,787
2010-10-12T16:15:00.000
7
0
1
0
python,ironpython,razor
3,917,668
3
true
0
0
To expand on the answer given by PaulStack: Razor is a templating engine (with a slant towards templating XML-style documents, e.g. HTML web pages) that is available as a View Engine in MVC 3 as well as the default page syntax in ASP.NET Web Pages (which is part of the WebMatrix stack). The Razor parser uses assumption...
3
2
0
I have a little bit of experience with the new Razor syntax, but none with Iron Python. I was wondering do both meet the same needs? Is one favored by Microsoft over the other (or will be)? Appreciate your thoughts, as I'm toying with the idea of learning Iron Python, but if Razor can meet the same need, I probably w...
Iron Python vs Razor
1.2
0
0
1,405
3,917,574
2010-10-12T17:56:00.000
-2
0
1
0
python,arrays,list,linked-list,python-internals
60,759,244
9
false
0
0
In CPython list is implemented as dynamic array, and therefore when we append at that time not only one macro is added but some more space is allocated so that everytime new space should not be added.
3
249
0
Is it a linked list, an array? I searched around and only found people guessing. My C knowledge isn't good enough to look at the source code.
How is Python's List Implemented?
-0.044415
0
0
121,568
3,917,574
2010-10-12T17:56:00.000
5
0
1
0
python,arrays,list,linked-list,python-internals
19,508,262
9
false
0
0
As others have stated above, the lists (when appreciably large) are implemented by allocating a fixed amount of space, and, if that space should fill, allocating a larger amount of space and copying over the elements. To understand why the method is O(1) amortized, without loss of generality, assume we have inserted a ...
3
249
0
Is it a linked list, an array? I searched around and only found people guessing. My C knowledge isn't good enough to look at the source code.
How is Python's List Implemented?
0.110656
0
0
121,568
3,917,574
2010-10-12T17:56:00.000
40
0
1
0
python,arrays,list,linked-list,python-internals
3,917,596
9
false
0
0
In CPython, lists are arrays of pointers. Other implementations of Python may choose to store them in different ways.
3
249
0
Is it a linked list, an array? I searched around and only found people guessing. My C knowledge isn't good enough to look at the source code.
How is Python's List Implemented?
1
0
0
121,568
3,919,922
2010-10-13T00:00:00.000
1
0
1
0
python,parsing
3,920,000
3
false
0
0
Regular expressions are not the way to go here. The languages already have a defined grammar, so use that.
1
5
0
Given a code base (say for example a large C or Objective-C project) I would like to analyze the sourcecode files and pick out symbols of interest. They might be class declarations, variable names or types, or method names. Is there a Python module that could help me with this? The only approach I can see going forwa...
Picking out symbols from a code base with Python
0.066568
0
0
151
3,920,842
2010-10-13T04:47:00.000
1
0
0
0
python,crash,wsgi,restart
3,923,177
2
true
1
0
I'd use your operational system's service integration to do that. For example, on debian linux, there's start-stop-daemon. On windows, there's the service management. It's the proven, well integrated way, provided by the operational system itself, to keep an application running. Just make your installation program regi...
1
0
0
i have a wsgi server which use paste,for some unkonw reason,it will often crash,so i want to has a application or just some package can help me to slove this,when it crashed automaticly kill the process and restart it.Any advice is welcome.
how to monitor python wsgi server,when it crashed restart it
1.2
0
0
829
3,920,873
2010-10-13T04:55:00.000
1
0
1
0
python,twos-complement
3,931,412
3
false
0
0
if you want to do it without converting back to a number, start from the right of the string until you find the first 1, then flip all chars to its left.
1
1
0
I am trying to add the Two's Complement to a Binary number represented with a string. Assuming the string has already been flipped, how would I go about "adding" 1 to the last character, and replacing the other characters in the string as needed? Example: 100010 is flipped to 011101, and is represented as a string. How...
Python - Applying Two's Complement to a String
0.066568
0
0
3,323
3,922,135
2010-10-13T09:02:00.000
2
0
0
1
python,process,pyqt4,pid
3,922,943
3
false
0
0
While it's not related to the way of the communication, I recommend checking out the pickle/cPickle module (which can encode objects into string streams and vice versa). Very useful.
2
12
0
I have two python applications. I need to send commands and data between them (between two processes). What is the best way to do that? One program is a daemon who should accept commands and parameters from another GUI application. How can I make daemon to monitor comands from GUI, while making it's job? I prefer solut...
How to interchange data between two python applications?
0.132549
0
0
6,055
3,922,135
2010-10-13T09:02:00.000
10
0
0
1
python,process,pyqt4,pid
3,922,174
3
true
0
0
You can use the following methods for data interchange: Socket Programming : In Qt you can access QtNetwork module. See qt assistant for examples IPC : Use shared Memory implemented in QSharedMemory class. If this application will run on unix os only, then you can try Posix based message queue etc. for data interchang...
2
12
0
I have two python applications. I need to send commands and data between them (between two processes). What is the best way to do that? One program is a daemon who should accept commands and parameters from another GUI application. How can I make daemon to monitor comands from GUI, while making it's job? I prefer solut...
How to interchange data between two python applications?
1.2
0
0
6,055
3,924,668
2010-10-13T14:19:00.000
1
0
0
0
python,web-applications,webserver,nginx
3,965,912
3
true
1
0
Available options are: apache + mod_python apache + mod_wsgi lighttpd + mod_fastcgi lighttpd + gunicorn nginx + gunicorn I suggest you to go for gunicorn.
1
2
0
I've made a small web app using web.py that I now want to put into production. I dont anticipate this will have very high concurrent use (probably max of 5 or so users at any given time, if that). That said, I dont want to go with the cherry.py server that comes with web.py (and which i have been using for debugging), ...
Python webapp - moving from testing to production
1.2
0
0
444
3,926,712
2010-10-13T18:19:00.000
1
0
0
1
python,google-app-engine
3,926,731
2
false
0
0
You can just open them (only read only).
2
1
0
Is there a way to read the contents of a static data directory or interact with that data in any way from within the code of an application? Edit: Please excuse me if it wasn't clear at first, I mean getting a list of the files in that directory, not reading the data in them.
Read static content from within the code of an application
0.099668
0
0
97
3,926,712
2010-10-13T18:19:00.000
3
0
0
1
python,google-app-engine
3,927,648
2
true
0
0
No. Files marked as static in app.yaml are not available to your application; they're served from separate servers. If you just need to list them, you could build a list as part of your deploy process. If you need to actually read them, you'll need to include a second copy in your application directory (although the ...
2
1
0
Is there a way to read the contents of a static data directory or interact with that data in any way from within the code of an application? Edit: Please excuse me if it wasn't clear at first, I mean getting a list of the files in that directory, not reading the data in them.
Read static content from within the code of an application
1.2
0
0
97
3,927,166
2010-10-13T19:13:00.000
8
0
1
0
python,arrays,variables
3,927,214
6
false
0
0
Hmmm, seems weird, but possible. Sounds like you need a class which records the time when __init__ is called. Then, implement __getitem__ to check the time when it is called, and only return the item if it's not too late. (It's probably easier to do this than to have a process "running in the background" which actively...
2
8
0
How to implement an automatically expiring variable in python? For example, Let the program running For one hour. I want implement an array of 6 variables, each variable in array will be automatically deleted themselves after 10 mins. And after 1 hour, there will be no variable in the array.
Automatically expiring variable
1
0
0
5,819
3,927,166
2010-10-13T19:13:00.000
1
0
1
0
python,arrays,variables
3,927,215
6
false
0
0
It sounds like the items in your array know about each other, because otherwise they'll all expire at the same time. I think you want to create a subclass of list which deletes its contents after a certain time.
2
8
0
How to implement an automatically expiring variable in python? For example, Let the program running For one hour. I want implement an array of 6 variables, each variable in array will be automatically deleted themselves after 10 mins. And after 1 hour, there will be no variable in the array.
Automatically expiring variable
0.033321
0
0
5,819
3,928,685
2010-10-13T22:48:00.000
2
0
0
0
python,symbian,pys60
4,002,429
1
true
0
0
Symbian C++ API has such a capability, so it is possible to write a python library for that, but if such already exists, that I do not know... BR STeN
1
0
0
Is there any way in python for S60 (using the python 2.5.4 codebase) to track the amount of data transferred over the mobile device's internet connection?
Measuring internet data transfers
1.2
0
1
83
3,929,005
2010-10-13T23:58:00.000
0
0
0
0
python,screen-scraping
3,992,151
4
false
1
0
For nonprogrammers, I recomment using IRobotSoft. It is visual oriented and with full javascript support. The shortcoming is that it runs only on Windows. The good thing is you can become an expert just by trial and error to learn the software.
1
2
0
Disclaimer here: I'm really not a programmer. I'm eager to learn, but my experience is pretty much basic on c64 20 years ago and a couple of days of learning Python. I'm just starting out on a fairly large (for me as a beginner) screen scraping project. So far I have been using python with mechanize+lxml for my browsin...
Options for handling javascript heavy pages while screen scraping
0
0
1
795
3,929,228
2010-10-14T00:48:00.000
6
0
1
0
python,import,module
3,929,323
1
true
0
0
I think that instead of from pack1.mod2 you actually want to say from lib.pack1.mod2. Edit: and, specifying what version of Python this is would help, since importation semantics have improved gradually over the years! Edit: Aha! Thank you for your comment; I now understand. You are trying to rename libraries without g...
1
1
0
I'm trying to import a few libraries into my program (which is a google AppEngine application). Basically, I'm supposed to put all libraries in the root folder, but I've just created another folder called lib and placed them within that folder. (I've created the __init__.py) Imports regularly work fine by using the i...
Importing nested modules in Python
1.2
0
0
4,776
3,929,278
2010-10-14T01:00:00.000
53
1
1
0
python
43,015,990
10
false
0
0
When used with sets it performs union operation.
2
183
0
Google won't let me search |= so I'm having trouble finding relevant documentation. Anybody know?
What does |= (ior) do in Python?
1
0
0
124,921
3,929,278
2010-10-14T01:00:00.000
2
1
1
0
python
51,221,579
10
false
0
0
In Python,|=(ior) works like union operation. like if x=5 and x|=5 then both the value will first convert in binary value then the union operation will perform and we get the answer 5.
2
183
0
Google won't let me search |= so I'm having trouble finding relevant documentation. Anybody know?
What does |= (ior) do in Python?
0.039979
0
0
124,921
3,930,129
2010-10-14T04:38:00.000
0
0
0
0
python,facebook
4,663,777
2
false
1
0
There's a getLoginUrl in the facebook SDK. You might want to look at that. -Roozbeh
1
2
0
I am trying to make an app for authenticating user with their facebook account in python. App opens the facebook login page in web browser. After user logs in, facebook redirects it to thei dummy success page. At that moment i need to capture that redirect url in my app. I am not able to catch that URL. I am opening f...
Catching the Access Token sent by Facebook after successful authentication
0
0
1
755
3,930,422
2010-10-14T05:45:00.000
41
1
1
0
python,unit-testing,nose,nosetests,pycharm
13,359,250
3
true
0
0
In the current version of Pycharm (2.6) there should be a context menu "run Nosetests in ..." on a test file. If this is missing, go to file->settings->Project Settings->python integrated tools and ensure the Default Test Runner is Nosetests. You do of course need to have Nosetests installed - pycharm will offer this i...
2
30
0
How do you execute nosetest from pycharm to run all unit tests? I know that pycharm supports python's unittest and py.test and that they will properly support nosetests in pycharm 1.1 but I was wondering if there was a work around.
How do you run nosetest from pycharm?
1.2
0
0
20,545
3,930,422
2010-10-14T05:45:00.000
2
1
1
0
python,unit-testing,nose,nosetests,pycharm
3,931,985
3
false
0
0
If you can live without the graphical test runner, you can simply create a "Python Script" run configuration and run the tests as you run them from the command line. The only way to get nose tests working with the graphical test runner, I'm afraid, is to hack on helpers/pycharm/utrunner.py from the PyCharm distribution...
2
30
0
How do you execute nosetest from pycharm to run all unit tests? I know that pycharm supports python's unittest and py.test and that they will properly support nosetests in pycharm 1.1 but I was wondering if there was a work around.
How do you run nosetest from pycharm?
0.132549
0
0
20,545
3,931,178
2010-10-14T08:00:00.000
2
0
1
0
python
7,136,383
2
false
0
0
Using space for separating options has the disadvantage that if space is already present in the options, as in the case of file names, it wont work. So better to use comma and split using .split(',') and remove leading/trailing whitespaces.
1
0
0
I have made a Config file and have multiple values for a keyword as: [section] database: mysql , sqlite and i want to access the values separately..How to go about it??
How to read muliple values from a config file using config parser
0.197375
0
0
792
3,931,951
2010-10-14T09:49:00.000
14
0
0
0
python,postgresql,sqlalchemy,psycopg2,vacuum
3,932,055
2
true
0
0
This is a flaw in the Python DB-API: it starts a transaction for you. It shouldn't do that; whether and when to start a transaction should be up to the programmer. Low-level, core APIs like this shouldn't babysit the developer and do things like starting transactions behind our backs. We're big boys--we can start tr...
1
9
0
Well, the question pretty much summarises it. My db activity is very update intensive, and I want to programmatically issue a Vacuum Analyze. However I get an error that says that the query cannot be executed within a transaction. Is there some other way to do it?
Is it possible to issue a "VACUUM ANALYZE " from psycopg2 or sqlalchemy for PostgreSQL?
1.2
1
0
5,030
3,933,923
2010-10-14T13:56:00.000
2
0
1
0
python,ubuntu,numpy
3,934,387
2
false
0
0
One way to try, which isn't guaranteed to work, but worth a shot is to see if uupdate can sucessfully update the package. Get a tarball of numpy 1.5. run "apt-get source numpy" which should fetch and unpack the current source from ubuntu. cd into this source directory and run "uupdate ../numpytarballname". This sho...
1
0
1
How do I build numpy 1.5 on ubuntu 10.10? The instructions I found seems outdated or not clear. Thanks
build recent numpy on recent ubuntu
0.197375
0
0
1,563
3,937,456
2010-10-14T20:51:00.000
1
0
0
0
python,openid,store
3,937,506
1
true
0
0
upd.: my previous answer was wrong The store you are referring to is where your app stores the data during auth. Storing it in a shared memcached instance should be the best option (faster than db and reliable enough).
1
3
0
Hi so this is what I understand how Openid works:- the user enters his openid url on the site say"hii.com" The app does a redirect to the openid provider and either does the login or denies it and sends the response back to the site i.e"hii.com" If authentication was succesful then the response object provided by the ...
what is the concept of store in OpenID
1.2
1
0
488
3,939,482
2010-10-15T04:22:00.000
1
0
0
1
python
3,939,511
3
true
0
0
It doesn't really answer your question, but there isn't really anything wrong with calling os.system to clear out the terminal (other than the system running on different operating systems) in which case you could use: os.system('cls' if os.name=='nt' else 'clear')
1
2
0
I have a stats app written in python that on a timer refreshes the ssh screen with stats. Right now it uses os.system('clear') to clear the screen and then outputs a multi line data with the stats. I'd like to do just do a \r instead of executing the clear but that only works with one line, is it possible to do this wi...
python - multi line stdout refresh issue
1.2
0
0
1,629
3,939,877
2010-10-15T06:11:00.000
12
0
1
0
python,django,eclipse,pydev
3,941,289
10
true
1
0
go in the menu to window -> preference -> pydev -> Interpreter - Python ; and add the python interpreter there, if you installed the django in a virtual environment you should add the python interpreter of the virtual env ; after adding the interpreter by clicking on new you should now click on Apply , you should see n...
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
1.2
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
6
0
1
0
python,django,eclipse,pydev
4,118,703
10
false
1
0
Jaffa, You might have configured your python interpreter in Eclipse prior to installing Django in python. So what you have to do now is in Eclipse remove the Python interpreter and add it again (now that it has Django installed) and all should work ok.
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
1
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
0
0
1
0
python,django,eclipse,pydev
28,459,588
10
false
1
0
Same problem I have faced today. I took help from these answer. but in my case it didnt work. There is small modification in @antonkeren answer. 1) Go to Preferences. Windows > preferences. 2) Search for Pydev 3) Select Python Interpreter 4) Pressed Quick Auto-config 5) now download www.djangoproject.org/downloads dja...
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
0
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
1
0
1
0
python,django,eclipse,pydev
3,943,039
10
false
1
0
I stumbled upon this only yesterday myself: Django must not be among the system libraries for this to function...
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
0.019997
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
0
0
1
0
python,django,eclipse,pydev
4,049,594
10
false
1
0
I think I've got the same problem, Eclipse 3.5.2 on Fedora. In my PyDev Python interpreter settings I've got the site-packages/django folder (site-packages/django/bin too, just in case), but when I try to create a django project I get an error dialogue saying "It seems that the selected interpreter does not have Django...
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
0
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
21
0
1
0
python,django,eclipse,pydev
4,241,222
10
false
1
0
I had the same problem and this is what I did just after installing eclipse: Preferences > Interpreter Python Pressed Auto-config Selected /Library/Python/x.x/site-packages, which was not selected (some django folders were in there, persumably the installation) Clicked apply / OK Creating a Django project afterwards ...
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
1
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
1
0
1
0
python,django,eclipse,pydev
4,563,129
10
false
1
0
Use auto config in the preferences option and then click apply and then ok.
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
0.019997
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
1
0
1
0
python,django,eclipse,pydev
4,961,144
10
false
1
0
If everything is done as said above, and still showing "Django not found" while your are trying to create django project, let try to double click 'django-admin' python file that in scripts folder of python. And try to create django project
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
0.019997
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
2
0
1
0
python,django,eclipse,pydev
5,612,184
10
false
1
0
I was having this same exact problem today, and I just wanted to add some notes to help people out. You can follow the instructions of antonkeren above, but there's one thing to note that was not mentioned. After adding the django directory to the path you must QUIT ECLIPSE OR APTANA STUDIO. After you restart it and tr...
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
0.039979
0
0
11,629
3,939,877
2010-10-15T06:11:00.000
1
0
1
0
python,django,eclipse,pydev
4,438,527
10
false
1
0
I had the same problem and had solved it by adding the python home directory to the PATH variable and reconfigure the python interpreter on pydev.
10
15
0
I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash. When I try creating a django project in pydev, I get an error: "Django not found." What could the problem be?
pydev not recognizing python installation with django
0.019997
0
0
11,629
3,939,912
2010-10-15T06:18:00.000
0
0
1
0
python,performance,intel
3,939,973
3
false
0
0
Consider repeating on regular HDD's - that SSD could well result in a substantial performance difference depending on caches, and the nature of that data.
2
4
0
I am running a program that does simple data processing: parses text populates dictionaries calculates some functions over the resulting data The program only uses CPU, RAM, and HDD: run from Windows command line input/output to the local hard drive nothing displayed on or printed to screen no networking The same p...
Python execution speed: laptop vs desktop
0
0
0
1,614
3,939,912
2010-10-15T06:18:00.000
0
0
1
0
python,performance,intel
3,939,957
3
false
0
0
Split your processing into multiple threads. Your particular i7 should be able to support up to 8 threads in parallel.
2
4
0
I am running a program that does simple data processing: parses text populates dictionaries calculates some functions over the resulting data The program only uses CPU, RAM, and HDD: run from Windows command line input/output to the local hard drive nothing displayed on or printed to screen no networking The same p...
Python execution speed: laptop vs desktop
0
0
0
1,614
3,940,057
2010-10-15T06:45:00.000
1
1
0
0
python,snmp,fitnesse,net-snmp,pysnmp
3,968,271
1
true
0
0
The engineTime and engineBoots values are probably what is messing you up because SNMPv3 requires they not go backwards. If you have an agent that is restarting from scratch and not incrementing it's boots count (which is illegal, but under tests I could see why you'd be doing that) then you'd need to reset the intern...
1
1
0
I'm trying to create automated integration tests for this hardware+software test subject which runs a SNMP agent as it's command interface. Our test setup looks like this: We're using Fitnesse as a test runner and PyFit to be able to write the tests in Python. We then use netsnmp with Python bindings to send SNMP comma...
Resetting all global internal state of the net-snmp library from the Python bindings
1.2
0
0
731
3,940,098
2010-10-15T06:53:00.000
0
0
0
0
python,google-app-engine,screenshot
3,940,121
5
false
1
0
It's certainly technically possible. You would probably have to render the HTML directly onto an image file (or more likely, onto an in-memory bitmap that's written to an image file once completed). I don't know any libraries to do this for you (apart from a modified WebKit, perhaps)... but there's certainly websites t...
1
6
0
Do you think is technically possible to take a screeshot of a website programmatically? I would like to craft a scheduled Python task that crawls a list of websites taking an homepage screenshot of them. Do you think is technically feasible or do you know third party website that offer a service like that (Input: url -...
Is it technically possible to take a screenshot of a website programmatically?
0
0
1
2,523
3,940,774
2010-10-15T08:53:00.000
1
1
0
0
python,oauth,twitter
3,940,860
2
true
0
0
Yes, thats right. You need to register it and connect "grant access" it with your twitter id, if you want, for example, post something on your twitter wall. Also see "connections" in your twitter id.
2
1
0
I'm unfamiliar with the new oauth system. I wanted to crawl the status updates of my friends, and their friends' (if permissions allow) with my specified account credentials using the python-twitter api. With the new oauth authentication, does it means that I have to first register an application with twitter before I...
noob question regarding twitter oauth
1.2
0
1
206
3,940,774
2010-10-15T08:53:00.000
0
1
0
0
python,oauth,twitter
3,940,840
2
false
0
0
For use api you must register your aplication or use GET methods to post into twi through web interface.
2
1
0
I'm unfamiliar with the new oauth system. I wanted to crawl the status updates of my friends, and their friends' (if permissions allow) with my specified account credentials using the python-twitter api. With the new oauth authentication, does it means that I have to first register an application with twitter before I...
noob question regarding twitter oauth
0
0
1
206
3,941,830
2010-10-15T11:36:00.000
3
0
1
0
python,py2exe
3,941,876
4
false
0
0
Python programs need python to run. All py2exe does is to include full python and all libraries you use together with your script in a single file.
3
1
0
whenever i build python file to exe file from py2exe, it takes lots of space of minimum 25MB for small project also,it includes all the the python library file. Is there any other way that i can reduce the size.
python windows standalone exe file
0.148885
0
0
1,131
3,941,830
2010-10-15T11:36:00.000
0
0
1
0
python,py2exe
3,941,907
4
false
0
0
py2exe tends to err on the side of caution. You can manually exclude some libraries with the exclude list option in order to reduce the size of the file. In my experience, you should be able to compress down to a ~9 MB installer (Inno) if you include wxPython or another GUI framework, ~7 MB if you ship a console app or...
3
1
0
whenever i build python file to exe file from py2exe, it takes lots of space of minimum 25MB for small project also,it includes all the the python library file. Is there any other way that i can reduce the size.
python windows standalone exe file
0
0
0
1,131
3,941,830
2010-10-15T11:36:00.000
-2
0
1
0
python,py2exe
3,941,866
4
false
0
0
No, not really; you need Python shipped with the exe so that it is standalone. It it not common to create exe Files from Python projects, anyway.
3
1
0
whenever i build python file to exe file from py2exe, it takes lots of space of minimum 25MB for small project also,it includes all the the python library file. Is there any other way that i can reduce the size.
python windows standalone exe file
-0.099668
0
0
1,131
3,943,106
2010-10-15T14:18:00.000
3
0
1
0
python,thread-safety,multicore,embedding,embedded-language
3,943,160
2
false
0
0
If you're CPU bound, Python can only scale to multiple core using the multiprocessing library. However, if you're I/O bound, then threading is usually sufficient. If you want easy thread safety, then use Queue for all message passing.
1
1
0
I'm trying to use Python in a module for an analysis software of vehicle bus systems. For this I have to embed Python in a thread safe manner, since there can be multiple instances of the module witch work independently. I could use a mutex to guard all access to Python and create an unique (python) module for every t...
Embedding Python thread safe
0.291313
0
0
912
3,943,598
2010-10-15T15:16:00.000
0
0
0
0
python,django,sysadmin
3,943,924
2
false
1
0
I think you're pretty much covering everything. Identify what's important to you and you're business practices: that's what counts.
1
0
0
Does anyone have or know of a good template / plan for doing automated server upgrades? In this case I am upgrading a python/django server, but am going to have to apply this update to many machines, and want to be sure that the operation is fully testable and recoverable should anything go wrong. Am picturing somethi...
Server Upgrade Script
0
0
0
88
3,943,808
2010-10-15T15:43:00.000
5
1
0
0
java,python,unit-testing
3,944,260
3
false
1
0
Python unit tests do check types. All the time. In fact, that's the only thing they are doing. Python is duck-typed. Duck typing means that the type of an object is defined by its behavior. Unit tests test behavior. Ergo, they test types.
1
3
0
I was going through a few tests written in Java using JUnit and I could'nt help noticing the emphasis which is laid on checking the "type" of objects. This is something I have never seen in Python test-suites. Java being statically-typed and Python being dynamically-typed, should'nt the reverse be the case?
Python unittests almost never check types
0.321513
0
0
187
3,945,750
2010-10-15T20:11:00.000
9
0
0
0
python,beautifulsoup
45,193,575
2
false
1
0
with bs4 things have changed a little. so the code should look like this soup = BeautifulSoup(htmlstring,'lxml') soup.find_all('div', {'style':"width=300px;"})
1
29
0
I can traverse generic tags easily with BS, but I don't know how to find specific tags. For example, how can I find all occurances of <div style="width=300px;">? Is this possible with BS?
Find a specific tag with BeautifulSoup
1
0
1
62,029
3,945,924
2010-10-15T20:35:00.000
18
0
1
0
python,this,self
3,945,938
2
true
0
0
Yes it is legal, and yes it is pythonic. I find myself using this pattern when you have an object and a container object where the contained objects need to know about their parent.
1
12
0
I recently was working on a little python project and came to a situation where I wanted to pass self into the constructor of another object. I'm not sure why, but I had to look up whether this was legal in python. I've done this many times in C++ and Java but I don't remember ever having to do this with python. Is pas...
Passing self into a constructor in python
1.2
0
0
5,745
3,945,940
2010-10-15T20:37:00.000
15
0
1
0
python,list,subclassing
3,946,763
4
true
0
0
There are no benefits to subclassing list. None of the methods will use any methods you override, so you can have unexpected bugs. Further, it's very often confusing doing things like self.append instead of self.foos.append or especially self[4] rather than self.foos[4] to access your data. You can make something that ...
3
17
0
I was recently going over a coding problem I was having and someone looking at the code said that subclassing list was bad (my problem was unrelated to that class). He said that you shouldn't do it and that it came with a bunch of bad side effects. Is this true? I'm asking if list is generally bad to subclass and if so...
What to consider before subclassing list?
1.2
0
0
9,358
3,945,940
2010-10-15T20:37:00.000
6
0
1
0
python,list,subclassing
3,946,030
4
false
0
0
Nick is correct. Also, while I can't speak to Python, in other OO languages (Java, Smalltalk) subclassing a list is a bad idea. Inheritance in general should be avoided and delegation-composition used instead. Rather, you make a container class and delegate calls to the list. The container class has a reference to the ...
3
17
0
I was recently going over a coding problem I was having and someone looking at the code said that subclassing list was bad (my problem was unrelated to that class). He said that you shouldn't do it and that it came with a bunch of bad side effects. Is this true? I'm asking if list is generally bad to subclass and if so...
What to consider before subclassing list?
1
0
0
9,358
3,945,940
2010-10-15T20:37:00.000
11
0
1
0
python,list,subclassing
3,945,953
4
false
0
0
I think the first question I'd ask myself is, "Is my new object really a list?". Does it walk like a list, talk like a list? Or is is something else? If it is a list, then all the standard list methods should all make sense. If the standard list methods don't make sense, then your object should contain a list, not be...
3
17
0
I was recently going over a coding problem I was having and someone looking at the code said that subclassing list was bad (my problem was unrelated to that class). He said that you shouldn't do it and that it came with a bunch of bad side effects. Is this true? I'm asking if list is generally bad to subclass and if so...
What to consider before subclassing list?
1
0
0
9,358
3,946,219
2010-10-15T21:16:00.000
2
0
0
0
python,statistics,numpy,stata
4,572,785
5
false
0
0
Use Rpy2 and call the R var package.
2
9
1
Some coworkers who have been struggling with Stata 11 are asking for my help to try to automate their laborious work. They mainly use 3 commands in Stata: tsset (sets a time series analysis) as in: tsset year_column, yearly varsoc (Obtain lag-order selection statistics for VARs) as in: varsoc column_a column_b ve...
Migrating from Stata to Python
0.07983
0
0
1,936
3,946,219
2010-10-15T21:16:00.000
0
0
0
0
python,statistics,numpy,stata
3,946,648
5
false
0
0
I have absolutely no clue what any of those do, but NumPy and SciPy. Maybe Sage or SymPy.
2
9
1
Some coworkers who have been struggling with Stata 11 are asking for my help to try to automate their laborious work. They mainly use 3 commands in Stata: tsset (sets a time series analysis) as in: tsset year_column, yearly varsoc (Obtain lag-order selection statistics for VARs) as in: varsoc column_a column_b ve...
Migrating from Stata to Python
0
0
0
1,936
3,947,313
2010-10-16T01:46:00.000
-2
0
0
1
python
3,947,329
4
false
0
0
Generally ls -la is in bytes. If you want it in "human readable" form, use the command ls -alh.
1
31
0
I want to delete all files in a folder that are less than 200 kB in size. Just want to be sure here, when i do a ls -la on my macbook, the file size says 171 or 143, I am assuming this is kb correct?
Python script to loop through all files in directory, delete any that are less than 200 kB in size
-0.099668
0
0
52,290
3,947,443
2010-10-16T02:36:00.000
2
0
0
1
python,google-app-engine,performance,wing-ide
3,957,947
2
true
1
0
Probably because you've got a debugger hooked up - debuggers slow code down a lot by instrumenting everything, and deserializing your datastore is a lot of work. Using the --use_sqlite flag will enable an experimental sqlite-based local datastore, which should require less startup time. Note that it'll require you to w...
1
1
0
I'm developing on Google App Engine. I am using WingIDE (a python IDE) to debug on the development server. I have several thousand entities in my datastore and I can see that when the development server starts up, it has to go through DatastoreFileStub.Read() and do something which each entity. The problem is, when I r...
Google App Engine development server is slow to start up when using WingIDE
1.2
0
0
713
3,948,257
2010-10-16T09:07:00.000
0
0
1
0
python,indentation,python-idle
3,948,671
5
false
0
0
textmate (and maybe e?): select then apple-] bbedit: also select then apple-] emacs: select then M-x 'indent-region' bpython: don't know, autoindenting is so easy in bpython, you'd have to work to break it xcode: don't do python in xcode that's generally all I need to know. also yeah it's easy to slap a brace above or...
3
3
0
In Python, what do you do when you write 100 lines of code and forget to add a bunch of loop statements somewhere? I mean, if you add a while statement somewhere, you've to now indent all the lines below it. It's not like you can just put braces and be done with it. Go to every single line and add tabs/spaces. What if...
Python indentation when adding looping statements to existing code
0
0
0
4,202
3,948,257
2010-10-16T09:07:00.000
11
0
1
0
python,indentation,python-idle
3,948,270
5
false
0
0
I think every serious editor or IDE supports the option to select multiple lines and press tab to indent or Shift-Tab to unindent all that lines.
3
3
0
In Python, what do you do when you write 100 lines of code and forget to add a bunch of loop statements somewhere? I mean, if you add a while statement somewhere, you've to now indent all the lines below it. It's not like you can just put braces and be done with it. Go to every single line and add tabs/spaces. What if...
Python indentation when adding looping statements to existing code
1
0
0
4,202
3,948,257
2010-10-16T09:07:00.000
3
0
1
0
python,indentation,python-idle
3,948,313
5
false
0
0
in IDLE, the standard python IDE, select the code, go on 'format' and you can chooose indent region, dedent region and so on
3
3
0
In Python, what do you do when you write 100 lines of code and forget to add a bunch of loop statements somewhere? I mean, if you add a while statement somewhere, you've to now indent all the lines below it. It's not like you can just put braces and be done with it. Go to every single line and add tabs/spaces. What if...
Python indentation when adding looping statements to existing code
0.119427
0
0
4,202
3,949,739
2010-10-16T16:33:00.000
0
0
0
0
python,html
5,693,726
2
false
1
0
urllib.unquote() on its own may still cause problems by throwing the exception: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position n: ordinal not in range(128) In that case try: print urllib.unquote("Ober%C3%B6sterreich.txt").decode("utf8")
1
0
0
I always found links in html source stored in such format, the question is how do I change such links back to what it's normally like? Thanks a lot!
How to turn an encoded link such as "http%3A%2F%2Fexample.com%2Fwhatever" into "http://example.com/whatever" in python?
0
0
1
797
3,949,842
2010-10-16T17:01:00.000
-1
0
0
0
python,user-interface,pyqt4
11,305,421
2
false
0
1
winBase, winForm = uic.loadUiType("mainWindow.ui") # this is the file created whith Qt Designer class Window(winBase, winForm): def __init__(self, parent = None) super(winBase, self).__init__(parent) self.setupUi(self)
1
0
0
I am new to the world of PyQt.I am using PyQt designer for designing the UI and coding to provide functionality in it.But unfortunately I am getting confused to link with the UI.By importing the class we generally doing in examples.But when I try my own code its not happening. Any hints for how designer and other parts...
PyQt GUI based CRUD application
-0.099668
0
0
1,463
3,950,607
2010-10-16T20:20:00.000
7
0
0
1
python,multithreading,io,blocking,nonblocking
3,950,630
1
true
0
0
Since you're I/O bound, then use the threading module. You should almost never need to use thread, it's a low-level interface; the threading module is a high-level interface wrapper for thread. The multiprocessing module is different from the threading module, multiprocessing uses multiple subprocesses to execute a t...
1
6
0
I have a Python application that, to be brief, receives data from a remote server, processes it, responds to the server, and occasionally saves the processed data to disk. The problem I've encountered is that there is a lot of data to write, and the save process can take upwards of half a minute. This is apparently a b...
What threading module should I use to prevent disk IO from blocking network IO?
1.2
0
1
1,332
3,950,687
2010-10-16T20:39:00.000
77
0
0
0
python,tkinter
3,950,766
3
true
0
1
Use somewidget.winfo_width() and somewidget.winfo_height() to get the actual widget size, the somewidget['width'] property is only a hint given to the geometry manager.
3
62
0
I'm using Python and Tkinter, and I need to know the current dimensions (width, height) of a widget. I've tried somewidget["width"], but it returns only a fixed value, and is not updated whenever the widget size changes (e.g. when the window is resized).
How to find out the current widget size in tkinter?
1.2
0
0
81,835
3,950,687
2010-10-16T20:39:00.000
82
0
0
0
python,tkinter
49,216,638
3
false
0
1
somewidget.winfo_width() and somewidget.winfo_height() give 1. You need to update Tk (issue tk.update()) before getting these values.
3
62
0
I'm using Python and Tkinter, and I need to know the current dimensions (width, height) of a widget. I've tried somewidget["width"], but it returns only a fixed value, and is not updated whenever the widget size changes (e.g. when the window is resized).
How to find out the current widget size in tkinter?
1
0
0
81,835
3,950,687
2010-10-16T20:39:00.000
13
0
0
0
python,tkinter
60,086,946
3
false
0
1
You can use the function somewidget.winfo_reqheight() for height and somewidget.winfo_reqwidth() for width, but first don't forget to call the update function of the widget you want to know the dimension somewidget.update(). If you do not call the update function you will get the default value 1.
3
62
0
I'm using Python and Tkinter, and I need to know the current dimensions (width, height) of a widget. I've tried somewidget["width"], but it returns only a fixed value, and is not updated whenever the widget size changes (e.g. when the window is resized).
How to find out the current widget size in tkinter?
1
0
0
81,835
3,950,851
2010-10-16T21:21:00.000
0
1
0
0
python,django,internationalization,project-planning
3,970,432
2
false
1
0
One big change in your project: you need to build in time to localize your strings. Depending on your schedules, you may have to rearrange work so that all the string-changing work is at the front so that you have time to get the translations done before launching. Or, alternately, you have to build in a buffer at the...
1
1
0
I am preparing to develop a web application that will (hopefully) be used by an audience with many different native languages. What should I do to prepare my software project to have the user interface be almost entirely internationalized? Are there any software stacks that make this easier?
Preparing a web site for international usage
0
0
0
98
3,951,089
2010-10-16T22:29:00.000
0
0
0
1
python,google-app-engine
4,927,348
5
false
1
0
Answer of Adam Bernier also can apply when you use the appcfg.py download_app for downloading app from appengine servers.
1
9
0
I have hosted GAE apps with two different email ids! When i first time used appcfg.py to update my app then it prompted me for email id and password but later it doesnot. How to i change the saved email id and password? I tried to use --email= flag with appcfg.py, but it dint worked.
How to change email account details in appcfg.py google appengine SDK
0
0
0
6,689
3,951,608
2010-10-17T01:36:00.000
1
0
1
0
python,osx-snow-leopard
3,951,616
1
true
0
0
Set the PATH environment variable so that /usr/bin is ahead of wherever you put your custom compiled Python binary.
1
0
0
So earlier this year I manually built 2.6.4 for Snow Leopard because I wanted a slightly more updated version of Python than what Apple released. This has caused all kinds of problems when installing some eggs like PIL and running other 3rd party python apps. Now I just want to revert everything back to what Snow Leopa...
How to revert compiled Python 2.6.4 to system default on Snow Leopard?
1.2
0
0
355
3,953,563
2010-10-17T14:07:00.000
2
1
0
0
php,python,xml
3,953,576
3
false
0
0
I think that both of them can rely over wrappers for fast C libraries (mostly libxml2) so there's shouldn't be too much difference in parsing per se. You could try if there are differences caused by overhead, then it depends what are you gonna do over that XML. Parsing it for what?
2
2
0
So I have 16 GB worth of XML files to process (about 700 files total), and I already have a functional PHP script to do that (With XMLReader) but it's taking forever. I was wondering if parsing in Python would be faster (Python being the only other language I'm proficient in, I'm sure something in C would be faster).
Is XML parsing in PHP as fast as Python or other alternatives?
0.132549
0
1
1,714
3,953,563
2010-10-17T14:07:00.000
2
1
0
0
php,python,xml
3,953,874
3
false
0
0
There's actually three differing performance problems here: The time it takes to parse a file, which depends on the size of individual files. The time it takes to handle the files and directories in the filesystem, if there's a lot of them. Writing the data into your databases. Where you should look for performance i...
2
2
0
So I have 16 GB worth of XML files to process (about 700 files total), and I already have a functional PHP script to do that (With XMLReader) but it's taking forever. I was wondering if parsing in Python would be faster (Python being the only other language I'm proficient in, I'm sure something in C would be faster).
Is XML parsing in PHP as fast as Python or other alternatives?
0.132549
0
1
1,714
3,953,999
2010-10-17T15:56:00.000
0
0
1
0
python,flash,actionscript
3,954,038
4
false
0
0
I am not aware of a browser plug-in for Python. With that in mind, no in-browser games. If you used PyGame you could do network delivered game. Alternately, you could go the AJAXy route and have a Python server work with JavaScript or some other tool a browser. If you go for a hybrid approach pretty much any AJAXy fram...
2
3
0
Can python be used as a language to develop browser based games? Like we do in flash. If yes then what frameworks are available to get my hands dirty? If no then what are the reasons?
Python vs Flash
0
0
0
1,390
3,953,999
2010-10-17T15:56:00.000
1
0
1
0
python,flash,actionscript
3,954,129
4
false
0
0
You can run IronPython code in the Silverlight plug-in.
2
3
0
Can python be used as a language to develop browser based games? Like we do in flash. If yes then what frameworks are available to get my hands dirty? If no then what are the reasons?
Python vs Flash
0.049958
0
0
1,390
3,954,099
2010-10-17T16:24:00.000
0
0
0
0
javascript,python,client-side,template-engine
3,954,282
3
false
1
0
I'll address your first question. You can store data in JavaScript objects (instead of SQL databases, for example). Those JavaScript objects can be stored in .js files, or inline as part of the HTML document. You can take a look at the source code of my w3viewer.com. All data is stored inside a JavaScript array. In...
3
2
0
Recently, I found out that jQuery has an official template engine which was contributed by the Microsoft team. Also I had heard about jTemplate from my friends, but I'm still confused: When & where might I need to use these plugins? How should I choose between the many client side template engines?
When would we need a javascript client template engine?
0
0
0
308
3,954,099
2010-10-17T16:24:00.000
0
0
0
0
javascript,python,client-side,template-engine
3,954,332
3
false
1
0
A template-engine prevents unnecessary HTML-code in the actual code. This makes it much easier to read.
3
2
0
Recently, I found out that jQuery has an official template engine which was contributed by the Microsoft team. Also I had heard about jTemplate from my friends, but I'm still confused: When & where might I need to use these plugins? How should I choose between the many client side template engines?
When would we need a javascript client template engine?
0
0
0
308
3,954,099
2010-10-17T16:24:00.000
1
0
0
0
javascript,python,client-side,template-engine
3,954,142
3
true
1
0
The reason for a jQuery template engine is this: developers write Javascript code to create new chunks of HTML to inject into the page. This usually is done by concatenating many strings with variables for values, and it becomes difficult to maintain. With a jQuery template engine, the process of creating HTML at the...
3
2
0
Recently, I found out that jQuery has an official template engine which was contributed by the Microsoft team. Also I had heard about jTemplate from my friends, but I'm still confused: When & where might I need to use these plugins? How should I choose between the many client side template engines?
When would we need a javascript client template engine?
1.2
0
0
308
3,955,077
2010-10-17T20:12:00.000
1
0
0
0
python,image,r,analysis
3,964,945
5
false
0
0
Try the rgdal package. You will be able to read (import) and write (export) GeoTiff image files from/to R. Marcio Pupin Mello
1
15
1
I would like to know how I would go about performing image analysis in R. My goal is to convert images into matrices (pixel-wise information), extract/quantify color, estimate the presence of shapes and compare images based on such metrics/patterns. I am aware of relevant packages available in Python (suggestions relev...
Image analysis in R
0.039979
0
0
4,953
3,955,361
2010-10-17T21:22:00.000
2
0
0
1
python,django,google-app-engine
3,957,752
2
true
1
0
os.path.normpath() on "content_includes" is a no-op - normpath just removes double slashes and other denormalizations. What you probably want is to build a path relative to the script, in which case you should do something like os.path.join(os.path.dirname(__file__), 'content_includes', pageName + '.inc').
2
2
0
I created a simple python project that serves up a couple of pages. I'm using the 'webapp' framework and django. What I'm trying to do is use one template file, and load 'content files' that contain the actual page text. When I try to read the content files using os.open, I get the following error: pageContent = os.op...
Reading files in GAE using python
1.2
0
0
613
3,955,361
2010-10-17T21:22:00.000
0
0
0
1
python,django,google-app-engine
3,994,580
2
false
1
0
If you dig in the dev_appserver.py source code and related files you see that the server does some incarnate checking to ensure that you open only files from below your applications root (in fact the rules seem even more complex). For file access troubled I instrumented that "path permission checking" code from the dev...
2
2
0
I created a simple python project that serves up a couple of pages. I'm using the 'webapp' framework and django. What I'm trying to do is use one template file, and load 'content files' that contain the actual page text. When I try to read the content files using os.open, I get the following error: pageContent = os.op...
Reading files in GAE using python
0
0
0
613
3,955,903
2010-10-18T00:17:00.000
5
0
1
0
python,pep8,pep
33,581,024
14
false
0
0
The "problem" with PEP 8 is that it treads on areas of personal preference that are subject to quite high amounts of emotion for most programmers. For me personally, camelCase vs underscores and column alignment directives were constant issues. I also see point in lots of other responses here and sometimes I break PEP ...
2
46
0
Over the years, the more Python I write, the more I find myself agreeing with most of the guidelines, though I consistently and intentionally break some for my own reasons. I'd be curious to know what in PEP 8 (or other PEPs too maybe) people religiously stick to and why, and what people find inconvenient or inadequate...
What PEP 8 guidelines do you ignore, and which ones do you stick to?
0.071307
0
0
21,397
3,955,903
2010-10-18T00:17:00.000
11
0
1
0
python,pep8,pep
23,239,799
14
false
0
0
My company's style guidelines specifically call for tabs, not spaces. PEP 8 hints that spaces are preferable but we've found the opposite. I like to see code indented 4 'spaces' in VIM, a coworker prefers 8 'spaces' in Emacs. Using tabs lets us both set our editors to show the code as we prefer it. Note that in other C...
2
46
0
Over the years, the more Python I write, the more I find myself agreeing with most of the guidelines, though I consistently and intentionally break some for my own reasons. I'd be curious to know what in PEP 8 (or other PEPs too maybe) people religiously stick to and why, and what people find inconvenient or inadequate...
What PEP 8 guidelines do you ignore, and which ones do you stick to?
1
0
0
21,397
3,957,025
2010-10-18T06:38:00.000
6
1
1
0
python,wav
9,184,327
4
false
1
0
The first thing you should do is a fourier transformation to transform the data into its frequencies. It is rather complex however. I wouldn't use voice recognition libraries here as it sounds like you don't record voices only. You would then try different time shifts (in case the sounds are not exactly aligned) and us...
4
23
0
I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho...
What does a audio frame contain?
1
0
0
39,854
3,957,025
2010-10-18T06:38:00.000
7
1
1
0
python,wav
20,810,191
4
false
1
0
I believe the accepted description to be slightly incorrect. A frame appears to be somewhat like stride in graphics formats. For interleaved stereo @ 16 bits/sample, the frame size is 2*sizeof(short)=4 bytes. For non-interleaved stereo @ 16 bits/sample, the samples of the left channel are all one after another, so th...
4
23
0
I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho...
What does a audio frame contain?
1
0
0
39,854
3,957,025
2010-10-18T06:38:00.000
8
1
1
0
python,wav
3,957,097
4
false
1
0
A simple byte-by-byte comparison has almost no chance of a successful match, even with some tolerance thrown in. Voice-pattern recognition is a very complex and subtle problem that is still the subject of much research.
4
23
0
I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho...
What does a audio frame contain?
1
0
0
39,854
3,957,025
2010-10-18T06:38:00.000
47
1
1
0
python,wav
3,957,230
4
true
1
0
An audio frame, or sample, contains amplitude (loudness) information at that particular point in time. To produce sound, tens of thousands of frames are played in sequence to produce frequencies. In the case of CD quality audio or uncompressed wave audio, there are around 44,100 frames/samples per second. Each of tho...
4
23
0
I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho...
What does a audio frame contain?
1.2
0
0
39,854
3,957,938
2010-10-18T09:36:00.000
1
0
0
0
python,sqlalchemy,python-elixir
3,975,114
3
false
0
0
The Elixir syntax is something I find useful when building a database for a given app from scratch and everything is all figured out beforehand. I have had my best luck with SQLAlchemy when using it on legacy databases (and on other similarly logistically immutable schemas). Particularly useful is the plugin SQLSoup, f...
1
7
0
... vs declarative sqlalchemy ?
What are the benefits of using Elixir
0.066568
1
0
4,024
3,958,019
2010-10-18T09:48:00.000
1
1
0
0
python,gmail,imaplib
3,984,960
2
true
0
0
You can do it using any of the 2 following ways. You can use Message-Id field of the mail header.Message-Id field for both the mail will be same. Apply SEARCH command on All Mail Folder. i.e search on title --> it will give you uid for that mail.
1
2
0
How to get UID of mail in All Maill folder if I have UID of this mail in inbox using imaplib? As you know the google store mails in the two instances in All Mail and in inbox I whant to move this to mail in trash folder using imaplib
How to get UID of mail in All Maill folder if I have UID of this mail in inbox using imaplib? (GMail)
1.2
0
0
2,438
3,958,044
2010-10-18T09:53:00.000
3
0
0
1
python,linux,ubuntu,debian
3,958,070
3
false
0
0
Closed-source? Meh. Well, you can compile python iirc, or simply use an obscusificator. But I recommend to open-source it ;-) The stuff you can double-click are .desktop files, for samples, see find /usr | grep desktop.
1
2
0
I have created a simple program in python. Now I want trasform this script in an executable program ( with hidden source code if possible ) and when I click 2 times on it, the program install itself on the ubuntu ( in the /usr/lib or /usr/bin I think ) and it will create a new launcher in the Application -> Game menu. ...
How create an Executable file + Launcher in Ubuntu from a python script?
0.197375
0
0
7,715
3,958,224
2010-10-18T10:24:00.000
1
0
0
1
python,google-app-engine
3,959,150
2
false
1
0
Afaik you can not store files in App Engine programmatically. You can just store them, when uploading your app. You can however store information in its data store. So you would need to deploy an app, that authenticates your user and then writs the image to the gae's data store
1
1
0
I am not running Django on AppEngine. I just want to use AppEngine as a content delivery network, basically a place I can host and serve images for free. It's for a personal side project. The situation is this: I have the URL of an image hosted on another server/provider. Instead of hotlinking to that image its better ...
Uploading images from a django application to a Google AppEngine application
0.099668
0
0
269
3,958,772
2010-10-18T11:46:00.000
1
0
0
0
c#,java,python,opengl,3d
3,960,791
3
false
0
0
The easiest way would be to use PANDA3D. it uses python and is quite complete.
2
1
0
I am building a ship simulator that will produce accurate position and orientation values for a prototype hull design in some defined sea-state. In terms of programming, I have 2 arrays (vectors) in MATLAB containing the position and acceleration values for x, y, z, yaw, pitch and roll. Because the visualisations in MA...
easiest way to make a live 3d scene, a bit like a simple game (for simulator visualisation purposes)
0.066568
0
0
587
3,958,772
2010-10-18T11:46:00.000
0
0
0
0
c#,java,python,opengl,3d
3,958,801
3
false
0
0
I've found OpenGL pretty easy to use in the past, or if you're on a Windows environment there's Direct3D too.
2
1
0
I am building a ship simulator that will produce accurate position and orientation values for a prototype hull design in some defined sea-state. In terms of programming, I have 2 arrays (vectors) in MATLAB containing the position and acceleration values for x, y, z, yaw, pitch and roll. Because the visualisations in MA...
easiest way to make a live 3d scene, a bit like a simple game (for simulator visualisation purposes)
0
0
0
587
3,961,945
2010-10-18T17:58:00.000
0
0
1
0
python,urllib2
3,962,002
2
false
0
0
Req refers to request object usually contains HTTP method and url code refers to response code or HTTP code value like 200 etc hdr refers to headers of the request like user-agent etc fp refers to file descriptor or socket descriptor in this case
1
1
0
In the method of the class urllib2.HTTPDefaultErrorHandler what so the arguments - self, req, fp, code,msg, hdrs - refer to?
What do these arguments refer to?
0
0
0
72
3,962,304
2010-10-18T18:46:00.000
0
0
0
0
python,django,gps
3,962,335
2
true
1
0
Save them as double/float with adequate precision in the input data
1
1
0
What is the best way to manage GPS coordinates (latitude and longitude) in django models ? I know that there is a module called GeoDjango but reading the tutorial seems dedicated to GIS and not simply to manage the latitude and longitude. I do not care to have convenient interface for the admin because int the applicat...
Handle GPS Coordinate in Django
1.2
0
0
1,957
3,963,438
2010-10-18T21:12:00.000
0
1
1
0
python,programming-languages
3,963,524
6
false
0
0
The stock answer is the only features that make certain languages more powerful than others are language features that cannot be easily replaced by adding libraries. This definition will almost always list LISP on the top, but has the odd side effect of listing assembly near the top unless special care is taken to excl...
4
5
0
I'm going to reveal my ignorance here, but in my defense, I'm an accounting major, and I've never taken a computer science class. I'm about to start a new project, and I'm considering using Python instead of PHP, even though I am much more adept with PHP, because I have heard that Python is a more powerful language. Th...
What makes some programming languages more powerful than others?
0
0
0
6,357
3,963,438
2010-10-18T21:12:00.000
1
1
1
0
python,programming-languages
3,963,547
6
false
0
0
I would not say that there are computer languages "more powerful", just languages more suited for your specific problem domain. That said, PHP is a language that evolved from a hack and tailored for a very specific problem domain; this shows up in several places, like for example inconsistent parameter order across dat...
4
5
0
I'm going to reveal my ignorance here, but in my defense, I'm an accounting major, and I've never taken a computer science class. I'm about to start a new project, and I'm considering using Python instead of PHP, even though I am much more adept with PHP, because I have heard that Python is a more powerful language. Th...
What makes some programming languages more powerful than others?
0.033321
0
0
6,357
3,963,438
2010-10-18T21:12:00.000
0
1
1
0
python,programming-languages
3,963,564
6
false
0
0
Its an interesting topic and in my line of word I come across this a lot. But I've discovered 'power' in the literal sense no longer has value when it comes to the language. What I fear those telling you 'python is more' powerful are getting mixed up with the language and the implementation. I'm a recent convert to pyt...
4
5
0
I'm going to reveal my ignorance here, but in my defense, I'm an accounting major, and I've never taken a computer science class. I'm about to start a new project, and I'm considering using Python instead of PHP, even though I am much more adept with PHP, because I have heard that Python is a more powerful language. Th...
What makes some programming languages more powerful than others?
0
0
0
6,357