Title
stringlengths
15
150
A_Id
int64
2.98k
72.4M
Users Score
int64
-17
470
Q_Score
int64
0
5.69k
ViewCount
int64
18
4.06M
Database and SQL
int64
0
1
Tags
stringlengths
6
105
Answer
stringlengths
11
6.38k
GUI and Desktop Applications
int64
0
1
System Administration and DevOps
int64
1
1
Networking and APIs
int64
0
1
Other
int64
0
1
CreationDate
stringlengths
23
23
AnswerCount
int64
1
64
Score
float64
-1
1.2
is_accepted
bool
2 classes
Q_Id
int64
1.85k
44.1M
Python Basics and Environment
int64
0
1
Data Science and Machine Learning
int64
0
1
Web Development
int64
0
1
Available Count
int64
1
17
Question
stringlengths
41
29k
Performance differences between Python and C
3,534,125
11
13
14,463
0
python,c,performance
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...
0
1
0
1
2010-08-20T18:27:00.000
14
1
false
3,533,759
1
0
0
11
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
3,533,877
37
13
14,463
0
python,c,performance
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 ...
0
1
0
1
2010-08-20T18:27:00.000
14
1.2
true
3,533,759
1
0
0
11
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...
Python shell and execfile scope
3,540,375
2
2
2,290
0
python,ipython,execfile
Functions create a new scope. execfile() runs the script in the current scope. What you are doing will not work.
0
1
0
1
2010-08-22T05:54:00.000
2
1.2
true
3,540,368
1
0
0
1
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...
Is it possible to run linux on hand-held tablets?
3,541,193
0
3
395
0
python,android,django
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....
0
1
0
0
2010-08-22T08:53:00.000
2
0
false
3,540,805
0
0
1
1
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...
windows/python manipulate versioninfo during runtime
3,603,987
0
0
169
0
python,windows,winapi,console
Version Information are stored as a resource in the executable. You cannot change them during runtime.
0
1
0
0
2010-08-22T17:11:00.000
1
1.2
true
3,542,426
1
0
0
1
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...
Uninstall python built from source?
3,544,394
-3
51
69,854
0
python,linux,ubuntu,python-2.x
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 ...
0
1
0
0
2010-08-23T02:32:00.000
6
-0.099668
false
3,544,378
1
0
0
2
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?
3,544,396
0
51
69,854
0
python,linux,ubuntu,python-2.x
In the future it may be prudent to use sudo checkinstall.
0
1
0
0
2010-08-23T02:32:00.000
6
0
false
3,544,378
1
0
0
2
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.
Is there a way of having a GUI for bash scripts?
3,556,046
0
3
2,093
0
python,user-interface,bash
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.
0
1
0
1
2010-08-24T11:41:00.000
4
0
false
3,556,027
0
0
0
1
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...
Command-line arguments as bytes instead of strings in python3
3,559,991
-3
4
2,162
0
encoding,python-3.x,filenames,command-line-arguments
Don't go against the grain: filenames are strings, not bytes. You shouldn't use a bytes when you should use a string. A bytes is a tuple of integers. A string is a tuple of characters. They are different concepts. What you're doing is like using an integer when you should use a boolean. (Aside: Python stores all string...
0
1
0
0
2010-08-24T14:59:00.000
2
-0.291313
false
3,557,830
1
0
0
1
I'm writing a python3 program, that gets the names of files to process from command-line arguments. I'm confused regarding what is the proper way to handle different encodings. I think I'd rather consider filenames as bytes and not strings, since that avoids the danger of using an incorrect encoding. Indeed, some of my...
add Python path to PATH system variable automatically under Windows
3,558,004
0
1
1,668
0
python,python-install
There has to be a way, but what some people do is provide batch files that set up the environment before invoking Python. That's what BZR does, anyway. If you can write that batch file somewhere that's already normally in the path, so much the better. If you're just worried about invoking Python, the normal Python inst...
0
1
0
0
2010-08-24T15:11:00.000
2
0
false
3,557,949
1
0
0
1
I'm creating one-click python installer (integrated with my application). Is there any way to force Python MSI installer to add python's path to SYSTEM PATH variable? I'm using MSI installer because it is very easy to specify (using command line) how it should interact with the user.
Where are Python dylibs installed on the Mac?
3,561,953
0
0
2,538
0
python,macos,dylib
Run the included setup.py file. You should never try to copy things into place manually; it'll lead to disaster, especially in situations involving pip or easy_install.
0
1
0
0
2010-08-24T21:32:00.000
2
0
false
3,561,209
1
0
0
2
On Mac OSX 10.6.4 where do you install dynamic libraries (dylib) so Python 2.6.1 can import them? I've tried placing them in /usr/local/lib and usr/localbin and /Library/Python/2.6/site-packages but none of these locations have worked. The library I'm trying to install is libevecache.dylib a library to access cache fil...
Where are Python dylibs installed on the Mac?
3,561,232
0
0
2,538
0
python,macos,dylib
Anywhere in your $DYLD_LIBRARY_PATH should work for compiled library files; you can also try setting $PYTHONPATH / sys.path.
0
1
0
0
2010-08-24T21:32:00.000
2
0
false
3,561,209
1
0
0
2
On Mac OSX 10.6.4 where do you install dynamic libraries (dylib) so Python 2.6.1 can import them? I've tried placing them in /usr/local/lib and usr/localbin and /Library/Python/2.6/site-packages but none of these locations have worked. The library I'm trying to install is libevecache.dylib a library to access cache fil...
How to check if DataStore Indexes are being served on AppEngine?
3,562,948
2
1
244
0
python,google-app-engine
Attempt to perform a query that requires that index. If it raises a NeedIndexError, it's not uploaded or not yet serving.
0
1
0
0
2010-08-25T02:32:00.000
2
1.2
true
3,562,466
0
0
1
1
How can I check if datastore Indexes as defined in index.yaml are serving in the python code? I am using Python 1.3.6 AppEngine SDK.
Which cross platform scripting language should we adopt for a group of DBAs?
3,564,251
1
6
3,213
1
python,scala,groovy,shell,jython
Although I prefer working on the JVM, one thing that turns me off is having to spin up a JVM to run a script. If you can work in a REPL this is not such a big deal, but it really slows you down when doing edit-run-debug scripting. Now of course Oracle has a lot of Java stuff where interaction moght be needed, but that...
0
1
0
0
2010-08-25T08:47:00.000
6
0.033321
false
3,564,177
0
0
0
5
I wanted to get the community's feedback on a language choice our team is looking to make in the near future. We are a software developer, and I work in a team of Oracle and SQL Server DBAs supporting a cross platform Java application which runs on Oracle Application Server. We have SQL Server and Oracle code bases, ...
Which cross platform scripting language should we adopt for a group of DBAs?
3,564,285
0
6
3,213
1
python,scala,groovy,shell,jython
I've been in a similar situation, though on a small scale. The previous situation was that any automation on the SQL Server DBs was done with VBScript, which I did start out using. As I wanted something cross-platform (and less annoying than VBScript) I went with Python. What I learnt is: Obviously you want a languag...
0
1
0
0
2010-08-25T08:47:00.000
6
0
false
3,564,177
0
0
0
5
I wanted to get the community's feedback on a language choice our team is looking to make in the near future. We are a software developer, and I work in a team of Oracle and SQL Server DBAs supporting a cross platform Java application which runs on Oracle Application Server. We have SQL Server and Oracle code bases, ...
Which cross platform scripting language should we adopt for a group of DBAs?
3,565,446
4
6
3,213
1
python,scala,groovy,shell,jython
The XML thing almost calls for Scala. Now, I love Scala, but I suggest Python here.
0
1
0
0
2010-08-25T08:47:00.000
6
0.132549
false
3,564,177
0
0
0
5
I wanted to get the community's feedback on a language choice our team is looking to make in the near future. We are a software developer, and I work in a team of Oracle and SQL Server DBAs supporting a cross platform Java application which runs on Oracle Application Server. We have SQL Server and Oracle code bases, ...
Which cross platform scripting language should we adopt for a group of DBAs?
3,568,609
5
6
3,213
1
python,scala,groovy,shell,jython
I think your best three options are Groovy, Python, and Scala. All three let you write code at a high level (compared to C/Java). Python has its own perfectly adequate DB bindings, and Groovy and Scala can use ones made for Java. The advantages of Python are that it is widely used already, so there are tons of tools,...
0
1
0
0
2010-08-25T08:47:00.000
6
0.16514
false
3,564,177
0
0
0
5
I wanted to get the community's feedback on a language choice our team is looking to make in the near future. We are a software developer, and I work in a team of Oracle and SQL Server DBAs supporting a cross platform Java application which runs on Oracle Application Server. We have SQL Server and Oracle code bases, ...
Which cross platform scripting language should we adopt for a group of DBAs?
3,564,413
6
6
3,213
1
python,scala,groovy,shell,jython
You can opt for Python. Its dynamic(interpreted) , is available on Windows/Linux/Solaris, has easy to read syntax so that your code maintenance is easy. There modules/libraries for Oracle interaction and various other database servers as well. there are also library support for XML. All 7 points are covered.
0
1
0
0
2010-08-25T08:47:00.000
6
1
false
3,564,177
0
0
0
5
I wanted to get the community's feedback on a language choice our team is looking to make in the near future. We are a software developer, and I work in a team of Oracle and SQL Server DBAs supporting a cross platform Java application which runs on Oracle Application Server. We have SQL Server and Oracle code bases, ...
Crash in development server clears datastore?
3,570,139
0
0
61
0
python,google-app-engine
The GAE development data store is only functionally equivalent to the production data store. It's really just a file (or set of files) on your local disk simulating BigTable. So if you abort it in the middle of doing something important, it could end up in an inconsistent state. If you're concerned about this, you ca...
0
1
0
0
2010-08-25T20:53:00.000
2
0
false
3,570,111
0
0
1
1
I'm testing my app with the development server. When I manually interrupt a request, it sometimes clears the datastore. This clears even models that are not modified by my request, like users, etc. Any idea why is this? Thanks
Function Names for sending and receiving RPCs?
3,575,219
1
0
60
0
python,naming-conventions,twisted,rpc
First tip: Use PB... it's well designed and does exactly that Second Tip: If the first tip isn't going to work for you, just do what PB does. On the client end a "callRemote("foo_func")" asks the server ot invoke the "foo_func" function on the server object. The server will then use "getattr(server_obj, "remote_" + "fo...
0
1
0
0
2010-08-26T12:43:00.000
1
1.2
true
3,575,119
0
0
0
1
I'm using twisted. I have my protocols set up so that, to send an RPC, I do protocol.send("update_status", data). To document which RPCs I've implemented, I make a separate function call for each one, so in this case I'd call REQUEST_UPDATE_STATUS(data) to send that RPC. When a protocol receives an RPC, a function gets...
Is there a standard way to make sure a python script will be interpreted by python2 and not python3?
3,586,813
0
22
1,239
0
python,unix,scripting,python-3.x,shebang
As I understand different distros will be in different locations in your drive. Here are some suggestions that come to mind - You could use UNIX alias to create shortcuts pointing to the different distros. Eg: alias py2="/usr/bin/python2.X". So when you run your script you could use py2 xx.py Or other way could be to...
0
1
0
0
2010-08-27T17:38:00.000
8
0
false
3,586,776
1
0
0
4
Is there a standard way to make sure a python script will be interpreted by python2 and not python3? On my distro, I can use #!/usr/bin/env python2 as the shebang, but it seems not all distros ship "python2". I could explicitly call a specific version (eg. 2.6) of python, but that would rule out people who don't have t...
Is there a standard way to make sure a python script will be interpreted by python2 and not python3?
3,587,849
2
22
1,239
0
python,unix,scripting,python-3.x,shebang
Depends on how you're distributing it, I guess. If you're using a normal setup.py file to manage your distribution, have it bomb out if the user is trying to install it in Python 3. Once it's installed, the shebang of the console script created by (say) setuptools will likely be linked to the specific interpreter used...
0
1
0
0
2010-08-27T17:38:00.000
8
0.049958
false
3,586,776
1
0
0
4
Is there a standard way to make sure a python script will be interpreted by python2 and not python3? On my distro, I can use #!/usr/bin/env python2 as the shebang, but it seems not all distros ship "python2". I could explicitly call a specific version (eg. 2.6) of python, but that would rule out people who don't have t...
Is there a standard way to make sure a python script will be interpreted by python2 and not python3?
3,587,790
2
22
1,239
0
python,unix,scripting,python-3.x,shebang
Not quite the same situation, but the company I work for has an app that can run Python scripts (among its many features). After numerous support issues involving Python installations on various platforms, we decided to just install our own Python interpreter with the app. That way we know exactly where it is installed...
0
1
0
0
2010-08-27T17:38:00.000
8
0.049958
false
3,586,776
1
0
0
4
Is there a standard way to make sure a python script will be interpreted by python2 and not python3? On my distro, I can use #!/usr/bin/env python2 as the shebang, but it seems not all distros ship "python2". I could explicitly call a specific version (eg. 2.6) of python, but that would rule out people who don't have t...
Is there a standard way to make sure a python script will be interpreted by python2 and not python3?
3,587,731
8
22
1,239
0
python,unix,scripting,python-3.x,shebang
This is a bit of a messy issue during what will be a very long transition time period. Unfortunately, there is no fool-proof, cross-platform way to guarantee which Python version is being invoked, other than to have the Python script itself check once started. Many, if not most, distributions that ship Python 3 are e...
0
1
0
0
2010-08-27T17:38:00.000
8
1.2
true
3,586,776
1
0
0
4
Is there a standard way to make sure a python script will be interpreted by python2 and not python3? On my distro, I can use #!/usr/bin/env python2 as the shebang, but it seems not all distros ship "python2". I could explicitly call a specific version (eg. 2.6) of python, but that would rule out people who don't have t...
Where is my local App Engine datastore?
42,148,664
0
11
11,200
0
python,google-app-engine,google-cloud-datastore
I'll restate a solution to getting permanent datastore as it worked for me (circa Feb 2017), running GoogleAppEngineLauncher on OS X v10.10. Create the folder path for permanent datastore In GAEL, click on the project in question e.g. PROJECTNAME Click Edit-Application Settings in Extra Flags field: --datastore_path...
0
1
0
0
2010-08-27T23:49:00.000
10
0
false
3,588,817
0
0
1
5
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
Where is my local App Engine datastore?
4,180,525
6
11
11,200
0
python,google-app-engine,google-cloud-datastore
To find the file location for the local AppEngine datastore on MacOSX/Python, you can run the following command: dev_appserver.py -help Mine was at something like: /var/folders/uP/uP1GHkGKGqO7QPq+eGMmb++++TI/-Tmp-/dev_appserver.datastore
0
1
0
0
2010-08-27T23:49:00.000
10
1
false
3,588,817
0
0
1
5
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
Where is my local App Engine datastore?
57,534,409
0
11
11,200
0
python,google-app-engine,google-cloud-datastore
The default location of the datastore for the platform you're running the app engine on is provided in the README that comes with the platform (at least, in the one for Linux). The README is in google_appengine_x.x.xx/google_appengine/README. This is what is says in the Linux'es one: --datastore_path=DS_FILE Path t...
0
1
0
0
2010-08-27T23:49:00.000
10
0
false
3,588,817
0
0
1
5
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
Where is my local App Engine datastore?
8,814,627
2
11
11,200
0
python,google-app-engine,google-cloud-datastore
Since it's top question on Google search and I spent quite amount of time searching for an answer I'll say that on Windows/Java mix DB file called local_db.bin.
0
1
0
0
2010-08-27T23:49:00.000
10
0.039979
false
3,588,817
0
0
1
5
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
Where is my local App Engine datastore?
23,270,307
4
11
11,200
0
python,google-app-engine,google-cloud-datastore
I use OS X Mavericks (10.9), Python 2.7.5, and Google App Engine SDK 1.9.3 (Python). None of the above worked for me, however, referencing @alsmola's answer, I executed sudo find / | grep datastore.db and found the file in /private/var/folders/vw/7w1zhkls4gb1wd8r160c36300000gn/T/appengine.YYYY.XXXXX/datastore.db (YYYY ...
0
1
0
0
2010-08-27T23:49:00.000
10
0.07983
false
3,588,817
0
0
1
5
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
Cross platform way to list disk drives on Linux, Windows and Mac using Python?
3,596,681
3
12
15,615
0
python,file,cross-platform,disk
There isn't really a unified naming scheme for Linux devices that guarantees you a formatable block device. There are conventions, but they can vary widely and I can call my thumb-drive /Thomas/O if I want and there is no cross-platform way in Python to know: That /Thomas/O corresponds to /dev/sdf1 That /dev/sdf1 can ...
0
1
0
0
2010-08-29T20:35:00.000
4
1.2
true
3,596,485
0
0
0
2
I am using Python2.6. I am trying to list the disk drives that a system may have. On Windows, it may be something like C:/, D:/, E:/, etc. On Linux, it may be something like /boot, /media/SDCard, etc. And I don't know what it's like on a Mac. Maybe something under /Volumes. Does anyone know of a cross platform way (th...
Cross platform way to list disk drives on Linux, Windows and Mac using Python?
55,051,781
2
12
15,615
0
python,file,cross-platform,disk
I don't see a way in psutil to include net mounts on Windows. I.e., \foobar\home is mapped to X:, but X: does not appear in the list returned by psutil.disk_partitions() (local drives are). Update: To include net drives in the returned list, simply use: psutil.disk_partitions(all=True) Works quite well.
0
1
0
0
2010-08-29T20:35:00.000
4
0.099668
false
3,596,485
0
0
0
2
I am using Python2.6. I am trying to list the disk drives that a system may have. On Windows, it may be something like C:/, D:/, E:/, etc. On Linux, it may be something like /boot, /media/SDCard, etc. And I don't know what it's like on a Mac. Maybe something under /Volumes. Does anyone know of a cross platform way (th...
google-app-engine-django loading fixtures
3,605,268
1
1
312
0
python,django,google-app-engine,fixtures,django-fixtures
Turns out the issue was caused because I wasn't declaring my model correctly in models.py When using google-app-engine-django, each model should be a subclass of: appengine_django.db.BaseModel after fixing this, it works. I also needed to put a valid pk: value in my fixture.
0
1
0
0
2010-08-30T01:32:00.000
1
1.2
true
3,597,332
0
0
1
1
I'm having troubles loading fixtures on GAE with google-app-engine-django. I receive an error that says "DeserializationError: Invalid model identifier: 'fcl.User'" ./manage.py loaddata users I'm trying to load a fixture that has the following data: - model: fcl.User fields: firstname: test lastname: t...
Getting Monitor resolution in Python on Ubuntu
3,598,627
4
4
12,480
0
python,ubuntu,monitor,resolution
I assume you're a GUI toolkit. Why else would you be interested in the screen dimensions? Check out gtk.gdk.screen_width() and gtk.gdk.screen_height() from PyGTK. Something similar should be available for QT.
0
1
0
0
2010-08-30T04:58:00.000
6
1.2
true
3,597,965
0
0
0
1
Is there a equatable bit of code to GetSystemMetrics in win32api, for Ubuntu? I need to get the monitors width and height in pixels.
Add/remove programs in Windows XP with Python script
3,599,566
2
0
2,948
0
python,windows,system,administration
Are you installing or uninstalling? Installing: Easy way: subprocess.Popen the installer. Nearly-as-easy way: subprocess.Popen the installer, with some Windows hackery so that the user doesn't have to click anything. Uninstalling: As above. Hard way: work out the files changed on the computer and revert them manually.
0
1
0
0
2010-08-30T09:27:00.000
1
0.379949
false
3,599,213
1
0
0
1
I would like to add add/programs like adobe acrobat reader and other application in windows XP using Python script. Kindly looking for some help. Thanks in advance! Everest.
Google App Engine self.redirect() POST method
40,599,400
0
4
5,118
0
python,google-app-engine
You can pass parameters. Here is an example: Let's say you have a main page and you want to POST to '/success'. Usually, you may use this way: self.redirect('/sucess') But if you want to pass some parameters from the main page to /success page, like username for example, you can modify the code to this: self.redirect('...
0
1
0
0
2010-08-30T12:01:00.000
3
0
false
3,600,101
0
0
1
1
In GAE (Python), using the webApp Framework, calling self.redirect('some_url') redirects the user to that URL via the GET method. Is it possible to do a (redirect) via the POST method with some parameters as well? If possible, how? Thanks!
Can python's mechanize use localhost sites?
3,603,922
0
0
257
0
python,mechanize
Yes. It can use any URL available so long as it is reachable. Just make sure it's properly formatted!
0
1
0
1
2010-08-30T20:12:00.000
2
1.2
true
3,603,883
0
0
1
1
Can Mechanize access sites being locally hosted by Apache?
List query with, facebook friends in list?
3,611,807
1
2
442
0
python,google-app-engine
I would suggest the following: Make 'marked' entities child entities of the users who have marked them. Use a key name for the 'marked' entity that is based on the URL of the page marked To find friends who have marked a page, retrieve a list of friends, then generate the list of entity keys from the list of friends (...
0
1
0
0
2010-08-31T06:59:00.000
2
0.099668
false
3,606,669
0
0
1
1
In a python based facebook application on GAE, i want to check which friends of current user have "marked" a web page or not. For this i have to run as many DB queries as the number of friends (say 100) I fear this may run into "timeout" because of large no of queries. Google DOCs suggest that "list" queries run in par...
Installing Python SSL module on Windows Vista
3,606,827
0
1
530
0
python,google-app-engine,ssl
Why don't you provide the complete path to python executable. That should work. C:\"Python2.5.2"\python.exe setup.py install
0
1
0
0
2010-08-31T07:07:00.000
3
0
false
3,606,743
1
0
0
1
I'm running GAE SDK on a Windows Vista laptop. It keeps reminding me to install the SSL module. I've been having great difficulty on how to do that. I've downloaded the SSL module. I've done 'python setup.py install' in cmd, but it just says "python is not recognized as an internal..." I've added C:\Python2.5.2 to my P...
How to edit a StringListProperty value in Google App Engine?
3,608,338
2
0
220
0
python,google-app-engine
You need to edit it programmatically. Not all property types can be edited in the data viewer.
0
1
0
0
2010-08-31T08:12:00.000
1
1.2
true
3,607,201
0
0
1
1
I would like to edit the value of a StringListProperty variable on App Engine. Is it possible? I don't see any sign of editable field for a StringListProperty variable right inside the DataViewer panel.
How to read symbols of an object file using C
3,607,298
0
0
1,506
0
python,c,linux
On linux object files are written in ELF file format.So i think you have to start with understanding the ELF file format and how OS write object file using this format.That can give you a idea how you can read object file and symbol table by your own program.To get some initial idea you can look into the source code of...
0
1
0
1
2010-08-31T08:21:00.000
3
1.2
true
3,607,254
0
0
0
1
Question is simple, i have a object file and i want to read the symbols of the object file via code. I am aware that the linux command "nm" would be able to do this, but i want to be able to do it inside code. Also note id like to do this either via C or Python. Regards Paul
pydev doesn't find python library after installation
14,501,729
3
28
12,392
0
python,eclipse,pydev
I've found that closing the project and reopening (after rescanning the interpreter) works for me.
0
1
0
0
2010-08-31T14:59:00.000
4
0.148885
false
3,610,272
1
0
1
4
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it....
pydev doesn't find python library after installation
3,610,311
37
28
12,392
0
python,eclipse,pydev
Pydev doesn't automatically rescan the site-packages folder. You need to go to Preferences-> Interpreter -> Python and click apply to make it scan again.
0
1
0
0
2010-08-31T14:59:00.000
4
1.2
true
3,610,272
1
0
1
4
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it....
pydev doesn't find python library after installation
43,832,437
0
28
12,392
0
python,eclipse,pydev
Well, I followed this sequence to make it work: 1) I installed the desired library by using pip install 2) I went in Eclipse to: Window --> Preferences --> Pydev --> Interpreters --> Python Interpreter, and clicked "Quick Auto-Config". It made the trick.
0
1
0
0
2010-08-31T14:59:00.000
4
0
false
3,610,272
1
0
1
4
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it....
pydev doesn't find python library after installation
6,144,832
14
28
12,392
0
python,eclipse,pydev
I also faced the same error when i had installed a new package.i'm using eclipse Helios. Even after applying and re scanning the folder it was NOT detecting the new packages. So finally i clicked on the "Click here to configure a interpreter not listed" listed and deleted the already selected interpreter and used the a...
0
1
0
0
2010-08-31T14:59:00.000
4
1
false
3,610,272
1
0
1
4
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it....
Is it possible to memcache a json result in App Engine?
3,610,930
7
2
717
0
python,json,google-app-engine
JSON is just text, so yes, you can store it in memcache.
0
1
0
0
2010-08-31T15:59:00.000
1
1.2
true
3,610,854
0
0
1
1
I think my question is already clear enough, but to make it even more clear i will illustrate it with my example. I'm currently returning many json every request, which I would like to cache in some way. I thought memcache would be great, but I only see that they use memcache for caching queries.
how do I return all memcached values in Google App Engine?
3,611,908
0
4
3,350
0
python,google-app-engine,memcached,python-memcached
as in comments above, I guess I could stick all data in a single memcache entry with a known key. Still for non-static data there are scenarios where it would be useful.
0
1
0
0
2010-08-31T17:59:00.000
3
0
false
3,611,830
0
0
1
2
I want to use all the data in my python app engine memcache. I do not know the keys in advance. How do I go about getting all data?
how do I return all memcached values in Google App Engine?
4,524,611
1
4
3,350
0
python,google-app-engine,memcached,python-memcached
I am using a 'well known key' called "config" where I store a list of all other keys and use that to enumerate the rest of the items.
0
1
0
0
2010-08-31T17:59:00.000
3
0.066568
false
3,611,830
0
0
1
2
I want to use all the data in my python app engine memcache. I do not know the keys in advance. How do I go about getting all data?
Is it possible to get a list of all versions of an app?
3,625,552
4
1
91
0
python,google-app-engine,version-control
No, there's no way to get a list of app versions from inside an app.
0
1
0
0
2010-09-01T21:07:00.000
1
1.2
true
3,622,165
0
0
1
1
the title speaks for itself. I play with GAE and some of my apps have versions like (1,2,3,4 and dev). So, is there a way to get all of them, so I could use it in my app to generate links to different versions ?
Python Windows service autostarts too early
3,626,820
2
2
348
0
python,windows-services
Add in script wait for the resources who script must use is in good standing, or rewrite script to better design like not exit if dont have connection; wait 1s and try again if connection failed.
0
1
0
0
2010-09-02T11:47:00.000
2
0.197375
false
3,626,766
0
0
0
1
I am running a Python script as a Windows service, but it seems to be failing whenever I set it to auto-start. I believe this may be because the service uses network resources that are not yet mounted when the service starts. Is there a way I can get it to wait until startup is complete before running?
Is there an Eclipse personality settings for Wing IDE?
9,213,010
1
1
139
0
python,eclipse,wing-ide
I've added an experimental one in version 4.1.3
0
1
0
1
2010-09-02T15:54:00.000
2
0.099668
false
3,628,847
1
0
0
2
While PyDev turns out to be a great IDE for python, especially if you are a former Java developer accustomed to all the eclipse ubercool navigation, it still lacks some features that Wing has, like GUI for running python unit-tests. I know Wing has some "personalities" of other editors: vi, emacs, Visual Studio, ... Un...
Is there an Eclipse personality settings for Wing IDE?
3,629,793
0
1
139
0
python,eclipse,wing-ide
Unfortunately, there's no Eclipse personality.
0
1
0
1
2010-09-02T15:54:00.000
2
1.2
true
3,628,847
1
0
0
2
While PyDev turns out to be a great IDE for python, especially if you are a former Java developer accustomed to all the eclipse ubercool navigation, it still lacks some features that Wing has, like GUI for running python unit-tests. I know Wing has some "personalities" of other editors: vi, emacs, Visual Studio, ... Un...
What is the best way of running shell commands from a web based interface?
3,637,544
1
8
4,016
0
python,ruby-on-rails,ruby,django,shell
I'm not sure if it's what you want, but there are some web based ssh clients out there. If you care about security and really just want dynamic feedback, you could look into comet or just have a frame with its own http session that doesn't end until it's done printing.
0
1
0
1
2010-09-03T15:59:00.000
7
0.028564
false
3,637,503
0
0
1
1
Imagine a web application that allows a logged in user to run a shell command on the web server at the press of a button. This is relatively simple in most languages via some standard library os tools. But if that command is long running you don't want your UI to hang. Again this is relatively easy to deal with using s...
Python, ctypes and mmap
3,640,616
1
12
3,930
0
python,ctypes
Be aware that the operating system is going to be doing readahead for read() anyway. You're going to be blocking either in read() or write()--one or the other will bottleneck the operation--but even though you're blocking in one, that doesn't mean the other isn't taking place for you behind the scenes. That's the job...
0
1
0
0
2010-09-03T22:51:00.000
2
0.099668
false
3,640,092
0
0
0
1
I am wondering if it is possible for the ctypes package to interface with mmap. Currently, my module allocates a buffer (with create_string_buffer) and then passes that using byref to my libraries mylib.read function. This, as the name suggests, reads data into the buffer. I then call file.write(buf.raw) to write the d...
Google App Engine: Including external packages
3,643,164
2
2
506
0
python,google-app-engine
Just place the package's folder in the root directory of your GAE application, easy!
0
1
0
0
2010-09-04T08:54:00.000
3
0.132549
false
3,641,538
0
0
0
1
I understand that if you want to include external packages you have to include them in your project. So I was wondering how do you do this? Do people use one general script that auto imports them from a location. Maybe some kind of config file that lists all the external packages? Do you always zip the packages and us...
Operating System from scratch
8,959,919
-3
15
13,899
0
python,operating-system
Buddy, here is the answer you have been looking for: Writting an Operating System is not different than writting any other application, actually it is far easier than writing any other code for the reason an Operating System is an ALL-PURPOSE software or what is meant as a platform... and you know it!. All of the previ...
0
1
0
0
2010-09-04T18:35:00.000
11
-0.054491
false
3,643,500
1
0
0
7
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
3,643,520
16
15
13,899
0
python,operating-system
Scale this down a lot. I would recommend looking at one very small piece of an operating system that you would want to do, perhaps parallel processing. There is no feasible way you will be able to write an entire operating system in under 500 hours, let only 5000 hours. The real question is is this for an undergradua...
0
1
0
0
2010-09-04T18:35:00.000
11
1
false
3,643,500
1
0
0
7
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
3,643,598
9
15
13,899
0
python,operating-system
Does your professor require a "low-level" component in the project? For example, anything that deals with the hardware or the instruction architecture. If so, your professor will not allow you to do the project in Python. The project must be written in C and assembly. And you will invariably be working on modifying the...
0
1
0
0
2010-09-04T18:35:00.000
11
1
false
3,643,500
1
0
0
7
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
3,644,442
1
15
13,899
0
python,operating-system
You could probably code a small embedded-system OS in the timeframe you indicate, using concepts that are over a decade old. Many newer operating systems require many more complicated scheduling and memory-management heuristics than would be typical in a small embedded OS; designing an entire modern OS would not be a ...
0
1
0
0
2010-09-04T18:35:00.000
11
0.01818
false
3,643,500
1
0
0
7
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
3,643,741
0
15
13,899
0
python,operating-system
Developing an operating system in Python is possible. However, you might want to choose C or Assembly because there's an huge code base developed in those languages.
0
1
0
0
2010-09-04T18:35:00.000
11
0
false
3,643,500
1
0
0
7
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
3,643,534
2
15
13,899
0
python,operating-system
I don't get how you think you can write an operating system in Python. You need native code to at least load an interpreter during bootup, not to mention hardware communication, drivers etc., all of which would be nearly impossible to do given current Python interpreters when running on a bare machine. I'm also ponderi...
0
1
0
0
2010-09-04T18:35:00.000
11
0.036348
false
3,643,500
1
0
0
7
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Operating System from scratch
3,644,477
1
15
13,899
0
python,operating-system
In our university we have operating systems course where we too are supposed to develop something on linux. Not entire OS. We did our own scheduling policy and file system for linux. But this will be done in C since linux is in C.
0
1
0
0
2010-09-04T18:35:00.000
11
0.01818
false
3,643,500
1
0
0
7
I have been asked to choose a project for my Operating System course at my university. I was bubbled with the idea of making an Operating System from scratch in Python. I have a few limitations: I have only 3 months. I want to do it in Python. I can put in say 20-30 hours every week into it. I want to know, how ...
Is code interpreted at every call in Web2Py?
3,649,957
2
4
814
0
python,performance,caching,bytecode,web2py
I don't know web2py particularly, but it runs via WSGI like most other Python frameworks. This means that code is only interpreted when the process starts, and is otherwise kept in memory. Processes are dynamically started and killed by the web server itself, but usually last for multiple requests. In any case, the Pyt...
0
1
0
1
2010-09-06T06:59:00.000
2
0.197375
false
3,649,607
0
0
1
2
If so, What is the advantage ? (sure it will avoid restarting webserver). But isn't it a perfomance bottleneck? For production, is it possible to make web2py run directly from bytecode skipping interpreting stage (Caching) (except for the first request) ?
Is code interpreted at every call in Web2Py?
3,653,081
6
4
814
0
python,performance,caching,bytecode,web2py
In web2py, by default, all code in models, views and controllers (not web2py code, not code in modules imported by your models, views, controllers) is interpreted at every request. This allows to use a third party web server (for example apache) and still be able to see changes in your code reflected immediately withou...
0
1
0
1
2010-09-06T06:59:00.000
2
1
false
3,649,607
0
0
1
2
If so, What is the advantage ? (sure it will avoid restarting webserver). But isn't it a perfomance bottleneck? For production, is it possible to make web2py run directly from bytecode skipping interpreting stage (Caching) (except for the first request) ?
Google App Engine - Tracking which indexes are used
3,651,774
5
3
226
0
python,database,google-app-engine,indexing
The App Engine SDK tracks this for its automatic index creation. Delete your index.yaml, then give your app a good workout. As long as you hit every distinct query in your testing, the SDK will generate a new index.yaml that contains only the indexes you need.
0
1
0
0
2010-09-06T12:55:00.000
2
1.2
true
3,651,609
0
0
1
1
I have a App Engine/Python/Django application which has grown and been modified over the past year and currently has 175 indexes. The problem is that I have not been thourough in cleaning up/removing indexes that are no longer needed. Now, I am not sure which indexes are active and which are essentially dead, but I am...
Subdomains vs folders/directories
3,653,270
1
3
286
0
python,django,nginx,subdomain
I think directories are the way to go. I believe it would be easier to adapt Django to the directories way much easier than to subdomains. And as one user commented you can avoid restarting your server each time. I prefer to keep subdomains reserved for system use. Users should get their own directories instead. This i...
0
1
0
1
2010-09-06T17:26:00.000
2
0.099668
false
3,653,239
0
0
0
2
I'm currently building a web application and I would like my users to have their own URLs to identify them. I could either do this using subdomains or using folders and am wondering what are the advantages and disadvantages of either one. I really like the folder solution because my URL mapping would be fairly easy. I ...
Subdomains vs folders/directories
3,653,257
0
3
286
0
python,django,nginx,subdomain
Use something like mod_wsgi instead of cgi scripts, they allow you to use arbitrary URL configs (example: Django, web.py, Zope ...)
0
1
0
1
2010-09-06T17:26:00.000
2
0
false
3,653,239
0
0
0
2
I'm currently building a web application and I would like my users to have their own URLs to identify them. I could either do this using subdomains or using folders and am wondering what are the advantages and disadvantages of either one. I really like the folder solution because my URL mapping would be fairly easy. I ...
ubuntu /usr/bin/env: python: No such file or directory
66,512,967
7
91
161,757
0
python,ubuntu-9.04
@mchid's answer is the one you should go for it. just FYI, if you do this: $ python it will say Command 'python' not found ... But if you do this: $ python3, it should work. So, just modify the shebang line from !#/usr/bin/env python to !#/usr/bin/env python3, you're good to go. (which is automatically done by doing su...
0
1
0
0
2010-09-07T02:06:00.000
7
1
false
3,655,306
0
0
0
1
I update the kernel, after that the Ubuntu doesn't work well, PS: I try to exec "meld" command, it will report that "/usr/bin/env: python: No such file or directory", then I exec "sudo apt-get install python" and get the result "python is already the newest version.", what should I do for it. I'm not good at linux, c...
reading .bash_history file through python script
3,656,550
0
1
696
0
python
Just some basic ideas, with important python functions for that: read the file; open go through all lines and sum up the number of occurences of a line; for, dict in case you only want to check parts of a command (for example treat cd XY and cd .. the same), normalize the lines by removing the command arguments after ...
0
1
0
1
2010-09-07T07:16:00.000
3
0
false
3,656,500
0
0
0
1
I want to write a python script which reads the '.bash_history' file and prints the statistics. Also, I would like to print the command which was used the most. I was able to read the bash history through the terminal but I'm not able to do it through python programming. Can someone please help me with how to start wit...
Twisted and connection to SQL Server
4,059,366
1
0
1,128
1
python,sql-server,twisted
If you want to have portable mssql server library, you can try the module from www.pytds.com. It works with 2.5+ and 3.1, have a good stored procedure support. It's api is more "functional", and has some good features you won't find anywhere else.
0
1
0
0
2010-09-07T09:07:00.000
2
0.099668
false
3,657,271
0
0
0
1
I have a Twisted application that runs in an x86 64bit machine with Win 2008 server. It needs to be connected to a SQL Server database that runs in another machine (in a cloud actually but I have IP, port, db name, credentials). Do I need to install anything more that Twisted to my machine? And which API should be use...
How to execute another python script from your script and be able to debug?
3,658,022
2
11
7,883
0
python,debugging,command-line,runpy
Do you have control over another.py? It would be a good idea to change it and add a main() method. Main() can then be invoked if __name__ == '__main__'. This will alleviate your problems a great deal. It is also unit testing friendly.
0
1
0
0
2010-09-07T10:51:00.000
4
0.099668
false
3,657,955
1
0
0
1
You have wrapper python script that is calling another python script, currently using os.system('python another.py some-params'). You want to be able to debug both scripts and if you use os.system() you'll loose the debugger, so it does make sense to load the second script using the same interpretor instead of starting...
Is it possible to stream a windows (7 / vista / xp) webcams via Gstreamer
3,661,651
1
0
1,416
0
python,windows,streaming,gstreamer
For Windows streaming, I would suggest VLC.
0
1
0
0
2010-09-07T14:07:00.000
2
1.2
true
3,659,382
0
0
0
1
I very new to the world of gstreamer. I was wondering, if it's possible to stream windows webcam via gstreamer? The only package i have seen so far is for linux. v4l2 (video for linux). Is there also a package for windows webcams? what is the correct python syntax? DJ
compile python script in linux
3,674,482
0
7
12,788
0
python,linux,binary,compilation
In linux, try to avoid such things. Most package managers handle dependencies quite fine, just distribute your script and tell what dependencies it needs.
0
1
0
0
2010-09-08T20:06:00.000
3
0
false
3,671,466
0
0
0
1
So I have a python script that relies on a couple modules. Specifically pexpect and pyinoitify. I know you can compile a python script into a .exe in windows, but is there something relatively equivalent in linux? I don't care about it being a binary, I'd just like to be able to distribute my script without requiring t...
How to connect to Cassandra inside a Pylons app?
3,687,133
2
10
885
1
python,pylons,cassandra
Well. I worked a little more. In fact, using a connection manager was probably not a good idea as this should be the template context. Additionally, opening a connection for each thread is not really a big deal. Opening a connection per request would be. I ended up with just pycassa.connect_thread_local() in app_global...
0
1
0
0
2010-09-08T20:14:00.000
2
1.2
true
3,671,535
0
0
0
1
I created a new Pylons project, and would like to use Cassandra as my database server. I plan on using Pycassa to be able to use cassandra 0.7beta. Unfortunately, I don't know where to instantiate the connection to make it available in my application. The goal would be to : Create a pool when the application is launc...
which language (python/perl/tcl) on linux doesn't need to install the third-party libs?
3,675,682
2
1
317
0
java,python,linux,perl,tcl
On Linux you should use the distribution's native package format (DEB, RPM, …) to deploy applications. The package managers included in the distributions can handle dependencies automatically. Apart from that, I think Perl is the only language that is available in most Linux systems out of the box. Python is very popul...
0
1
0
0
2010-09-09T10:17:00.000
5
0.07983
false
3,675,659
0
0
0
1
When deploy java app on linux, we don't need to install anything, all third-party libs are jar files and we only update classpath in script file. But java needs jre which is quite large. So is there any other language supported by linux can do that? By default our server only support perl/python/tcl, no gcc available, ...
Execute external application and send some key events to it
3,754,755
0
3
2,394
0
python,wxpython
Thanks for answering. I tried using the subprocess.Popen(), but it seems that it doesn't work. Sending the '\t' string does not work... It simply does nothing... Notice that the application is not python based (it's an installation application - basically, they are auto-extracting zip files (.exe) and I have hundreds o...
0
1
0
0
2010-09-10T12:29:00.000
3
0
false
3,684,594
0
0
0
1
I wasn't able to find a solution for Python. I am abelt o launch the application (using subprocess.Popen or subprocess.call), but I can't find a way to do the other part: I want to send a serie of keys (kind of macro) to the application I just opened. Like: Tab Tab Enter Tab Tab Delete ... Is there a way to do this tha...
Killing a program using multiprocessing
3,686,703
23
12
5,670
0
python
Hit Ctrl-Z to suspend the Python process, then do kill %1 to kill it. You can also just hit Ctrl-\ (backslash), but that may cause the process to leave a core file.
0
1
0
0
2010-09-10T17:07:00.000
3
1.2
true
3,686,677
1
0
0
1
I'm using the multiprocessing module to do parallel processing in my program. When I'm testing it, I'll often want to kill the program early when I notice a bug, since it takes a while to run to completion. In my Linux environment, I run my program from a terminal, and use Ctrl+C to kill it. With multiprocessing, th...
How to Install rpy2 on Mac OS X
3,792,577
2
6
7,010
0
python,macos,osx-snow-leopard,rpy2
easy_install and rpy2 work fine together (just did it) but you need to have easy_install in sync with your specific python version. This comes down to controlling your $PATH and $PYTHONPATH environment variables so that the first Python directory that appears is the version you want and also has the easy_install versio...
0
1
0
1
2010-09-10T20:04:00.000
2
1.2
true
3,687,939
1
0
0
1
I am trying, so far unsuccessfully, at installing the rpy2 for python on my Mac OSX. I have tried Macports and DarwinPorts but have had no luck with import rpy2 within the python shell environment. I don't know much about programming in Mac and I am a wiz at installing modules on a Windoze based system, but for the l...
I can't delete a folder that I just extracted from a zip file in python
3,688,484
4
1
2,123
0
python,windows,windows-vista,operating-system,zip
Many reasons possible. You need to use os.rmdir to remove directories You need to empty the folder first - remember, the Windows command rmdir needs a /S option to remove the contents, and Python probably uses that. Is the unzip also using the archive's attributes? Read-only attributes may be applied. Are you reading...
0
1
0
0
2010-09-10T21:24:00.000
2
1.2
true
3,688,456
1
0
0
2
So here's my problem. I have a python script that takes a zipfile and extracts its contents. Then based on some constraint, I will try to delete the folder whose contents were just extracted. For some reason I get an error, WindowsError: [Error 5] Access is denied: 'Foldername' when i try to delete that folder. The sim...
I can't delete a folder that I just extracted from a zip file in python
3,691,118
1
1
2,123
0
python,windows,windows-vista,operating-system,zip
I see a possible problem on Windows, which is that you could have an opened file in this directory. Make sure that you close explicitly all the files that you have opened using file.close() (your sample code looks right, though). Also, it might be useful to have a look at shutils.rmtree: it can recursively remove direc...
0
1
0
0
2010-09-10T21:24:00.000
2
0.099668
false
3,688,456
1
0
0
2
So here's my problem. I have a python script that takes a zipfile and extracts its contents. Then based on some constraint, I will try to delete the folder whose contents were just extracted. For some reason I get an error, WindowsError: [Error 5] Access is denied: 'Foldername' when i try to delete that folder. The sim...
Security considerations - office website/portal on GAE
3,692,597
1
0
182
0
python,django,security,google-app-engine
There is always the choice between usabiity and secutity. The more security features you implent, the more difficult it gets to use it. can we host the apps on GAE (appspot.com) with https? Yes, but not on your own domain, only on appspot.com. If you are serving your app off of an own domain, you must direct all secu...
0
1
0
0
2010-09-11T20:23:00.000
1
1.2
true
3,692,526
0
0
1
1
If one needs to create an office website (that serves as a platform for clients/customers/employees) to login and access shared data, what are the security considerations. to give you some more detail, The office portal has been developed in django/python and hosted through GAE. Essentially, the end point comes with a...
Using scp to transfer a single file into a remote folder that doesn't exist
3,693,682
0
2
5,882
0
python,scp
It's not exactly scp, but sftp can take the -b parameter with a batch file. You can send a mkdir and a put.
0
1
0
1
2010-09-12T03:54:00.000
3
0
false
3,693,666
0
0
0
3
I'm working on a python script that monitors a directory and uploads files that have been created or modified using scp. That's fine, except I want this to be done recursively, and I'm having a problem if a user creates a directory in the watch directory, and then modifies a file inside that new directory. I can detect...
Using scp to transfer a single file into a remote folder that doesn't exist
3,693,690
2
2
5,882
0
python,scp
Since you have ssh, can't you just create the directory first? For example, given a file with absolute path /some/path/file.txt, issue a mkdir -p /home/path before uploading file.txt. UPDATE: If you're looking to lower the number of transactions, a better method might be to make a tar file locally, transfer that, and...
0
1
0
1
2010-09-12T03:54:00.000
3
1.2
true
3,693,666
0
0
0
3
I'm working on a python script that monitors a directory and uploads files that have been created or modified using scp. That's fine, except I want this to be done recursively, and I'm having a problem if a user creates a directory in the watch directory, and then modifies a file inside that new directory. I can detect...
Using scp to transfer a single file into a remote folder that doesn't exist
4,294,064
1
2
5,882
0
python,scp
While I imagine your specific application will have its own quirks (as does mine), this may put you on the right path. Below is a short snippet from a script I use to put files onto a remote EC2 instance using Fabric built on paramiko. Also note I where I put the sudo commands as Fabric has its own "sudo" class. Thi...
0
1
0
1
2010-09-12T03:54:00.000
3
0.066568
false
3,693,666
0
0
0
3
I'm working on a python script that monitors a directory and uploads files that have been created or modified using scp. That's fine, except I want this to be done recursively, and I'm having a problem if a user creates a directory in the watch directory, and then modifies a file inside that new directory. I can detect...
windows python script to traverse directory to remove folders, restart PC and continue the next line of the script?
3,696,438
1
0
472
0
python,windows,directory,traversal
In a nutshell, here's what you'll need to do. You can delete the files and folders by using the remove() and rmdir() or removedirs() methods in the os module (assuming your user/program has administrative rights). To restart your script you will first need to add some command line argument handling to it that allows it...
0
1
0
0
2010-09-12T07:07:00.000
1
0.197375
false
3,694,051
1
0
0
1
I want to remove a incorrectly installed program and reinstall it. I can remove the program with subprocess.Popen calling the msiexe on it and install new program the same way BUT ONLY with two independent scripts. But i also need to remove some folders in C:\Programs files and also in C:\Doc& Settings. How can i trave...
changing python path on mac?
61,142,084
0
18
91,910
0
python,macos
i managed to fixed mine by removing python2, i don't if it's a good practice
0
1
0
0
2010-09-12T18:56:00.000
4
0
false
3,696,124
0
0
0
1
I would like to change my PATH from Python 2.6.1 to 3.1.2. I have both versions installed on my computer, but when I type python --version in the terminal I get Python 2.6.1. So, thats the current version it's "pointing" to. Now if I type python3.1 it loads the version I want to use, although the PATH is still pointi...
Python Installation Manager
7,931,136
0
0
141
0
python,distutils
More precisely, it may be the product of the distutils bdist_winsinst command, or the bdist_msi command, or maybe the product of py2exe, a third-party project building on distutils.
0
1
0
0
2010-09-12T19:16:00.000
2
0
false
3,696,183
1
0
0
1
Often when I install .exe files made from python files I get an installation manager that is blue and has the logo "python powered". What is the name of this manager? I'd like to use it to make some installable python files.
prefer windows or unix line ending for code?
3,698,117
9
4
1,627
0
c++,python,multiplatform,line-endings
Use a version control system that's smart enough to ignore line-endings on check-in, and use the correct value for the platform on check-out.
0
1
0
0
2010-09-13T05:56:00.000
3
1.2
true
3,698,084
1
0
0
3
I writing code that should compiled and run on both Windows and unix like Linux. I know about difference between line endings, but question is which to prefer for my code? Does it matter? I want it to be consistent - say all my code uses LF only, or is it better CRLF only? Are there critaria for comparing? If it matter...
prefer windows or unix line ending for code?
3,698,106
2
4
1,627
0
c++,python,multiplatform,line-endings
For the code itself, it does not matter. All reasonably modern editors and compilers handle both just as well (I presume you are not using notepad :-) ). Just use the line ending of the main development platform.
0
1
0
0
2010-09-13T05:56:00.000
3
0.132549
false
3,698,084
1
0
0
3
I writing code that should compiled and run on both Windows and unix like Linux. I know about difference between line endings, but question is which to prefer for my code? Does it matter? I want it to be consistent - say all my code uses LF only, or is it better CRLF only? Are there critaria for comparing? If it matter...
prefer windows or unix line ending for code?
3,698,642
2
4
1,627
0
c++,python,multiplatform,line-endings
IME the easiest is to use *NIX line endings. Windows' compilers and IDEs can deal with it fine and it is native for *NIX tools. Using DOS line endings creates, if not problems, inconveniences with some (even the more popular) text editors on *NIX. You often get ugly '^M' at the end of the line then and you have to expl...
0
1
0
0
2010-09-13T05:56:00.000
3
0.132549
false
3,698,084
1
0
0
3
I writing code that should compiled and run on both Windows and unix like Linux. I know about difference between line endings, but question is which to prefer for my code? Does it matter? I want it to be consistent - say all my code uses LF only, or is it better CRLF only? Are there critaria for comparing? If it matter...
How can we call the CLI executables commands using Python
3,699,299
0
1
170
0
python,django,web-services,api,soap
Depends on how you want to design your software. You could do stand-alone scripts as servers listening for requests on specific ports, or you could use a webserver which runs python scripts so you just have to access a URL. REST is one option to implement the latter. You should then look for frameworks for REST develop...
0
1
1
0
2010-09-13T09:41:00.000
3
0
false
3,699,268
0
0
0
1
How can we call the CLI executables commands using Python For example i have 3 linux servers which are at the remote location and i want to execute some commands on those servers like finding the version of the operating system or executing any other commands. So how can we do this in Python. I know this is done throug...
Google App Engine's db.UserProperty with rpxnow
3,707,639
1
0
389
1
python,google-app-engine,rpxnow
You can only get a User object if you're using one of the built-in authentication methods. User objects provide an interface to the Users API, which is handled by the App Engine infrastructure. If you're using your own authentication library, regardless of what protocol it uses, you will have to store user information ...
0
1
0
0
2010-09-13T10:55:00.000
2
1.2
true
3,699,751
0
0
1
1
We have a Django project which runs on Google App Engine and used db.UserProperty in several models. We don't have an own User model. My boss would like to use RPXNow (Janrain) for authentication, but after I integrated it, the users.get_current_user() method returned None. It makes sense, because not Google authentica...
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
15,379,528
5
435
1,708,519
0
python,windows,environment-variables,pythonpath
To augment PYTHONPATH, run regedit and navigate to KEY_LOCAL_MACHINE \SOFTWARE\Python\PythonCore and then select the folder for the python version you wish to use. Inside this is a folder labelled PythonPath, with one entry that specifies the paths where the default install stores modules. Right-click on PythonPath and...
0
1
0
0
2010-09-13T15:04:00.000
22
0.045423
false
3,701,646
0
0
1
5
I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly. I tried adding C:\My_Projects\; to my Windows Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it sti...
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
13,650,817
2
435
1,708,519
0
python,windows,environment-variables,pythonpath
This PYTHONPATH variable needs to be set for ArcPY when ArcGIS Desktop is installed. PYTHONPATH=C:\arcgis\bin (your ArcGIS home bin) For some reason it never was set when I used the installer on a Windows 7 32-bit system.
0
1
0
0
2010-09-13T15:04:00.000
22
0.01818
false
3,701,646
0
0
1
5
I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly. I tried adding C:\My_Projects\; to my Windows Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it sti...
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
38,088,508
6
435
1,708,519
0
python,windows,environment-variables,pythonpath
The python 2.X paths can be set from few of the above instructions. Python 3 by default will be installed in C:\Users\\AppData\Local\Programs\Python\Python35-32\ So this path has to be added to Path variable in windows environment.
0
1
0
0
2010-09-13T15:04:00.000
22
1
false
3,701,646
0
0
1
5
I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly. I tried adding C:\My_Projects\; to my Windows Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it sti...
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
14,753,412
61
435
1,708,519
0
python,windows,environment-variables,pythonpath
Just append your installation path (ex. C:\Python27\) to the PATH variable in System variables. Then close and open your command line and type 'python'.
0
1
0
0
2010-09-13T15:04:00.000
22
1
false
3,701,646
0
0
1
5
I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly. I tried adding C:\My_Projects\; to my Windows Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it sti...
How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
58,418,095
1
435
1,708,519
0
python,windows,environment-variables,pythonpath
While this question is about the 'real' Python, it did come up in a websearch for 'Iron Python PYTHONPATH'. For Iron Python users as confused as I was: It turns out that Iron Python looks for an environment variable called IRONPYTHONPATH. Linux/Mac/POSIX users: Don't forget that not only does Windows use \ as path sepa...
0
1
0
0
2010-09-13T15:04:00.000
22
0.009091
false
3,701,646
0
0
1
5
I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly. I tried adding C:\My_Projects\; to my Windows Path variable from the Windows GUI (My Computer > Properties > Advanced System Settings > Environment Variables). But it sti...
Python: How to use platform.win32_ver() on a remote machine?
3,954,806
0
1
1,156
0
python,windows
I had to use remote registry... HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion ProductName, EditionID, CurrentVersion, CurrentBuild
0
1
0
0
2010-09-14T21:17:00.000
2
1.2
true
3,712,992
0
0
0
1
So of course I'm new to Python and to programming in general... I am trying to get OS version information from the network. For now I only care about the windows machines. using PyWin32 I can get some basic information, but it's not very reliable. This is an example of what I am doing right now: win32net.NetWkstaGetInf...
Is python's shutil.move() atomic on linux?
3,716,361
20
19
4,324
0
python,file,unix,atomic
It is not atomic if the files are on different filsystems. In that case, python opens the source and destination file, loops on reading from the source and writing to the desination and finally unlinks the source file. If the source and destination file are on the same file system, python uses the rename() C call, whi...
0
1
0
0
2010-09-15T09:27:00.000
1
1.2
true
3,716,325
1
0
0
1
I am wondering whether python's shutil.move is atomic on linux ? Is the behavior different if the source and destination files are on two different partitions or is it same as when they are present on the same partition ? I am more concerned to know whether the shutil.move is atomic if the source and destination files ...
How do you properly determine the current script directory?
6,236,300
5
358
156,322
0
python
Just use os.path.dirname(os.path.abspath(__file__)) and examine very carefully whether there is a real need for the case where exec is used. It could be a sign of troubled design if you are not able to use your script as a module. Keep in mind Zen of Python #8, and if you believe there is a good argument for a use-c...
0
1
0
1
2010-09-15T14:34:00.000
16
0.062419
false
3,718,657
0
0
0
1
I would like to see what is the best way to determine the current script directory in Python. I discovered that, due to the many ways of calling Python code, it is hard to find a good solution. Here are some problems: __file__ is not defined if the script is executed with exec, execfile __module__ is defined only in m...
Python subprocess how to determine if child process hangs?
3,724,308
1
2
2,476
0
python,process,subprocess,parent-child
I guess, you are asking, how do you find if the child process is hung while operating. You can't tell easily. A process could be doing a long running operation. The context is important to understand when a process is hung. If you are expecting a process to respond to a user input and is not responsive for a long perio...
0
1
0
0
2010-09-16T06:35:00.000
2
0.099668
false
3,724,238
1
0
0
2
How do I know is there my child process got hang while operating?