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 ac... | 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 t... |
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 u... | 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 t... |
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.
sa... | 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 ). ... |
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 don... | 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 de... |
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 th... | 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... |
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 diffe... | 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 up... |
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 th... | 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... |
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 en... | 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-specifi... |
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 considera... | 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-specifi... |
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/... |
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 ... | 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 differ... |
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 reac... |
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 Su... |
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 f... | 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 y... | 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... |
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 ... |
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 ... |
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/NewPro... |
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 ... | 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... | 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... |
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, m... | 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... |
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... |
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... |
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 ... |
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 interf... |
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 interf... |
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... |
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... |
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 th... | 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 th... |
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 ... | 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 ... |
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 ... |
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 encry... | 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 ... |
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 ... |
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 ... |
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 o... | 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 t... |
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... | 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 synchro... |
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... |
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... |
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... | 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... |
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 malic... | 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 f... |
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() wh... | 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... |
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 ... | 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... |
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 w... | 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 syst... |
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... t... | 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 syst... |
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 la... | 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 syst... |
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
Cus... | 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 in... | 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 t... |
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... |
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,... | 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... |
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 wi... | 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 ... |
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 la... | 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 ... |
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... | 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 ad... |
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 t... | 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... |
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... |
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 con... | 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... |
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... |
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 hi... | 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 langua... |
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) wi... | 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 langua... |
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 langua... |
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 ... | 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 langua... |
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 langua... |
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 sti... | 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 langua... |
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 se... | 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 Pyth... |
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 m... | 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? Thou... |
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 dist... | 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 com... |
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 com... |
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 acq... | 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 com... |
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 com... |
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 ha... |
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 ha... |
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
... | 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 firewal... |
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... | 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/Libr... |
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 Win... |
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 Win... |
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... | 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 no... |
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 ... |
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 PA... |
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 PA... |
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 avoi... | 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... | 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... | 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... | 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 arg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.