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
How can I use google app engine?
3,143,745
0
0
171
0
python,google-app-engine,web-applications,webstore
It is hard to say if App Engine is suited to your particular needs without more details about what functionality you want your web store to present. It also depends a little bit on your background and experience. However, the "app like feel" and crafting a "completely unique feel" for your site is something you can accomplish on any reasonable platform - I expect the presentation style will be relatively independent of the backend you choose.
0
1
0
0
2010-06-29T18:38:00.000
2
0
false
3,143,703
0
0
1
2
I've begun planning a kind of web store interface that I want to work on soon. I'm starting to import products from China and want to have a completely unique feel for my site. Now I'm kinda a google fanboy and have heard alot about google app engine. Mostly I like the hosting available with google more then anything though. But I wanted to know, would the App Engine be good for what I'm making? Namely a web store with an app like feel. I've decided, to help if I ever need to move my host, to work in web2py hosted in the App Engine. Or would I be better with django or something on a normal host? Is google best for webapps? Or is it pretty well suited for webstores as well? Thanks
How can I use google app engine?
3,143,763
0
0
171
0
python,google-app-engine,web-applications,webstore
You can build almost anything on GAE. As Monk would say that is a blessing and a curse. GAE is relatively new and so e commerce ventures are relatively rare. This means you would be responsible for every piece of the site. Other dedicated e commerce technologies trade some of the control and look and feel for ease of use/setup. So in short yes you could use GAE to create an e commerce site, but you would be spending a lot of time getting it up and running and then managing it. Time you may find better spent on sales and marketing.
0
1
0
0
2010-06-29T18:38:00.000
2
1.2
true
3,143,703
0
0
1
2
I've begun planning a kind of web store interface that I want to work on soon. I'm starting to import products from China and want to have a completely unique feel for my site. Now I'm kinda a google fanboy and have heard alot about google app engine. Mostly I like the hosting available with google more then anything though. But I wanted to know, would the App Engine be good for what I'm making? Namely a web store with an app like feel. I've decided, to help if I ever need to move my host, to work in web2py hosted in the App Engine. Or would I be better with django or something on a normal host? Is google best for webapps? Or is it pretty well suited for webstores as well? Thanks
how to detect bounce mail in google app engine?
3,194,130
0
3
1,227
0
python,google-app-engine,email
easiest is to encode an email address via base64 or simiar encoding and prefixed it to from address. all address from something@myapp.appspotmail.com are valid email address for from in gae. simply create a mail receive handler. decode the from string and get the email address to whom you send the email originally. sad thing is maximum 64 character length allowed for local part. in that case storing email address in datastore and using its key as a local part to email can be a option.
0
1
0
1
2010-06-30T07:38:00.000
4
1.2
true
3,147,267
0
0
1
1
sometime due to wrong input from user side, mail bounce and did not reach the recipient. ( sent from google app engine.) How to detect such email ? edit: may be i was not clear in my question : I want to know to which mail i have sent the mail which was return ( so that i may alert the user or delete the email id ). this is more related to how email bounce works. normally the bounce mail does not come exactly same as sent but with different information, is there any particular header or something there to know which email id was that ? ... i think i have figure out while writing these, i am keeping this question so it might help somebody. i will simply mail from base64encodedrecipientemailaddress@myapp.appspot.com and create a mail receive handler. :) so one more question : what is the maximum length does app-engine ( or any mail server ) allows for email address ?
Python-dependency, windows (CMake)
3,150,286
2
2
1,123
0
c++,python,installation,cmake
Python doesn't really have to be installed to function properly. For my own CMake based projects on Windows, I just use a .zip file containing the entire python tree. All you need to do is extract it to a temporary directory, add it to your path, and set your PYTHONHOME/PYTHONPATH environment variables. Once that's done, you have a fully operational Python interpreter at your disposal. About the only 'gotcha' on Windows is to make sure you remember to copy the Python DLL out of C:\Windows\system32 into the top-level Python directory prior to creating the .zip.
0
1
0
0
2010-06-30T08:55:00.000
1
1.2
true
3,147,754
0
0
0
1
I have a large, crossplatform, python-dependent project, which is built by CMake. In linux, python is either preinstalled or easily retrived by shell script. But on windows build, i have to install python manually from .msi before running CMake. Is there any good workaround using cmake scripts? PS All other external dependencies are downloaded from dedicated FTP server.
Global Exception Handling in Google App Engine
3,154,925
0
2
1,028
0
python,google-app-engine,exception-handling,global
You application probably has a main() function, put the try/except in that function, and it'll catch everything from your application.
0
1
0
0
2010-07-01T03:26:00.000
3
0
false
3,154,900
0
0
1
2
Instead of encapsulating my entire code in a try{} except{} block, is there someway of catching exceptions globally? Basically I am looking for a way to have a global exception handler which will handle all unhandled exceptions in the my python application written for google app engine
Global Exception Handling in Google App Engine
3,154,924
0
2
1,028
0
python,google-app-engine,exception-handling,global
Well, at the most basic level you could wrap all of your handler scripts referenced by app.yaml in a giant try-except block. If you are using the webapp framework, consider overriding handle_exception() for each of your request handlers. If you want all of your request handlers to have some basic exception handling that you specify, you could a request handler which implements this method and then derive all of your handlers from it.
0
1
0
0
2010-07-01T03:26:00.000
3
0
false
3,154,900
0
0
1
2
Instead of encapsulating my entire code in a try{} except{} block, is there someway of catching exceptions globally? Basically I am looking for a way to have a global exception handler which will handle all unhandled exceptions in the my python application written for google app engine
How to test a function that deals with setting file ownership without being root
3,155,835
2
0
177
0
python,linux,testing
You could make an object which does the chmod, and inject a mock when testing. This mock would not really do the chmod, but make it possible to test if it was called with the right parameters.
0
1
0
1
2010-07-01T07:17:00.000
1
1.2
true
3,155,748
0
0
0
1
I wrote a function that copies the /etc/skel directory on a linux machine during a "create new user" RPC call. Now, there is quite a few things about this I want to test, for example the files in /etc/skel and the targets of symlinks should not have changed permissions afterwards, whereas the copied files including the actual symlinks should have a changed owner. Now, i can create my test directory and files using mkdtemp and stuff, but I can't chown those to another user without root privileges. How would you write a test for this?
What's the best library for video capture in Python on linux?
3,156,482
0
7
11,928
0
python,linux,webcam,video-capture
If you have a favorite video capture C library, you can probably write a simple facade to it using the ctypes module.
0
1
0
0
2010-07-01T07:54:00.000
5
0
false
3,155,961
0
0
0
2
I want to write an application to video capture from web-cams in linux. Is there a python library to do that?
What's the best library for video capture in Python on linux?
3,158,044
0
7
11,928
0
python,linux,webcam,video-capture
there is a lib called open-cv. Try that. It has a lot of features for handling images as well.
0
1
0
0
2010-07-01T07:54:00.000
5
0
false
3,155,961
0
0
0
2
I want to write an application to video capture from web-cams in linux. Is there a python library to do that?
Google application engine, maximum number of static files?
3,166,662
5
3
1,582
0
python,django,google-app-engine
Welcome to Stack Overflow! One of the limitations in App Engine is that you cannot write directly to the filesystem from your app. Static files would be things like HTML, CSS, javascript and images that are global to your application, and get uploaded manually when you deploy. They are uploaded to and served from different servers than the ones that handle dynamic content. Since you can't write to the filesystem from your app, files uploaded by users must be saved to the datastore as blobs. These are not considered static files. As others have mentioned, you can use S3 or the Blobstore API, however both of these require billing. With the free quotas, each entity can be up to 1MB, and each HTTP request and response can be up to 10MB. Using standard entities with a BlobProperty, you can easily store and serve dynamically uploaded files up to 1MB, or 10MB if you want to get fancy and store your blob in slices across multiple entities.
0
1
0
0
2010-07-02T12:46:00.000
3
1.2
true
3,165,753
0
0
1
1
I am developing an application in google application engine which would have a user profiles kind of feature. I was going through the Google App's online tutorial where I found that the maximum number of static files (app files and static files) should not exceed 3000. I am afraid whether the user's would be able to upload their images when the number of users increase. Is this limitation for the Free Quota only or its even after billing. In the document, its mentioned as the additional limit than the Free Quota. Please suggest. Thanks in advance.
Rename a computer programmatically
3,167,542
0
1
2,734
0
c#,java,python,hostname
In Windows you have to modify registry keys and the reboot the system. You actually have to change two entries: HostName under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpIp\Parameters and ComputerName under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName Please note that if the computer ha joined an NT Domain this change could be harmful (and in this case you have an additional entry to change under TcpIp\Parameters).
0
1
0
0
2010-07-02T16:27:00.000
3
0
false
3,167,469
0
0
0
1
I need to automate the changing of the hostname of a computer, but I can't figure out how to do it inside a program. My options are open; I would be happy with a solution in any of the following: Command line Java Python C# (would prefer one of the other 3, but this is ok) It would be helpful to learn how to do this on both Linux and Windows.
Picking a front-end/interpreter for a scientific code
3,188,680
0
6
453
0
c++,python,matlab,tcl,interpreter
Well, unless there are any other suggestions, the final answer I have arrived at is to go with Python. I seriously considered matlab/octave, but when reading the octave API and matlab API, they are different enough that I'd need to build separate interfaces for each (or get very creative with macros). With python I end up with a single, easier to maintain codebase for the front end, and it is used by just about everyone we know. Thanks for the tips/feedback everyone!
0
1
0
0
2010-07-02T16:58:00.000
3
0
false
3,167,661
0
1
0
2
The simulation tool I have developed over the past couple of years, is written in C++ and currently has a tcl interpreted front-end. It was written such that it can be run either in an interactive shell, or by passing an input file. Either way, the input file is written in tcl (with many additional simulation-specific commands I have added). This allows for quite powerful input files (e.g.- when running monte-carlo sims, random distributions can be programmed as tcl procedures directly in the input file). Unfortunately, I am finding that the tcl interpreter is becoming somewhat limited compared to what more modern interpreted languages have to offer, and its syntax seems a bit arcane. Since the computational engine was written as a library with a c-compatible API, it should be straightforward to write alternative front-ends, and I am thinking of moving to a new interpreter, however I am having a bit of a time choosing (mostly because I don't have significant experience with many interpreted languages). The options I have begun to explore are as follows: Remaining with tcl: Pros: - No need to change the existing code. - Existing input files stay the same. (though I'd probably keep the tcl front end as an option) - Mature language with lots of community support. Cons: - Feeling limited by the language syntax. - Getting complaints from users as to the difficulty of learning tcl. Python: Pros: - Modern interpreter, known to be quite efficient. - Large, active community. - Well known scientific and mathematical modules, such as scipy. - Commonly used in the academic Scientific/engineering community (typical users of my code) Cons: - I've never used it and thus would take time to learn the language (this is also a pro, as I've been meaning to learn python for quite some time) - Strict formatting of the input files (indentation, etc..) Matlab: Pros: - Very power and widely used mathematical tool - Powerful built-in visualization/plotting. - Extensible, through community submitted code, as well as commercial toolboxes. - Many in science/engineering academia is familiar with and comfortable with matlab. Cons: - Can not distribute as an executable- would need to be an add-on/toolbox. - Would require (?) the matlab compiler (which is pricy). - Requires Matlab, which is also pricy. These pros and cons are what I've been able to come up with, though I have very little experience with interpreted languages in general. I'd love to hear any thoughts on both the interpreters I've proposed here, if these pros/cons listed are legitimate, and any other interpreters I haven't thought of (e.g.- would php be appropriate for something like this? lua?). First hand experience with embedding an interpreter in your code is definitely a plus!
Picking a front-end/interpreter for a scientific code
3,168,060
3
6
453
0
c++,python,matlab,tcl,interpreter
Have you considered using Octave? From what I gather, it is nearly a drop-in replacement for much of matlab. This might allow you to support matlab for those who have it, and a free alternative for those who don't. Since the "meat" of your program appears to be written in another language, the performance considerations seem to be not as important as providing an environment that has: plotting and visualization capabilities, is cross-platform, has a big user base, and in a language that nearly everyone in academia and/or involved with modelling fluid flow probably already knows. Matlab/Octave can potentially have all of those.
0
1
0
0
2010-07-02T16:58:00.000
3
0.197375
false
3,167,661
0
1
0
2
The simulation tool I have developed over the past couple of years, is written in C++ and currently has a tcl interpreted front-end. It was written such that it can be run either in an interactive shell, or by passing an input file. Either way, the input file is written in tcl (with many additional simulation-specific commands I have added). This allows for quite powerful input files (e.g.- when running monte-carlo sims, random distributions can be programmed as tcl procedures directly in the input file). Unfortunately, I am finding that the tcl interpreter is becoming somewhat limited compared to what more modern interpreted languages have to offer, and its syntax seems a bit arcane. Since the computational engine was written as a library with a c-compatible API, it should be straightforward to write alternative front-ends, and I am thinking of moving to a new interpreter, however I am having a bit of a time choosing (mostly because I don't have significant experience with many interpreted languages). The options I have begun to explore are as follows: Remaining with tcl: Pros: - No need to change the existing code. - Existing input files stay the same. (though I'd probably keep the tcl front end as an option) - Mature language with lots of community support. Cons: - Feeling limited by the language syntax. - Getting complaints from users as to the difficulty of learning tcl. Python: Pros: - Modern interpreter, known to be quite efficient. - Large, active community. - Well known scientific and mathematical modules, such as scipy. - Commonly used in the academic Scientific/engineering community (typical users of my code) Cons: - I've never used it and thus would take time to learn the language (this is also a pro, as I've been meaning to learn python for quite some time) - Strict formatting of the input files (indentation, etc..) Matlab: Pros: - Very power and widely used mathematical tool - Powerful built-in visualization/plotting. - Extensible, through community submitted code, as well as commercial toolboxes. - Many in science/engineering academia is familiar with and comfortable with matlab. Cons: - Can not distribute as an executable- would need to be an add-on/toolbox. - Would require (?) the matlab compiler (which is pricy). - Requires Matlab, which is also pricy. These pros and cons are what I've been able to come up with, though I have very little experience with interpreted languages in general. I'd love to hear any thoughts on both the interpreters I've proposed here, if these pros/cons listed are legitimate, and any other interpreters I haven't thought of (e.g.- would php be appropriate for something like this? lua?). First hand experience with embedding an interpreter in your code is definitely a plus!
correct configuration for apache and mod_python
11,032,693
0
0
1,196
0
python,apache2,mod-python,ubuntu-10.04
In my case, changing PythonHandler pywps to PythonHandler wps in the .htaccess (or the apache configuration file) fixed the problem. I think that the file pywps.py has been renamed to wps.py, and this gives problems, since the sample configuration file has been left with the old name.
0
1
0
1
2010-07-02T20:34:00.000
1
0
false
3,168,963
0
0
0
1
hi all, how you must configure Apache 2.2 or mod_python?, to avoid the following error: MOD_PYTHON ERROR ProcessId: 5399 Interpreter: '127.0.1.1' ServerName: '127.0.1.1' DocumentRoot: '/var/www' URI: '/cgi-bin/wps/' Location: None Directory: '/usr/lib/cgi-bin/' Filename: '/usr/lib/cgi-bin/wps/' PathInfo: '' Phase: 'PythonHandler' Handler: 'pywps' Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1206, in _process_target object = apache.resolve_object(module, object_str, arg, silent=silent) File "/usr/lib/python2.6/dist-packages/mod_python/apache.py", line 696, in resolve_object raise AttributeError, s AttributeError: module '/usr/local/lib/python2.6/dist-packages/pywps/init.pyc' contains no 'handler' this is for a configuration (ubuntu (10.4)) for AMD64. thanks for your answers
Python: Google App Engine source uses tab depth 2
3,172,928
-6
3
468
0
python,google-app-engine
It's miserably bad style. 2-space indentation is simply unreadable. Don't copy it. Never use less than 4 spaces to indent in any language. (Don't assume that something is good simply because Google source is doing it. If you've ever spent some time looking through the Android source you'd know that there's as much incompetently-written code developed at Google as there is at any other company.)
0
1
0
0
2010-07-03T21:10:00.000
3
-1
false
3,172,893
0
0
1
1
Looking through the Google App Engine source, I noticed that the tab depth is 2 spaces instead of the conventional 4. Is there some wisdom behind this, or is it just someone's preference? (Maybe it's trivial, or maybe Google knows something that isn't immediately obvious.) UPDATE I wasn't suggesting that it ran differently based on the tab depth. But perhaps there's a good reason for their style.
Remote server command execute
17,816,896
0
4
15,038
0
python
Paramiko is really good and convenient for transferring files and executing commands in remote server. But, the problem is that we won't be able to catch the output of the command. It will be difficult to understand whether the command executed properly or not.
0
1
0
1
2010-07-04T07:02:00.000
4
0
false
3,173,977
0
0
0
1
What would be the best way to execute shell commands on remote servers and get output without actually logging in. Maybe with shh keys. Preferably with python.
How to design a twisted solution to download a file by reading on certain portion?
3,175,439
0
2
427
0
python,twisted
I don't think this really provides the direction the user requires - the question seems to be clear in how to use Twisted to achieve this - the answer implies reasonable knowledge of Twisted.
0
1
0
0
2010-07-04T10:28:00.000
1
0
false
3,174,374
0
0
0
1
How do I download a remote file into several chunks using twisted? Lets say if the file is 100 bytes, I want to spawn 10 connection which will read 10 bytes each but in no particular order and then later on merge them all. I was able to do this using threads in Python but I don't have any idea how to use twisted's reactor + manager + protocol to achieve the same. Any advice as to how should I design this?
App Engine SDK: How do I view keys in a specific namespace using the Memcache Viewer?
3,322,690
0
2
435
0
python,google-app-engine,memcached
Not possible. In dev, check namespace'd memcache items programmatically, e.g. using a handler. Credit: moraes on #appengine / freenode (validated by looking at source)
0
1
0
0
2010-07-04T16:59:00.000
1
1.2
true
3,175,462
0
0
1
1
I'm trying to use the Memcache Viewer in the App Engine Dev Console to view keys in a specific namespace. The obvious syntax of namespace.key is not working; I haven't been able to find documentation describing specific usage. Is this possible?
Controlling Linux Compiz Brightness Programmatically with Python or Vala
3,185,814
1
0
579
0
python,gnome,vala,compiz
You want to look into gnome-compiz especially into gtk-window-decorator and gnome-xgl-settings.
0
1
0
0
2010-07-05T03:02:00.000
1
0.197375
false
3,177,057
0
0
0
1
Several laptops on the market have problems with Linux for brightness controls. However, recently I found out that you can use CompizConfig settings to dim at least a particular window. Many people, however, want to dim all windows. I know Compiz can do this in the API somewhere because look what happens when you do Super + Tab in Compiz. So this got me thinking...what I need to build is a GNOME applet in either Python, or perhaps this new Vala language, that interfaces with the Compiz API and lets me dim the entire screen. Does anyone know where I might find some programming resources to learn how to use Compiz API in Python or Vala to dim the screen?
how to set the python framework path before building cxfreeze for python3
5,056,761
0
0
135
0
python,build-process,python-3.x
Make sure your cxFreexe is installed with and run with the same python as you run the application you want to freeze. That way your PYTHONPATH should be set up correctly. The exception is if the script you want to freeze itself modifies Python path. In that case you need to make the same modifications yourself before freezing.
0
1
0
0
2010-07-05T13:16:00.000
1
0
false
3,179,754
0
0
0
1
I m building a python script using a setup.py file. In building process, it links to python framework. I want to change the linking framework path as its linking to the wrong location. How to set the framework path before building the script. Thanks in advance for sparring ur valuable time for this thread.
Python scripts (curses + pysqlite) hanging after parent shell goes away
3,186,685
1
0
281
0
python,ssh,exit,signals
Well, the reason they're not shutting down when your ssh session terminates is because HUP is the signal used by a parent to inform its children that they should shut down. If you're overriding the behavior of this signal, then your processes will not automatically shut down when the SSH session is closed. As for why you cannot kill -9 them, however, I'm at a loss. The only thing I've seen that causes that behavior is processes blocked on misbehaving filesystems (nfs & unionfs being the two I've encountered the problem with).
0
1
0
1
2010-07-06T09:20:00.000
1
0.197375
false
3,184,974
0
0
0
1
I've written a python script which does some curses and pysqlite stuff, but I've noticed that in occasions where I've been running this script over ssh when that ssh session is killed for whatever reason the python script doesn't actually exit, instead it ends up as being a child of init and just stays there forever. I can't kill -9 them or anything. They also increase the reported system load by 1. Currently I have 8 of these mostly dead processes hanging around, and the server has a load average of 8.abit. I take it this is because there is some sort of resource that these scripts are waiting on, but lsof shows nothing actually open by them, all data files they were using are listed as deleted etc... and they are using no cpu time whatsoever. I'm doing some signal checking in the script, calling out to do some refresh routines on a HUP, but nothing else, not forking or anything and I'm at a loss as to why the scripts are not just shuffling off when I close my ssh session. Thanks Chris
python xinetd client disconnection handling
3,185,279
2
0
864
0
python,linux
Add a signal handler for SIGHUP. (x)inetd sends this upon the socket disconnecting.
0
1
0
0
2010-07-06T10:05:00.000
3
1.2
true
3,185,263
0
0
0
2
This may or may not being a coding issue. It may also be an xinetd deamon issue, i do not know. I have a python script which is triggered from a linux server running xinetd. Xinetd has been setup to only allow one instance as I only want one machine to be able to connect to the service, which is therefore also limited by IP. Currently when the client connects to xinetd the service works correctly and the script begins sending its output to the client machine. However, when the client disconnects (i.e: due to reboot), the process is still alive on the server, and this blocks the ability for the client to connect once its finished rebooting or so on. Q: How can i detect in python that the client has disconnected. Perhaps i can test if stdout is no longer being read from by the client (and then exit the script), or is there a much eaiser way in xinetd to have the child process be killed when the client disconnects ? (I'm using python 2.4.3 on RHEL5 linux - solutions for 2.4 are needed, but 3.1 solutions would be useful to know also.)
python xinetd client disconnection handling
7,097,401
0
0
864
0
python,linux
Monitor the signals sent to your proccess. Maybe your script isn't responding to the SIGHUP sent by xinet, monitor the signal and let it die.
0
1
0
0
2010-07-06T10:05:00.000
3
0
false
3,185,263
0
0
0
2
This may or may not being a coding issue. It may also be an xinetd deamon issue, i do not know. I have a python script which is triggered from a linux server running xinetd. Xinetd has been setup to only allow one instance as I only want one machine to be able to connect to the service, which is therefore also limited by IP. Currently when the client connects to xinetd the service works correctly and the script begins sending its output to the client machine. However, when the client disconnects (i.e: due to reboot), the process is still alive on the server, and this blocks the ability for the client to connect once its finished rebooting or so on. Q: How can i detect in python that the client has disconnected. Perhaps i can test if stdout is no longer being read from by the client (and then exit the script), or is there a much eaiser way in xinetd to have the child process be killed when the client disconnects ? (I'm using python 2.4.3 on RHEL5 linux - solutions for 2.4 are needed, but 3.1 solutions would be useful to know also.)
How do I call a Python/Perl script in bin folder from a Bash script?
3,187,323
3
0
1,145
0
python,perl,bash
Just do python /path/to/my/python/script.py.
0
1
0
0
2010-07-06T14:49:00.000
3
1.2
true
3,187,301
0
0
0
1
I previously used to copy Python/Perl scripts to access from my bash script. Duplication is not a good idea I know! Is there a way to call them from bin or libs folder that we have set up? For instance : My python script resides in /home/ThinkCode/libs/python/script.py My bash script resides in /home/ThinkCode/NewProcess/ProjectA/run.sh Now I want to use/call script.py from run.sh Thank you!
Get the key of logged-in user with no DB access in Django on Google App Engine?
3,192,350
1
1
64
0
python,django,google-app-engine
You probably are still going to hit the DB once to get the session record, which is where the user_id field is stored. Then you may need to side-step the lazy evaluation done in the django.contrib.auth.middleware code. It's not difficult, but you need to read the code and find exactly the info you want and then get at it without triggering any of the magic. Oh, and if you want to mumble your way through the Session objects directly you will have to call session.get_decoded() to get a dict. The field you want (if it exists) is _auth_user_id.
0
1
0
0
2010-07-06T16:38:00.000
1
1.2
true
3,188,274
0
0
1
1
I'm using Django on GAE. When I say user = request.user, I believe it hits the datastore to fetch the User entity. I would like to just get the key for the currently logged in user, because that will allow me to get the user-related data I need from the memcache.
How to show list of deleted files in windows file system
3,551,199
1
0
1,086
0
python,windows
This is a very complex task. I woudl look at open-source forensic tools. You also should analyze the recylcing bin ( not completly deleted file ) For FAT you will not be able to get the first character of a deleted file. For some deleted files the metadata will be gone. NTFS is much more complex and time consuming due to the more complex nature of this file system.
0
1
0
0
2010-07-06T21:04:00.000
1
0.197375
false
3,190,226
1
0
0
1
I am wondering if it is possible to compile a list of deleted files on a windows file system, FAT or NTFS. I do not need to actually recover the files, only have access to their name and any other accessible time (time deleted, created etc). Even if I can run a cmd line tool to achieve this it would be acceptable. The application is being developed in Python, however if another language has the capability I could always create a small component implemented in that language. Thanks.
Scripting Languages
3,193,910
13
7
932
0
python,programming-languages,scripting,lua,dynamic-languages
Both Lua and Python can provide the features you mention, so choosing one of them will depend on other criteria. Lua is a lighter weight solution, it will have a much smaller disk footprint and likely a smaller memory overhead than Python too. For some uses it may be faster. Python has a much richer standard library, more mature third party libraries and a more expressive language. Both have been embedded into major applications. Python can be found in Blender, OpenOffice and Civilization 4. Lua can be found in World of Warcraft and Adobe Lightroom. I'd recommend looking at a few tutorials for each and the facilities available to embed them in your application and just choose the one that fits your brain best.
0
1
0
1
2010-07-07T08:18:00.000
7
1
false
3,193,012
1
0
0
3
I am looking for a good scripting language to link to my program. I am looking for 2 important attributes: Scripting language should be hard linked into the executable (not requiring 3rd party installations). This is important to me to simplify distribution. Scripting should allow some run-time debugging option (When running a script inside my program I would like to easily run it inside a debugger while it is running in the context of my program) Can python,lua or some other language supply me with this?
Scripting Languages
3,217,793
0
7
932
0
python,programming-languages,scripting,lua,dynamic-languages
I'll add Tcl to the mix. It's designed to be easily embedded into other programs.
0
1
0
1
2010-07-07T08:18:00.000
7
0
false
3,193,012
1
0
0
3
I am looking for a good scripting language to link to my program. I am looking for 2 important attributes: Scripting language should be hard linked into the executable (not requiring 3rd party installations). This is important to me to simplify distribution. Scripting should allow some run-time debugging option (When running a script inside my program I would like to easily run it inside a debugger while it is running in the context of my program) Can python,lua or some other language supply me with this?
Scripting Languages
3,195,618
1
7
932
0
python,programming-languages,scripting,lua,dynamic-languages
I really like Lua for embedding, but just as another alternative, JavaScript is easily embeddable in C, C++ (SpiderMonkey and V8) and Java (Rhino) programs.
0
1
0
1
2010-07-07T08:18:00.000
7
0.028564
false
3,193,012
1
0
0
3
I am looking for a good scripting language to link to my program. I am looking for 2 important attributes: Scripting language should be hard linked into the executable (not requiring 3rd party installations). This is important to me to simplify distribution. Scripting should allow some run-time debugging option (When running a script inside my program I would like to easily run it inside a debugger while it is running in the context of my program) Can python,lua or some other language supply me with this?
uwsgi + django via Nginx - uwsgi settings/spawn?
28,769,075
0
6
3,116
0
python,django,nginx,wsgi,uwsgi
I will go with supervisord for managing the starting, stoping process.
0
1
0
0
2010-07-07T09:08:00.000
3
0
false
3,193,346
0
0
1
1
I am leaning towards uwsgi+nginx for my Django app, can anyone share the best method for starting up my uwsgi processes? Does anyone have experience tuning uwsgi?
Redirecting stdio from a command in os.system() in Python
3,197,579
0
9
42,816
0
python,stdout,stdio,os.system
If you want to completely eliminate the console that launches with the python program, you can save it with the .pyw extension. I may be misunderstanding the question, though.
0
1
0
0
2010-07-07T17:59:00.000
4
0
false
3,197,509
1
0
0
2
Usually I can change stdout in Python by changing the value of sys.stdout. However, this only seems to affect print statements. So, is there any way I can suppress the output (to the console), of a program that is run via the os.system() command in Python?
Redirecting stdio from a command in os.system() in Python
3,197,521
0
9
42,816
0
python,stdout,stdio,os.system
Redirect stderr as well as stdout.
0
1
0
0
2010-07-07T17:59:00.000
4
0
false
3,197,509
1
0
0
2
Usually I can change stdout in Python by changing the value of sys.stdout. However, this only seems to affect print statements. So, is there any way I can suppress the output (to the console), of a program that is run via the os.system() command in Python?
malformed start tag error - Python, BeautifulSoup, and Sipie - Ubuntu 10.04
3,198,945
-2
9
7,977
0
python,beautifulsoup
Look at column 3 of line 100 in the "data" that is mentioned in File "/usr/bin/Sipie/Sipie/Factory.py", line 298
0
1
0
0
2010-07-07T21:13:00.000
5
-0.07983
false
3,198,874
0
0
1
1
I just installed python, mplayer, beautifulsoup and sipie to run Sirius on my Ubuntu 10.04 machine. I followed some docs that seem straightforward, but am encountering some issues. I'm not that familiar with Python, so this may be out of my league. I was able to get everything installed, but then running sipie gives this: /usr/bin/Sipie/Sipie/Config.py:12: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 Traceback (most recent call last): File "/usr/bin/Sipie/sipie.py", line 22, in <module> Sipie.cliPlayer() File "/usr/bin/Sipie/Sipie/cliPlayer.py", line 74, in cliPlayer completer = Completer(sipie.getStreams()) File "/usr/bin/Sipie/Sipie/Factory.py", line 374, in getStreams streams = self.tryGetStreams() File "/usr/bin/Sipie/Sipie/Factory.py", line 298, in tryGetStreams soup = BeautifulSoup(data) File "/usr/local/lib/python2.6/dist-packages/BeautifulSoup-3.1.0.1-py2.6.egg/BeautifulSoup.py", line 1499, in __init__ BeautifulStoneSoup.__init__(self, *args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/BeautifulSoup-3.1.0.1-py2.6.egg/BeautifulSoup.py", line 1230, in __init__ self._feed(isHTML=isHTML) File "/usr/local/lib/python2.6/dist-packages/BeautifulSoup-3.1.0.1-py2.6.egg/BeautifulSoup.py", line 1263, in _feed self.builder.feed(markup) File "/usr/lib/python2.6/HTMLParser.py", line 108, in feed self.goahead(0) File "/usr/lib/python2.6/HTMLParser.py", line 148, in goahead k = self.parse_starttag(i) File "/usr/lib/python2.6/HTMLParser.py", line 226, in parse_starttag endpos = self.check_for_whole_start_tag(i) File "/usr/lib/python2.6/HTMLParser.py", line 301, in check_for_whole_start_tag self.error("malformed start tag") File "/usr/lib/python2.6/HTMLParser.py", line 115, in error raise HTMLParseError(message, self.getpos()) HTMLParser.HTMLParseError: malformed start tag, at line 100, column 3 I looked through these files and the line numbers, but since I am unfamiliar with Python, it doesn't make much sense. Any advice on what to do next?
pydev and twisted framework
3,199,728
12
5
1,684
0
python,eclipse,twisted,pydev
go to preferences->Pydev->Interpreter - Python and hit the apply button. That will rescan your modules directory and add any missing modules. That should fix any normal import errors. Some modules do some runtime magic that PyDev cant follow.
0
1
0
0
2010-07-07T23:40:00.000
1
1.2
true
3,199,702
0
0
1
1
It seems like my Eclipse PyDev does not recognize that Twisted is installed on my system. I can't make auto suggest working. Does anyone know how to solve it?
what's a good module for writing an http web service interface for a daemon?
3,201,519
0
0
400
0
python,web-services
Don't re-invent the bicycle! Run jobs via cron script, and create a separate web interface using, for example, Django or Tornado. Connect them via a database. Even sqlite will do the job if you don't want to scale on more machines.
0
1
1
0
2010-07-08T07:26:00.000
4
0
false
3,201,446
0
0
0
2
To give a little background, I'm writing (or am going to write) a daemon in Python for scheduling tasks to run at user-specified dates. The scheduler daemon also needs to have a JSON-based HTTP web service interface (buzzword mania, I know) for adding tasks to the queue and monitoring the scheduler's status. The interface needs to receive requests while the daemon is running, so they either need to run in a separate thread or cooperatively multitask somehow. Ideally the web service interface should run in the same process as the daemon, too. I could think of a few ways to do it, but I'm wondering if there's some obvious module out there that's specifically tailored for this kind of thing. Any suggestions about what to use, or about the project in general are quite welcome. Thanks! :)
what's a good module for writing an http web service interface for a daemon?
3,201,631
0
0
400
0
python,web-services
I believed all kinds of python web framework is useful. You can pick up one like CherryPy, which is small enough to integrate into your system. Also CherryPy includes a pure python WSGI server for production. Also the performance may not be as good as apache, but it's already very stable.
0
1
1
0
2010-07-08T07:26:00.000
4
0
false
3,201,446
0
0
0
2
To give a little background, I'm writing (or am going to write) a daemon in Python for scheduling tasks to run at user-specified dates. The scheduler daemon also needs to have a JSON-based HTTP web service interface (buzzword mania, I know) for adding tasks to the queue and monitoring the scheduler's status. The interface needs to receive requests while the daemon is running, so they either need to run in a separate thread or cooperatively multitask somehow. Ideally the web service interface should run in the same process as the daemon, too. I could think of a few ways to do it, but I'm wondering if there's some obvious module out there that's specifically tailored for this kind of thing. Any suggestions about what to use, or about the project in general are quite welcome. Thanks! :)
distributing independent python app to other machines
3,219,422
1
1
149
0
python,distribution,cx-freeze
Try py2app for Mac OS X. (And py2exe for Windows.)
0
1
0
0
2010-07-08T08:00:00.000
2
0.099668
false
3,201,642
0
0
0
2
I created independent python app using cxfreeze under linux and can run it other machines without python and other dependencies. But while doing it for mac OS X, in other machines the app searches for the following python installed location which actually present in the machine where it is frozen. "/Library/Frameworks/Python.framework/Versions/3.1/Python" How to execute this app without this dependency?
distributing independent python app to other machines
3,226,239
0
1
149
0
python,distribution,cx-freeze
Is py2app supports python 3 version?
0
1
0
0
2010-07-08T08:00:00.000
2
0
false
3,201,642
0
0
0
2
I created independent python app using cxfreeze under linux and can run it other machines without python and other dependencies. But while doing it for mac OS X, in other machines the app searches for the following python installed location which actually present in the machine where it is frozen. "/Library/Frameworks/Python.framework/Versions/3.1/Python" How to execute this app without this dependency?
Reference ID in GAE
3,207,714
3
2
105
0
python,google-app-engine,google-cloud-datastore
I can reference it through record.key().id(). I just found this RIGHT AFTER I posted this question (as luck would have it). Sorry for wasting anybody's time.
0
1
0
0
2010-07-08T20:24:00.000
2
1.2
true
3,207,671
0
0
1
2
I have a feeling the answer is simple and documented, but I'm absolutely missing it: Is there a way, using Python and webapp through Google App Engine, to pass the id field of a record to the template? I'm fairly new to the app engine, and yes, I have searched all around the Google Documentation to find this.
Reference ID in GAE
3,209,539
1
2
105
0
python,google-app-engine,google-cloud-datastore
Assuming you're using the built-in Django 0.96 templates, you can access the ID (assuming the entity has one; it might have a key name instead if you saved it with one) with {{entity.key.id}}.
0
1
0
0
2010-07-08T20:24:00.000
2
0.099668
false
3,207,671
0
0
1
2
I have a feeling the answer is simple and documented, but I'm absolutely missing it: Is there a way, using Python and webapp through Google App Engine, to pass the id field of a record to the template? I'm fairly new to the app engine, and yes, I have searched all around the Google Documentation to find this.
Get Mac idle time C or Python
3,208,731
0
2
1,227
0
python,c,macos,python-idle
Is your application GUI-driven? If so, you could start a timer when the GUI comes up and then have keyboard and mouse callbacks at the top level. Every time the keyboard or mouse callback is triggered, reset the timer. Otherwise when the timer goes off, it's handler code should suspend your counter. If not, ignore this... ;-)
0
1
0
0
2010-07-08T22:24:00.000
4
0
false
3,208,450
0
0
0
2
How can i get system idle time (no keys pressed - mouse moved) in C or Python? EDIT: My program suspend a counter when idle time > 10 sec
Get Mac idle time C or Python
3,208,501
0
2
1,227
0
python,c,macos,python-idle
what about that in python ( win ) ? like time module in standard lib of python ... ?
0
1
0
0
2010-07-08T22:24:00.000
4
0
false
3,208,450
0
0
0
2
How can i get system idle time (no keys pressed - mouse moved) in C or Python? EDIT: My program suspend a counter when idle time > 10 sec
Google application engine Datastore - any alternatives to aggregate functions and group by?
3,211,471
1
0
322
1
python,google-app-engine
The best way is to populate the summaries (aggregates) at the time of write. This way your reads will be faster, since they just read - at the cost of writes which will have to update the summaries if its likely to be effected by the write. Hopefully you will be reading more often than writing/updating summaries.
0
1
0
0
2010-07-09T07:21:00.000
1
1.2
true
3,210,577
0
0
1
1
As is mentioned in the doc for google app engine, it does not support group by and other aggregation functions. Is there any alternatives to implement the same functionality? I am working on a project where I need it on urgent basis, being a large database its not efficient to iterate the result set and then perform the logic. Please suggest. Thanks in advance.
Python: Why does os.getcwd() sometimes crash with OSError?
3,210,928
9
30
15,175
0
python
You might get that error if the current working directory has been deleted. Programs that are working in a particular directory don't automatically notice if the directory gets deleted; as far as the program is concerned, the CWD is just a string, at least until you do something like os.getcwd() that actually accesses that path on the filesystem. So it's possible to have a current directory that doesn't exist. Without knowing more about your program and its execution environment, I couldn't tell you if that is what's actually happening, though.
0
1
0
0
2010-07-09T08:10:00.000
5
1
false
3,210,902
0
0
0
5
I have this program that at one point accesses os.getcwd(), but some times, depending on where the program has gone before getting to that line, it crashes with the message "OSError: [Errno 2] No such file or directory". I cannot figure out what i can do wrong then calling os.getcwd(). There's no arguments, and there should always be a current working directory, right?
Python: Why does os.getcwd() sometimes crash with OSError?
3,210,929
48
30
15,175
0
python
The current directory may have been deleted by another process.
0
1
0
0
2010-07-09T08:10:00.000
5
1.2
true
3,210,902
0
0
0
5
I have this program that at one point accesses os.getcwd(), but some times, depending on where the program has gone before getting to that line, it crashes with the message "OSError: [Errno 2] No such file or directory". I cannot figure out what i can do wrong then calling os.getcwd(). There's no arguments, and there should always be a current working directory, right?
Python: Why does os.getcwd() sometimes crash with OSError?
59,532,717
1
30
15,175
0
python
It is also possible to get this error when working with an encrypted filesystem and if the partition containing the working directory went back to a "locked" state. In my case, a README file was available at the mounting point of the partition explaining how to unlock the partition again. It could depend of the encryption system and settings. Once the partition unlocked again, to get rid of the error, a change directory is needed to reset the working directory. Even if the target directory is the directory where you already are.
0
1
0
0
2010-07-09T08:10:00.000
5
0.039979
false
3,210,902
0
0
0
5
I have this program that at one point accesses os.getcwd(), but some times, depending on where the program has gone before getting to that line, it crashes with the message "OSError: [Errno 2] No such file or directory". I cannot figure out what i can do wrong then calling os.getcwd(). There's no arguments, and there should always be a current working directory, right?
Python: Why does os.getcwd() sometimes crash with OSError?
65,927,209
0
30
15,175
0
python
Sommeone probably erased your filesystem while you had the Python open. That is why Python is stating that it could not be found. This had happened to me.
0
1
0
0
2010-07-09T08:10:00.000
5
0
false
3,210,902
0
0
0
5
I have this program that at one point accesses os.getcwd(), but some times, depending on where the program has gone before getting to that line, it crashes with the message "OSError: [Errno 2] No such file or directory". I cannot figure out what i can do wrong then calling os.getcwd(). There's no arguments, and there should always be a current working directory, right?
Python: Why does os.getcwd() sometimes crash with OSError?
3,210,937
3
30
15,175
0
python
You would get that error if your current directory no longer exists (it is deleted).
0
1
0
0
2010-07-09T08:10:00.000
5
0.119427
false
3,210,902
0
0
0
5
I have this program that at one point accesses os.getcwd(), but some times, depending on where the program has gone before getting to that line, it crashes with the message "OSError: [Errno 2] No such file or directory". I cannot figure out what i can do wrong then calling os.getcwd(). There's no arguments, and there should always be a current working directory, right?
Many-to-many relationships in Google AppEngine - efficient?
3,213,988
0
1
280
1
python,google-app-engine,performance,many-to-many
I don't think there's a hard and fast answer to questions like this. "Is this optimization worth it" always depends on many variables such as, is the lack of optimization actually a problem to start with? How much of a problem is it? What's the cost in terms of extra time and effort and risk of bugs of a more complex optimized implementation, relative to the benefits? What might be the extra costs of implementing the optimization later, such as data migration to a new schema?
0
1
0
0
2010-07-09T08:21:00.000
1
1.2
true
3,210,994
0
0
1
1
I'm using Google Appengine to store a list of favorites, linking a Facebook UserID to one or more IDs from Bing. I need function calls returning the number of users who have favorited an item, and the number of times an item has been favorited (and by whom). My question is, should I resolve this relationship into two tables for efficiency? If I have a table with columns for Facebook ID and Bing ID, I can easily use select queries for both of the functions above, however this will require that each row is searched in each query. The alternative is having two tables, one for each Facebook user's favorites and the other for each Bing item's favorited users, and using transactions to keep them in sync. The two tables option has the advantage of being able to use JSON or CSV in the database so that only one row needs to be fetched, and little manipulation needs to be done for an API. Which option is better, in terms of efficiency and minimising cost? Thanks, Matt
How should I share and store data in a small multithreaded python application?
3,211,387
0
1
178
0
python,multithreading,concurrency,datastore
What you're seeking isn't too Python specific, because AFAIU you want to communicate between two different processes, which are only incidentally written in Python. If this indeed is your problem, you should look for a general solution, not a Python-specific one. I think that a simple No-SQL key-value datastore such as Redis, for example, could be a very nice solution for your situation. Contrary to "complicated" using a tool designed specifically for such a purpose will actually make your code simpler. If you insist on a Python-only solution, then consider using the Python bindings for SQLite which come pre-installed with Python. An SQLite DB can be concurrently used by two processes in a safe manner, as long as your semantics of data access are well defined (i.e. problems you have to solve anyway, the tool nonwithstanding).
0
1
0
0
2010-07-09T09:27:00.000
1
1.2
true
3,211,379
1
0
1
1
I'm writing a small multithreaded client-side python application that contains a small webserver (only serves page to the localhost) and a daemon. The webserver loads and puts data into a persistent "datastore", and the daemon processes this data, modifies it and adds some more. It should also takes care of the synchronization with the disk. I'd like to avoid complicated external things like SQL or other databases as much as possible. What are good and simple ways to design the datastore? Bonus points if your solution uses only standard python.
Pydev relative project path
3,212,495
1
6
3,341
0
python,eclipse,relative-path,pydev
Take a look in the project settings, I've never used Pydev with Eclipse, but you should be able to set where the project is executed at, or paths for references. Of course there may be a better solution, but hopefully that's some help!
0
1
0
0
2010-07-09T10:21:00.000
3
0.066568
false
3,211,690
1
0
0
3
I installed eclipse with pydev plugin. I need to run my existing project on eclipse. But there are relative paths to the files inside my code. I expect from eclipse to append relative paths to the project's default directory. Instead, it appends the relative path to the directory where Eclipse is installed. I could not find a way to solve the problem. Thanks in advance.
Pydev relative project path
4,901,532
0
6
3,341
0
python,eclipse,relative-path,pydev
Another way to do it is to go to the 'Environment' tab from the "Run Configuration". Add a new variable with name, "PATH", specifying your desired directory in the "Value" box.
0
1
0
0
2010-07-09T10:21:00.000
3
0
false
3,211,690
1
0
0
3
I installed eclipse with pydev plugin. I need to run my existing project on eclipse. But there are relative paths to the files inside my code. I expect from eclipse to append relative paths to the project's default directory. Instead, it appends the relative path to the directory where Eclipse is installed. I could not find a way to solve the problem. Thanks in advance.
Pydev relative project path
3,213,187
7
6
3,341
0
python,eclipse,relative-path,pydev
I finally found out how to do it and I am writing the answer for other people with the same problem. You can find it in Run Configurations or Debug Configurations. Choose "Python Run" and your run configuration from the left and then in the "Arguments" tab in the right side, set your "working directory" as "other" with giving "the path" on which you want to run your code. Thanks for your interest, Wayne btw.
0
1
0
0
2010-07-09T10:21:00.000
3
1.2
true
3,211,690
1
0
0
3
I installed eclipse with pydev plugin. I need to run my existing project on eclipse. But there are relative paths to the files inside my code. I expect from eclipse to append relative paths to the project's default directory. Instead, it appends the relative path to the directory where Eclipse is installed. I could not find a way to solve the problem. Thanks in advance.
RestrictedPython on Google AppEngine (GAE)
5,072,453
1
2
336
0
python,google-app-engine
Note that even if you could get access to the ast modules on GAE, RestrictedPython might still not be the right solution for your use-case. It's only aimed at securing input from less trusted users, where you don't trust their ability to code. You still need to trust and know them. There's various ways in which a malicious user can cause large resource usage or infinite recursions - so don't use it to protect against anonymous users.
0
1
0
0
2010-07-09T10:25:00.000
1
0.197375
false
3,211,723
0
0
1
1
I'm looking for a way to execute user submitted python code in GAE in a secure fashion (much stricter then the GAE sandbox). RestrictedPython would certainly fit the shoe, being used in Zope for the exakt same purpose. But RestrictedPython relies on modifying the AST (abstract syntax tree) which means loading modules from the compiler (I get as far as loading the parser module before the SDK complains). Has anyone else done any work with this for Google App Engine?
How do I execute Python/bash code in the current directory as part of a code?
3,218,680
1
0
276
0
python,bash
My interpretation of your context, is that you have a Python script that performs various make- or autoconf-like operations, and you want to allow clients to write their own Makefiles for Foobuzzle. The problem with directories I don't understand. import will always search the local directory? And you can os.chdir() when you hop around to change current working directory, like make does. Having it as a bash script has the pro that nobody needs to learn Python or, specifically, the Python-like Foobuzzle DSL. But it is a lot less powerful: you're basically limited to sending and receiving text only. You can't write support functions that the bash code can call (unless you generate that into bash as well), proper error handling might be tough, etc. Depending on how powerful the configuration needs to be, I would use Python. I'd probably load the file itself and use eval() on it, giving me full control over its namespace. I could pass various utility and helper functions, for example, or provide objects they can manipulate directly. If it's really simple though, specifying flags and names, that sort of thing, then you could just have it as .ini files and use ConfigParser() in the standard library.
0
1
0
1
2010-07-10T09:10:00.000
1
1.2
true
3,218,599
1
0
0
1
Lets say I am designing a tool foobuzzle (foobuzzle's exact job is to set up SRPM files for cross-compiling a variety of codes into their own compartmentalized prefix directories, but this is not important). I would like foobuzzle to take in an input file (buzzle_input) specified by an (intelligent, code-savvy) client, who will tell foobuzzle how they would like it to perform these operations. I am writing foobuzzle in Python, and it seems to make sense for the user to provide buzzle_input configuration information in either Python or bash. Which would you choose? How would you implement it? I am expecting that Python will need some global environment variables that may need to be set up by executing some other scripts, probably from within the buzzle_input script. This is not production code, just an internal tool a small team of developers will be using to help manage a fairly large cross-compiled environment of C/C++/FORTRAN codes. My best guess is to use something to wrap the foobuzzle script so that the $PYTHONPATH variable picks up the current working directory, and to have the foobuzzle_input script imported and executed as set up. Is there a cleaner way to do this without wrapping foobuzzle? Any special considerations for executing the bash scripts (assume safety is not really a concern and that these scripts will not be run with system administrator privileges).
Updating my program, using a diff-based patch approach
3,219,785
1
3
535
0
python,diff,patch
Your update manager can know which version the current app is, and which version is the most recent one and apply only the relevant patches. Suppose the user runs 0.38, and currently there is 0.42 available. The update for 0.42 contains patches for 0.39, 0.40, 0.41 and 0.42 (and probably farther down the history). The update manager downloads the 0.42 update, knows it's at 0.38 and applies all the relevant patches. If it currently runs 0.41, it only applies the latest patch, and so on.
0
1
0
0
2010-07-10T15:25:00.000
2
0.099668
false
3,219,772
1
0
0
1
Currently my program updates itself by downloading the latest .tar.gz file containing the source code, and extracting it over the current directory where the program lives. There are 2 "modes" of update - one for users running the Python source, and one if the user is running the program as a Windows exe. Over time my program's filesize is becoming larger with each release, due to new images, libraries, documentation and code. However, sometimes only code changes occur from one release to another, so the user ends up re-downloading all the images, documentation etc over and over, when only there are only small code changes. I was thinking that a more efficient approach would be to use a patch/diff based system where the program incrementally updates itself from one version to another by only downloading small change sets. However, how should I do this? If the user is running version 0.38, and there is a 0.42 available, do they download 0.38->39; 0.39->40; 0.40->41, 0.41->42? How would I handle differences in binary files? (images, in my case). I'd also have to maintain some repository containing all the patches, which isn't too bad. I'd just generate the diffs with each new release. But I guess it would be harder to do this to executables than to pure python code? Any input is appreciated. Many thanks.
What is the dominant reason for Python's popularity as a systems and application programming language?
3,227,900
4
5
3,307
0
python,programming-languages,prototype
I started twelve years ago to replace my Perl scripts -- and the new ones were shorter and way more readable. So, readability and the gentle learning curve was the main reason to use it. After version 2, the language has got more and more flexible, and with it my programming needs and I got used to do metaprogramming without even noticing. To see what I mean, have a look at the examples in SQLAlchemy's documentation. You point to lack of tools -- but the last time I've seen a code generator has been ... I guess 10 years ago, and it was a bad idea even at the time, because you just don't need it. The development team cares a lot about compatibility -- they ponder for years before introducing new syntax. Only mature modules go in the standard library, and python 3 has been discussed for ages. On top of the porting facilities, there is now a moratorium -- no new features to the language for at least two years. As for performance - since I don't have to think about which methods throws which exception or having explicit interfaces for everything, and I have a lot more design patterns embedded in the language.. well, I am free to experiment with the architecture and optimize where it makes sense. Most of the time, for me, it's the network or the DB.
0
1
0
0
2010-07-12T10:49:00.000
5
0.158649
false
3,227,789
0
0
0
3
Coming from an enterprise systems background (think Java and Windows) - I'm surprised at the popularity of python as a prototyping language and am trying to put my finger on the precise reason for this. Examples include being listed as one of the four languages Google uses. Possible reasons include: enables rapid systems application prototyping using of c++ libraries using swig wrappers built to a well defined language specification innovative features at the syntax level enabling high level of expressiveness highly flexible web frameworks built long before other languages (django) The questions is what makes it so popular/highly regarded, but to give some balance I'm going to give some reasons it might not be popular: less tool support less enterprise support (ie a vendor helpdesk) lower performance BDFL not caring about backward compatibility in version upgrades Or was it just the best at a particular point in time (about 8 years ago) and other languages and frameworks have since caught up?
What is the dominant reason for Python's popularity as a systems and application programming language?
3,227,836
6
5
3,307
0
python,programming-languages,prototype
enables rapid systems application prototyping using of c++ libraries using swig wrappers ... What? Most people doing Python programming aren't doing C++ programming, they're doing Python programming. And they're doing it fast, because they don't need to worry about things like memory management, or templates, or... the sort of namespace support C++ uses.
0
1
0
0
2010-07-12T10:49:00.000
5
1
false
3,227,789
0
0
0
3
Coming from an enterprise systems background (think Java and Windows) - I'm surprised at the popularity of python as a prototyping language and am trying to put my finger on the precise reason for this. Examples include being listed as one of the four languages Google uses. Possible reasons include: enables rapid systems application prototyping using of c++ libraries using swig wrappers built to a well defined language specification innovative features at the syntax level enabling high level of expressiveness highly flexible web frameworks built long before other languages (django) The questions is what makes it so popular/highly regarded, but to give some balance I'm going to give some reasons it might not be popular: less tool support less enterprise support (ie a vendor helpdesk) lower performance BDFL not caring about backward compatibility in version upgrades Or was it just the best at a particular point in time (about 8 years ago) and other languages and frameworks have since caught up?
What is the dominant reason for Python's popularity as a systems and application programming language?
3,227,809
19
5
3,307
0
python,programming-languages,prototype
Highly expressive language. People often say, "Python works the way my brain does". Dynamic typing means you spend zero time appeasing the compiler. A large standard library means you often have the tools you need at your fingertips. An even larger stable of third-party packages (PIL, Numpy, NLTK, Django) mean that large problem domains are often well-supported. Open-source implementation means you don't have to grovel at the vendor helpdesk, you can find answers yourself, and get solutions from a large community of users.
0
1
0
0
2010-07-12T10:49:00.000
5
1.2
true
3,227,789
0
0
0
3
Coming from an enterprise systems background (think Java and Windows) - I'm surprised at the popularity of python as a prototyping language and am trying to put my finger on the precise reason for this. Examples include being listed as one of the four languages Google uses. Possible reasons include: enables rapid systems application prototyping using of c++ libraries using swig wrappers built to a well defined language specification innovative features at the syntax level enabling high level of expressiveness highly flexible web frameworks built long before other languages (django) The questions is what makes it so popular/highly regarded, but to give some balance I'm going to give some reasons it might not be popular: less tool support less enterprise support (ie a vendor helpdesk) lower performance BDFL not caring about backward compatibility in version upgrades Or was it just the best at a particular point in time (about 8 years ago) and other languages and frameworks have since caught up?
How to stop SIGINT being passed to subprocess in python?
3,731,948
16
16
5,099
0
python,subprocess,signals,intercept,sigint
Signal handlers are inherited when you start a subprocess, so if you use the signal module to ignore SIGINT (signal.signal(signal.SIGINT, signal.SIG_IGN)), then your child process automatically will also. There are two important caveats, though: You have to set the ignore handler before you spawn the child process Custom signal handlers are reset to the default handlers, since the child process won't have access to the handler code to run it. So if you need to customise your handling of SIGINT rather than just ignoring it, you probably want to temporarily ignore SIGINT while you spawn your child process, then (re)set your custom signal handler. If you're trying to catch SIGINT and set a flag so you can exit at a safe point rather than immediately, remember that when you get to that safe point your code will have to manually clean up its descendants, since your child process and any processes it starts will be ignoring the SIGINT.
0
1
0
0
2010-07-12T21:57:00.000
3
1
false
3,232,613
0
0
0
1
My python script intercepts the SIGINT signal with the signal process module to prevent premature exit, but this signal is passed to a subprocess that I open with Popen. is there some way to prevent passing this signal to the subprocess so that it also is not exited prematurely when the user presses ctrl-c?
App Engine Unique Non Numeric Code
3,232,948
2
2
215
0
python,google-app-engine
This would be difficult to use as-is on app engine because many copies of your application could be running at once. Each copy would need access to the "last identifier" and be able to update it atomically. This would likely require too much overhead, unless you only need to generate new IDs in this fashion rather infrequently. Why not use GAE's built-in numeric IDs? They are guaranteed to be unique and are also easy to communicate. They are also generally sequential and increasing, though this is not guaranteed.
0
1
0
0
2010-07-12T22:38:00.000
2
0.197375
false
3,232,833
0
0
1
1
Using an alphabet like "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" I'd like to generate 2 to 4 letter codes to identify unique datastore entries. I have a python function capable of doing this when passed an list indicating the letter positions of the last code [7,17,11] -> "7GA". the next code can be made by incrementing that right most element by one and carrying one up when the alphabet length is exceeded. This method has the advantage of keeping codes short, sequential, consistent, easy to communicate, and looking how I want them to. I'm wondering though if this would work on app engine since the function must hold onto or be passed the last identifier to enforce uniqueness which may not play well with the non-continuous nature of Google's infrastructure. Alternate ways to make this happen or reasoned arguments against it are welcome.
How to specify python interpreter on Windows
3,236,999
0
2
2,736
0
python
Maybe "Open with..." + 'Remember my choice' in context menu of explorer?
0
1
0
0
2010-07-13T12:10:00.000
5
0
false
3,236,983
1
0
0
2
My program has been written on python 3.1 (it was the biggest mistake I've ever made). Now I want to use a few modules that were written on 2.6. I know that it's possible to specify the interpreter in Unix #!/usr/bin/python2.6. But what if I use Windows? Does any way to specify the interpreter exist in Windows? Edit: I want to be able to use both interpreters simultaneously.
How to specify python interpreter on Windows
3,237,236
0
2
2,736
0
python
If you go into Control Panel -> System -> Advanced -> Environment Variables, and then add Python 2.6 to the PATH variable (it's probably located at C:\Python26 or C:\Program Files\Python26) -- and make sure Python 3.1 isn't in it -- then if you type python at the command prompt, you'll get 2.6 instead. As for Explorer, you'll want to associate it by using the Open With... dialog. Browse to the path (probably C:\Python26\python.exe) and set it. Make sure you check to make it the default before you hit OK. To add the to PATH variable, you'll have to add a ; on the end of the current PATH variable and then add the folder's path after it (remove 3.1 if needed). For example: PATH="C:\Program Files\Emacs23\bin;C:\Cygwin\bin;C:\Python31" would become: PATH="C:\Program Files\Emacs23\bin;C:\Cygwin\bin;C:\Python26"
0
1
0
0
2010-07-13T12:10:00.000
5
0
false
3,236,983
1
0
0
2
My program has been written on python 3.1 (it was the biggest mistake I've ever made). Now I want to use a few modules that were written on 2.6. I know that it's possible to specify the interpreter in Unix #!/usr/bin/python2.6. But what if I use Windows? Does any way to specify the interpreter exist in Windows? Edit: I want to be able to use both interpreters simultaneously.
python execute remote program
3,238,241
4
4
2,814
0
python,windows,linux,twisted
Another option is paramiko. It's a Python library that implements SSH. I've used it to remotely execute commands and transfer files to windows boxes running an SSH server. The problem is it doesn't properly capture stdout on windows due to the peculiarities of the windows command shell. You may have the same problem with a solution based on twisted. What kind of results are you trying to capture?
0
1
0
0
2010-07-13T13:23:00.000
5
0.158649
false
3,237,558
0
0
0
2
I'm re-writing a legacy Windows application using Python and running on Linux. Initially, the new application needs to call the legacy application so that we have consistent results between customers still using the legacy application and customers using the new application. So I have a Linux box, sitting right next to a Windows box and I want a process on the Linux box to execute a command on the Windows box and capture the result (synchronously). My initial thought was to write a web service on the Windows box, but that would mean running a web server on the Windows machine in addition to the legacy application. So then I thought that using Twisted.Conch might allow me to just execute a command over the network without the additional overhead of running a web server, but I assume there is also overhead with running an ssh server on the Windows machine. What are some alternative ways that I can initiate a synchronous process on a different machine, using Python, besides a web service or ssh, or is a web service or ssh the best approach? Also, if a web service or ssh are the best routes to pursue, is Twisted something that I should consider using?
python execute remote program
3,255,382
1
4
2,814
0
python,windows,linux,twisted
RPC is the right answer IMO. I think: using SimpleXMLRPCServer for the windows machine using xmlrpclib for the linux machine from the standard library would give you the most freedom. You implement what you need and you don't have to worry about windows APIs, overblown technologies as DCOM, etc., you are in python land, even on the windows machine. Sidenote: Twisted is of course always an excellent option, so don't worry about that; I think Apples CalDav server runs on Twisted too.
0
1
0
0
2010-07-13T13:23:00.000
5
0.039979
false
3,237,558
0
0
0
2
I'm re-writing a legacy Windows application using Python and running on Linux. Initially, the new application needs to call the legacy application so that we have consistent results between customers still using the legacy application and customers using the new application. So I have a Linux box, sitting right next to a Windows box and I want a process on the Linux box to execute a command on the Windows box and capture the result (synchronously). My initial thought was to write a web service on the Windows box, but that would mean running a web server on the Windows machine in addition to the legacy application. So then I thought that using Twisted.Conch might allow me to just execute a command over the network without the additional overhead of running a web server, but I assume there is also overhead with running an ssh server on the Windows machine. What are some alternative ways that I can initiate a synchronous process on a different machine, using Python, besides a web service or ssh, or is a web service or ssh the best approach? Also, if a web service or ssh are the best routes to pursue, is Twisted something that I should consider using?
Authentication in Google App Engine: app.yaml vs. python code
3,241,208
2
4
1,616
0
python,google-app-engine,authentication
If you have handlers which are only accessible to admins, then app.yaml certainly seems like the easiest way to secure the pages those handlers expose. However, if you have some handlers which serve both admin and non-admin views (e.g., your main.py), then you'll have to use something more fine-grained than app.yaml (e.g., google.appengine.api.users.is_current_user_admin()). I'd expect performance to be roughly equivalent once your application is running (a negligible fraction of the time it takes to load your page).
0
1
0
0
2010-07-13T20:01:00.000
2
0.197375
false
3,240,990
0
0
1
1
I am writing a small app that uses the GAE. I have parts of my app that are for administrative use only. I have two options using login: admin option in the app.yaml or google.appengine.api.users.is_current_user_admin() in python code. The basic authentication is sufficient for my case. Which solution is better? The advantage of using app.yaml is that the python code is a bit cleaner. Plus it may be the case that app.yaml may be more efficient, since it can be handled in the server. (In worst case it is equal in terms of performance.) The only drawback is that I do not display a custom page, but I don't care to much for that. I am unsure if my assertions are correct.
Difference between binary and text I/O in python on Windows
3,262,082
27
23
7,560
0
python,windows,file,file-io
Well this is for historical (or as i like to say it, hysterical) reasons. The file open modes are inherited from C stdio library and hence we follow it. For Windows, there is no difference between text and binary files, just like in any of the Unix clones. No, i mean it! - there are (were) file systems/OSes in which text file is completely different beast from object file and so on. In some you had to specify the maximum length of lines in advance and fixed size records were used... fossils from the times of 80-column paper punch-cards and such. Luckily, not so in Unices, Windows and Mac. However - all other things equal - Unix, Windows and Mac hystorically differ in what characters they use in output stream to mark end of one line (or, same thing, as separator between lines). In Unix, \x0A (\n) is used. In Windows, sequence of two characters \x0D\x0A (\r\n) is used; on Mac - just \xOD (\r). Here are some clues on the origin of use of those two symbols - ASCII code 10 is called Line Feed (LF) and when sent to teletype, would cause it to move down one line (Y++), without changing its horizontal (X) position. Carriage Return (CR) - ASCII 13 - on the other hand, would cause the printing carriage to return to the beginning of the line (X=0) without scrolling one line down. So when sending output to the printer, both \r and \n had to be send, so that the carriage will move to the beginning of a new line. Now when typing on terminal keyboard, operators naturally are expected to press one key and not two for end of line. That on Apple][ was the key 'Return' (\r). At any rate, this is how things settled. C's creators were concerned about portability - much of Unix was written in C, unlike before, when OSes were written in assembler. So they did not want to deal with each platform quirks about text representation, so they added this evil hack to their I/O library depending on the platform, the input and output to that file will be "patched" on the fly so that the program will see the new lines the righteous, Unix-way - as '\n' - no matter if it was '\r\n' from Windows or '\r' from Mac. So the developer need not worry on what OS the program ran, it could still read and write text files in native format. There was a problem, however - not all files are text, there are other formats and in they are very sensitive to replacing one character with another. So they though, we will call those "binary files" and indicate that to fopen() by including 'b' in the mode - and this will flag the library not to do any behind-the-scenes conversion. And that's how it came to be the way it is :) So to recap, if file is open with 'b' in binary mode, no conversions will take place. If it was open in text mode, depending on the platform, some conversions of the new line character(s) may occur - towards Unix point of view. Naturally, on Unix platform there is no difference between reading/writing to "text" or "binary" file.
0
1
0
0
2010-07-15T16:45:00.000
4
1
false
3,257,869
1
0
0
4
I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files. But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same.
Difference between binary and text I/O in python on Windows
3,257,905
-2
23
7,560
0
python,windows,file,file-io
For reading files there should be no difference. When writing to text-files Windows will automatically mess up your line-breaks (it will add \r's before the \n's). That's why you should use "wb".
0
1
0
0
2010-07-15T16:45:00.000
4
-0.099668
false
3,257,869
1
0
0
4
I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files. But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same.
Difference between binary and text I/O in python on Windows
3,257,886
25
23
7,560
0
python,windows,file,file-io
This mode is about conversion of line endings. When reading in text mode, the platform's native line endings (\r\n on Windows) are converted to Python's Unix-style \n line endings. When writing in text mode, the reverse happens. In binary mode, no such conversion is done. Other platforms usually do fine without the conversion, because they store line endings natively as \n. (An exception is Mac OS, which used to use \r in the old days.) Code relying on this, however, is not portable.
0
1
0
0
2010-07-15T16:45:00.000
4
1.2
true
3,257,869
1
0
0
4
I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files. But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same.
Difference between binary and text I/O in python on Windows
3,257,903
1
23
7,560
0
python,windows,file,file-io
In Windows, text mode will convert the newline \n to a carriage return followed by a newline \r\n. If you read text in binary mode, there are no problems. If you read binary data in text mode, it will likely be corrupted.
0
1
0
0
2010-07-15T16:45:00.000
4
0.049958
false
3,257,869
1
0
0
4
I know that I should open a binary file using "rb" instead of "r" because Windows behaves differently for binary and non-binary files. But I don't understand what exactly happens if I open a file the wrong way and why this distinction is even necessary. Other operating systems seem to do fine by treating both kinds of files the same.
GAE is any good ? if yes then JAVA or Python?
3,266,220
3
2
652
0
java,python,google-app-engine
Most people here are missing the fact that the question is really about App Engine, not java or python in general. The Java and Python SDKs and App Engine runtimes have pretty much the same abilities at this point. One caveat with the current java runtime is that if you use a lot of external libraries, your loading hits (the first time someone hits your website, and app engine has to spin up your app) can be a bit slow.
0
1
0
0
2010-07-16T10:21:00.000
6
1.2
true
3,263,847
0
0
1
6
Basically I am coding websites in PHP from last year. But now I want to use something else and GAE looks a good option. So I want to know if GAE is good for making a little website to share favorite youtube videos ? I have done single website in Python+Django few months back, it looks good to me. But JAVA is the language that I want to learn too (never coded in JAVA since School days ). Phew, it is hard to choose, so I need opinions !! Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client.
GAE is any good ? if yes then JAVA or Python?
3,265,021
2
2
652
0
java,python,google-app-engine
You'll be able to accomplish the exact same results using either Python or Java. Java is much more verbose than Python, which can make it have a bit of a steeper learning curve. The fact that you have some experience in Django (which GAE's webapp is largely based on and which you can even use directly if you want) will make it easier for you to get the website up and running in the immediate term. So again, it does depend on what you want to accomplish. If your goal is to learn Java, then doing a project in Java is the best way to learn it. If your main goal is to get the site up and running, Python will be a better choice as it will let you focus less on struggling with learning new Java syntax and more on simply getting the website off the ground.
0
1
0
0
2010-07-16T10:21:00.000
6
0.066568
false
3,263,847
0
0
1
6
Basically I am coding websites in PHP from last year. But now I want to use something else and GAE looks a good option. So I want to know if GAE is good for making a little website to share favorite youtube videos ? I have done single website in Python+Django few months back, it looks good to me. But JAVA is the language that I want to learn too (never coded in JAVA since School days ). Phew, it is hard to choose, so I need opinions !! Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client.
GAE is any good ? if yes then JAVA or Python?
3,264,425
1
2
652
0
java,python,google-app-engine
You need an IRL mentor.
0
1
0
0
2010-07-16T10:21:00.000
6
0.033321
false
3,263,847
0
0
1
6
Basically I am coding websites in PHP from last year. But now I want to use something else and GAE looks a good option. So I want to know if GAE is good for making a little website to share favorite youtube videos ? I have done single website in Python+Django few months back, it looks good to me. But JAVA is the language that I want to learn too (never coded in JAVA since School days ). Phew, it is hard to choose, so I need opinions !! Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client.
GAE is any good ? if yes then JAVA or Python?
3,263,926
1
2
652
0
java,python,google-app-engine
I would personally go with a Java based solution. If this is just a little website for yourself, then it would be a good idea to learn a new technology, in this case Java. Little projects like this are ideal for learning new technologies and seeing if they are suitable for you as a developer and other projects you may decide to do in the future
0
1
0
0
2010-07-16T10:21:00.000
6
0.033321
false
3,263,847
0
0
1
6
Basically I am coding websites in PHP from last year. But now I want to use something else and GAE looks a good option. So I want to know if GAE is good for making a little website to share favorite youtube videos ? I have done single website in Python+Django few months back, it looks good to me. But JAVA is the language that I want to learn too (never coded in JAVA since School days ). Phew, it is hard to choose, so I need opinions !! Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client.
GAE is any good ? if yes then JAVA or Python?
3,263,908
2
2
652
0
java,python,google-app-engine
If you want to learn Java, then use Java! If you feel that Java is too verbose compared to Python, you could try Scala, which runs on the JVM like Java. Scala is more concise and well designed.
0
1
0
0
2010-07-16T10:21:00.000
6
0.066568
false
3,263,847
0
0
1
6
Basically I am coding websites in PHP from last year. But now I want to use something else and GAE looks a good option. So I want to know if GAE is good for making a little website to share favorite youtube videos ? I have done single website in Python+Django few months back, it looks good to me. But JAVA is the language that I want to learn too (never coded in JAVA since School days ). Phew, it is hard to choose, so I need opinions !! Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client.
GAE is any good ? if yes then JAVA or Python?
3,264,075
3
2
652
0
java,python,google-app-engine
Java and Python are both excellent languages. It is a matter of taste and believe which you choose. If you prefer a lightweight solution, use Python. If you have enterprise needs, whatever that means, use Java. If you ask for my personal believe, my subjective stand-of-point is: Use Python wherever possible and stick to other languages if there is a need to. So this is my opinion, but as S.Lott commented on your question: Opinions are going to be useless.
0
1
0
0
2010-07-16T10:21:00.000
6
0.099668
false
3,263,847
0
0
1
6
Basically I am coding websites in PHP from last year. But now I want to use something else and GAE looks a good option. So I want to know if GAE is good for making a little website to share favorite youtube videos ? I have done single website in Python+Django few months back, it looks good to me. But JAVA is the language that I want to learn too (never coded in JAVA since School days ). Phew, it is hard to choose, so I need opinions !! Specifically : Want to know if any glitch/problem in using either python or Java under GAE. Or if GAE is preferred or not. Not gonna make website for learning only, it will be for a client.
Why aren't the Python 2.7 command-line tools located in `/usr/local/bin` on Mac OS X?
3,267,460
4
5
7,190
0
python,macos,installation
The python.org Python installer for OS X is a meta package with a set of several packages. You can see the packages by clicking on the Customize button during the installation process. The symlinks in /usr/local/bin are installed by the UNIX command-line tools package. For the 2.7 release, that package is no longer selected by default. You can install it and the symlinks by doing a custom install and selecting that package; if you've already installed 2.7, select just that package. EDIT: That said, it is important to recognize that, with OS X Python framework builds, just having /usr/local/bin in your search path is generally not sufficient. The reason for that is that python scripts included in packages are, by default, installed into the bin directory of the Python directory, e.g. /Library/Frameworks/Python.framework/Versions/2.7/bin. This is true of just about anything that uses Distutils defaults or installation tools that wrap Distutils, like easy_install (Distribute or setuptools) or pip. This is why there is another installer package, Shell profile updater, that is enabled by default and attempts to modify your login profile to put the framework bin directory at the front of your shell search path, PATH. If that is done, the symlinks in /usr/local/bin are not required for python2.7 to be invoked.
0
1
0
0
2010-07-16T14:41:00.000
3
1.2
true
3,266,005
1
0
0
1
The Python 2.7 installer disk image for Mac OS X (python-2.7-macosx10.5.dmg) states: The installer puts the applications in "Python 2.7" in your Applications folder, command-line tools in /usr/local/bin and the underlying machinery in /Library/Frameworks/Python.framework. However, after installation there are no Python 2.7 files in /usr/local/bin/. Are others seeing the same behavior? I assume the solution is simply to create the equivalent symbolic links to /usr/local/bin as Python 2.6, or am I overlooking something?
Google App Engine: Redirect to RequestHandler
3,267,906
3
3
1,160
0
python,google-app-engine
One alternative would be to have a map of symbolic names to URLs, that way you could redirect to the mapped URL - you could then update your URLs with impunity. Or if you'd rather just execute the code from another handler, I don't know why you couldn't just make a method call - worst case, you could extract a common method from the two handlers and call that.
0
1
0
0
2010-07-16T18:31:00.000
3
1.2
true
3,267,830
0
0
1
1
I just started with Google App Engine using python and I was following a tutorial and writing my own little app to get familiar the webapp framework. Now I just noticed the tutorial does the following self.redirect('/'). So that got me wondering: is there a way to redirect to a handler instead of a hardcoded path? Thought that might be better so that you can change your urls without breaking your app.
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,788
2
2
2,889
0
php,python,perl,compiler-construction,scripting-language
There are 3 options of encrypting Perl code: Use PAR to create executable file with PAR::Filter::Obfuscate or PAR::Filter::Crypto Use Filter::Crypto::CryptFile (will require some modules installed on target OS) Turn into module and encrypt into Module::Crypt. Also you can try B::C - it was removed from core Perl distribution and is now available on CPAN.
0
1
0
1
2010-07-17T06:11:00.000
8
0.049958
false
3,270,464
0
0
0
4
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,490
0
2
2,889
0
php,python,perl,compiler-construction,scripting-language
For Python You can call your code and give the *.pyc file to the client.
0
1
0
1
2010-07-17T06:11:00.000
8
0
false
3,270,464
0
0
0
4
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,852
4
2
2,889
0
php,python,perl,compiler-construction,scripting-language
I'm sorry, it's simply not worth spending your time on. For any language you choose (from among the ones you listed), for any compiler/obfuscator someone chooses to come up with, I promise you I can get readable source code out of it (within an hour if it's Perl; longer if it's Python or PHP simply because I'm less acquainted with the implementations of those languages, not because it's intrinsically harder with those languages). I think you should take a better look at what your goals are and why you want to work for a client that you're assuming a priori wants to rip you off. And if you still want to go ahead with such a scheme, write in C or Fortran -- certainly not anything starting with "P".
0
1
0
1
2010-07-17T06:11:00.000
8
0.099668
false
3,270,464
0
0
0
4
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
Good compilers for compiling perl/python/php scripts into linux executables?
3,270,518
0
2
2,889
0
php,python,perl,compiler-construction,scripting-language
For linux an executable is something which has +x set, so there's no need to compile scripts. To hide your sourcecode you could use an obfuscator. This makes your sourcecode unreadable.
0
1
0
1
2010-07-17T06:11:00.000
8
0
false
3,270,464
0
0
0
4
I am working on a project that requires reading text files, extracting data from them, and then generating reports (text files). Since there are a lot of string parsing, I decided to do it in Perl or Python or PHP (preference in that order). But I don't want to expose the source code to my client. Is there any good compiler for compiling perl/python/php scripts into linux executables? I am not looking for a 100% perfect one, but I am looking for an at least 90% perfect one. By perfect, I mean the compiler doesn't require to write scripts with a limited subset of language features.
Can I install Python windows packages into virtualenvs?
3,274,878
7
125
32,413
0
python,windows,virtualenv
easy_install is able to install .exe packages as long as they were built using distutils' bdist_wininst target, which covers many popular packages. However, there are many others that aren't (wxPython is one that I've struggled with)
0
1
0
0
2010-07-17T13:10:00.000
7
1
false
3,271,590
1
0
0
2
Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects' dependencies aren't all thrown together into a common pile. But if I want to install a package on Windows that's packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6.exe. When I run it, it examines the registry, and finds only one Python26 to install into, the common one that my virtualenv is based off of. How can I direct it to install into the virtualenv?
Can I install Python windows packages into virtualenvs?
72,302,027
0
125
32,413
0
python,windows,virtualenv
You should type path of your file and write 'python ' before it. Than it will run your python script without any virtual environment. Thanks.
0
1
0
0
2010-07-17T13:10:00.000
7
0
false
3,271,590
1
0
0
2
Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects' dependencies aren't all thrown together into a common pile. But if I want to install a package on Windows that's packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6.exe. When I run it, it examines the registry, and finds only one Python26 to install into, the common one that my virtualenv is based off of. How can I direct it to install into the virtualenv?
No IDLE Subprocess connection
3,277,996
2
3
13,342
0
python,macos,subprocess
You can try running IDLE with the "-n" option. From the IDLE help: Running without a subprocess: If IDLE is started with the -n command line switch it will run in a single process and will not create the subprocess which runs the RPC Python execution server. This can be useful if Python cannot create the subprocess or the RPC socket interface on your platform. However, in this mode user code is not isolated from IDLE itself. Also, the environment is not restarted when Run/Run Module (F5) is selected. If your code has been modified, you must reload() the affected modules and re-import any specific items (e.g. from foo import baz) if the changes are to take effect. For these reasons, it is preferable to run IDLE with the default subprocess if at all possible.
0
1
1
0
2010-07-19T01:27:00.000
2
0.197375
false
3,277,946
0
0
0
1
I'm new to python programming, and want to try to edit scripts in IDLE instead of the OSX command line. However, when I try to start it, it gives me the error "Idle Subprocess didn't make a connection. Either Idle can't start a subprocess or personal firewall software is blocking the connection." I don't have a firewall configured, so what could the problem be?
Compiling a PyObjC application for 10.5 (Leopard) into xcode 10.6 (Snow Leopard)
4,708,176
0
6
400
0
python,cocoa,xcode,pyobjc
XCode has so called SDKs which can be used to target earlier Max OS X versions from a recent one. Currently installed SDKs can be found in /Developer/SDKs. Additional SDKs may be installed from an XCode DVD. In a project created with XCode, SDK can be selected the following way. Open Get info of a target, find Base SDK setting inside the Architectures section. Select SDK you need and rebuild. For example, Mac OS X 10.5 SDK contains Python versions 2.5 and 2.3 and the Current version points to 2.5.
0
1
0
0
2010-07-19T14:37:00.000
2
0
false
3,282,053
0
0
0
1
I'm trying to deploy on 10.5 a PyObjC (or Cocoa-Python) application developed on Xcode 3.2.X (Snow Leopard) which runs perfectly fine on 10.6 systems. The application doesn't launch on 10.5;it crashes at launch giving this error message (found on Crash Report): Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/Versions/2.6/Python Referenced from: /Users/myuser/Documents/myApp.app/Contents/MacOS/myApp Reason: image not found Seems that somewhere Xcode hardcodes the Versions/2.6 python framework path (instead of setting it as Versions/Current, for example). However, I was not able to find where this link path could be modified to be set to Current (or to 2.5, maybe conditionally)...
How do I launch a function and wait/don't wait on it depending on whether it's a GUI application?
3,288,296
0
0
606
0
python,windows,process
Python has no standard way to examine the executables you can start with the process API. How about you start the external command using cmd.exe? Or create a BAT script in %TEMP% and run that.
0
1
0
0
2010-07-20T08:42:00.000
2
0
false
3,288,289
0
0
0
2
I'm looking for a Python function which behaves just like the Windows command interpreter cmd.exe when it comes to waiting for newly launched processes to finish. Right now I'm using os.system() but this function always blocks, even when launching GUI applications (which, in case they were written in C/C++, have a WinMain function and were linked with /SUBSYSTEM:WINDOWS). What code should I be using for launching external processes in case I do want the function to block when launching console applications, but I do not want it to block when launching GUI applications?
How do I launch a function and wait/don't wait on it depending on whether it's a GUI application?
3,288,395
2
0
606
0
python,windows,process
You could write a small C wrapper/extension that checks for the subsystem (using ImageNtHeader). If all else fails, you can parse the PE headers directly.
0
1
0
0
2010-07-20T08:42:00.000
2
1.2
true
3,288,289
0
0
0
2
I'm looking for a Python function which behaves just like the Windows command interpreter cmd.exe when it comes to waiting for newly launched processes to finish. Right now I'm using os.system() but this function always blocks, even when launching GUI applications (which, in case they were written in C/C++, have a WinMain function and were linked with /SUBSYSTEM:WINDOWS). What code should I be using for launching external processes in case I do want the function to block when launching console applications, but I do not want it to block when launching GUI applications?
Sending email from my domain vs from the admin google account?
3,292,433
2
2
497
0
python,google-app-engine,email
When sending email, you can designate the sender as either the currently logged in user or any registered administrator. It does not have to be the administrator who created the app. Also note that you can add any email address as an administrator on your app (from the permissions tab in the admin console). It does not need to be a Gmail or Google Apps account; any email account that you can access to click on the confirmation link will work.
0
1
0
0
2010-07-20T16:36:00.000
2
0.197375
false
3,292,238
0
0
1
1
I have a domain xyz.com and right now it is pointing to my app in appspot. I want to send email alerts to users for various events. However, appengine restricts email sender to admin email address which was used to create the google app engine account. Can I send emails on behalf of user@xyz.com using app engine? If not, is there a simple workaround to do this?
What is the Windows equivalent of pwd.getpwnam(username).pw_dir?
3,309,135
0
8
6,669
0
python,windows,home-directory
This seems to be only applicable to the current user, but on my (winxp) machine, os.path.expanduser('~') returns my home directory.
0
1
0
0
2010-07-22T04:30:00.000
4
0
false
3,305,787
0
0
0
1
The Python pwd module provides access to getpwnam(3) POSIX API, which can be used to get the home directory for a particular user by username, as well determining if the username is valid at all. pwd.getpwnam will raise an exception if called with a non-existent username. At first it seems like the same result can be achieved in a cross-platform manner via os.path.expanduser('~username'). However, it appears that with Python 2.6 on Windows XP this won't actually produce a failure for a non-existent username. Furthermore, on Python 2.5 on Windows XP, it seems to fail even for valid users. Can this information be obtained reliably on Windows? How?
Cannot pass an argument to python with "#!/usr/bin/env python"
3,306,575
13
90
27,298
0
python,arguments,shebang
Passing arguments to the shebang line is not standard and in as you have experimented do not work in combination with env in Linux. The solution with bash is to use the builtin command "set" to set the required options. I think you can do the same to set unbuffered output of stdin with a python command. my2c
0
1
0
1
2010-07-22T07:07:00.000
9
1
false
3,306,518
0
0
0
2
I needed to have a directly executable python script, so i started the file with #!/usr/bin/env python. However, I also need unbuffered output, so i tried #!/usr/bin/env python -u, but that fails with python -u: no such file or directory. I found out that #/usr/bin/python -u works, but I need it to get the python in PATH to support virtual env environments. What are my options?
Cannot pass an argument to python with "#!/usr/bin/env python"
8,921,497
17
90
27,298
0
python,arguments,shebang
When you use shebang on Linux, the entire rest of the line after the interpreter name is interpreted as a single argument. The python -u gets passed to env as if you'd typed: /usr/bin/env 'python -u'. The /usr/bin/env searches for a binary called python -u, which there isn't one.
0
1
0
1
2010-07-22T07:07:00.000
9
1
false
3,306,518
0
0
0
2
I needed to have a directly executable python script, so i started the file with #!/usr/bin/env python. However, I also need unbuffered output, so i tried #!/usr/bin/env python -u, but that fails with python -u: no such file or directory. I found out that #/usr/bin/python -u works, but I need it to get the python in PATH to support virtual env environments. What are my options?
how to get final redirected url
3,309,766
3
1
1,704
0
python,google-app-engine,feedparser
It is not possible to get the 'final' URL by parsing, in order to resolve it, you would need to at least perform an HTTP HEAD operation
0
1
1
0
2010-07-22T14:05:00.000
3
0.197375
false
3,309,695
0
0
1
2
i am using google app engine for fetching the feed url bur few of the urls are 301 redirect i want to get the final url which returns me the result i am usign the universal feed reader for parsing the url is there any way or any function which can give me the final url.
how to get final redirected url
3,309,853
0
1
1,704
0
python,google-app-engine,feedparser
You can do this by handling redirects manually. When calling fetch, pass in follow_redirects=False. If your response object's HTTP status is a redirect code, either 301 or 302, grab the Location response header and fetch again until the HTTP status is something else. Add a sanity check (perhaps 5 redirects max) to avoid redirect loops.
0
1
1
0
2010-07-22T14:05:00.000
3
0
false
3,309,695
0
0
1
2
i am using google app engine for fetching the feed url bur few of the urls are 301 redirect i want to get the final url which returns me the result i am usign the universal feed reader for parsing the url is there any way or any function which can give me the final url.
Maven equivalent for python
4,560,558
6
162
113,883
0
python,deployment,dependency-management
It's good to use virtualenv to create standalone project environment and use pip/easy_install to management dependencies.
0
1
0
0
2010-07-24T06:41:00.000
5
1
false
3,324,108
0
0
1
1
I'm a java developer/python beginner, and I'm missing my maven features, particularly dependency management and build automation (I mean you don't build, but how to create a package for deployment?) Is there a python equivalent to achieve these features? Note: I use python 2.x Thanks.
What is the relation between PATH_MAX and NAME_MAX, and how do I obtain?
3,325,616
6
6
2,365
0
python,c,posix,gnu,limits
PATH_MAX is the maximum length of a filesystem path. NAME_MAX is the maximum length of a filename (in a particular spot). So, /foo/bar is restricted by PATH_MAX, and only the bar portion has its length limited by NAME_MAX. You can get these at run time via pathconf, as _PC_PATH_MAX and _PC_NAME_MAX, although standard practice is generally just to use the static macros at compile time. I suppose it would be better to use the run-time option because you could potentially support longer values that way, but I'm not sure what (if any) systems actually provide a return from pathconf which is greater than the value of the POSIX_FOO_MAX values.
0
1
0
0
2010-07-24T15:12:00.000
1
1.2
true
3,325,602
1
0
0
1
In limits.h, and in various places in the POSIX manpages, there are references to PATH_MAX and NAME_MAX. How do these relate to one another? Where is the official documentation for them? How can I obtain them at run time, and (where relevant) compile time for the C, Python, and GNU (shell) environments?
GAE - Sharing Authentication Across Apps
3,325,984
1
0
263
0
python,google-app-engine,authentication,openid
Not using the built in authentication support - users have to authenticate separately with each application.
0
1
0
0
2010-07-24T16:36:00.000
2
0.099668
false
3,325,906
0
0
1
1
Let's say I had a root app and multiple sub-apps. Would it be possible to share authenticated sessions across them? I'm using Google App Engine (Python).
How to create partial download in twisted?
3,328,795
3
2
597
0
python,twisted
You must use Range HTTP header: Range. Request only part of an entity. Bytes are numbered from 0. Range: bytes=500-999 Ie. If you want download 1000 file in 4 parts, you will starts 4 downloads: 0-2499 2500-4999 5000-7499 7500-9999 And then simply join data from responses. To check file size you can use HEAD method: HEAD Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.
0
1
0
0
2010-07-25T04:49:00.000
1
0.53705
false
3,328,059
1
0
0
1
How do you create multiple HTTPDownloader instance with partial download asynchronously? and does it assemble the file automatically after all download is done?
Python library for monitoring /proc/diskstats?
3,329,904
2
5
5,882
0
python,linux,io,monitoring
What's wrong with just periodically reading /proc/diskstats, e.g. using sched to repeat the operation every minute or whatever? Linux's procfs is nice exactly because it provides a textual way for the kernel to supply info to userland programs, as text is easiest to read and use in a huge variety of languages...!
0
1
0
0
2010-07-25T12:21:00.000
4
0.099668
false
3,329,165
0
0
0
1
I would like to monitor system IO load from a python program, accessing statistics similar to those provided in /proc/diskstats in linux (although obviously a cross-platform library would be great). Is there an existing python library that I could use to query disk IO statistics on linux?
How would an irc bot written in tcl stack up against a python/node.js clone?
3,331,115
6
3
964
0
python,tcl,irc,node.js,eggdrop
As you suspected, eggdrop is not written in tcl, it is written in C, however it does use tcl as its scripting/extension language. I would expect that in the case of an eggdrop, the performance difference between using tcl as a scripting language, and using Python, Lua, JS, or virtually anything else would be negligible, as eggdrops generally aren't performing high load tasks. In the event it really was an issue, your question would need more specifics. Performance for what task under what conditions? Memory use? CPU efficiency? Latency? And the answer would probably be "measure and find out". Given the typical use of an eggdrop, it doesn't take particularly efficient code to respond to the occasional IRC trigger command once every few minutes or hours. As a more general case, I'm sure you could find benchmark comparisons of specific algorithms or tasks performed by various scripting languages on particular operating systems or environments, at which point it wouldn't really have anything to do with IRC or eggdrop.
0
1
0
1
2010-07-25T21:13:00.000
2
1.2
true
3,331,027
0
0
0
1
I believe eggdrop is the most active/popular bot and it's written in tcl ( and according to wiki the core is C but I haven't confirmed that ). I'm wondering if there would be any performance benefit of recoding it's functionality in node.js or Python, in addition to making it more accessible since Python and JS are arguably more popular languages and not many are familiar with tcl. So, how would they stack up vs tcl in general, performance-wise?