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,515,673
2010-08-18T18:59:00.000
3
0
1
1
python,installation,uninstallation
53,206,032
14
false
0
0
It's actually quite simple. When you installed it, you must have done it using some .exe file (I am assuming). Just run that .exe again, and then there will be options to modify Python. Just select the "Complete Uninstall" option, and the EXE will completely wipe out python for you. Also, you might have to checkbox the...
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
0.042831
0
0
600,614
3,515,673
2010-08-18T18:59:00.000
3
0
1
1
python,installation,uninstallation
71,832,157
14
false
0
0
First, uninstall Python, then remove the pip packages you installed. Uninstall Python: "Add or Remove Programs", search for Python and uninstall it. Remove Pip packages: type in File Explorer %LOCALAPPDATA%\Programs\Python, and remove the folders you want. This will clean up any pip package you installed. Otherwise, ...
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
0.042831
0
0
600,614
3,515,673
2010-08-18T18:59:00.000
3
0
1
1
python,installation,uninstallation
69,742,157
14
false
0
0
If you still have the python installer on your PC, you can double-click on it (run it, it will open the installer window), and select the "Uninstall" option. It will uninstall that python version (if the installer is for Python3.9, then Python3.9 will be uninstalled, if it is for Python3.10, then that version...)
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
0.042831
0
0
600,614
3,515,673
2010-08-18T18:59:00.000
2
0
1
1
python,installation,uninstallation
51,663,703
14
false
0
0
Uninstall the python program using the windows GUI. Delete the containing folder e.g if it was stored in C:\python36\ make sure to delete that folder
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
0.028564
0
0
600,614
3,515,673
2010-08-18T18:59:00.000
1
0
1
1
python,installation,uninstallation
36,202,297
14
false
0
0
I know it is an old question, but I ran into this problem with 2.7 and 3.5. Though 2.7 would not show up in my default windows uninstall list, it showed up fine in the ccleaner tools tab under uninstall. Uninstalled and reinstalled afterwards and it has been smooth coding ever since.
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
0.014285
0
0
600,614
3,515,673
2010-08-18T18:59:00.000
0
0
1
1
python,installation,uninstallation
35,889,457
14
false
0
0
Windows 7 64-bit, with both Python3.4 and Python2.7 installed at some point :) I'm using Py.exe to route to Py2 or Py3 depending on the script's needs - but I previously improperly uninstalled Python27 before. Py27 was removed manually from C:\python\Python27 (the folder Python27 was deleted by me previously) Upon re-i...
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
0
0
0
600,614
3,515,673
2010-08-18T18:59:00.000
1
0
1
1
python,installation,uninstallation
3,515,850
14
false
0
0
Almost all of the python files should live in their respective folders (C:\Python26 and C:\Python27). Some installers (ActiveState) will also associate .py* files and add the python path to %PATH% with an install if you tick the "use this as the default installation" box.
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
0.014285
0
0
600,614
3,515,673
2010-08-18T18:59:00.000
-1
0
1
1
python,installation,uninstallation
66,791,174
14
false
0
0
Windows Start Menu > Settings > Apps > Apps & features > Select the app and click the Uninstall button
12
123
0
I installed both Python 2.7 and Python 2.6.5. I don't know what went wrong, but nothing related to Python seems to work any more. e.g. "setup.py install" for certain packages don't recognize the "install" parameter and other odd phenomena... I would like to completely remove Python from my system. I tried running the 2...
How to completely remove Python from a Windows machine?
-0.014285
0
0
600,614
3,516,560
2010-08-18T20:49:00.000
1
0
1
0
python,c
6,150,403
7
false
0
0
As someone who has worked with Java for over 12 years, I found that picking up a problem and solving it in a new language is the best way to learn. I don't believe in reading - it wastes a huge amount of time, and you can easily end up reading for too long. My advice is to find a problem and set off to solve it with Py...
3
18
0
I've got a good grasp on C, my first programming language. I know a reasonable number of tricks and techniques and have written quite a few programs, mostly for scientific stuff. Now I'd like to branch out and understand OOP, and Python seems like a good direction to go. I've seen several questions on how to learn Pyth...
Coming from C, how should I learn Python?
0.028564
0
0
22,778
3,516,560
2010-08-18T20:49:00.000
1
0
1
0
python,c
3,517,315
7
false
0
0
Diveintopython, official docs, "Learning python" by Mark Lutz(4th edition) is one of the best books.
3
18
0
I've got a good grasp on C, my first programming language. I know a reasonable number of tricks and techniques and have written quite a few programs, mostly for scientific stuff. Now I'd like to branch out and understand OOP, and Python seems like a good direction to go. I've seen several questions on how to learn Pyth...
Coming from C, how should I learn Python?
0.028564
0
0
22,778
3,516,560
2010-08-18T20:49:00.000
32
0
1
0
python,c
3,516,905
7
true
0
0
I knew C before I knew Python. No offence intended, but I don't think that your C knowledge is that big a deal. Unless you read very, very slowly, just set out to learn Python. It won't take that long to skim through the material you're familiar with, and it's not as if a Python tutorial aimed at C programmers will mak...
3
18
0
I've got a good grasp on C, my first programming language. I know a reasonable number of tricks and techniques and have written quite a few programs, mostly for scientific stuff. Now I'd like to branch out and understand OOP, and Python seems like a good direction to go. I've seen several questions on how to learn Pyth...
Coming from C, how should I learn Python?
1.2
0
0
22,778
3,517,011
2010-08-18T21:49:00.000
1
1
0
1
python,c,python-module,i2c
3,517,141
5
false
0
0
Don't use the Python C API, there are much easier alternatives, most notably cython. cython is a Python-like language, which compiles into C code for the Python c library. Basically it's C with Python syntax and features (e.g. nice for loops, exceptions, etc.). cython is clearly the most recommendable way to write ...
3
1
0
So I have a C program to interface with an i2c device. I need to interface to that device from python. I'm just wondering if it's worth porting the program into a python module or if the amount of effort involved in porting won't outweigh just executing the program using subprocess. I know I'm sure it's different for e...
Extending python with C module
0.039979
0
0
471
3,517,011
2010-08-18T21:49:00.000
0
1
0
1
python,c,python-module,i2c
3,517,152
5
false
0
0
I've had good luck using ctypes. Whatever you choose, though, you may not gain any time this time but the next time around your effort will be much faster than doing the whole thing in C.
3
1
0
So I have a C program to interface with an i2c device. I need to interface to that device from python. I'm just wondering if it's worth porting the program into a python module or if the amount of effort involved in porting won't outweigh just executing the program using subprocess. I know I'm sure it's different for e...
Extending python with C module
0
0
0
471
3,517,011
2010-08-18T21:49:00.000
2
1
0
1
python,c,python-module,i2c
3,517,190
5
false
0
0
One of the first Python programs I wrote was a script that called functions from a C library, which sounds close to what you're doing. I used ctypes, and I was impressed as to how easy it was: I could access each library function from python by writing just a few lines of python (no C at all!). I'd tried the Python C A...
3
1
0
So I have a C program to interface with an i2c device. I need to interface to that device from python. I'm just wondering if it's worth porting the program into a python module or if the amount of effort involved in porting won't outweigh just executing the program using subprocess. I know I'm sure it's different for e...
Extending python with C module
0.07983
0
0
471
3,517,410
2010-08-18T22:58:00.000
-2
1
1
0
python,unit-testing,interactive,ipython
3,517,604
3
false
0
0
Are you really sure you want to do this? Your unit tests should do one thing, should be well-named, and should clearly print what failed. If you do all of that, the failure message will pinpoint what went wrong; no need to go look at it interactively. In fact, one of the big advantages of TDD is that it helps you av...
1
3
0
I'd like to be able to enter an interactive session, preferably with IPython, if a unit test fails. Is there an easy way to do this? edit: by "interactive session" I mean a full Python REPL rather than a pdb shell. edit edit: As a further explanation: I'd like to be able to start an interactive session that has access...
drop into an interactive session to examine a failed unit test
-0.132549
0
0
1,014
3,517,841
2010-08-19T00:33:00.000
1
0
0
0
python,qt,networking,pyqt,thin
3,517,886
2
true
0
1
Your desire to send "app logic" from the server to the client without sending "code" is inherently self-contradictory, though you may not realize that yet -- even if the "logic" you're sending is in some simplified ad-hoc "language" (which you don't even think of as a language;-), to all intents and purposes your Pytho...
1
0
0
Here is what I would like to do, and I want to know how some people with experience in this field do this: With three POST requests I get from the http server: widgets and layout and then app logic (minimal) data Or maybe it's better to combine the first two or all three. I'm thinking of using pyqt. I think I can loa...
how to implement thin client app with pyqt
1.2
0
1
1,647
3,518,465
2010-08-19T03:15:00.000
2
0
1
0
dll,types,ironpython
3,518,530
1
true
0
0
For import you need to know the namespaces or type names if not in a namespace to import them. But you can do "test = clr.LoadAssemblyFromFileWithPath(...)" which will return an assembly object. In IronPython assembly objects support dotting through them so you could then access the namespaces/types directly from tha...
1
2
0
import clr clr.AddReferenceToFileAndPath(r'E:\MyDocuments\Surface Extension\Samples\test.dll') But, How to watch the types in the test.dll. import test I got : error: No module named test Shold I must know the types in the test.dll??
How to watch the types in dll?
1.2
0
0
156
3,519,565
2010-08-19T07:14:00.000
0
0
1
0
python,regex,indexing
61,329,622
3
false
0
0
This should solve your issue pattern=r"(?=(\"[^\"]+\"|'[^']+'))" Then use the following to get all overlapping indices, indicesTuple=[(mObj.start(1),mObj.end(1)-1) for mObj in re.finditer(pattern,input)]
1
97
0
I'm parsing strings that could have any number of quoted strings inside them (I'm parsing code, and trying to avoid PLY). I want to find out if a substring is quoted, and I have the substrings index. My initial thought was to use re to find all the matches and then figure out the range of indexes they represent. It s...
Find the indexes of all regex matches?
0
0
0
111,929
3,520,672
2010-08-19T10:07:00.000
1
0
0
0
python,scipy
3,520,715
2
false
0
0
Yes. Those integrals (I'll assume they're area integrals over a region in 2D space) can be calculated using an appropriate quadrature rule. You can also use Green's theorem to convert them into contour integrals and use Gaussian quadrature to integrate along the path.
2
1
1
(Couldn't upload the picture showing the integral as I'm a new user.)
Can scipy calculate (double) integrals with complex-valued integrands (real and imaginary parts in integrand)?
0.099668
0
0
571
3,520,672
2010-08-19T10:07:00.000
0
0
0
0
python,scipy
3,526,740
2
false
0
0
Thanks duffymo! I am calculating Huygens-Fresnel diffraction integrals: plane and other wave diffraction through circular (2D) apertures in polar coordinates. As far as the programming goes: Currently a lot of my code is in Mathematica. I am considering changing to one of: scipy, java + flanagan math library, java + ap...
2
1
1
(Couldn't upload the picture showing the integral as I'm a new user.)
Can scipy calculate (double) integrals with complex-valued integrands (real and imaginary parts in integrand)?
0
0
0
571
3,521,548
2010-08-19T12:05:00.000
0
0
0
0
python,local,wsgi
4,376,995
3
false
1
0
Earlier today I saw exactly what you're asking for -- a way to call WSGI through an API without actually connecting over the network. However, it shouldn't be that hard. On a side note, you might want to look at PySide, of particular interest to you may be the ability to bind python elements to DOM events, so if you'r...
1
8
0
Disclaimer: I'm not very familiar with any of the things mentioned in the question title. Would it be possible to use a browser control (like Webkit) as a frontend for a WSGI app (using a framework like Flask) without starting a local WSGI server? Basically the requests and responses are managed by a middle layer betwe...
Embedded WSGI backend for Python desktop app using webkit
0
0
0
921
3,522,372
2010-08-19T13:42:00.000
78
0
1
0
python,path,directory,nlp,nltk
3,903,787
7
false
0
0
Just change items of nltk.data.path, it's a simple list.
2
96
0
How to config nltk data directory from code?
How to config nltk data directory from code?
1
0
0
63,097
3,522,372
2010-08-19T13:42:00.000
0
0
1
0
python,path,directory,nlp,nltk
56,460,309
7
false
0
0
Another solution is to get ahead of it. try import nltk nltk.download() When the window box pops up asking if you want to download the corpus , you can specify there which directory it is to be downloaded to.
2
96
0
How to config nltk data directory from code?
How to config nltk data directory from code?
0
0
0
63,097
3,522,380
2010-08-19T13:43:00.000
0
0
1
0
python,python-3.x
3,522,548
7
false
0
0
I would say to teach Python 2.*, as while Python 3 is the new hotness, there are very few supported libraries yet, and the vast majority of resources on the web are for older Python versions.
6
7
0
Which is more suited as the platform for a first course in computing: Python 2 or Python 3? Reason for asking your opinion: Python 2 is used in the vast majority of installations worlwide, but Python 3 is the coming thing.
Python 2 or Python 3 as the student's first language
0
0
0
476
3,522,380
2010-08-19T13:43:00.000
0
0
1
0
python,python-3.x
3,522,512
7
false
0
0
Python 2. Unfortunately library support for python 3 is dismal.
6
7
0
Which is more suited as the platform for a first course in computing: Python 2 or Python 3? Reason for asking your opinion: Python 2 is used in the vast majority of installations worlwide, but Python 3 is the coming thing.
Python 2 or Python 3 as the student's first language
0
0
0
476
3,522,380
2010-08-19T13:43:00.000
4
0
1
0
python,python-3.x
3,522,458
7
false
0
0
I would say that it depends on your curriculum. If you are going to be using/showing some open source libraries, you may have issues with some of them working on 3, so in that case go with 2. If you're just showing the language itself and having your students write everything from scratch without the use of any exter...
6
7
0
Which is more suited as the platform for a first course in computing: Python 2 or Python 3? Reason for asking your opinion: Python 2 is used in the vast majority of installations worlwide, but Python 3 is the coming thing.
Python 2 or Python 3 as the student's first language
0.113791
0
0
476
3,522,380
2010-08-19T13:43:00.000
0
0
1
0
python,python-3.x
3,522,531
7
false
0
0
For a student, my recomendation is python 2.x, because older it is, easier you find code exapmles and usage of pythonic functions. If you choose to study python 3, you may have problem finding code examples and help. Also there is much more python 2.x expert than 3.0.
6
7
0
Which is more suited as the platform for a first course in computing: Python 2 or Python 3? Reason for asking your opinion: Python 2 is used in the vast majority of installations worlwide, but Python 3 is the coming thing.
Python 2 or Python 3 as the student's first language
0
0
0
476
3,522,380
2010-08-19T13:43:00.000
3
0
1
0
python,python-3.x
3,522,941
7
false
0
0
Frankly, I think you have a great opportunity to teach your students a valuable lesson: keeping their skills up-to-date while daily dealing with "older" code. This is a simple reality in life they'll have to grasp if they want to be successful programmers (heck, it's likely true for most jobs). Here's how I would appr...
6
7
0
Which is more suited as the platform for a first course in computing: Python 2 or Python 3? Reason for asking your opinion: Python 2 is used in the vast majority of installations worlwide, but Python 3 is the coming thing.
Python 2 or Python 3 as the student's first language
0.085505
0
0
476
3,522,380
2010-08-19T13:43:00.000
0
0
1
0
python,python-3.x
3,522,722
7
false
0
0
id say python 2, python 2 has been around for a while and is very mature, with a lot of libraries and modules and major frameworks available for it. Python 3 is very new, and doesnt have many libraries yet. I guess this will be the scenario for a couple of years.
6
7
0
Which is more suited as the platform for a first course in computing: Python 2 or Python 3? Reason for asking your opinion: Python 2 is used in the vast majority of installations worlwide, but Python 3 is the coming thing.
Python 2 or Python 3 as the student's first language
0
0
0
476
3,522,584
2010-08-19T14:07:00.000
1
0
1
0
python,web-services,sandbox
4,007,217
5
false
0
0
You definitely don't want to test with live data first. In order to build the integration test, you should first mock your dependencies and use I/O sets you control. Having expected input and output is very important. Building those unit tests will help you immensely when doing your integration testing. As for your ...
3
4
0
I'm building an integration test for a web application that has multiple interdependent services. All of them depend on a shared resource in order to run correctly. I'd like to make sure that the data in the system is sane when its live so I'm leveraging a live service. I'm using Python to build it and this is my idea ...
Sandboxing web services with Python
0.039979
0
0
308
3,522,584
2010-08-19T14:07:00.000
0
0
1
0
python,web-services,sandbox
4,044,514
5
false
0
0
Perhaps you should take a step back and ask a few questions first. What is the most important part to have tested? How difficult is it to setup that test? Is the cost of setting up the test worth getting the test results? Can I have most of what I wanted tested with a simpler test? Any way you go I would use a fixtur...
3
4
0
I'm building an integration test for a web application that has multiple interdependent services. All of them depend on a shared resource in order to run correctly. I'd like to make sure that the data in the system is sane when its live so I'm leveraging a live service. I'm using Python to build it and this is my idea ...
Sandboxing web services with Python
0
0
0
308
3,522,584
2010-08-19T14:07:00.000
0
0
1
0
python,web-services,sandbox
3,591,657
5
false
0
0
The third possibility is the easiest - avoid any locking issues by having your own daemon be the intermediate and have it be the only process with direct access to the resource, and all other processes need to go through it to get access.
3
4
0
I'm building an integration test for a web application that has multiple interdependent services. All of them depend on a shared resource in order to run correctly. I'd like to make sure that the data in the system is sane when its live so I'm leveraging a live service. I'm using Python to build it and this is my idea ...
Sandboxing web services with Python
0
0
0
308
3,522,641
2010-08-19T14:13:00.000
2
0
0
0
python,windows,http
3,522,672
2
true
0
0
Without any code sample I can only assume that your server is listening on some private interface like localhost/127.0.0.1 and not something that is connected to the rest of your network.
2
0
0
I have written a small HTTP server and everything is working fine locally, but I am not able to connect to the server from any other computer, including other computers on the network. I'm not sure if it is a server problem, or if I just need to make some adjustments to Windows. I turned the firewall off, so that can't...
Python Server Help
1.2
0
1
213
3,522,641
2010-08-19T14:13:00.000
0
0
0
0
python,windows,http
3,522,734
2
false
0
0
Some things to check: Can you connect to the server via your machine's IP instead of localhost? I.e. if your machine is 1.2.3.4 in the network and the server is listening on port 8080, can you see it by opening a browser to http://1.2.3.4:8080 on the same machine? Can you do (1) from another machine? (just a sanity ch...
2
0
0
I have written a small HTTP server and everything is working fine locally, but I am not able to connect to the server from any other computer, including other computers on the network. I'm not sure if it is a server problem, or if I just need to make some adjustments to Windows. I turned the firewall off, so that can't...
Python Server Help
0
0
1
213
3,524,168
2010-08-19T16:55:00.000
7
0
1
0
python
3,524,212
6
false
0
0
I think it depends on the module. For example, Django has a VERSION variable that you can get from django.VERSION, sqlalchemy has a __version__ variable that you can get from sqlalchemy.__version__.
2
47
0
I'm trying to get the version number of a specific few modules that I use. Something that I can store in a variable.
How do I get a python module's version number through code?
1
0
0
73,190
3,524,168
2010-08-19T16:55:00.000
35
0
1
0
python
3,524,247
6
true
0
0
Generalized answer from Matt's, do a dir(YOURMODULE) and look for __version__, VERSION, or version. Most modules like __version__ but I think numpy uses version.version
2
47
0
I'm trying to get the version number of a specific few modules that I use. Something that I can store in a variable.
How do I get a python module's version number through code?
1.2
0
0
73,190
3,524,236
2010-08-19T17:02:00.000
1
0
0
0
python,database,django,sqlite
3,524,305
2
false
1
0
if you don't provide full path, it will use the current directory of settings.py, and if you wish to specify static path you can specify it like: c:/projects/project1/my_proj.db or in case you want to make it dynamic then you can use os.path module so os.path.dirname(file) will give you the path of settings.py and acco...
1
5
0
I'm in the settings.py module, and I'm supposed to add the directory to the sqlite database. How do I know where the database is and what the full directory is? I'm using Windows 7.
Trouble setting up sqlite3 with django! :/
0.099668
1
0
3,575
3,525,005
2010-08-19T18:29:00.000
2
0
0
0
python,wxpython
3,525,652
1
false
0
1
If you put a wx.Panel as the only child of the ScrolledWindow and put the other widgets on the panel, then it should work automatically. You could also use ScrolledPanel instead.
1
3
0
I made a frame that asks the user to put in a bunch of information in several text control fields. How can I make it so that when you hit the 'tab' key your cursor moves to the next text control?
wxPython: switching text control focus on tab press
0.379949
0
0
595
3,526,629
2010-08-19T21:59:00.000
0
0
0
0
python,mysql,batch-file
3,527,732
1
false
0
0
If all of your tables' records had timestamps, you could identify "the values that have changed in the server" -- otherwise, it's not clear how you plan to do that part (which has nothing to do with insert or update, it's a question of "selecting things right"). Once you have all the important values, somecursor.execut...
1
1
0
I'm working with two databases, a local version and the version on the server. The server is the most up to date version and instead of recopying all values on all tables from the server to my local version, I would like to enter each table and only insert/update the values that have changed, from server, and copy th...
Python + MySQLDB Batch Insert/Update command for two of the same databases
0
1
0
1,035
3,526,748
2010-08-19T22:19:00.000
6
0
0
1
python,django,postgresql
3,529,637
2
true
1
0
Only one thing I could think of that will kill automatically a process on Linux - the OOM killer. What's in the system logs?
1
7
0
Sometimes, when fetching data from the database either through the python shell or through a python script, the python process dies, and one single word is printed to the terminal: Killed That's literally all it says. It only happens with certain scripts, but it always happens for those scripts. It consistently happens...
Why do some Django ORM queries end abruptly with the message "Killed"?
1.2
1
0
1,944
3,530,851
2010-08-20T12:34:00.000
3
1
0
0
python,imap,pop3,imaplib,poplib
3,566,252
2
true
0
0
The In-Reply-To header of the child should have the value of the Message-Id header of the parent(s).
2
0
0
I've develop webmail client for any mail server. I want to implement message conversion for it — for example same emails fwd/reply/reply2all should be shown together like gmail does... My question is: what's the key to find those emails which are either reply/fwd or related to the original mail....
How to maintain mail conversion (reply / forward / reply to all like gmail) of email using Python pop/imap lib?
1.2
0
1
1,161
3,530,851
2010-08-20T12:34:00.000
2
1
0
0
python,imap,pop3,imaplib,poplib
3,530,868
2
false
0
0
Google just seems to chain messages based on the subject line (so does Apple Mail by the way.)
2
0
0
I've develop webmail client for any mail server. I want to implement message conversion for it — for example same emails fwd/reply/reply2all should be shown together like gmail does... My question is: what's the key to find those emails which are either reply/fwd or related to the original mail....
How to maintain mail conversion (reply / forward / reply to all like gmail) of email using Python pop/imap lib?
0.197375
0
1
1,161
3,531,430
2010-08-20T13:47:00.000
2
0
1
0
python,string
3,531,457
5
false
0
0
Either escape it as "\\" or use raw strings like so: r"\".
1
1
0
I have problem with refering to special symbol in string: I have: path='C:\dir\dir1\dir2\filename.doc' and I want filename. When I try: filename=path[path.rfind("\"):-4] then interpreter says it's an error line right from "\" since is treated as a comment.
How to refer to "\" sign in python string
0.07983
0
0
275
3,532,417
2010-08-20T15:34:00.000
0
0
0
1
python,google-app-engine,pickle
5,152,644
2
false
1
0
The key advantages of using Django are its ORM and template system. The ORM is not very useful with datastore because of its non-relational nature and the template system is available as part of the app engine to be used with webapp. I have had good success with using webapp and django templates for our project.
2
2
0
I am porting a Python investing application to Google App Engine. Every market that you can trade in is a plugin: for example the stocks trading and FOREX trading are all plugins. The application stores the portfolio (which is a Portfolio class instance containing the active investments (class instances) and history) a...
Store python classes as pickles in GAE?
0
0
0
366
3,532,417
2010-08-20T15:34:00.000
1
0
0
1
python,google-app-engine,pickle
3,532,598
2
false
1
0
The best solution would be to use the Datastore data models, but you'll have to rewrite parts of your app. Using Pickle for data persistance, especially involving much data, is not a good pratice.
2
2
0
I am porting a Python investing application to Google App Engine. Every market that you can trade in is a plugin: for example the stocks trading and FOREX trading are all plugins. The application stores the portfolio (which is a Portfolio class instance containing the active investments (class instances) and history) a...
Store python classes as pickles in GAE?
0.099668
0
0
366
3,532,947
2010-08-20T16:40:00.000
1
0
1
0
python,regex
3,532,984
7
false
1
0
You probably want to match a non-digit before and after your string of 5 digits, like [^0-9]([0-9]{5})[^0-9]. Then you can capture the inner group (the actual string you want).
3
29
0
I'm attempting to string match 5-digit coupon codes spread throughout a HTML web page. For example, 53232, 21032, 40021 etc... I can handle the simpler case of any string of 5 digits with [0-9]{5}, though this also matches 6, 7, 8... n digit numbers. Can someone please suggest how I would modify this regular expressio...
Python Regular Expression Match All 5 Digit Numbers but None Larger
0.028564
0
0
93,863
3,532,947
2010-08-20T16:40:00.000
3
0
1
0
python,regex
3,532,981
7
false
1
0
A very simple way would be to match all groups of digits, like with r'\d+', and then skip every match that isn't five characters long when you process the results.
3
29
0
I'm attempting to string match 5-digit coupon codes spread throughout a HTML web page. For example, 53232, 21032, 40021 etc... I can handle the simpler case of any string of 5 digits with [0-9]{5}, though this also matches 6, 7, 8... n digit numbers. Can someone please suggest how I would modify this regular expressio...
Python Regular Expression Match All 5 Digit Numbers but None Larger
0.085505
0
0
93,863
3,532,947
2010-08-20T16:40:00.000
16
0
1
0
python,regex
3,532,978
7
false
1
0
full string: ^[0-9]{5}$ within a string: [^0-9][0-9]{5}[^0-9]
3
29
0
I'm attempting to string match 5-digit coupon codes spread throughout a HTML web page. For example, 53232, 21032, 40021 etc... I can handle the simpler case of any string of 5 digits with [0-9]{5}, though this also matches 6, 7, 8... n digit numbers. Can someone please suggest how I would modify this regular expressio...
Python Regular Expression Match All 5 Digit Numbers but None Larger
1
0
0
93,863
3,533,064
2010-08-20T16:54:00.000
1
0
0
1
python,orm,mongodb,mongoengine,mongokit
3,553,262
1
true
0
0
We are running a production site using Mongodb for the backend (no direct queries to Mongo, we have a search layer in between). We wrote our own business / object layer, i suppose it just seemed natural enough for the programmers to write in the custom logic. We did separate the database and business layers, but they...
1
2
0
I've been diving into MongoDB with kind help of MongoKit and MongoEngine, but then I started thinking whether the data mappers are necessary here. Both mappers I mentioned enable one to do simple things without any effort. But is any effort required to do simple CRUD? It appears to me that in case of NoSQL the mappers ...
Do you use data mappers with MongoDB?
1.2
1
0
366
3,533,759
2010-08-20T18:27:00.000
7
1
1
1
python,c,performance
3,533,838
14
false
0
0
Is there really a noticeable difference between sorting a textfile using the same algorithm in C versus Python, for example? Yes. The noticeable differences are these There's much less Python code. The Python code is much easier to read. Python supports really nice unit testing, so the Python code tends to be highe...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
1
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
0
1
1
1
python,c,performance
15,903,255
14
false
0
0
C is definitely faster than Python because Python is written in C. C is middle level language and hence faster but there not much a great difference between C & Python regarding executable time it takes. but it is really very easy to write code in Python than C and it take much shorter time to write code and learn Pyth...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
0
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
-1
1
1
1
python,c,performance
3,539,538
14
false
0
0
The excess time to write the code in C compared to Python will be exponentially greater than the difference between C and Python execution speed.
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
-0.014285
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
-1
1
1
1
python,c,performance
3,536,830
14
false
0
0
You will find C is much slower. Your developers will have to keep track of memory allocation, and use libraries (such as glib) to handle simple things such as dictionaries, or lists, which python has built-in. Moreover, when an error occurs, your C program will typically just crash, which means you'll need to get the e...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
-0.014285
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
0
1
1
1
python,c,performance
3,534,845
14
false
0
0
Across all programs, it isn't really possible to say whether things will be quicker or slower on average in Python or C. For the programs that I've implemented in both languages, using similar algorithms, I've seen no improvement (and sometimes a performance degradation) for string- and IO-heavy code, when reimplementi...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
0
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
1
1
1
1
python,c,performance
3,534,210
14
false
0
0
It really depends a lot on what your doing and if the algorithm in question is available in Python via a natively compiled library. If it is, then I believe you'll be looking at performance numbers close enough that Python is most likely your answer -- assuming it's your preferred language. If you must implement the al...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
0.014285
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
4
1
1
1
python,c,performance
3,534,052
14
false
0
0
If your text files that you are sorting and parsing are large, use C. If they aren't, it doesn't matter. You can write poor code in any language though. I have seen simple code in C for calculating areas of triangles run 10x slower than other C code, because of poor memory management, use of structures, pointers, etc. ...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
0.057081
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
4
1
1
1
python,c,performance
3,533,974
14
false
0
0
The first rule of computer performance questions: Your mileage will vary. If small performance differences are important to you, the only way you will get valid information is to test with your configuration, your data, and your benchmark. "Small" here is, say, a factor of two or so. The second rule of computer perfo...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
0.057081
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
10
1
1
1
python,c,performance
3,533,800
14
false
0
0
In general IO bound work will depend more on the algorithm then the language. In this case I would go with Python because it will have first class strings and lots of easy to use libraries for manipulating files, etc.
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
1
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
11
1
1
1
python,c,performance
3,534,125
14
false
0
0
C will absolutely crush Python in almost any performance category, but C is far more difficult to write and maintain and high performance isn't always worth the trade off of increased time and difficulty in development. You say you're doing things like text file processing, but what you omit is how much text file proce...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
1
0
0
14,463
3,533,759
2010-08-20T18:27:00.000
37
1
1
1
python,c,performance
3,533,877
14
true
0
0
Use python until you have a performance problem. If you ever have one figure out what the problem is (often it isn't what you would have guessed up front). Then solve that specific performance problem which will likely be an algorithm or data structure change. In the rare case that your problem really needs C then you ...
11
13
0
Working on different projects I have the choice of selecting different programming languages, as long as the task is done. I was wondering what the real difference is, in terms of performance, between writing a program in Python, versus doing it in C. The tasks to be done are pretty varied, e.g. sorting textfiles, disk...
Performance differences between Python and C
1.2
0
0
14,463
3,534,127
2010-08-20T19:17:00.000
6
0
0
0
python,user-interface,gtk,pygtk
3,534,190
2
true
0
1
The row-activated signal is sent when a GTK TreeView row is double-clicked.
1
5
0
I'm displaying some data as a TreeView. How can I detect a click on a particular tree-view cell, so that I know which column of which row was clicked on? This is what I want to do, so maybe there's a better way: Part of the data is a series of True/False values indicating a particular set of options. For example, the o...
gtk: detect click on a cell in a TreeView
1.2
0
0
4,742
3,535,535
2010-08-20T23:30:00.000
1
0
0
0
python,logging,pylons
3,537,529
2
false
1
0
For custom error handling i think you should look at ErrorHandler and StatusCodeRedirect (from pylons.middleware) and maybe make your own class based on them?
1
0
0
I want to log 404 and 500 errors in a pylons app before they redirect to my custom error message (/error/document). My problem is that since Pylons does the redirect, I am unable to determine the page on which the error occurred inside the error controller. So without building a parser for the paster.log I don't know ...
Pylons - catching errors before redirect to document/error for logging
0.099668
0
0
316
3,538,430
2010-08-21T18:16:00.000
2
1
0
0
python,email,smtp,mime,pop3
3,538,453
2
true
0
0
It has all the components you need, in a more modular and flexible arrangement than you appear to envisage -- the standard library's email package deals with the message once you have received it, and separate modules each deal with means of sending and receiving, such as pop, smtp, imap. SSL is an option for each of ...
1
0
0
Does python have a full fledged email library with things for pop, smtp, pop3 with ssl, mime? I want to create a web mail interface that pulls emails from email servers, and then shows the emails, along with attachments, can display the sender, subject, etc. (handles all the encoding issues etc). It's one thing to be a...
Does python have a robust pop3, smtp, mime library where I could build a webmail interface?
1.2
0
1
513
3,538,724
2010-08-21T20:00:00.000
0
0
1
0
python
3,539,344
2
false
0
0
Actually, I thought it was from the standard library. On inspection, it is from enthought.traits.api.Instance. It holds a reference to an object instance. If you pass a specific class to the constructor (e.g. Instance(MyClass) ), it does validation to make sure you pass the correct class.
2
3
0
var = Instance(object)?
What does Instance() do in Python assignments?
0
0
0
174
3,538,724
2010-08-21T20:00:00.000
4
0
1
0
python
3,538,730
2
false
0
0
It calls the __call__() method.
2
3
0
var = Instance(object)?
What does Instance() do in Python assignments?
0.379949
0
0
174
3,538,769
2010-08-21T20:09:00.000
0
0
0
0
python,user-interface,pygtk,tkinter,glade
3,538,804
3
false
0
1
Those actions are not that difficult. All you really need for that is hit detection, which is not hard (is the cursor over the correct area? Okay, perform the operation then). The harder part is finding an appropriate canvas widget for the toolkit in use.
1
7
0
What Python-related code (PyGTK, Glade, Tkinter, PyQT, wxPython, Cairo, ...) could you easily use to create a GUI to do some or all of the following? Part of the GUI has an immovable square grid. The user can press a button to create a resizable rectangle. The user can drag the rectangle anywhere on the grid, and it w...
How do you draw a grid and rectangles in Python?
0
0
0
5,729
3,539,120
2010-08-21T21:44:00.000
25
0
0
0
python,django,cython
3,539,136
6
false
1
0
Well, yes, but most things a web app does won't really benefit from this sort of change unless you have firm proof that it will. Profile twice, optimize once.
3
38
0
Is it possible to optimize speed of a mission critical application developed in Django with Cython? Recently I have read on the internet, that Cython can turn a Python code to C like speed. Is this possible with Django?
Using Cython with Django. Does it make sense?
1
0
0
16,714
3,539,120
2010-08-21T21:44:00.000
1
0
0
0
python,django,cython
52,422,538
6
false
1
0
It depends if you have heavy processes on the backend side. In my case it could improve one of the processes and speed it up ~5 times. I had a function that rework large XML files that is inputed by the user and save the output into database. telling Cython that in some places the input or output is string did the 5x s...
3
38
0
Is it possible to optimize speed of a mission critical application developed in Django with Cython? Recently I have read on the internet, that Cython can turn a Python code to C like speed. Is this possible with Django?
Using Cython with Django. Does it make sense?
0.033321
0
0
16,714
3,539,120
2010-08-21T21:44:00.000
35
0
0
0
python,django,cython
3,539,374
6
true
1
0
Is it possible to optimize speed of a mission critical application developed in Django with Cython It's doubtful. Most of a web application response time is the non-HTML elements that must be downloaded separately. The usual rule of thumb is 8 static files per HTML page. (.CSS, .JS, images, etc.) Since none of t...
3
38
0
Is it possible to optimize speed of a mission critical application developed in Django with Cython? Recently I have read on the internet, that Cython can turn a Python code to C like speed. Is this possible with Django?
Using Cython with Django. Does it make sense?
1.2
0
0
16,714
3,540,288
2010-08-22T05:23:00.000
1
0
1
0
python
3,540,307
11
false
0
0
Seek to a random position, read a line and discard it, then read another line. The distribution of lines won't be normal, but that doesn't always matter.
1
51
0
Is there a built-in method to do it? If not how can I do this without costing too much overhead?
How do I read a random line from one file?
0.01818
0
0
98,440
3,540,368
2010-08-22T05:54:00.000
2
1
1
1
python,ipython,execfile
3,540,375
2
true
0
0
Functions create a new scope. execfile() runs the script in the current scope. What you are doing will not work.
1
2
0
I'm working from inside an ipython shell and often need to reload the script files that contain my functions-under-construction. Inside my main.py I have: def myreload(): execfile("main.py") execfile("otherfile.py") Calling myreload() works fine if I have already ran in the same ipython session the execfile com...
Python shell and execfile scope
1.2
0
0
2,290
3,540,805
2010-08-22T08:53:00.000
0
0
0
1
python,android,django
3,541,193
2
false
1
0
Do you want it to run on a tablet or a hand-held device? Are netbooks okay? There are plenty netbooks that run Ubuntu, on which you should be able to run python. I also remember that the sharp zaurus handheld devices were able to run Zope for example (be it very, very slowly) In general, smaller, embedded systems (i.e....
1
3
0
I want to run a django app on a hand-held device. It'll need to run Python (obviously) and will write its data to an SQLite database. Are there any tablets available that will let me do this? Specifically, if I bought an Android tablet, would I have to/be able to install linux instead, or would I be able to run it und...
Is it possible to run linux on hand-held tablets?
0
0
0
395
3,542,095
2010-08-22T15:46:00.000
6
1
1
0
python,filter
3,542,173
5
false
0
0
If all the students are running the same version of Python (e.g. at a computer lab), you can distribute pyc files. This is just obfuscation, but it will deter casual users.
2
1
0
I'm a school teacher who spent the summer writing a vocab training program in python that uses text available from wikipedia and gutenberg. Now all I have to do is figure out a way to filter out curse words so that I can distribute to students. Normally I would just have an array (list) of those curse words and do a si...
How to "hide" curse words in a py file?
1
0
0
674
3,542,095
2010-08-22T15:46:00.000
1
1
1
0
python,filter
3,542,374
5
false
0
0
Why not distribute the compiled python .*pyc files instead? They could still lookup the strings if they wanted, but it will likely deter casual browsing of the file, which may be sufficient for your needs.
2
1
0
I'm a school teacher who spent the summer writing a vocab training program in python that uses text available from wikipedia and gutenberg. Now all I have to do is figure out a way to filter out curse words so that I can distribute to students. Normally I would just have an array (list) of those curse words and do a si...
How to "hide" curse words in a py file?
0.039979
0
0
674
3,542,426
2010-08-22T17:11:00.000
0
0
1
1
python,windows,winapi,console
3,603,987
1
true
0
0
Version Information are stored as a resource in the executable. You cannot change them during runtime.
1
0
0
I have multiple python processes running in their console output windows. I can set their console title via win32api.SetConsoleTitle(). Thats nice, but it would be even nicer to set some versioninfo strings (like description/company name/version) during runtime as that would allow me to easier differentiate between the...
windows/python manipulate versioninfo during runtime
1.2
0
0
169
3,542,723
2010-08-22T18:22:00.000
1
0
0
0
python,django,content-management-system,django-admin,feincms
3,777,528
1
false
1
0
Sure -- there's nothing stopping you from adding a ForeignKey or a ManyToManyField to the MediaFile model to one of your own models. Note that you'll have a hard time limiting the media files to only images. Maybe limit_choices_to will help though.
1
6
0
I'm using Django and FeinCMS on a project. I'm currently using FeinCMS for all the pages on the site. But I also have another separate model that handles very simple stock for the site too. This stock model has the usual fields (name, description, etc) but I also want it to have photos. Because FeinCMS has a media libr...
Django and FeinCMS: A way to use the Media Library in other normal models?
0.197375
0
0
717
3,543,193
2010-08-22T20:19:00.000
2
1
0
0
php,python,ruby,perl,benchmarking
3,543,230
3
false
0
0
The best thing to do would be to create your own benchmarks for the specific tasks you are interested in. Pick languages that you like working in and then write benchmarks for the system you will be using and the task you will be performing. If you are very concerned about speed I would also recommend looking at the in...
1
0
0
Does anyone know where I could find reviews or reports on tasks that people implemented in two or more scripting languages to see which was more suited to a specific job? I want to know which languages are best suited to which types of operation so that I can make the most of them. "Types of operation" could be sockets...
Benchmarks of scripting languages doing the same task?
0.132549
0
0
1,097
3,543,833
2010-08-22T23:05:00.000
0
0
1
0
python
60,114,979
10
false
0
0
Isn't the easiest way to create a class contining all the needed variables? Then you have one object with all curretn variables, and if you need you can overwrite this variable?
3
104
0
I am looking for something similar to 'clear' in Matlab: A command/function which removes all variables from the workspace, releasing them from system memory. Is there such a thing in Python? EDIT: I want to write a script which at some point clears all the variables.
How do I clear all variables in the middle of a Python script?
0
0
0
381,886
3,543,833
2010-08-22T23:05:00.000
4
0
1
0
python
52,326,585
10
false
0
0
In Spyder one can configure the IPython console for each Python file to clear all variables before each execution in the Menu Run -> Configuration -> General settings -> Remove all variables before execution.
3
104
0
I am looking for something similar to 'clear' in Matlab: A command/function which removes all variables from the workspace, releasing them from system memory. Is there such a thing in Python? EDIT: I want to write a script which at some point clears all the variables.
How do I clear all variables in the middle of a Python script?
0.07983
0
0
381,886
3,543,833
2010-08-22T23:05:00.000
0
0
1
0
python
55,055,041
10
false
0
0
In the idle IDE there is Shell/Restart Shell. Cntrl-F6 will do it.
3
104
0
I am looking for something similar to 'clear' in Matlab: A command/function which removes all variables from the workspace, releasing them from system memory. Is there such a thing in Python? EDIT: I want to write a script which at some point clears all the variables.
How do I clear all variables in the middle of a Python script?
0
0
0
381,886
3,544,331
2010-08-23T02:17:00.000
7
0
1
0
python,file,text,diff,compare
3,544,342
5
true
0
0
If order matters, try the comm utility. If order doesn't matter, sort file1 file2 | uniq -u.
1
10
0
I have two 3GB text files, each file has around 80 million lines. And they share 99.9% identical lines (file A has 60,000 unique lines, file B has 80,000 unique lines). How can I quickly find those unique lines in two files? Is there any ready-to-use command line tools for this? I'm using Python but I guess it's less p...
Quickly find differences between two large text files
1.2
0
0
17,368
3,544,378
2010-08-23T02:32:00.000
-3
0
1
1
python,linux,ubuntu,python-2.x
3,544,394
6
false
0
0
Do you still have the source directory where you compiled Python before? If so, you can CD into that directory and run sudo make uninstall. If you don't have it still, you could re-create it by going through the build steps again--download, extract, configure, and make--but end with sudo make uninstall instead of sudo ...
2
51
0
I've installed python 2.6 from source, and somehow later mistakenly installed another python 2.6 from a package manager too. I can't find a way to uninstall a python that was built from source, is this possible/easy? Running ubuntu 10.04.
Uninstall python built from source?
-0.099668
0
0
69,854
3,544,378
2010-08-23T02:32:00.000
0
0
1
1
python,linux,ubuntu,python-2.x
3,544,396
6
false
0
0
In the future it may be prudent to use sudo checkinstall.
2
51
0
I've installed python 2.6 from source, and somehow later mistakenly installed another python 2.6 from a package manager too. I can't find a way to uninstall a python that was built from source, is this possible/easy? Running ubuntu 10.04.
Uninstall python built from source?
0
0
0
69,854
3,545,230
2010-08-23T06:42:00.000
2
0
0
0
python,linux,mouse,mouse-cursor,wiimote
9,583,583
8
false
0
1
Open your terminal and goto cd /usr/share/pyshared/twisted/protocols/mice may this __init__.py mouseman.py python script will work for you,check them out.
1
40
0
I'm currently in the process of making my Nintendo Wiimote (Kinda sad actually) to work with my computer as a mouse. I've managed to make the nunchuk's stick control actually move the mouse up and down, left and right on the screen! This was so exciting. Now I'm stuck. I want to left/right click on things via python wh...
Simulate Mouse Clicks on Python
0.049958
0
0
65,052
3,545,690
2010-08-23T08:06:00.000
15
0
1
0
python,performance,decorator
3,546,120
3
true
0
0
The overhead added by using a decorator should be just one extra function call. The work being done by the decorator isn't part of the overhead as your alternative is to add the equivalent code to the decorated object. So it's possible that the decorate function takes twice as long to run, but that's because the decora...
2
21
0
I've been playing around with a timing decorator for my pylons app to provide on the fly timing info for specific functions. I've done this by creating a decorator & simply attaching it to any function in the controller I want timed. It's been pointed out however that decorators could add a fair amount of overhead to t...
How much overhead do decorators add to Python function calls
1.2
0
0
5,433
3,545,690
2010-08-23T08:06:00.000
2
0
1
0
python,performance,decorator
3,548,038
3
false
0
0
Do decorators add significant overhead to a system? I can't find anything to back that up. They add almost no measurable overhead. Zero. It's important to note that the decorator runs once to create the decorated function. Once. The decorated function has two parts to it. whatever decoration was added. This is not ...
2
21
0
I've been playing around with a timing decorator for my pylons app to provide on the fly timing info for specific functions. I've done this by creating a decorator & simply attaching it to any function in the controller I want timed. It's been pointed out however that decorators could add a fair amount of overhead to t...
How much overhead do decorators add to Python function calls
0.132549
0
0
5,433
3,547,534
2010-08-23T12:33:00.000
32
0
1
0
python,encoding
3,548,031
6
false
1
0
In Python 2: Normal strings (Python 2.x str) don't have an encoding: they are raw data. In Python 3: These are called "bytes" which is an accurate description, as they are simply sequences of bytes, which can be text encoded in any encoding (several are common!) or non-textual data altogether. For representing text, y...
4
18
0
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
What encoding do normal python strings use?
1
0
0
18,945
3,547,534
2010-08-23T12:33:00.000
1
0
1
0
python,encoding
3,547,580
6
false
1
0
Python 2.x strings are 8-bit, nothing more. The encoding may vary (though ASCII is assumed). I guess the reasons are historical. Few languages, especially languages that date back to the last century, use unicode right away. In Python 3, all strings are unicode.
4
18
0
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
What encoding do normal python strings use?
0.033321
0
0
18,945
3,547,534
2010-08-23T12:33:00.000
4
0
1
0
python,encoding
3,552,681
6
false
1
0
what encoding are normal python strings use? In Python 3.x str is Unicode. This may be either UTF-16 or UTF-32 depending on whether your Python interpreter was built with "narrow" or "wide" Unicode characters. The Windows version of CPython uses UTF-16. On Unix-like systems, UTF-32 tends to be preferred. In Python...
4
18
0
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
What encoding do normal python strings use?
0.132549
0
0
18,945
3,547,534
2010-08-23T12:33:00.000
-2
0
1
0
python,encoding
3,547,565
6
false
1
0
Before Python 3.0, string encoding was ascii by default, but could be changed. Unicode string literals were u"...". This was silly.
4
18
0
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
What encoding do normal python strings use?
-0.066568
0
0
18,945
3,549,833
2010-08-23T16:57:00.000
23
0
1
0
python,multithreading,memory-model
3,549,940
1
true
0
0
There is no formal model for Python's threading (hey, after all, there wasn't one for Java's for years... hopefully, one will also eventually be written for Python). In practice, no Python implementation performs any advanced optimization such as statement reordering or temporarily treating shared variables as thread-l...
1
26
0
Does python threading expose issues of memory visibility and statement reordering as Java does? Since I can't find any reference to a "Python Memory Model" or anything like that, despite the fact that lots of people are writing multithreaded Python code, I'm guessing that these gotchas don't exist here. No volatile key...
python threading: memory model and visibility
1.2
0
0
11,806
3,550,336
2010-08-23T18:05:00.000
11
0
1
0
python
3,550,500
4
true
0
0
@Joe Kington's solutions works if there is a __dict__ (some objects, including builtins, don't have one) and __eq__ works for all values of both dicts (a badly written __eq__ mayraise exceptions etc). But it is horribly unpythonic. It doesn't even handle nominal subtypes properly... much less structural subtypes (i.e. ...
2
18
0
Is there any way to check if two objects have the same values, other than to iterate through their attributes and manually compare their values?
Comparing two objects
1.2
0
0
28,508
3,550,336
2010-08-23T18:05:00.000
-3
0
1
0
python
3,550,408
4
false
0
0
object1.__dict__ == object2.__dict__ Should be all you need, I think... Edit: vars(object1) == vars(object2) is perhaps a bit more pythonic, though @delnan makes a valid point about objects (e.g. ints) that don't have a __dict__. I disagree that a custom __eq__ is a better approach for simple cases, though... Sometime...
2
18
0
Is there any way to check if two objects have the same values, other than to iterate through their attributes and manually compare their values?
Comparing two objects
-0.148885
0
0
28,508
3,552,928
2010-08-24T01:22:00.000
3
1
0
0
python,timeout,mechanize
3,553,063
3
false
0
0
If you're using Python 2.6 or better, and a correspondingly updated version of mechanize, mechanize.urlopen should accept a timeout=... optional argument which seems to be what you're looking for.
1
15
0
How do i set a timeout value for python's mechanize?
how do i set a timeout value for python's mechanize?
0.197375
0
0
9,833
3,555,065
2010-08-24T09:21:00.000
2
0
0
0
python,image,wxpython
3,557,437
1
false
0
1
I don't think a dialog is a good choice for a growing list of images, but if you have a good argument for that... Anyway, you should be able to display your images using the wx.StaticBitmap widget. To add another one, use your sizer's Add method, then call the dialog's Layout() method and maybe its Refresh() method. If...
1
1
0
I want to add images to wx.Dialog (and then sizer) some like wx.ImageList and display it dynamically. But I don't want to change already displayed image, I want to add next. How can I resolve this problem?
How to add images/bitmaps to wx.Dialog
0.379949
0
0
883
3,555,485
2010-08-24T10:30:00.000
1
0
0
0
python
5,845,120
2
false
0
0
There is a package named roscraco that configure and extract information from some consumer level routers. It's available on PyPi.
2
1
0
i want to do router configuration using python , but dont want to use any application level protocol to configure it . Is it possible to deal it on a hardware level ? Please do tell if the question is vague or if it needs more explanation , then I would put more details on as to what I have my doubt in
is it possible to write python scripts which can do router configuration without telnetting into the router?
0.099668
0
1
616
3,555,485
2010-08-24T10:30:00.000
1
0
0
0
python
3,555,720
2
false
0
0
The title of your question by itself makes some sense. The body of your question doesn't make sense. is it possible to write python scripts which can do router configuration without telnetting into the router? Yes, depending on the platform. You maybe able to use a variety of other methods to configure the router that...
2
1
0
i want to do router configuration using python , but dont want to use any application level protocol to configure it . Is it possible to deal it on a hardware level ? Please do tell if the question is vague or if it needs more explanation , then I would put more details on as to what I have my doubt in
is it possible to write python scripts which can do router configuration without telnetting into the router?
0.099668
0
1
616
3,556,027
2010-08-24T11:41:00.000
0
1
0
1
python,user-interface,bash
3,556,046
4
false
0
0
basically, all bash does is start other programs (and do symbolic math on the command line). So no, you're going to have to involve some other program.
1
3
0
I have some bash scripts, some simple ones to copy, search, write lines to files and so on. I am an Ubuntu. and I've searched in google, but it seems that everybody is doing that on python. I could do these on python, but since I am not a python programmer, I just know the basics. I have no idea of how calling a sh scr...
Is there a way of having a GUI for bash scripts?
0
0
0
2,093
3,556,266
2010-08-24T12:12:00.000
1
0
0
0
python,urllib2
31,354,580
4
false
0
0
e.g.: urllib2.urlopen('ORIGINAL LINK').geturl() urllib2.urlopen(urllib2.Request('ORIGINAL LINK')).geturl()
2
22
0
I'm using the urllib2.urlopen method to open a URL and fetch the markup of a webpage. Some of these sites redirect me using the 301/302 redirects. I would like to know the final URL that I've been redirected to. How can I get this?
How can I get the final redirect URL when using urllib2.urlopen?
0.049958
0
1
34,914
3,556,266
2010-08-24T12:12:00.000
4
0
0
0
python,urllib2
3,556,295
4
false
0
0
The return value of urllib2.urlopen has a geturl() method which should return the actual (i.e. last redirect) url.
2
22
0
I'm using the urllib2.urlopen method to open a URL and fetch the markup of a webpage. Some of these sites redirect me using the 301/302 redirects. I would like to know the final URL that I've been redirected to. How can I get this?
How can I get the final redirect URL when using urllib2.urlopen?
0.197375
0
1
34,914