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
1,424,398
2009-09-14T23:28:00.000
1
1
0
1
python,python-idle
35,376,000
11
false
0
0
For OS X: Open a new finder window,then head over to applications. Locate your Python application. (For my mac,it's Python 3.5) Double click on it. Right click on the IDLE icon,show package contents. Then go into the contents folder,then resources. Now,this is the important part: (Note: You must be the administrator or...
8
9
0
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
0.01818
0
0
28,611
1,424,398
2009-09-14T23:28:00.000
2
1
0
1
python,python-idle
53,340,799
11
false
0
0
In Windows 10+, click the Windows Start button, then type idle, and then right-click on the IDLE desktop app and open the file location. This should bring you to the Start Menu shortcuts for Python, and you'll find a shortcut to IDLE there. Right-click on the IDLE shortcut and select properties. Set the "Start in" dire...
8
9
0
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
0.036348
0
0
28,611
1,424,398
2009-09-14T23:28:00.000
1
1
0
1
python,python-idle
43,900,532
11
false
0
0
I am using windows 7 and by going to Start-> IDLE(Python 3.6 32-bit) The click on properties and then in the shortcut tab go to Start in and entering the desired path worked for me kindly note if IDLE is open and running while you do this you'll have to shut it down and restart it for this to work
8
9
0
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
0.01818
0
0
28,611
1,424,398
2009-09-14T23:28:00.000
2
1
0
1
python,python-idle
5,161,261
11
false
0
0
It seems like you can get idle into the directory you want if you run any module from that directory. I had previously tried opening idlemain.py through the path browser. I was able to open and edit the file, but it seemed like I wasn't able to save my modifications. I'm just glad to hear other people are having this ...
8
9
0
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
0.036348
0
0
28,611
1,424,398
2009-09-14T23:28:00.000
1
1
0
1
python,python-idle
1,424,722
11
false
0
0
On Windows (Vista at least, which is what I'm looking at here), shortcut icons on the desktop have a "Start in" field where you can set the directory used as the current working directory when the program starts. Changing that works for me. Anything like that on the Mac? (Starting in the desired directory from the c...
8
9
0
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
0.01818
0
0
28,611
1,424,398
2009-09-14T23:28:00.000
0
1
0
1
python,python-idle
1,424,502
11
false
0
0
If you locate the idlelib directory in your Python install, it will have a few files with the .def extension. config-main.def has instructions on where to put the custom config files. However, looking through these I did not find any configurable paths (your install may vary). Looks like you might need to crack open th...
8
9
0
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
0
0
0
28,611
1,424,398
2009-09-14T23:28:00.000
1
1
0
1
python,python-idle
1,424,507
11
false
0
0
If you open a module, that sets the default working directory. Start IDLE. File -> Open to open your file. And set the current working directory.
8
9
0
Does anyone know where or how to set the default path/directory on saving python scripts prior to running? On a Mac it wants to save them in the top level ~/Documents directory. I would like to specify a real location. Any ideas?
Default save path for Python IDLE?
0.01818
0
0
28,611
1,424,534
2009-09-15T00:24:00.000
2
0
1
0
python
1,424,582
2
true
0
0
The main question I would think about is how much of your library would return numpy objects? If its pervasive I would go with directly returning a numpy as your so tied to numpy you might as well make it explicit. Plus it will probably make it easier to use other numpy based libraries. If on the other hand you only...
1
1
0
Common scenario: I have a library that uses other libraries. For example, a math library (let's call it foo) that uses numpy. Functions of foo can either: return a numpy object (either pure or an inherited reimplementation) return a list return a foo-implemented object that behaves like numpy (performing delegation) ...
exposing or hiding objects of dependencies?
1.2
0
0
147
1,424,593
2009-09-15T00:47:00.000
0
1
0
0
php,python,ipc
1,424,687
2
false
0
0
You could look at shared memory or named pipes, but I think there are two more likely options, assuming at least one of these languages is being used for a webapp: A. Use your database's atomicity. In python, begin a transaction, put a message into a table, and end the transaction. From php, begin a transaction, take...
1
1
0
I have a python program which starts up a PHP script using the subprocess.Popen() function. The PHP script needs to communicate back-and-forth with Python, and I am trying to find an easy but robust way to manage the message sending/receiving. I have already written a working protocol using basic sockets, but it doesn'...
Easy, Robust IPC between Python and PHP
0
0
1
2,322
1,424,734
2009-09-15T01:49:00.000
1
0
0
0
python,pygame,alphablending
1,429,443
2
true
0
1
Considering the pygame docs I would say "no, there is no global way to disable alpha". However there are at least two 'local' ways to do it: First would be to subclass pygame.Surface and provide your own implementation of set_alpha which in turn could honor your global alpha settings. Second one is a bit more tr...
1
1
0
I have a computer game I'm working on, and I'm wanting to give the user an option to turn off alpha compositing for speed purposes. Rather than doing checks everywhere, does Pygame have a global option to say "Don't use alpha" such that it would just ignore all my calls to set_alpha and the likes?
Turn off Pygame alpha
1.2
0
0
570
1,425,149
2009-09-15T04:42:00.000
1
0
0
0
python,gps,geocoding,reverse-geocoding
1,425,355
6
false
0
0
If you can get hold of state boundaries as polygons (for example, via OpenStreetMap), determining the current state is just a point-in-polygon test. If you need address data, an offline solution would be to use Microsoft Mappoint.
2
14
0
I am working on an application where one of the requirements is that I be able to perform realtime reverse geocoding operations based on GPS data. In particular, I must be able to determine the state/province to which a latitude, longitude pair maps and detect when we have moved from one state/province to another. I h...
Reverse Geocoding Without Web Access
0.033321
0
0
12,745
1,425,149
2009-09-15T04:42:00.000
0
0
0
0
python,gps,geocoding,reverse-geocoding
1,425,312
6
false
0
0
I have a database with all of this data and some access tools. I made mine from the census tiger data. I imagine it'd basically be an export of my database to sqlite and a bit of code translation.
2
14
0
I am working on an application where one of the requirements is that I be able to perform realtime reverse geocoding operations based on GPS data. In particular, I must be able to determine the state/province to which a latitude, longitude pair maps and detect when we have moved from one state/province to another. I h...
Reverse Geocoding Without Web Access
0
0
0
12,745
1,425,162
2009-09-15T04:48:00.000
1
0
1
0
python,data-structures,matrix
1,425,181
4
false
0
0
You only need to store the lower triangle of the matrix. Typically this is done with one n(n+1)/2 length list. You'll need to overload the __getitem__ method to interpret what the entry means.
2
1
1
I'm looking to create a 2d matrix of integers with symmetric addressing ( i.e. matrix[2,3] and matrix[3,2] will return the same value ) in python. The integers will have addition and subtraction done on them, and be used for logical comparisons. My initial idea was to create the integer objects up front and try to fill...
Symmetrically adressable matrix
0.049958
0
0
247
1,425,162
2009-09-15T04:48:00.000
2
0
1
0
python,data-structures,matrix
1,425,305
4
false
0
0
You're probably better off using a full square numpy matrix. Yes, it wastes half the memory storing redundant values, but rolling your own symmetric matrix in Python will waste even more memory and CPU by storing and processing the integers as Python objects.
2
1
1
I'm looking to create a 2d matrix of integers with symmetric addressing ( i.e. matrix[2,3] and matrix[3,2] will return the same value ) in python. The integers will have addition and subtraction done on them, and be used for logical comparisons. My initial idea was to create the integer objects up front and try to fill...
Symmetrically adressable matrix
0.099668
0
0
247
1,426,272
2009-09-15T10:05:00.000
0
0
0
0
python,design-patterns,architecture
1,426,368
2
false
1
0
You may be operating under a mis-conception: pickles don't include the code from classes that are pickled. You can add methods to your data structures, and it will not increase the size of your pickles. This is a common misunderstanding about pickles. They don't include code.
1
1
0
Please consult me with your opinions on the following topic: I have a model - a structure of the objects. Such as: Event, containing participants Current task Assignee of each task The model is going to be pickled on the server and transferred over the network to the client GUI application. Because of the pickle I'd ...
Live UI update of model changes when the model contains plain data structures only
0
0
0
108
1,426,779
2009-09-15T12:08:00.000
1
0
0
1
python,google-app-engine,proxy
1,427,324
3
false
1
0
SOCKS is not an HTTP-based protocol, so it's not possible to write a SOCKS proxy on App Engine. Edit: Note I wrote the above when you were specifically referring to a SOCKS proxy. Regarding general HTTP proxy servers, you can't really do that on App Engine, either, because proxies need to be able to accept requests for...
1
2
0
I am looking for a basic open source http proxy server for Google App Engine. Preferably written in Python. Any suggestions?
Proxy for Google App Engine
0.066568
0
0
5,503
1,430,517
2009-09-16T01:51:00.000
0
0
0
0
python,django,multithreading
1,430,541
2
false
1
0
What are you using to restart django? I'd put something in that script to look for process id's in the socket file(s) and kill those before starting django. Alternatively, you could be very heavy handed and just run something like 'pkill -9 *django*' before your django startup sequence.
1
0
0
I'm running Django, and I'm creating threads that run in parallel while Django runs. Those threads sometimes run external processes that block while waiting for external input. When I restart Django, those threads that are blocking while awaiting external input sometimes persist through the restart, and further they ha...
Kill sub-threads when Django restarts?
0
0
0
1,029
1,431,495
2009-09-16T07:30:00.000
11
1
0
0
python
1,431,524
3
false
0
0
Key code? If you send AT commands you are probably sending strings with ascii text and control codes, right? Ctrl-Z is usually 26 (decimal). So chr(26) should work, or if it's a part of a string, '\x1a' as 26 decimal is 1A hex. That said, Ctrl-Z is not usually a part of the AT command set... so if this doesn't help you...
1
6
0
I want to send some modem AT commands using python code, and am wondering what is the keycode for the key combination control+z Gath
What is the keycode for control+z key in python?
1
0
0
13,499
1,432,480
2009-09-16T11:49:00.000
10
0
1
0
python,python-idle
1,435,237
22
false
0
0
There does not appear to be a way to clear the IDLE 'shell' buffer.
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
1
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
53
0
1
0
python,python-idle
24,466,596
22
false
0
0
Most of the answers, here do clearing the DOS prompt screen, with clearing commands, which is not the question. Other answers here, were printing blank lines to show a clearing effect of the screen. The simplest answer of this question is It is not possible to clear python IDLE shell without some external module int...
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
1
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
48
0
1
0
python,python-idle
29,189,588
22
false
0
0
ctrl + L clears the screen on Ubuntu Linux.
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
1
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
3
0
1
0
python,python-idle
42,591,664
22
false
0
0
It seems it is impossible to do it without any external library. An alternative way if you are using windows and don't want to open and close the shell everytime you want to clear it is by using windows command prompt. Type python and hit enter to turn windows command prompt to python idle (make sure python is install...
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
0.027266
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
2
0
1
0
python,python-idle
38,944,644
22
false
0
0
None of these solutions worked for me on Windows 7 and within IDLE. Wound up using PowerShell, running Python within it and exiting to call "cls" in PowerShell to clear the window. CONS: Assumes Python is already in the PATH variable. Also, this does clear your Python variables (though so does restarting the shell)...
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
0.01818
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
5
0
1
0
python,python-idle
51,869,884
22
false
0
0
"command + L" for MAC OS X. "control + L" for Ubuntu Clears the last line on the interactive session
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
0.045423
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
-3
0
1
0
python,python-idle
24,121,785
22
false
0
0
This works for me in Windows: print chr(12)
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
-0.027266
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
5
0
1
0
python,python-idle
4,550,807
22
false
0
0
File -> New Window In the new window** Run -> Python Shell The problem with this method is that it will clear all the things you defined, such as variables. Alternatively, you should just use command prompt. open up command prompt type "cd c:\python27" type "python example.py" , you have to edit this using IDLE when i...
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
0.045423
0
0
585,254
1,432,480
2009-09-16T11:49:00.000
5
0
1
0
python,python-idle
57,809,229
22
false
0
0
It seems like there is no direct way for clearing the IDLE console. One way I do it is use of exit() as the last command in my python script (.py). When I run the script, it always opens up a new console and prompt before exiting. Upside : Console is launched fresh each time the script is executed. Downside : Console i...
9
187
0
I know there's a similar topic about python console, but I do not know if they are the same. I tried system("clear") and it didn't work here. How do I clear python's IDLE window?
Any way to clear python's IDLE window?
0.045423
0
0
585,254
1,434,144
2009-09-16T16:42:00.000
0
0
1
0
python,compiler-construction
19,947,830
8
false
0
0
Answer for Windows first you must install python then set path variable after that write your python program and save think there is a python program that name "hello.py" open cmd.exe then goto the path that you saved your "hello.py" file, and then type python hello.py and press enter key. now the python code is aut...
2
48
0
How can I compile and run a python file (*.py extension)?
Compiling Python
0
0
0
59,572
1,434,144
2009-09-16T16:42:00.000
8
0
1
0
python,compiler-construction
1,434,486
8
false
0
0
Python is an interpreted language, so you don't need to compile it; just to run it. As it happens, the standard version of python will compile this to "bytecode", just like Java etc. does, and will save that (in .pyc files) and run it next time around, saving time, if you haven't updated the file since. If you've upd...
2
48
0
How can I compile and run a python file (*.py extension)?
Compiling Python
1
0
0
59,572
1,435,415
2009-09-16T20:56:00.000
2
0
1
0
python,debugging,memory-management,memory-leaks
9,352,959
9
false
0
0
This is by no means exhaustive advice. But number one thing to keep in mind when writing with the thought of avoiding future memory leaks (loops) is to make sure that anything which accepts a reference to a call-back, should store that call-back as a weak reference.
3
212
0
I have a long-running script which, if let to run long enough, will consume all the memory on my system. Without going into details about the script, I have two questions: Are there any "Best Practices" to follow, which will help prevent leaks from occurring? What techniques are there to debug memory leaks in Python?
Python memory leaks
0.044415
0
0
201,706
1,435,415
2009-09-16T20:56:00.000
3
0
1
0
python,debugging,memory-management,memory-leaks
1,435,434
9
false
0
0
Not sure about "Best Practices" for memory leaks in python, but python should clear it's own memory by it's garbage collector. So mainly I would start by checking for circular list of some short, since they won't be picked up by the garbage collector.
3
212
0
I have a long-running script which, if let to run long enough, will consume all the memory on my system. Without going into details about the script, I have two questions: Are there any "Best Practices" to follow, which will help prevent leaks from occurring? What techniques are there to debug memory leaks in Python?
Python memory leaks
0.066568
0
0
201,706
1,435,415
2009-09-16T20:56:00.000
13
0
1
0
python,debugging,memory-management,memory-leaks
1,435,485
9
false
0
0
You should specially have a look on your global or static data (long living data). When this data grows without restriction, you can also get troubles in Python. The garbage collector can only collect data, that is not referenced any more. But your static data can hookup data elements that should be freed. Another prob...
3
212
0
I have a long-running script which, if let to run long enough, will consume all the memory on my system. Without going into details about the script, I have two questions: Are there any "Best Practices" to follow, which will help prevent leaks from occurring? What techniques are there to debug memory leaks in Python?
Python memory leaks
1
0
0
201,706
1,436,384
2009-09-17T02:03:00.000
2
0
1
0
python,google-app-engine,loops
1,436,401
3
false
0
0
Classes are defined in modules. Modules are created by an import statement. Modules are simply dictionaries. If you want, you can use the dir(x) function on a module named x Or you can use x.__dict__ on a module named x.
1
2
0
How can I iterate over a list of all classes loaded in memory? I'm thinking of doing it for a backup, looking for all classes inheriting from db.Model (Google App Engine). Thanks, Neal Walters
Python - Iterate over all classes
0.132549
0
0
2,014
1,436,411
2009-09-17T02:18:00.000
2
0
1
0
python
1,436,482
6
false
0
0
10B booleans (1.25MB of memory, assuming Python is sane) I think you have your arithmetic wrong -- stored supercompactly, 10B booleans would be 1.25 GIGA, _not__ MEGA, bytes. A list takes at least 4 bytes per item, so you'd need 40GB to do it the way you want. You can store an array (see the array module in the standa...
2
2
1
I'm attempting to shorten the memory footprint of 10B sequential integers by referencing them as indexes in a boolean array. In other words, I need to create an array of 10,000,000,000 elements, but that's well into the "Long" range. When I try to reference an array index greater than sys.maxint the array blows up: x ...
long-index arrays in python
0.066568
0
0
4,919
1,436,411
2009-09-17T02:18:00.000
3
0
1
0
python
1,436,547
6
false
0
0
A dense bit vector is plausible but it won't be optimal unless you know you won't have more than about 10**10 elements, all clustered near each other, with a reasonably randomized distribution. If you have a different distribution, then a different structure will be better. For instance, if you know that in that ran...
2
2
1
I'm attempting to shorten the memory footprint of 10B sequential integers by referencing them as indexes in a boolean array. In other words, I need to create an array of 10,000,000,000 elements, but that's well into the "Long" range. When I try to reference an array index greater than sys.maxint the array blows up: x ...
long-index arrays in python
0.099668
0
0
4,919
1,436,962
2009-09-17T06:07:00.000
9
0
1
0
python,sorting
1,436,981
3
false
0
0
Well, the .sort() method of lists sorts the list in place, while sorted() creates a new list. So if you have a large list, part of your performance difference will be due to copying. Still, an order of magnitude difference seems larger than I'd expect. Perhaps list.sort() has some special-cased optimization that sort...
1
40
1
I know that __builtin__ sorted() function works on any iterable. But can someone explain this huge (10x) performance difference between anylist.sort() vs sorted(anylist) ? Also, please point out if I am doing anything wrong with way this is measured. """ Example Output: $ python list_sort_timeit.py Using sort method...
Python sort() method on list vs builtin sorted() function
1
0
0
63,711
1,437,357
2009-09-17T07:59:00.000
2
1
0
0
python,html,minimize
1,531,684
3
false
1
0
there are bindings to tidy for python, called mxTidy from eGenix (Marc André Lemburg)
1
1
0
I have a cherrypy web server that uses larges amounts of HTML data. Is there anyway in Python to minimize the HTML so that all comments, spaces, ext, are removed?
Python HTML Minimizer
0.132549
0
0
1,549
1,439,533
2009-09-17T15:19:00.000
0
1
0
0
python,exception,binding,exit
8,099,938
2
false
0
1
You can override the library linking with LD_LIBRARY_PATH and make your own exit function. Works fine.
2
7
0
I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. Is there a way to catch this event, or do I need to modify the library to handle error cases differently ? Thank you very much...
How to catch exit() in embedded C++ module from python code?
0
0
0
1,407
1,439,533
2009-09-17T15:19:00.000
7
1
0
0
python,exception,binding,exit
1,439,585
2
true
0
1
You must modify the source of the library. There is no "exception handling" in C and exit() does not return to the calling code under any circumstances.
2
7
0
I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. Is there a way to catch this event, or do I need to modify the library to handle error cases differently ? Thank you very much...
How to catch exit() in embedded C++ module from python code?
1.2
0
0
1,407
1,439,616
2009-09-17T15:33:00.000
0
0
0
0
python,mysql
1,439,734
1
true
0
0
Ha! Just realized I was trying to use the cursor after having closed the connection! In any case, it was nice writing! : ) l
1
0
0
I am just starting out with the MySQLdb module for python, and upon running some SELECT and UPDATE queries, the following gets output: Exception _mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query') in bound method Cursor.del of MySQLdb.cursors.Cursor object at 0x8c0188c igno...
have you seen? _mysql_exceptions.OperationalError "Lost connection to MySQL server during query" being ignored
1.2
1
0
2,148
1,440,245
2009-09-17T17:34:00.000
6
0
0
0
python,psycopg2
1,492,172
2
true
0
0
psycopg2 doesn't pool connections unless you explicitely use the psycopg.pool module.
1
0
0
I have configured pgpool-II for postgres connection pooling and I want to disable psycopg2 connection pooling. How do I do this? Thanks!
How do I disable psycopg2 connection pooling?
1.2
1
0
1,426
1,440,434
2009-09-17T18:07:00.000
1
1
1
0
python,oop,class-design,procedural-programming
1,440,734
5
false
0
0
OOP lends itself well to complex programs. It's great for capturing the state and behavior of real world concepts and orchestrating the interplay between them. Good OO code is easy to read/understand, protects your data's integrity, and maximizes code reuse. I'd say code reuse is one big advantage to keeping your frequ...
3
7
0
I write a lot of scripts in Python to analyze and plot experimental data as well as write simple simulations to test how theories fit the data. The scripts tend to be very procedural; calculate some property, calculate some other property, plot properties, analyze plot... Rather than just writing a procedure, would th...
Class usage in Python
0.039979
0
0
4,545
1,440,434
2009-09-17T18:07:00.000
1
1
1
0
python,oop,class-design,procedural-programming
1,447,527
5
false
0
0
Object-oriented programming isn't the solution to every coding problem. In Python, functions are objects. You can mix as many objects and functions as you want. Modules with functions are already objects with properties. If you find yourself passing a lot of the same variables around — state — an object is probably bet...
3
7
0
I write a lot of scripts in Python to analyze and plot experimental data as well as write simple simulations to test how theories fit the data. The scripts tend to be very procedural; calculate some property, calculate some other property, plot properties, analyze plot... Rather than just writing a procedure, would th...
Class usage in Python
0.039979
0
0
4,545
1,440,434
2009-09-17T18:07:00.000
4
1
1
0
python,oop,class-design,procedural-programming
1,440,655
5
false
0
0
You don't need to use classes in Python - it doesn't force you to do OOP. If you're more comfortable with the functional style, that's fine. I use classes when I want to model some abstraction which has variations, and I want to model those variations using classes. As the word "class" implies, they're useful mainly wh...
3
7
0
I write a lot of scripts in Python to analyze and plot experimental data as well as write simple simulations to test how theories fit the data. The scripts tend to be very procedural; calculate some property, calculate some other property, plot properties, analyze plot... Rather than just writing a procedure, would th...
Class usage in Python
0.158649
0
0
4,545
1,440,941
2009-09-17T19:44:00.000
0
1
0
1
python,linux,process
1,440,965
7
false
0
0
The proc filesystem exports this (and other) information. Look at the /proc/PID/cmd symlink.
3
8
0
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
Finding the command for a specific PID in Linux from Python
0
0
0
9,565
1,440,941
2009-09-17T19:44:00.000
5
1
0
1
python,linux,process
1,443,544
7
false
0
0
Look in /proc/$PID/cmdline, and then os.readlink() on /proc/$PID/exe. /proc/$PID/cmdline is not necessarily going to be correct, as a program can change its argument vector or it may not contain a full path. Three examples of this from my current process list are: avahi-daemon: chroot helper qmgr -l -t fifo -u /usr/sb...
3
8
0
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
Finding the command for a specific PID in Linux from Python
0.141893
0
0
9,565
1,440,941
2009-09-17T19:44:00.000
6
1
0
1
python,linux,process
1,440,969
7
false
0
0
Look in /proc/$PID/cmdline
3
8
0
I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks.
Finding the command for a specific PID in Linux from Python
1
0
0
9,565
1,441,502
2009-09-17T21:47:00.000
4
0
0
0
python,wxpython,wxtextctrl
1,442,312
1
true
0
1
How about setting the style wx.TE_NO_VSCROLL for the wx.TxtCtrl?
1
4
0
I have a wx.TextCtrl that I am using to represent a display with a fixed number of character rows and columns. I would like to hide the vertical scrollbar that is displayed to the right of the text pane since it is entirely unnecessary in my application. Is there a way to achieve this? Also...I would like to hide the b...
Hiding Vertical Scrollbar in wx.TextCtrl
1.2
0
0
2,839
1,441,967
2009-09-18T00:05:00.000
1
0
1
0
python,command-line,libraries,imaging
1,545,544
9
false
0
0
Take a look at some of these imaging libraries: hxxp://pypi.python.org/pypi/collective.croppingimagefield/0.1beta hxxp://pypi.python.org/pypi/cropresize/0.1.1 hxxp://pypi.python.org/pypi/image_resize/1.0
4
10
0
I have python code that needs to do just a couple simple things to photographs: crop, resize, and overlay a watermark. I've used PIL, and the resample/resize results are TERRIBLE. I've used imagemagick, and the interface and commands were designed by packaging a cat in a box, and then repeatedly throwing it down a set ...
Python imaging alternatives
0.022219
0
0
10,072
1,441,967
2009-09-18T00:05:00.000
18
0
1
0
python,command-line,libraries,imaging
1,442,062
9
true
0
0
I've used PIL, and the resample/resize results are TERRIBLE. They shouldn't be, as long as you: use only Image.ANTIALIAS filtering for downscaling operations use only Image.BICUBIC filtering for upscaling operations. remember to convert to 'RGB' colour mode before the resize if you are using a paletted image don't us...
4
10
0
I have python code that needs to do just a couple simple things to photographs: crop, resize, and overlay a watermark. I've used PIL, and the resample/resize results are TERRIBLE. I've used imagemagick, and the interface and commands were designed by packaging a cat in a box, and then repeatedly throwing it down a set ...
Python imaging alternatives
1.2
0
0
10,072
1,441,967
2009-09-18T00:05:00.000
1
0
1
0
python,command-line,libraries,imaging
1,442,011
9
false
0
0
PIL can do good resizing. Make sure your source image is in RGB mode, not palette colors, and try the different algorithm choices.
4
10
0
I have python code that needs to do just a couple simple things to photographs: crop, resize, and overlay a watermark. I've used PIL, and the resample/resize results are TERRIBLE. I've used imagemagick, and the interface and commands were designed by packaging a cat in a box, and then repeatedly throwing it down a set ...
Python imaging alternatives
0.022219
0
0
10,072
1,441,967
2009-09-18T00:05:00.000
1
0
1
0
python,command-line,libraries,imaging
1,442,286
9
false
0
0
GIMP has a reasonable command-line interface, I think.
4
10
0
I have python code that needs to do just a couple simple things to photographs: crop, resize, and overlay a watermark. I've used PIL, and the resample/resize results are TERRIBLE. I've used imagemagick, and the interface and commands were designed by packaging a cat in a box, and then repeatedly throwing it down a set ...
Python imaging alternatives
0.022219
0
0
10,072
1,442,024
2009-09-18T00:22:00.000
3
0
1
1
python,path,executable
1,442,077
3
true
0
0
You can change the current directory of your script with os.chdir(). You can also set environment variables with os.environ
1
1
0
I'm trying to make a Python script run another program from its own path. I've got the execution of the other program working using os.system, but the program will crash because it cannot find its resources (wrong path, I assume). I tried adding the folder harboring the executable to the path, but that didn't help.
Python execute program change path
1.2
0
0
3,173
1,442,264
2009-09-18T02:00:00.000
4
0
1
0
python,c,datetime
1,442,541
6
false
0
0
I should be able to specify a timezone like "US/Eastern" and it should be smart enough to know whether a given timestamp should correspond to EST or EDT. This part isn't always possible - in the same way that 2:30am doesn't exist for one day of the year (in timezones with daylight saving that switches at 2:00a...
1
7
0
I'm wondering if anyone knows of a good date and time library that has correctly-implemented features like the following: Microsecond resolution Daylight savings Example: it knows that 2:30am did not exist in the US on 8 March 2009 for timezones that respect daylight savings. I should be able to specify a timezone li...
Full-featured date and time library
0.132549
0
0
5,826
1,443,173
2009-09-18T08:12:00.000
0
1
0
0
python,testing,mocking,module,monkeypatching
1,443,195
5
false
0
0
Yes, Python can do that, and so long as the methods exposed in the ResourceXSimulated module "look and smell" like these of the original module, the application should not see much any difference (other than, I'm assuming, bogus data fillers, different response times and such).
2
1
0
I want to simulate MyApp that imports a module (ResourceX) which requires a resource that is not available at the time and will not work. A solution for this is to make and import a mock module of ResourceX (named ResourceXSimulated) and divert it to MyApp as ResourceX. I want to do this in order to avoid breaking a l...
Is it possible to divert a module in python? (ResourceX diverted to ResourceXSimulated)
0
0
1
256
1,443,173
2009-09-18T08:12:00.000
1
1
0
0
python,testing,mocking,module,monkeypatching
1,443,281
5
false
0
0
Yes, it's possible. Some starters: You can "divert" modules by manipulating sys.modules. It keeps a list of imported modules, and there you can make your module appear under the same name as the original one. You must do this manipulating before any module that imports the module you want to fake though. You can also m...
2
1
0
I want to simulate MyApp that imports a module (ResourceX) which requires a resource that is not available at the time and will not work. A solution for this is to make and import a mock module of ResourceX (named ResourceXSimulated) and divert it to MyApp as ResourceX. I want to do this in order to avoid breaking a l...
Is it possible to divert a module in python? (ResourceX diverted to ResourceXSimulated)
0.039979
0
1
256
1,444,651
2009-09-18T13:47:00.000
2
0
1
0
python,eclipse,pydev
1,445,869
1
false
0
0
When you hover your cursor over a function or class, Pydev should show you the docstring. Click on the function/class, then press F3, and it will take you to the definition of that function/class. If that is not happening, you probably have not configured Pydev correctly. Look over the documentation again, making sure ...
1
2
0
I've been -trying- to use pydev to do some python (can't say I'm having good times so far). I finally got code completion working for the libraries I'm using, but I'm still wondering about a couple of things... So the library I'm using is called orange. Say I call the function orange.MakeRandomIndices2, but I'm not su...
Pydev code browsing?
0.379949
0
0
894
1,444,961
2009-09-18T14:35:00.000
1
0
1
0
c++,python
2,930,737
13
false
0
0
The Clang project provides libraries for just parsing C++ code. Either with Clang and GCC you can generate an XML representation of the code If you prefer a more Pythonian solution you could also search for a C++ yacc grammar and use py-ply (Yacc for Python), but that seems the solution that needs more work
1
59
0
Google didn't turn up anything that seemed relevant. I have a bunch of existing, working C++ code, and I'd like to use python to crawl through it and figure out relationships between classes, etc. EDIT: Just wanted to point out: I don't think I need or want to parse every bit of C++; I just need something smart enough ...
Is there a good Python library that can parse C++?
0.015383
0
0
34,263
1,445,971
2009-09-18T17:48:00.000
1
0
0
0
python,django,idioms
1,446,128
2
false
1
0
Do you really want to use the db_column="complex" argument and call your field something else?
1
5
0
I have a model that needs to have a field named complex and another one named type. Those are both python reserved names. According to PEP 8, I should name them complex_ and type_ respectively, but django won't allow me to have fields named with a trailing underscore. Whats the proper way to handle this?
Whats the proper idiom for naming django model fields that are python reserved names?
0.099668
0
0
412
1,445,989
2009-09-18T17:52:00.000
3
0
0
0
javascript,python,django
1,446,136
8
false
1
0
You can include <script> tags inside your .html templates, and then build your data structures however is convenient for you. The template language isn't only for HTML, it can also do Javascript object literals. And Paul is right: it might be best to use a json module to create a JSON string, then insert that string i...
3
59
0
I'm using Django and Apache to serve webpages. My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of choices. I want to derive these data from a Python dictionary. I think I know how to embed the JavaScript code in the HTM...
Passing Python Data to JavaScript via Django
0.07486
0
0
89,362
1,445,989
2009-09-18T17:52:00.000
2
0
0
0
javascript,python,django
1,446,060
8
false
1
0
It is suboptimal. Have you considered passing your data as JSON using django's built in serializer for that?
3
59
0
I'm using Django and Apache to serve webpages. My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of choices. I want to derive these data from a Python dictionary. I think I know how to embed the JavaScript code in the HTM...
Passing Python Data to JavaScript via Django
0.049958
0
0
89,362
1,445,989
2009-09-18T17:52:00.000
1
0
0
0
javascript,python,django
1,448,178
8
false
1
0
Putting Java Script embedded into Django template is rather always bad idea. Rather, because there are some exceptions from this rule. Everything depends on the your Java Script code site and functionality. It is better to have seperately static files, like JS, but the problem is that every seperate file needs another...
3
59
0
I'm using Django and Apache to serve webpages. My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of choices. I want to derive these data from a Python dictionary. I think I know how to embed the JavaScript code in the HTM...
Passing Python Data to JavaScript via Django
0.024995
0
0
89,362
1,446,137
2009-09-18T18:20:00.000
4
0
1
0
python,cmd,command-line-interface
1,446,164
1
true
0
0
Yes, it would just be a case of making a number of commands that all reference the same function. This is common. It often helps to provide multiple common aliases for a command. It makes the user's life simpler because the odds of them guessing correctly are improved.
1
2
0
I am making a command line interface in Python 3.1.1 using the cmd module. Is there a way to create a command with more than one name e.g. "quit" and "exit"? Or would it just be a case of making a number of commands that all reference the same function?
Python cmd module command aliases
1.2
0
0
853
1,446,549
2009-09-18T19:58:00.000
8
1
0
0
python,text,binary,file-type
1,446,580
4
false
0
0
It's inherently not simple. There's no way of knowing for sure, although you can take a reasonably good guess in most cases. Things you might like to do: Look for known magic numbers in binary signatures Look for the Unicode byte-order-mark at the start of the file If the file is regularly 00 xx 00 xx 00 xx (for arbit...
1
17
0
I need identify which file is binary and which is a text in a directory. I tried use mimetypes but it isnt a good idea in my case because it cant identify all files mimes, and I have strangers ones here... I just need know, binary or text. Simple ? But I couldn´t find a solution... Thanks
How to identify binary and text files using Python?
1
0
0
20,864
1,446,672
2009-09-18T20:28:00.000
0
0
0
0
wxpython
1,483,678
1
false
0
1
If the main panel has the accelerator table with Alt+b, this should work. Maybe the sub-panels have their own accelerator tables that are conflicting? You might try inactivating these with subpanel.SetAcceleratorTable(wx.NullAcceleratorTable) for each subpanel.
1
2
0
Accelerators on wxPython do not seem to work with nested panels. In other words: ----------------------------------------------- | Main panel | | ----------------- ----------------- | | | Subpanel 1 | | Subpanel 2 | | | | accelerator | | ac...
wxPython, nested panels and accelerators
0
0
0
336
1,447,422
2009-09-19T01:19:00.000
1
0
1
0
python
1,447,430
1
true
0
0
Python is pretty smart about knowing where it is run from. What happens if you just copy the whole directory tree to the thumb drive?
1
1
0
I have installed python from .msi installer in windows and installed a lot of other modules. i would like to have all these available on a portable thumbdrive, but i don't want to redownload all the extramodules. Is there a way i can convert my C:\python26* to a portable python installation?
Installed Python to portable python
1.2
0
0
450
1,447,575
2009-09-19T02:44:00.000
18
0
1
0
python,winapi,symlink,pywin32
20,511,634
10
false
0
0
os.symlink works on Python 3.3 using Windows 8.1 with an NTFS filesystem.
1
45
0
Does anyone know of a way to make/read symbolic links across versions of win32 from Python? Ideally there should be a minimum amount of platform specific code, as I need my app to be cross platform.
Symlinks on windows?
1
0
0
38,996
1,448,308
2009-09-19T10:42:00.000
4
0
0
0
python,google-app-engine,role-based
1,448,733
1
true
1
0
I would do this by adding a ListProperty for roles to the model representing users. The list contains any roles a given user belongs to. This way if you want to know whether a given user belongs to a given role (I expect, the most common operation), it is a fast membership test. You could put the role names directly in...
1
5
0
I would like to ask what is the common way for handling role-based security with Google App Engine, Python? In the app.yaml, there is the "login" section, but available values are only "admin" and "required". How do you normally handle role-based security? Create the model with two tables: Roles and UserRoles Import v...
Role-based security with Google App Engine and Python
1.2
0
0
2,588
1,448,582
2009-09-19T13:47:00.000
0
0
0
0
ironpython
1,448,617
2
false
0
0
Well i can\t quite get exactly what are you looking for, whole solution or maybe you've got problem with colors, if that second thing below you got some ideas The most simple solution would be to create 14-elements array with color that you write from hand with help of some graphic software and than simply fetch elemen...
1
0
1
I am trying to plot some data in ipy. The data consists of three variables alpha,beta and delta. The alpha and beta values are the coordinates of the data points that I wish to plot using a hammer projection. I want to scale the colour of the markers according to the delta values, preferably in a rainbow scale colormap...
Colour map in ipython
0
0
0
279
1,449,935
2009-09-20T00:33:00.000
3
0
1
0
python,svn,revision
1,450,760
11
false
0
0
I do this by simply running a small script when building my project. The script just calls svn info in combination with sed to get out the bare revision data and injects that number into the revision.txt file. The Hudson build server makes it even easier as it sets the SVN revision number as an environment variable ri...
2
19
0
I have a python project under SVN, and I'm wanting to display the version number when it is run. Is there any way of doing this (such as automatically running a short script on commit which could update a version file, or querying an SVN repository in Python?)
Getting SVN revision number into a program automatically
0.054491
0
0
31,518
1,449,935
2009-09-20T00:33:00.000
1
0
1
0
python,svn,revision
1,458,623
11
false
0
0
I find the when it is run section slightly ambiguous - when it is run from where ? From an SVN checkout or from released code ? All the solutions work on injecting the SVN version somehow into the Python source or somewhere in the repository in a separate version file. The version file is changed on fresh checkouts, so...
2
19
0
I have a python project under SVN, and I'm wanting to display the version number when it is run. Is there any way of doing this (such as automatically running a short script on commit which could update a version file, or querying an SVN repository in Python?)
Getting SVN revision number into a program automatically
0.01818
0
0
31,518
1,450,038
2009-09-20T01:33:00.000
0
1
0
0
python,queue
1,450,105
3
false
0
0
Are you considering single machine architecture, or a cluster of machines? Forwarding the image to an available worker process on the same machine or a different machine isn't profoundly different, particularly if you use TCP sockets. Knowing what workers are available, spawning more if necessary and the resources ar...
1
2
0
I'm building a mobile photo sharing site in Python similar to TwitPic and have been exploring various queues to handle the image processing. I've looked into RabbitMQ and ActiveMQ but I'm thinking that there is a better solution for my use case. I'm looking for something a little more lightweight. I'm open to any sugg...
Which queue is most appropriate?
0
0
0
290
1,450,180
2009-09-20T03:06:00.000
-5
0
0
0
python,tkinter
41,727,157
3
false
0
1
It is really simple in PyQt4 simply use this one single line below and you will be able to change focus by pressing tab button: self.textEdit.setTabChangesFocus(True)
1
15
0
I'm new to Python and I'm trying to create a simple GUI using Tkinter. So often in many user interfaces, hitting the tab button will change the focus from one Text widget to another. Whenever I'm in a Text widget, tab only indents the text cursor. Does anyone know if this is configurable?
Change the focus from one Text widget to another
-1
0
0
13,443
1,450,478
2009-09-20T06:59:00.000
10
0
1
1
python
1,451,204
6
false
0
0
It depends on what you mean by "a running python script". __file__ will give you the name of the currently executing file. If that's a module, you'll get where it was imported from e.g. blahblah.pyc sys.argv[0] will give you the name of the script that is being run, even if called from a module that that script importe...
2
12
0
How do I get the name of a running Python script? I tried os.__file__ but that returns the name of the file where os resides.
How to get the name of a running Python script?
1
0
0
16,150
1,450,478
2009-09-20T06:59:00.000
1
0
1
1
python
1,450,484
6
false
0
0
sys.argv[0] should give you the name of the script.
2
12
0
How do I get the name of a running Python script? I tried os.__file__ but that returns the name of the file where os resides.
How to get the name of a running Python script?
0.033321
0
0
16,150
1,450,897
2009-09-20T12:14:00.000
0
0
1
0
python,string
56,201,293
17
false
0
0
I used this. 'letters' should contain all the letters that you want to get rid of: Output = Input.translate({ord(i): None for i in 'letters'})) Example: Input = "I would like 20 dollars for that suit" Output = Input.translate({ord(i): None for i in 'abcdefghijklmnopqrstuvwxzy'})) print(Output) Output: 20
1
173
0
How can I remove all characters except numbers from string?
Remove characters except digits from string using Python?
0
0
0
259,411
1,451,138
2009-09-20T14:27:00.000
85
0
0
0
python,django,django-templates
1,451,155
18
true
1
0
I think what you want is to have access to the request context, see RequestContext.
2
202
0
How do I get the domain name of my current site from within a Django template? I've tried looking in the tag and filters but nothing there.
How can I get the domain name of my site within a Django template?
1.2
0
0
188,129
1,451,138
2009-09-20T14:27:00.000
-6
0
0
0
python,django,django-templates
23,763,770
18
false
1
0
You can use {{ protocol }}://{{ domain }} in your templates to get your domain name.
2
202
0
How do I get the domain name of my current site from within a Django template? I've tried looking in the tag and filters but nothing there.
How can I get the domain name of my site within a Django template?
-1
0
0
188,129
1,451,349
2009-09-20T16:01:00.000
2
0
0
0
python,sockets
1,451,356
2
true
0
0
There are two problems here. First problem, you will need to be able to address the remote party. This is related to what you referred to as "does not work over Internet as most ISP don't allow TCP server socket". It is usually difficult because the other party could be placed behind a NAT or a firewall. As for the s...
2
1
0
I want to stream a binary data using python. I do not have any idea how to achieve it. I did created python socket program using SOCK_DGRAM. Problem with SOCK_STREAM is that it does not work over internet as our isp dont allow tcp server socket. I want to transmit screen shots periodically to remote computer. I have ...
How to stream binary data in python
1.2
0
1
1,737
1,451,349
2009-09-20T16:01:00.000
3
0
0
0
python,sockets
1,451,365
2
false
0
0
SOCK_STREAM is the correct way to stream data. What you're saying about ISPs makes very little sense; they don't control whether or not your machine listens on a certain port on an interface. Perhaps you're talking about firewall/addressing issues? If you insist on using UDP (and you shouldn't because you'll have to wo...
2
1
0
I want to stream a binary data using python. I do not have any idea how to achieve it. I did created python socket program using SOCK_DGRAM. Problem with SOCK_STREAM is that it does not work over internet as our isp dont allow tcp server socket. I want to transmit screen shots periodically to remote computer. I have ...
How to stream binary data in python
0.291313
0
1
1,737
1,452,148
2009-09-20T22:06:00.000
0
0
0
1
python,windows,windows-vista,pywin32
4,610,520
5
false
0
0
You could leverage the Tcl you have available with Tkinter, as that has a 'file link' command that knows about junctions, unlike Pythons os module.
1
4
0
Currently the buildout recipe collective.recipe.omelette uses junction.exe on all versions of Windows to create symlinks. However junction.exe does not come with Windows by default and most importantly does not support creating symlinks to files (only directories) which causes a problem with quite a few Python packages...
Detecting symlinks (mklink) on Vista/7 in Python without Pywin32
0
0
0
1,727
1,452,509
2009-09-21T01:24:00.000
1
1
1
0
python
1,452,566
9
false
0
0
Well, the short answer is, since you mentioned Perl, anything you could build in Perl you could build in Python. You can build anything in any language, and if the language has easy C bindings, you could even do it efficiently. Now, this being the case, the question becomes somewhat philosophical. Python has as a k...
5
25
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
What kind of applications are built using Python?
0.022219
0
0
80,717
1,452,509
2009-09-21T01:24:00.000
1
1
1
0
python
1,452,576
9
false
0
0
Most of the 3d packages these days, such as Maya, SoftImage, Houdini, RealFlow, Blender, etc. all use Python as an embedded scripting and plugin language.
5
25
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
What kind of applications are built using Python?
0.022219
0
0
80,717
1,452,509
2009-09-21T01:24:00.000
10
1
1
0
python
1,452,546
9
false
0
0
You say: I am new to Python world but I know it's an scripting language. I think the distinction between "scripting languages" and "programming languages" is quite arbitrary. Nearly every language developed in the last 10-20 years has some kind of runtime support, usually in the form of a bytecode interpreter or vir...
5
25
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
What kind of applications are built using Python?
1
0
0
80,717
1,452,509
2009-09-21T01:24:00.000
33
1
1
0
python
1,452,532
9
true
0
0
It's hard to think of kinds of general applications where Python would be unsuitable, but there are several kinds where, like just about all higher-level languages akin to it, it might be considered a peculiar and probably inferior choice. In "hard real time" applications, all dynamic memory allocation and freeing, and...
5
25
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
What kind of applications are built using Python?
1.2
0
0
80,717
1,452,509
2009-09-21T01:24:00.000
0
1
1
0
python
1,452,528
9
false
0
0
Bittorrent was built on Python.
5
25
0
I wanted to know Python is suited for what kind of applications? I am new to Python world but I know it's a scripting language like Perl but I was not sure about the kind of applications which one would build using Python and would certainly appreciate if someone can provide some useful information.
What kind of applications are built using Python?
0
0
0
80,717
1,452,652
2009-09-21T02:44:00.000
4
0
0
0
java,php,python,ruby-on-rails
1,452,676
8
false
1
0
You've already tagged your question with "java", "php", "python", and "ruby-on-rails", so researching and learning more about those tools would probably help to answer your question. However, I believe that rapidly building an application is almost never actually the correct goal. Normally, what you want to do is buil...
4
5
0
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be: Faster to learn. Ease of use. Have widgets for rapid development(From a GUI perspective). Database integration. I would want this web app to communicate to a Java client. I am n...
How to rapidly build a Web Application?
0.099668
0
0
4,394
1,452,652
2009-09-21T02:44:00.000
1
0
0
0
java,php,python,ruby-on-rails
1,452,751
8
false
1
0
Speaking only in terms of speed of development, Ruby on Rails is the fastest one out there.
4
5
0
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be: Faster to learn. Ease of use. Have widgets for rapid development(From a GUI perspective). Database integration. I would want this web app to communicate to a Java client. I am n...
How to rapidly build a Web Application?
0.024995
0
0
4,394
1,452,652
2009-09-21T02:44:00.000
2
0
0
0
java,php,python,ruby-on-rails
1,453,699
8
false
1
0
I would say part of the learning curve will go into understanding concepts. I have been learning about web-apps for some months now, and with my improved understanding of concepts right now, most frameworks show very much similarities. Here are my results so far: PHP: Great to learn about concepts for doing forms, ht...
4
5
0
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be: Faster to learn. Ease of use. Have widgets for rapid development(From a GUI perspective). Database integration. I would want this web app to communicate to a Java client. I am n...
How to rapidly build a Web Application?
0.049958
0
0
4,394
1,452,652
2009-09-21T02:44:00.000
1
0
0
0
java,php,python,ruby-on-rails
1,452,667
8
false
1
0
There are tons, which ones are "good" depend on what you need. There's Ruby on Rails, which is pretty handy. For python there's django. For PHP (I spend a lot of time dealing with PHP), you can look at: symfony cakePHP Solar Zend Framework Which are all good in certain situations, and annoying in others.
4
5
0
To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be: Faster to learn. Ease of use. Have widgets for rapid development(From a GUI perspective). Database integration. I would want this web app to communicate to a Java client. I am n...
How to rapidly build a Web Application?
0.024995
0
0
4,394
1,452,694
2009-09-21T02:59:00.000
0
0
1
0
python,loops
1,452,705
5
false
0
0
What you want is two arrays and one loop, iterate over each array once, adding the results.
2
6
0
I want to create a loop who has this sense: for i in xrange(0,10): for k in xrange(0,10): z=k+i print z where the output should be 0 2 4 6 8 10 12 14 16 18
Creating Simultaneous Loops in Python
0
0
0
12,942
1,452,694
2009-09-21T02:59:00.000
2
0
1
0
python,loops
1,452,706
5
false
0
0
You can do this in python - just have to make the tabs right and use the xrange argument for step. for i in xrange(0, 20, 2); print i
2
6
0
I want to create a loop who has this sense: for i in xrange(0,10): for k in xrange(0,10): z=k+i print z where the output should be 0 2 4 6 8 10 12 14 16 18
Creating Simultaneous Loops in Python
0.07983
0
0
12,942
1,453,952
2009-09-21T10:52:00.000
2
0
1
0
python,module,standard-library
3,057,772
16
false
0
0
I think everyone here got all the important ones, except for sys. If you look at actual Python code, sys is probably one of the most commonly used modules (usually because of sys.version). Also, it's not really a module, but I would mention __future__. And nobody should use Python without doing import this.
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
0.024995
0
0
24,060
1,453,952
2009-09-21T10:52:00.000
3
0
1
0
python,module,standard-library
1,456,618
16
false
0
0
os and os.path: because those are the core modules which anyone will require to write platform independent code in python and students can switch from shell script to python script after learning os and os.path.
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
0.037482
0
0
24,060
1,453,952
2009-09-21T10:52:00.000
4
0
1
0
python,module,standard-library
1,454,636
16
false
0
0
operator, next to what's already mentioned.
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
0.049958
0
0
24,060
1,453,952
2009-09-21T10:52:00.000
7
0
1
0
python,module,standard-library
5,252,164
16
false
0
0
I just remember a very practical module: copy. I use the deepcopy() from it quite often.
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
1
0
0
24,060
1,453,952
2009-09-21T10:52:00.000
1
0
1
0
python,module,standard-library
1,454,028
16
false
0
0
Aside from those you mentioned, I found subprocess and sqlite3 modules particularly useful. But I would certainly advice to students to take a look at the list of standard library modules themselves. Also, from modules outside of standard library, I would mention numpy (or numarray) and pyparsing.
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
0.012499
0
0
24,060
1,453,952
2009-09-21T10:52:00.000
3
0
1
0
python,module,standard-library
1,454,580
16
false
0
0
Don't forget about datetime, weakref, pickle, StringIO, heapq, may be threading. And numpy also worths mentioning, although it is not from the standard library.
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
0.037482
0
0
24,060
1,453,952
2009-09-21T10:52:00.000
41
0
1
0
python,module,standard-library
1,454,779
16
true
0
0
Modules to cover in a 1-2 hour slot entirely depend on your audience's interest or focus. What other classes are they taking? What are they prepared to make use of immediately? Be sure to mention math, decimal and datetime and time and re. For IT-types who will be doing file-oriented work: glob, fnmatch, os, os.path,...
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
1.2
0
0
24,060
1,453,952
2009-09-21T10:52:00.000
6
0
1
0
python,module,standard-library
1,454,863
16
false
0
0
It depends a little on what they will be doing and what level they are. Some modules I wish someone pointed out to me when I started are: StringIO - to stop them from reimplementing it, which they will if they don't discover it. logging - to put them on the right path when it comes to debug printouts pickle - to stop ...
11
55
0
I am teaching a graduate level Python class at the University of Paris, and the students need to be introduced to the standard library. I want to discuss with them about some of the most important standard modules. What modules do you think are absolute musts? Even though responses probably vary depending on your fie...
Most useful Python modules from the standard library?
1
0
0
24,060