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
Access Arguments to Parent Task from Subtask in Celery
71,510,516
0
2
960
0
python,celery
I think you can, at least in chord. When you bind=True your task, you can access self.request. In self.request.chord You can find a detailed dict. In its kwargs or options['chord'] you will find what you're looking for, but it's not an elegant solution. Also, if the parent has been replaced, you will only be able to se...
0
1
0
0
2013-02-17T16:59:00.000
2
0
false
14,923,583
0
0
0
1
Is it possible to access the arguments with which a parent task A was called, from its child task Z? Put differently, when Task Z gets called in a chain, can it somehow access an argument V that was invoked when Task A was fired, but that was not passed through any intermediary nodes between tasks A and Z? And if so, h...
Is there a Python Memcached library with support for AWS ElastiCache's auto-discovery feature?
14,924,764
1
2
2,949
0
python,memcached,amazon-elasticache
As far as I know, ElastiCache cluster is just a bunch of memcached servers, so you need to give your memcached client the list of all of your servers and have the client do the relevant load balancing. For Python, you have a couple of options: pylibmc - which is a wrapper around libmemcached - one of the best and fast...
0
1
0
0
2013-02-17T18:35:00.000
3
1.2
true
14,924,586
0
0
1
1
Recently, AWS announced ElastiCache's auto-discovery feature, although they only officially released a client for Java. Does anyone know of a Python Memcached library with support for this feature?
Cluster job scheduler: tools
42,817,839
0
3
1,313
0
python,cluster-computing,scheduler
Take a look at the ipcluster_tools. The documentation is sparse but it is easy to use.
0
1
0
0
2013-02-18T16:54:00.000
2
0
false
14,941,334
0
0
0
1
we are trying to solve a problem related to cluster job scheduler. The problem is the following we have a set of python scripts which are executed in a cluster, the launching process is currently done by means of the human interaction, I mean to start the test we have a bash script which interact with the cluster to r...
Will os.fork() use copy on write or do a full copy of the parent-process in Python?
14,942,111
24
9
3,526
0
python,linux,fork
Even if COW is employed, CPython uses reference counting and stores the reference count in each object's header. So unless you don't do anything with that data, you'll quickly have spurious writes to the memory in question, which will force the system to copy the data. Pass it to a function? That's another reference, a...
0
1
0
0
2013-02-18T17:15:00.000
2
1.2
true
14,941,729
1
0
0
1
I would like to load a rather large data structure into a process and then fork in the hope to reduce total memory consumption. Will os.fork work that way or copy all of the parent process in Linux (RHEL)?
How to disable Google App Engine python SDK import hook?
14,950,038
0
1
158
0
python,google-app-engine
Easiest thing is to modify google/appengine/tools/dev_appserver_import_hook.py and add the module you want to the whitelist. This will allow you to import whatever you want. Now there's a good reason that the imports are restricted in the development server. The restricted imports match what's available on the product...
0
1
0
0
2013-02-19T00:35:00.000
1
0
false
14,947,860
0
0
1
1
I am playing around with local deployment of GAE python SDK. The code that I am trying to run contains many external libraries which are not part of GAE import whitelist. I want to disable the import restrictions and let GAE app import any locally installed module. After walking through the code, I figured out that th...
What is difference between os.getuid() and os.geteuid()?
14,950,419
6
40
27,249
0
python,uid
Function os.getuid() returns ID of a user who runs your program. Function os.geteuid() of a user your program use permissions of. In most cases this will be the same. Well known case when these values will be different is when setuid bit is set for your program executable file, and user that runs your program is dif...
0
1
0
0
2013-02-19T05:21:00.000
2
1
false
14,950,378
0
0
0
1
The documentation for os.getuid() says: Return the current process’s user id. And of os.geteuid() says: Return the current process’s effective user id. So what is the difference between user id and effective user id? For me both works same (on both 2.x and 3.x). I am using it to check if script is being run as root...
need assisstance to set python2.7 as default & Django to install
14,955,895
1
0
143
0
linux,django,python-2.7,centos
Your CentOS relies on python 2.4 so that's not going to work. You should probably create a new system user and install pyton 2.7 in its home directory (or use your root user and install python in /opt for global usage), you can find plenty of tutorials on Google. After succesfully doing so, you can set an alias in your...
0
1
0
0
2013-02-19T10:43:00.000
1
1.2
true
14,955,468
0
0
1
1
I am not able to install Django.I am using CentOS 5,not able to set python2.7 environment variable.Priviously in my system python2.4.3 is available,but after installing python 2.7 in the terminal i checked the version avail in system using "python -V"cmd it executed as python 2.4.3.But if i checked using "python2.7 -V"...
Running a script on EC2 start and stop
14,966,165
1
1
1,561
0
python,linux,amazon-web-services,amazon-ec2,amazon-rds
It is possible. You just have to write an init script and setup proper symbolic links in /etc/rc#.d directories. It will be started with a parameter start or stop depending on if machine is starting up or shutting down.
0
1
1
1
2013-02-19T16:26:00.000
1
1.2
true
14,962,414
0
0
1
1
I have an Amazon Ubuntu instance which I stop and start (not terminate). I was wondering if it is possible to run a script on start and stop of the server. Specifically, I am looking at writting a python boto script to take my RDS volume offline when the EC2 server is not running. Can anyone tell me if this is possible...
Retranslation audio stream with python on Google App Engine
14,964,896
1
1
193
0
python,google-app-engine,audio-streaming
You can't make long running external calls with App Engine. Maximum deadline (task queue and cron job handler) for UrlFetch is 10 minutes. So, I think it is not possible.
0
1
0
0
2013-02-19T18:25:00.000
1
1.2
true
14,964,717
0
0
1
1
I have a URL address to the audio stream, how I can retranslate it in the web with my address (myapp.appspot.com)? Let me explain why I need it: I have a very narrow channel, and will not stand many connections, so I have to do it with GAE Thanks!
Anyway to provide progress from os.walk?
14,970,241
3
2
931
0
python
The walk itself can't give you progress, because there's no way of knowing in advance how many entries are under some directory tree.* However, in most programs that use walk, you're actually doing something with the files, which usually takes a whole lot longer than the implicit stat call. For example, grabbing my fir...
0
1
0
0
2013-02-19T22:07:00.000
1
0.53705
false
14,968,441
1
0
0
1
for root, dirs, files in os.walk(rootDir, topdown='true'): is something regularly used in python scripts. Just wondering is there any well known way to provide progress here? When you have a large folder structure this API can take a while? Thanks.
Python shell access to a separate running script
14,970,626
1
0
196
0
python,shell,process
You can't generally access one Python interpreter from another. The most general way to do something like is to put an interpreter-on-a-socket (or -pipe or whatever) into your server program, and just connect your shell up to that interpreter. Doing this on top of the code module isn't hard, but to make it as nice as ...
0
1
0
0
2013-02-19T23:59:00.000
1
0.197375
false
14,969,929
1
0
0
1
I have Python application running on a web server via mod_wsgi and I am able to access python shell through SSH on the server. Part of the application generates a dictionary and a small number of lists in memory over time while the application is running. Is there a possible way of starting the Python shell on the serv...
Can the compiled opencl program be stored as a seperate binary file?
15,017,872
1
2
1,010
0
python,opencl,gpgpu,pyopencl,amd-processor
on NVIDIA the binary will be in the ptx format. obtain the Binary sizes clGetProgramInfo() using the flag CL_PROGRAM_BINARY_SIZES store the binaries in ptx file. clGetProgramInfo() using the flag CL_PROGRAM_BINARIES clCreateProgramWithBinary() with the ptx file as input.
0
1
0
0
2013-02-20T15:32:00.000
2
0.099668
false
14,983,709
0
0
0
1
I have 2 two python script on separate files. The first one has opencl program that performs some image processing on the image passed to it and returns the results. The second script reads the image on from a file and calls the first script passing the read image as a parameter and obtains the results returned by it w...
Description of Hadoop job
15,004,130
0
1
109
0
python,hadoop,mapreduce,hadoop-streaming
Yes, you can specify a name for each job using job.setJobName(String). If you were to set the job name to something distinguishing you should be able to tell them apart. For example, by using something likeManagementFactory.getRuntimeMXBean().getName() you can get the process id and machine name (on linux anyway, unsur...
0
1
0
0
2013-02-21T13:15:00.000
2
0
false
15,003,202
0
0
0
1
I have a Hadoop cluster and different processes are able submit mapreduce jobs to this cluster (they all use the same user account). Is there a way to distinguish these jobs? Some kind of description, which can be added to job during submit like 'This is a job of process "1234", do not touch'? I am using Python and Ha...
How to kill downstream jobs if upstream job is stopped?
15,006,928
2
3
1,600
0
java,python,jenkins,jenkins-plugins
Instead of killing the job, have another job that programmatically terminates all the required jobs. You could reuse the same property file to know which all jobs to be killed. You could use groovy script to terminate jobs.
0
1
0
0
2013-02-21T15:40:00.000
2
0.197375
false
15,006,278
0
0
0
1
I have a parent job that triggers many downstream jobs dynamically. I use python code to generate the list of jobs to be triggered, write it to a properties file, Inject the file using EnvInject plugin and then use the "Parameterized trigger plugin" with the job list variable (comma separated) variable to launch the jo...
python distutils include shell scripts in module directory
47,823,714
0
3
1,820
0
python
Another issue might be that such pypi packages containing Bash scripts might not run correctly on e.g. Windows?
0
1
0
1
2013-02-21T17:59:00.000
3
0
false
15,009,146
1
0
0
1
What is the best way to include a 'helper' shell script in setup.py that is used by a python module? I don't want to include is as a script since it is not run on it's own. Also, data_files just copies things in the the install path (not the module install path) so that does not really seem like the best route. I guess...
Why is my clojure shell result not like what works in python?
15,010,740
1
3
189
0
python,clojure
It sounds like you want sh to return immediately instead of waiting for notepad's exit code. How about writing a sh! macro or somesuch that runs the original sh command on a new Thread? If you're only using this as a convenience in the REPL, it would be entirely unproblematic. EDIT Arthur's answer is better and more ...
0
1
0
0
2013-02-21T19:10:00.000
2
0.099668
false
15,010,364
1
0
0
1
When working in the python repl I often need to edit multiline code. So I use import os then os.system("notepad npad.py") In clojure I first run (use '[clojure.java.shell :only [sh]]) Then I run (sh "notepad" "jpad.clj") This starts notepad but not in a useful way because the clojure repl now hangs. In other words, unt...
Hadoop Streaming Job with binary input?
15,181,203
0
1
546
0
python,hadoop,hadoop-streaming
You may consider using NullWritable as output, and generating the SequenceFile directly inside of your python script. You can look up the hadoop-python project in github to see candidate code: though it is admittedly bit large-ish/heavy it does handle the sequencefile generation.
0
1
0
0
2013-02-21T21:02:00.000
1
0
false
15,012,162
0
0
0
1
I wish to convert a binary file in one format to a SequenceFile. I have a Python script that takes that format on stdin and can output whatever I want. The input format is not line-based. The individual records are binary themselves, hence the output format cannot be \t delimited or broken into lines with \n. Can I us...
opening a usb device in python -- what is the path in winXP?
15,013,500
0
0
1,609
0
python,usb
"Everything is a file" is one of the core ideas of Unix. Windows does not share this philosophy and, as far as I know, doesn't provide an equivalent interface. You're going to have to find a different way. The first way would to be to continue handling everything at a low level & have your code use a different code p...
0
1
0
0
2013-02-21T21:37:00.000
2
0
false
15,012,694
0
0
0
2
I'm trying to access a usb device through python but I'm unsure how to find the path to it. The example I'm going from is: pipe = open('/dev/input/js0','r') In which case this is either a mac or linux path. I don't know how to find the path for windows. Could someone steer me in the proper direction? I've sifted throug...
opening a usb device in python -- what is the path in winXP?
15,012,889
0
0
1,609
0
python,usb
The default USB path on windows is D:\. So, if we have a text document named mydoc.txt, which is in the folder myData the appropriate path is D:\myData\mydoc.txt
0
1
0
0
2013-02-21T21:37:00.000
2
0
false
15,012,694
0
0
0
2
I'm trying to access a usb device through python but I'm unsure how to find the path to it. The example I'm going from is: pipe = open('/dev/input/js0','r') In which case this is either a mac or linux path. I don't know how to find the path for windows. Could someone steer me in the proper direction? I've sifted throug...
another transaction already in progress
15,033,087
5
2
3,012
0
python,google-app-engine
appcfg.py rollback C:\path\to\my\app is the required command. If you are using Java, the rollback command is same as above, but the path to the application should be to the application's target directory. Otherwise, rollback will fail.
0
1
0
0
2013-02-22T16:54:00.000
1
1.2
true
15,029,252
0
0
1
1
I am using app engine launcher in windows and for some reason the last time i deployed my app, the transaction wouldn't finish, and now every time i try to deploy i get the error another transaction by user is already in progress for app: s~ myapp, version 1 i have tried doing appcfg.py rollback, which brings up a py...
Python on the AWS Beanstalk. How to snapshot custom logs?
15,183,303
6
15
5,607
0
python,logging,amazon-elastic-beanstalk
If you need have ability to snapshot log files from Beanstalk management console, you should just write you log files to "/opt/python/log/" folder. Elastic beanstalk scripts use this folder for log tailing.
0
1
0
0
2013-02-23T07:12:00.000
2
1.2
true
15,038,135
0
0
1
1
I'm developing python application which works on aws beanstalk environment. For error handling and debugging proposes I write logs to custom lof file on the directory /var/logs/. What should I do in order to have ability snapshot logs from Elastic beanstalk management console?
keep getting access violation after setting a breakpoint with winappdbg
15,235,645
0
0
656
0
python,debugging,breakpoints,access-violation,ida
Apperently the pida_dump script didn't got the right base address so when i did a rebase the code was like address - old_base_address + new_base_address and because the old_base_address was worng it missed up my BP. thanks any way for the help!
0
1
0
0
2013-02-24T19:20:00.000
2
1.2
true
15,055,561
1
0
0
1
i am using winappdbg framework to build a debugger in python. i can set some breakpoints using the event.debug.break_at(event.get_pid(),address) in order to set the breakpoint but after setting certin breakpoints (and not while setting them but once the program hits them!) i get access violation exception. for exemple ...
User Idle time in Linux
15,069,543
1
2
3,300
0
python,linux,bash
In deps of internet I found something like this, and it looks like working - but still not perfect solution because it returns much more info than I need and also the number near which is proper value is not constant (it differs in other system): ls -l /dev/pts | fgrep username
0
1
0
0
2013-02-25T14:08:00.000
4
0.049958
false
15,068,887
0
0
0
1
I need to check how much time passed since last user input occurence (preffered way - in python) on Linux (lucid - 10.4) I know that this is easy in normal way (just using XScreenSaverQueryInfo), but the tricky part is that I don't have x11/extensions/scrnsaver.h header and I HAVE to do that some other way (even if I i...
Unable to exit with ^C
15,073,287
7
2
1,083
0
python,terminal,pytest
I would suggest trying control-Z. That should suspend it; you can then do kill %1 (or kill -9 %1) to kill it (assuming you don't have anything else running in the background) What I'm guessing is happening (from personal experience) is that one of your tests is running in a try / except that is catching all exceptions...
0
1
0
1
2013-02-25T17:52:00.000
1
1.2
true
15,073,210
0
0
0
1
I am using pytest to run tests and, during the execution of a test, interrupted with ctrl-C. No matter how many times I ctrl-C to get out of the test session (I've also tried ctrl-D to get out of the environment I'm using), my terminal prompt does not return. I accidentally pressed F as well... test.py ^CF^C Does the ...
pros and cons between os.path.exists vs os.path.isdir
15,077,527
0
81
120,324
0
python,directory,os.path
Most of the time, it is the same. But, path can exist physically whereas path.exists() returns False. This is the case if os.stat() returns False for this file. If path exists physically, then path.isdir() will always return True. This does not depend on platform.
0
1
0
0
2013-02-25T22:06:00.000
5
0
false
15,077,424
1
0
0
3
I'm checking to see if a directory exists, but I noticed I'm using os.path.exists instead of os.path.isdir. Both work just fine, but I'm curious as to what the advantages are for using isdir instead of exists.
pros and cons between os.path.exists vs os.path.isdir
56,261,695
4
81
120,324
0
python,directory,os.path
os.path.isdir() checks if the path exists and is a directory and returns TRUE for the case. Similarly, os.path.isfile() checks if the path exists and is a file and returns TRUE for the case. And, os.path.exists() checks if the path exists and doesn’t care if the path points to a file or a directory and returns TRUE in...
0
1
0
0
2013-02-25T22:06:00.000
5
0.158649
false
15,077,424
1
0
0
3
I'm checking to see if a directory exists, but I noticed I'm using os.path.exists instead of os.path.isdir. Both work just fine, but I'm curious as to what the advantages are for using isdir instead of exists.
pros and cons between os.path.exists vs os.path.isdir
15,077,442
6
81
120,324
0
python,directory,os.path
Just like it sounds like: if the path exists, but is a file and not a directory, isdir will return False. Meanwhile, exists will return True in both cases.
0
1
0
0
2013-02-25T22:06:00.000
5
1
false
15,077,424
1
0
0
3
I'm checking to see if a directory exists, but I noticed I'm using os.path.exists instead of os.path.isdir. Both work just fine, but I'm curious as to what the advantages are for using isdir instead of exists.
Can you read variable data of an already running Python Script from its DMP file in Windows?
15,094,305
1
0
165
0
python,windows,python-2.7,save
Does it contain some or all of the current execution state of your program? Yes. Is it in a form that you could easily extract the information in the user-level format you are probably looking for from it? Probably not. It will dump the state of the entire Python interpreter, including the data as represented in me...
0
1
0
0
2013-02-26T16:06:00.000
1
1.2
true
15,093,780
1
0
0
1
I have a Python program that had some kind of error that prevents it from saving my data. The program is still running, but I cannot save anything. Unfortunately, I really need to save this data and there seems to be no other way to access it. Does the DMP file created for the process through the task manager contain t...
Using pip in pythonbrew
15,259,856
3
2
2,019
0
python,pip,pythonbrew
I found a solution. I uninstalled my Python 3.3.0 by issuing pythonbrew uninstall 3.3.0. Then I installed it again with pythonbrew install --configure="--with-zlib" 3.3.0. This allowed pip to install and thus now I can use it to install to this Python version. Maybe somebody else can find this helpful, cheers!
0
1
0
0
2013-02-26T18:15:00.000
1
1.2
true
15,096,306
0
0
0
1
I have started using pythonbrew to manage different Python installs. The main reason I wanted to do this is to install third party modules without affecting my system's Python install. Fore example I thought I would install the requests library using: pip install requests However this causes an error saying: error: co...
Google App Engine development server random (?) slowdowns
15,098,634
2
2
237
1
python,google-app-engine
Don't worry about it. It (IIRC) keeps the whole DB (datastore) in memory using a "emulation" of the real thing. There are lots of other issues that you won't see when deployed. I'd suggest that your hard drive is spinning down and the delay you see is it taking a few seconds to wake back up. If this becomes a problem...
0
1
0
0
2013-02-26T19:54:00.000
2
0.197375
false
15,098,051
0
0
1
2
I'm doing a small web application which might need to eventually scale somewhat, and am curious about Google App Engine. However, I am experiencing a problem with the development server (dev_appserver.py): At seemingly random, requests will take 20-30 seconds to complete, even if there is no hard computation or data u...
Google App Engine development server random (?) slowdowns
15,106,246
0
2
237
1
python,google-app-engine
Does this happen in all web browsers? I had issues like this when viewing a local app engine dev site in several browsers at the same time for cross-browser testing. IE would then struggle, with requests taking about as long as you describe. If this is the issue, I found the problems didn't occur with IETester. Sorry i...
0
1
0
0
2013-02-26T19:54:00.000
2
0
false
15,098,051
0
0
1
2
I'm doing a small web application which might need to eventually scale somewhat, and am curious about Google App Engine. However, I am experiencing a problem with the development server (dev_appserver.py): At seemingly random, requests will take 20-30 seconds to complete, even if there is no hard computation or data u...
Is it possible to reload (Windows) environment variables?
15,099,480
3
0
7,103
0
python,windows,environment-variables
If you set an environment variable in the registry (or via the System Properties > Advanced > Environment Variables UI), it will be global and persistent for every process launched from the top level context created after the variable was set. Shells and contexts initialized before your change will not pick up those c...
0
1
0
0
2013-02-26T21:11:00.000
1
1.2
true
15,099,344
0
0
1
1
Exactly what it says. I can set per-user environment variables, either from Windows > type "Path", or using RegEdit, or even from a Python script. But if I run an application (e.g. from Launchy, or launch it from Chrome), it won't pick up the new variables. I've got to start a new cmd or Windows Explorer (I think) to g...
How to get full user name in the output of 'top' command in *nix?
15,111,135
2
0
2,320
0
python,unix
Consider using ps instead of top as I don't know any reasons why top would be better for this task. You can configure ps output much more flexibly than top one.
0
1
0
1
2013-02-27T11:29:00.000
2
0.197375
false
15,110,982
0
0
0
1
I need to extract process details from top command on a few *nix systems I monitor. The details needed are username, command executed, PID, PPID, username and resident memory consumption. If memory usage is greater than a threshold or command is illegal, I need to send a warning to the user at username@company.com I am...
threads or processes
15,121,552
2
0
91
0
python,python-3.x
If you don't have time to wait for a performance test, you presumably just want guesses. So: There's probably no real advantage to multiprocessing over threading here. There is a disadvantage to multiprocessing in the overhead per task. You can get around that by tuning the batch size, but with threading, you don't ha...
0
1
0
0
2013-02-27T20:10:00.000
3
1.2
true
15,121,405
1
0
0
1
I am writing basically port scanner (not really, but it's close). Pinging machines one by one is just slow, so I definitely need some kind of parallel processing. Bottle neck is definitely network I/O, so I was thinking that threads would suffice (with python's GIL existing), they're easier to use. But would utilizatio...
How to check if I'm running in a shell (have a terminal) in Python?
15,121,639
2
2
206
0
python,python-2.6
If you really need to check this, Pavel Anossov's answer is the way to do it, and it's pretty much the same as your initial guess. But do you really need to check this? Why not just write a Python script that writes to stdout and/or stderr, and your cron job can just redirect to log files? Or, even better, use the logg...
0
1
0
1
2013-02-27T20:13:00.000
2
0.197375
false
15,121,468
0
0
0
1
I have a Python script that normally runs out of cron. Sometimes, I want to run it myself in a (Unix) shell, and if so, have it write its output to the terminal instead of writing to a log file. What is the pythonic way of determining if a script is running out of cron or in an interactive shell (I mean bash, ksh, etc...
Differentiate celery, kombu, PyAMQP and RabbitMQ/ironMQ
15,131,010
2
9
7,047
0
python,heroku,rabbitmq,celery,kombu
"One of the biggest differences between IronMQ and RabbitMQ/AMQP is that IronMQ is hosted and managed, so you don't have to host the server yourself and worry about uptime." Currently there are at least two hosted managed RabbitMQ-as-a-service options: Bigwig and CloudAMQP. Celery should work well with both.
0
1
0
0
2013-02-27T20:16:00.000
2
0.197375
false
15,121,519
0
0
1
1
I want to upload images to S3 server, but before uploading I want to generate thumbnails of 3 different sizes, and I want it to be done out of request/response cycle hence I am using celery. I have read the docs, here is what I have understood. Please correct me if I am wrong. Celery helps you manage your task queues ...
How do I get a python program to run instead of opening in Notepad?
31,030,969
3
5
20,810
0
python,notepad
okay. 1) i tried turning it off and on again. 2) i uninstalled and reinstalled python still no joy. and then! in windows explorer there's an open with option that sets the default program that windows is pointed toward if you click on the filename or enter it on the command line. change that from notepad or whatev...
0
1
0
0
2013-02-27T20:26:00.000
4
0.148885
false
15,121,714
1
0
0
2
I am having some trouble with opening a .py file. I have a program that calls this .py file (i.e. pathname/example.py file.txt), but instead of running the python program, it opens it in Notepad. How to I get it to run? The program itself takes in a file, and creates an output that is more readable. Edit: The operating...
How do I get a python program to run instead of opening in Notepad?
38,337,893
6
5
20,810
0
python,notepad
This happened because most probably you have set notepad as the default program to open a .py file. Go to default programs app in windows. Select choose app by extension. Here search for .py files. Change the option from notepad to python. This should solve your problem.
0
1
0
0
2013-02-27T20:26:00.000
4
1
false
15,121,714
1
0
0
2
I am having some trouble with opening a .py file. I have a program that calls this .py file (i.e. pathname/example.py file.txt), but instead of running the python program, it opens it in Notepad. How to I get it to run? The program itself takes in a file, and creates an output that is more readable. Edit: The operating...
Python version in terminal after download Python for OSX
15,133,546
1
1
58
0
python-3.x
python3 should start the correct version for you.
0
1
0
0
2013-02-28T05:52:00.000
1
0.197375
false
15,128,411
1
0
0
1
I downloaded and successfully installed Python 3.3 for OSX. After executing "python" in terminal it opened the python terminal window, stating: "Python 2.7.2 (default, June 20 2012...) Is there another update I need to do? Thanks!
Django: Automatically executing statements in `manage.py shell`
15,164,238
-1
2
158
0
python,django,shell
I ended up monkeypatching IPython.frontend.terminal.embed.InteractiveShellEmbed.__call__ to add the definitions I wanted. (I know many people are opposed to monkeypatching but I find it to be a good solution in this case.)
0
1
0
0
2013-03-01T15:19:00.000
2
1.2
true
15,161,051
0
0
1
1
Every time I start a shell using python manage.py shell, I want a few lines to be executed automatically. (In my case it would be a few import lines in the style of import django, my_app.) How do I do this?
py2exe cmd failure
15,165,112
3
0
125
0
python
This has nothing to do with py2exe, and everything to do with the machine's setup. You don't have python on your path. You can test this by just running python by itself to open the interactive interpreter. If cmd can't find python, it can't run it. Here are some ways around this: Explicitly use the full path to Pytho...
0
1
0
0
2013-03-01T19:09:00.000
1
1.2
true
15,165,070
1
0
0
1
i wrote a python script and installed py2exe 0.6.9 (win32) to a 32bit-Windows7 machine with Python 2.7. I could successfully run "python setup.py py2exe" via cmd. Now I installed py2exe 0.6.9 (win64) to a 2nd PC (Win7, 64bit, Python2.7) and tried the same to exactly the same script: But "python setup.py py2exe" returne...
Call Python code from LLVM JIT
15,175,018
2
6
1,071
0
python,llvm,llvm-py
You can call external C functions from LLVM JIT-ed code. What else do you need? These external functions will be found in the executing process, meaning that if you link Python into your VM you can call Python's C API functions. The "VM" is probably less magic than you think it is :-) In the end, it's just machine code...
0
1
0
0
2013-03-02T00:08:00.000
2
0.197375
false
15,169,015
1
0
0
1
I write a language lexer/parser/compiler in python, that should run in the LLVM JIT-VM (using llvm-py) later. The first two steps are quite straightforward for now, but (even if I didn't start the compile-task yet) I see a problem, when my code wants to call Python-Code (in general), or interact with the Python lexer/p...
python is not recognised as an internal or external command
39,730,308
0
11
50,485
0
python,cmd
Okay, as you said your Python install directory is C:\Python27, open my computer, then open c: drive, if you don't see "Python27" named folder there then try to search it using search option, (in my case i found it in old.window folder, don't know how it moved there) cut and past it in c drive along with folders like,...
0
1
0
0
2013-03-02T05:36:00.000
8
0
false
15,171,157
1
0
0
6
This is a really annoying problem. I've prowled the web for solutions, but all I found was tips about changing the PATH variable, which I did, of course. My Python install directory is C:\Python27. It' a 32 bit version. Whenever I type python in the command prompt, it says that it isn't recognised as an internal or ext...
python is not recognised as an internal or external command
15,171,325
1
11
50,485
0
python,cmd
After adding the python folder to the system PATH variable, you should reboot your computer. Another simple solution is: create a shortcut of the python.exe executable (probably it is in C:\Python27\python.exe, or similar) in a place like C:\Windows\system32 (that is, a place that already is listed in the PATH variable...
0
1
0
0
2013-03-02T05:36:00.000
8
0.024995
false
15,171,157
1
0
0
6
This is a really annoying problem. I've prowled the web for solutions, but all I found was tips about changing the PATH variable, which I did, of course. My Python install directory is C:\Python27. It' a 32 bit version. Whenever I type python in the command prompt, it says that it isn't recognised as an internal or ext...
python is not recognised as an internal or external command
41,311,109
0
11
50,485
0
python,cmd
This is only a partial answer, but I found (repeatedly) that I'd have similar issues when I would use the gui installer and not go through the custom setup. Using the custom setup option, then using the same settings, the "install for all users" (that then installs to C://python.version/blah instead of the user based d...
0
1
0
0
2013-03-02T05:36:00.000
8
0
false
15,171,157
1
0
0
6
This is a really annoying problem. I've prowled the web for solutions, but all I found was tips about changing the PATH variable, which I did, of course. My Python install directory is C:\Python27. It' a 32 bit version. Whenever I type python in the command prompt, it says that it isn't recognised as an internal or ext...
python is not recognised as an internal or external command
15,171,259
4
11
50,485
0
python,cmd
Quick fix: May not be the most elegant or long term fix but if you are really frustrated and just want to get it to run, just copy paste the python.exe file to your current directory. This worked for me.
0
1
0
0
2013-03-02T05:36:00.000
8
0.099668
false
15,171,157
1
0
0
6
This is a really annoying problem. I've prowled the web for solutions, but all I found was tips about changing the PATH variable, which I did, of course. My Python install directory is C:\Python27. It' a 32 bit version. Whenever I type python in the command prompt, it says that it isn't recognised as an internal or ext...
python is not recognised as an internal or external command
15,171,248
1
11
50,485
0
python,cmd
After changing the PATH variable in windows, you need to reboot your system before it takes effect. Edit: As stated by @tdelaney, only a restart of cmd.exe should be required. This is true atleast for Windows 7 64bit.
0
1
0
0
2013-03-02T05:36:00.000
8
0.024995
false
15,171,157
1
0
0
6
This is a really annoying problem. I've prowled the web for solutions, but all I found was tips about changing the PATH variable, which I did, of course. My Python install directory is C:\Python27. It' a 32 bit version. Whenever I type python in the command prompt, it says that it isn't recognised as an internal or ext...
python is not recognised as an internal or external command
35,899,777
0
11
50,485
0
python,cmd
When installing, there is a checkbox that is by default not selected, but it asks to add python to the environment variable. Re-install and check that box. I'd rather the installer do it than struggle in the weeds myself.
0
1
0
0
2013-03-02T05:36:00.000
8
0
false
15,171,157
1
0
0
6
This is a really annoying problem. I've prowled the web for solutions, but all I found was tips about changing the PATH variable, which I did, of course. My Python install directory is C:\Python27. It' a 32 bit version. Whenever I type python in the command prompt, it says that it isn't recognised as an internal or ext...
Does initialize in tornado.web.RequestHandler get called every time for a request/
15,202,174
8
3
1,206
0
python,tornado
Yes, tornado calls initialize for each request. If you want to share state between requests(like db connection) - store it in self.application.
0
1
0
0
2013-03-04T10:09:00.000
1
1.2
true
15,199,028
0
0
1
1
There'a an initialize method in tornado.web.RequestHandler class, is it called every time there's a request?
Twisted and libtorrent - do I need to worry about blocking?
15,299,811
2
4
370
0
python,twisted,bittorrent,libtorrent
I may be able to provide answers to some of those questions. all of libtorrents logic, including networking and disk I/O is done in separate threads. So, over all, the concern of "blocking" is not that great. Assuming you mean libtorrent functions not returning immediately. Some operations are guaranteed to return imme...
0
1
0
0
2013-03-04T10:30:00.000
1
1.2
true
15,199,448
1
0
0
1
I am looking into building a multi-protocol application using twisted. One of those protocols is bittorrent. Since libtorrent is a fairly complete implementation and its python bindings seems to be a good choice. Now the question is: When using libtorrent with twisted, do I need to worry about blocking? Does the libto...
AppEngine NDB property validations
15,202,052
0
0
744
0
python,google-app-engine,app-engine-ndb,wtforms,google-cloud-endpoints
Not this is is always the best solution, but you could roll your own. Just pre-define a bunch of properties with reg-exs/mins and maxs etc. It seems like your properties are straight forward enough that it wouldn't be too difficult.
0
1
0
0
2013-03-04T11:53:00.000
1
0
false
15,200,952
0
0
1
1
I wonder what the best approach is for validating NDB entity properties likes: a date must be in the future a grade (integer property) must be between 1 and 10 a reference to another entity must have certain property values (e.g. book.category.active must be True) I'm also using WTForms to validate submitted requests...
How to start app without navigating to its directory
15,210,530
1
1
113
0
python,console
http://stackoverflow.com/questions/7054424/python-not-recognised-as-a-command Add python to your environment path. You should then be able to use it anywhere.
0
1
0
0
2013-03-04T20:25:00.000
2
1.2
true
15,210,454
1
0
0
1
I've looked around for an answer to this, but i don't know how to phrase it in a way that google will understand. I'm trying to learn Python, and i've installed it on my machine. However, when i just type "python" in cmd.exe, the python app is not found/launched. I have to manually go to the directory in which python.e...
Can I use uwsgi + (tornado, gevent, etc) at the same time?
15,225,962
2
3
1,970
0
python,django,tornado,uwsgi
uWSGI+gevent is a solid combo, while there is currently no-way to run uWSGI with the tornado api (and as uWSGI dropped support in 1.9 for callback based approach, i think that we will never see that combo working). The problem you need to solve before starting working with gevent, is ensuring that all of your pieces ar...
0
1
0
0
2013-03-05T13:43:00.000
2
0.197375
false
15,225,320
0
0
1
2
why? because I have a django project that capture data from user and consume many webservices displaying the results to the user in order to compare information, something like aggregators websites who search flights tickets via airlines webservices and show the result in real time in order to compare tickets. nowaday ...
Can I use uwsgi + (tornado, gevent, etc) at the same time?
45,253,612
0
3
1,970
0
python,django,tornado,uwsgi
I don't know about uWSGI+gevent, but you can use tornado with uWSGI. Tornado basically gives you an inbuilt WSGI support in tornado.wsgi.WSGIContainer module to make it compactable with other WSGI servers like uWSGI and gunicorn.But it depends on your use and I think it's not a good idea to use an Asynchronous framewor...
0
1
0
0
2013-03-05T13:43:00.000
2
0
false
15,225,320
0
0
1
2
why? because I have a django project that capture data from user and consume many webservices displaying the results to the user in order to compare information, something like aggregators websites who search flights tickets via airlines webservices and show the result in real time in order to compare tickets. nowaday ...
Python script will not run in Task Scheduler for "Run whether use is logged on or not"
15,235,210
0
0
2,604
0
python,automation,task,scheduler
I would try it with the script not in your Users directory
0
1
0
0
2013-03-05T22:06:00.000
3
0
false
15,235,085
0
0
0
1
I have written a python script and wanted to have it run at a set period everyday with the use of Task Scheduler. I have had no problems with Task Scheduler for running programs while logged off, before creating this task. If I select "Run only when user is logged on" my script runs as expected with the desired result ...
Invoking scons from a Python script
15,252,510
3
8
2,664
0
python,scons
Well, I guess it's possible in theory. The scons executable itself is just a python script and all it does is execute SCons.Script.main() after modifying the sys.path variable. But you would probably have to start digging deep into the source to really understand how to make it do things you want. A much cleaner soluti...
0
1
0
0
2013-03-06T14:53:00.000
3
0.197375
false
15,250,538
0
0
0
2
I'm new to scons and Python. I was wondering if there's a way to invoke scons from within a python script. My python script accepts from the user, a list of directories where the code to be compiled together is located (in addition to doing some other non-trivial things). It also generates a string which is to be used...
Invoking scons from a Python script
15,271,954
1
8
2,664
0
python,scons
Thanks for the answers. I ended up using this method: The python script writes a list of options into a text file, closes it, and invokes scons -f MySConscript_file using a subprocess call. The SConstruct reads values from the text file into a list, and uses them.
0
1
0
0
2013-03-06T14:53:00.000
3
0.066568
false
15,250,538
0
0
0
2
I'm new to scons and Python. I was wondering if there's a way to invoke scons from within a python script. My python script accepts from the user, a list of directories where the code to be compiled together is located (in addition to doing some other non-trivial things). It also generates a string which is to be used...
standard way to handle user session in tornado
15,265,556
14
14
14,722
1
python,tornado
Tornado designed to be stateless and don't have session support out of the box. Use secure cookies to store sensitive information like user_id. Use standard cookies to store not critical information. For storing large objects - use standard scheme - MySQL + memcache.
0
1
0
0
2013-03-06T17:55:00.000
4
1.2
true
15,254,538
0
0
1
3
So, in order to avoid the "no one best answer" problem, I'm going to ask, not for the best way, but the standard or most common way to handle sessions when using the Tornado framework. That is, if we're not using 3rd party authentication (OAuth, etc.), but rather we have want to have our own Users table with secure co...
standard way to handle user session in tornado
16,320,593
17
14
14,722
1
python,tornado
Here's how it seems other micro frameworks handle sessions (CherryPy, Flask for example): Create a table holding session_id and whatever other fields you'll want to track on a per session basis. Some frameworks will allow you to just store this info in a file on a per user basis, or will just store things directly in ...
0
1
0
0
2013-03-06T17:55:00.000
4
1
false
15,254,538
0
0
1
3
So, in order to avoid the "no one best answer" problem, I'm going to ask, not for the best way, but the standard or most common way to handle sessions when using the Tornado framework. That is, if we're not using 3rd party authentication (OAuth, etc.), but rather we have want to have our own Users table with secure co...
standard way to handle user session in tornado
16,346,968
4
14
14,722
1
python,tornado
The key issue with sessions is not where to store them, is to how to expire them intelligently. Regardless of where sessions are stored, as long as the number of stored sessions is reasonable (i.e. only active sessions plus some surplus are stored), all this data is going to fit in RAM and be served fast. If there is a...
0
1
0
0
2013-03-06T17:55:00.000
4
0.197375
false
15,254,538
0
0
1
3
So, in order to avoid the "no one best answer" problem, I'm going to ask, not for the best way, but the standard or most common way to handle sessions when using the Tornado framework. That is, if we're not using 3rd party authentication (OAuth, etc.), but rather we have want to have our own Users table with secure co...
glibc detected *** free(): invalid pointer: Python c++ and Swig
15,264,849
1
1
2,165
0
c++,python,swig
I finally figured out! I executed the command ulimit -c unlimited After this i see a core dump, now i can analyse it via gdb /usr/bin/python2.3 core.31685
0
1
0
0
2013-03-06T19:14:00.000
2
0.099668
false
15,255,989
0
0
0
1
I have to run some unit tests which are written in Python. We have the code to test in c++, so I compiled it into a shared object and using swig providing an interface for the python scripts to call into the necessary api's to test. Now when i run one of the python scripts (it is obviously accessing the c++ codebase wh...
How to make Jython work with PIG?
20,953,873
0
2
432
0
python,jython,apache-pig
From my short experience in Pig there are two ways of doing this: you can either place the jar in your Pig's lib folder, somewhere about /usr/share/pig/lib/, or register the jar using its specific location from grunt (Pig shell), using: REGISTER /path/to/your/jar/jython.jar; Once available, register your UDF from grunt...
0
1
0
0
2013-03-06T22:37:00.000
1
0
false
15,259,499
0
0
1
1
I have jython jar and Pig installed on the server. Have Pig jars as well. Can someone help me out with the proper steps to bundle them so that I can use my Python UDFs ? Thanks
Controlling the distribution of tests with py.test xdist
25,073,350
0
3
1,185
0
python,testing,nose,pytest
I am not sure if this would help. But if you know ahead of time how you want to divide up your tests, instead of having pytest distribute your tests, you could use your continuous integration server to call a different run of pytest for each different machine. Using -k or -m to select a subset of tests, or simply speci...
0
1
0
1
2013-03-06T23:45:00.000
1
0
false
15,260,422
0
0
0
1
I have several thousand tests that I want to run in parallel. The tests are all compiled binaries that give a return code of 0 or non-zero (on failure). Some unknown subsets of them try to use the same resources (files, ports, etc). Each test assumes that it is running independently and just reports a failure if a reso...
Python stdin filename
15,261,083
0
8
7,109
0
python,filenames,stdin
I don't think it's possible. As far as your python script is concerned it's writing to stdout. The fact that you are capturing what is written to stdout and writing it to file in your shell has nothing to do with the python script.
0
1
0
0
2013-03-07T00:27:00.000
4
0
false
15,260,888
1
0
0
1
I'm trying to get the filename thats given in the command line. For example: python3 ritwc.py < DarkAndStormyNight.txt I'm trying to get DarkAndStormyNight.txt When I try fileinput.filename() I get back same with sys.stdin. Is this possible? I'm not looking for sys.argv[0] which returns the current script name. Tha...
Calling Python script from JAVA MySQLdb imports
15,318,731
0
3
534
0
java,python,jakarta-ee
So, I discovered that the issue was with the arguments that I was passing in Java to run the python program. The first argument was - python 2.6 but it should have rather been just python not some version number because there was compatibility issue with MySQLdB and python. I finally decided to use MySQL Python connect...
0
1
0
1
2013-03-07T05:33:00.000
1
1.2
true
15,263,854
0
0
1
1
I am calling a Python script from my Java code. This is the code : import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class JavaRunCommand { public static void main(String args[]) throws IOException { // set up the command and parameter String pyt...
Does Heroku no longer support Celery?
15,734,662
3
13
6,436
0
python,heroku,celery,amqp
I think there are issues with Celery as a background task on Heroku. We tried to create such tasks and they take all memory after running for about 20 minutes, even with DEBUG=False on Redis or RabbitMQ. Worse still, the memory is NEVER released: every time we have to restart the worker. The same code runs flawlessly ...
0
1
0
0
2013-03-07T07:21:00.000
5
0.119427
false
15,265,319
0
0
1
1
I was finally getting to the point where I had some free time and wanted to add Celery to my Python/Flask project on Heroku. However, almost all mentions of Celery from the Heroku docs are gone. There used to be article with a tutotial in the "Getting started with Django", but it's gone. Will "just doing it" myself wor...
gtk allow background processes
15,276,223
0
0
159
0
python,gtk
If your program has a Gtk UI then the program is supposed to be driven by the GTK main loop. You may be able to run a gtk main loop in a secondary thread, but that it not really a supported configuration and you may run into many more problems
1
1
0
0
2013-03-07T12:58:00.000
1
0
false
15,271,870
0
0
0
1
I'm creating a program in python, and use GTK for part of it. Whenever GTK opens, it causes the whole program to stop responding, and not move on to the next process. Ideally, i would like it if the gtk window opened independently to the rest of the program, since the GTK window is just to display information, and the ...
How to invoke a specific Python version WITHIN a script.py -- Windows
15,279,856
0
8
7,048
0
python,windows,python-2.7
There is not "shebang" notation on Windows. You'll need to change the file association for .py files to use your 2.7.2 installation ("Open With", "Use application as default").
0
1
0
0
2013-03-07T19:15:00.000
3
0
false
15,279,793
1
0
0
1
What line of text should I place at the top of a script.py to invoke the specific version of Python that I need to use? I have two versions of Python on Windows XP, 2.6.5 and 2.7.2. They each have their own special modules and were installed by separate applications. My scripts are placed on the desktop so that I can...
How to distribute my Python/shell script?
15,283,656
1
5
894
0
python,bash,shell
chmod +x cmd.py then they can type ./cmd.py they can also use it piped. I would add that unix users would probably already know how to make a file executable and run it, so all you'd have to do is make the file available to them. Do make sure they know what version(s) of python they need to run your script.
0
1
0
1
2013-03-07T22:59:00.000
2
0.099668
false
15,283,483
0
0
0
1
I have written a very simple command line utility for myself. The setup consists of: A single .py file containing the application/source. A single executable (chmod +x) shell script which runs the python script. A line in my .bash_profile which aliases my command like so: alias cmd='. shellscript' (So it runs in the s...
How bottle return binary files
15,287,095
1
5
5,164
0
python,nginx,uwsgi,bottle
If you are not in a hurry i suggest you to try uWSGI 1.9 (it is still in development but the first stable release will be in 10 days) and use offload-threads = n (set it to the number of cpus). In that way when you send a file from your app it will be asynced (and non blocking) served by a different thread, suddenly fr...
0
1
0
0
2013-03-07T23:48:00.000
2
0.099668
false
15,284,154
0
0
0
1
I want to make bottle python web service to serve binary files like pdf, picture and exe with authentication. Is it possible to serve all this files using bottle? I have hard time finding a tutorial for that. How about the performance? Does bottle python handle hundreds of thousands downloads simultaneously? I am plann...
Installed Python from Package, Terminal didn't update?
56,398,790
0
2
2,274
0
python
You have few options In your bash ~/.bash_profile add alias python='python3' Instead of using python command use python3 instead. Install python3 via homebrew
0
1
0
0
2013-03-08T00:08:00.000
3
0
false
15,284,381
1
0
0
1
Terminal is still showing Python 2.7.2 after an install of 3.3.0 I'm new to python- just want to get a good development environment working on Mac 10.8.
Hyde static page site generator - issue with running hyde command from command line
15,325,334
0
0
203
0
python,pip,hyde
I need to have /usr/local/share/python in my PATH.
0
1
0
0
2013-03-08T02:15:00.000
1
0
false
15,285,564
0
0
0
1
I installed Hyde with pip. I can see hyde in /usr/local/share/python. But when I am running hyde from command line, I am getting "Bash - Command not found error". I am on Mac OSX (ML) and python 2.7.3 Please help.
Quick writing to log file after http request
15,291,684
1
0
457
0
php,python,performance,logging
One possible option what I can think of is a separate logging process. So that your web.py can be shielded for performance issue. This is classical way of handling logging module. You can use IPC or any other bus communication infrastructure. With this you will be able to address two issues - Logging will not be a ...
0
1
0
0
2013-03-08T10:01:00.000
1
0.197375
false
15,291,294
0
0
1
1
I currently finished building a Web server who's main responsibility is to simply take the contents of the body data in each http post request and write it to a log file. The contents of the post data is obfuscated when received. So i'm un obfuscating the post data and writing it to a log file on the server. The conten...
When to transition from Datastore to NDB?
15,311,815
0
1
151
0
google-app-engine,python-2.7,google-cloud-datastore,gql
To add to Dan's correct answer, remember ndb and the older db are just APIs so you can seamlessly begin switching to ndb without worrying about schema changes etc.. You're question asks about switching from datastore to NDB, but you're not switching from the datastore as NDB still uses the datastore. Make sense?
0
1
0
0
2013-03-08T17:35:00.000
2
0
false
15,299,975
0
0
1
1
From what I have heard, it is better to move to NDB from Datastore. I would be doing that eventually since I hope my website will be performance intensive. The question is when. My project is in its early stages. Is it better to start in NDB itself? Does NDB take care of Memcache also. So I don't need to have an expli...
In homebrew how do I change the python3 symlink to only "python"
15,304,867
8
13
11,485
0
python,symlink,homebrew
You definitely do not want to do this! You may only care about Python 3, but many people write code that expects python to symlink to Python 2. Changing this can seriously mess your system up.
0
1
0
0
2013-03-08T23:01:00.000
5
1
false
15,304,785
0
0
0
2
I want to install python using homebrew and I noticed there are 2 different formulas for it, one for python 2.x and another for 3.x. The first symlinks "python" and the other uses "python3". so I ran brew install python3. I really only care about using python 3 so I would like the default command to be "python" instea...
In homebrew how do I change the python3 symlink to only "python"
42,743,923
1
13
11,485
0
python,symlink,homebrew
As mentioned this is not the best idea. However, the simplest thing to do when necessary is run python3 in terminal. If you need to run something for python3 then run python3
0
1
0
0
2013-03-08T23:01:00.000
5
0.039979
false
15,304,785
0
0
0
2
I want to install python using homebrew and I noticed there are 2 different formulas for it, one for python 2.x and another for 3.x. The first symlinks "python" and the other uses "python3". so I ran brew install python3. I really only care about using python 3 so I would like the default command to be "python" instea...
Default working directory for Python IDLE?
49,071,459
0
11
37,378
0
python,python-idle
Here's a way to reset IDLE's default working directory for MacOS if you launch Idle as an application by double-clicking it. You need a different solution if you launch Idle from a command line in Terminal. This solution is a permanent fix. You don't have to rechange the directory everytime you launch IDLE. I wish ...
0
1
0
0
2013-03-12T17:11:00.000
9
0
false
15,367,688
0
0
0
3
Is there a configuration file where I can set its default working directory? It currently defaults to my home directory, but I want to set it to another directory when it starts. I know I can do "import os" followed by "os.chdir("")" but that's kind of troublesome. It'd be great if there is a conf file that I can edit ...
Default working directory for Python IDLE?
54,316,970
-1
11
37,378
0
python,python-idle
This ought to be the number one answer. I have been playing around this for an hour or more and nothing worked. Paul explains this perfectly. It's just like the PATH statement in Windows. I successfully imported a module by appending my personal "PythonModules" path/dir on my Mac (starting at "/users/etc") using a ...
0
1
0
0
2013-03-12T17:11:00.000
9
-0.022219
false
15,367,688
0
0
0
3
Is there a configuration file where I can set its default working directory? It currently defaults to my home directory, but I want to set it to another directory when it starts. I know I can do "import os" followed by "os.chdir("")" but that's kind of troublesome. It'd be great if there is a conf file that I can edit ...
Default working directory for Python IDLE?
15,367,752
0
11
37,378
0
python,python-idle
It can change depending on where you installed Python. Open up IDLE, import os, then call os.getcwd() and that should tell you exactly where your IDLE is working on.
0
1
0
0
2013-03-12T17:11:00.000
9
0
false
15,367,688
0
0
0
3
Is there a configuration file where I can set its default working directory? It currently defaults to my home directory, but I want to set it to another directory when it starts. I know I can do "import os" followed by "os.chdir("")" but that's kind of troublesome. It'd be great if there is a conf file that I can edit ...
Embedded scripting language with C/C++ API for multithreading environment
15,369,077
7
0
338
0
c++,python,c,scripting,lua
Reconsider Lua: Yes. Yes. Lua does not create any OS threads at all. Garbage collection does not start until you've created lots of objects. You can simply turn it off. To destroy all variables once the script is executed, simply close the state. Yes. Yes.
0
1
0
0
2013-03-12T17:45:00.000
1
1
false
15,368,366
1
0
0
1
I'm looking for an embedded scripting language. I don't need anything fancy, just basic constructs like conditionals, loops, logic and arithmetic operations etc. I have the following requirements Thread friendly - i.e. without "global interpreter lock" (python is out for this reason) Cheap "interpreter instance" crea...
Is it possible to get output from windows application through wine?
16,091,620
1
4
172
0
python,winapi,wine
So you're controlling a Windows downloader running in Wine. Is this downloader graphical? Is this icon in a window or what? Assuming yes to both: If your Python application is running natively in *nix (not Wine), the only sure way is to take a screenshot around the cursor and use Optical Character Recognition to recog...
0
1
0
0
2013-03-13T04:27:00.000
1
1.2
true
15,377,078
0
0
0
1
I'm writing a python GUI for a downloader in windows. Currently I can wine that application in some way to download things from the website. I want to write a GUI which calls the downloader so that it's easier for myself to use it. So one important thing for my GUI is to display the progress. When the downloader is ru...
OAuth to authenticate my app and allow it to access data at Google App Engine
15,399,334
0
2
556
0
python,google-app-engine,rest,mobile,oauth
I see you say you're not using Endpoints, but not why. It's likely the solution you want, as it's designed precisely for same-party (i.e. you own the backend and the client application) use cases, which is exactly what you've described.
0
1
0
0
2013-03-13T10:02:00.000
2
1.2
true
15,382,094
0
0
1
1
I have a web server at Google App Engine and I want to protect my data. My mobile app will access the server to get this data. The idea is with OAuth authenticate my app, when it requests some data via REST. After the first authentication, the app will always be able to access the content. I don't want user's data, as ...
Windows "open with" python py2exe application
15,393,682
1
0
262
0
python,python-2.7,py2exe
Yep, the path to the file gets passed in as an argument and can be accessed via sys.argv[1].
0
1
0
0
2013-03-13T18:10:00.000
2
0.099668
false
15,393,202
1
0
0
1
I wonder how the Windows "Open file with..." feature works. Or rather, how would do if I write a program in python, compile a executable with py2exe and then want to be able to open certain files in that program by right-clicking and choose it in "Open with". Is the file simply passed as an argument, like "CMD>C:/myapp...
How to make your own commands
15,393,788
1
1
240
0
python,linux
add the program to your /bin directory - it's where linux will search for the command
0
1
0
0
2013-03-13T18:32:00.000
2
0.099668
false
15,393,622
0
0
0
1
I am new to linux. I made a python script that takes two input Input 1> directory path ex:- ~/home/user/apps Input 2> file path File contains pattern in each line And the output of script is all the file that matches the pattern and are in directory or in subdirectories of input directory path. Now using this python...
How to run a Python script from IDLE command line?
61,899,486
1
5
16,394
0
python,python-idle
If what you meant is executing in the Python IDLE's interactive shell instead of command prompt or command line, then I usually use this approach: python -m idlelib.idle -r "C:/dir1/dir2/Your script.py" It works well with me. Tested on my Windows 10, python 3.7.3. Please ensure that you have added your desired python ...
0
1
0
0
2013-03-14T01:10:00.000
3
0.066568
false
15,399,444
1
0
0
1
In a bash shell, I can use 'bash ' or 'source ' to invoke a script by hand. Can I do the similar thing in the Python IDLE's interactive shell? I know I can go to File >> Open Module, then run it in a separate window, but that's troublesome.
Python: get MAC address of default gateway
15,407,559
2
3
5,009
0
python,linux,ip,mac-address,arp
You can read from /proc/net/arp and parse the content, that will give you couples of known IP-MAC addresses. The gateway is probably known at all times, if not you should ping it, and an ARP request will be automatically generated. You can find the default gw in /proc/net/route
0
1
1
0
2013-03-14T10:59:00.000
3
0.132549
false
15,407,354
0
0
0
2
Is there any quick way in Python to get the MAC address of the default gateway? I can't make any ARP requests from the Linux machine I'm running my code on, so it has to come directly from the ARP table.
Python: get MAC address of default gateway
15,407,512
2
3
5,009
0
python,linux,ip,mac-address,arp
Are you using Linux? You could parse the /proc/net/arp file. It contains the HW address of your gateway.
0
1
1
0
2013-03-14T10:59:00.000
3
0.132549
false
15,407,354
0
0
0
2
Is there any quick way in Python to get the MAC address of the default gateway? I can't make any ARP requests from the Linux machine I'm running my code on, so it has to come directly from the ARP table.
Persistent in-memory Python object for nginx/uwsgi server
45,383,617
1
8
4,976
0
python,optimization,nginx,redis,uwsgi
"python in-memory data will NOT be persisted across all requests to my knowledge, unless I'm terribly mistaken." you are mistaken. the whole point of using uwsgi over, say, the CGI mechanism is to persist data across threads and save the overhead of initialization for each call. you must set processes = 1 in your .ini ...
0
1
0
1
2013-03-15T23:31:00.000
4
0.049958
false
15,443,732
0
0
1
2
I doubt this is even possible, but here is the problem and proposed solution (the feasibility of the proposed solution is the object of this question): I have some "global data" that needs to be available for all requests. I'm persisting this data to Riak and using Redis as a caching layer for access speed (for now....
Persistent in-memory Python object for nginx/uwsgi server
45,384,113
1
8
4,976
0
python,optimization,nginx,redis,uwsgi
You said nothing about writing this data back, is it static? In this case, the solution is every simple, and I have no clue what is up with all the "it's not feasible" responses. Uwsgi workers are always-running applications. So data absolutely gets persisted between requests. All you need to do is store stuff in a glo...
0
1
0
1
2013-03-15T23:31:00.000
4
0.049958
false
15,443,732
0
0
1
2
I doubt this is even possible, but here is the problem and proposed solution (the feasibility of the proposed solution is the object of this question): I have some "global data" that needs to be available for all requests. I'm persisting this data to Riak and using Redis as a caching layer for access speed (for now....
Is it possible to create Python-based Application in Xcode or equivalent?
15,469,982
0
3
3,884
0
python,xcode,interface
Open Automator Choose "Application" Drag a "Run Shell Script" onto the workflow panel Choose "/usr/bin/python" as the shell. Paste in your script, and select Pass Input: "to stdin" Or, choose bash as the shell, and simply have the automator script run your Python script with Pass Input "as arguments" selected on the to...
1
1
0
0
2013-03-18T04:31:00.000
3
1.2
true
15,469,799
0
0
0
1
So I have a lot of python scripts that I have written for my work but no one in my lab knows how to use Python so I wanted to be able to generate a simple Mac App where you can 'Browse' for a file on your computer and type in the name of the file that you want to save . . . everything else will be processed by the appl...
Message queue with random read\write access to queue elements before dequeing (rabbitmq or)
15,501,068
0
0
875
0
python,rabbitmq,amqp
What you're describing sounds like a pretty typical middleware pipeline. While that achieves the same effect of modifying messages before they are delivered to their intended consumer, it doesn't work by accessing queues. The basic idea is that all messages first go into a special queue where they are delivered to t...
0
1
0
0
2013-03-18T19:06:00.000
1
0
false
15,484,850
0
0
0
1
I use rabbitmq in Python via amqplib. I try to use AMQP for something more than just a queue, if that's possible - searching messages by ID, modifying them before dequeing, deleting from queue before dequeing. Those things are used to store/update a real users queue for a balancer, and that queue could be updated async...
Build package for OSX when on Windows (Python 3.3, tkinter)
15,486,937
0
0
98
0
python
I am pretty sure OSX build tools (XCode et. al.) exist only on Apple platforms and there is no business rationale why Apple would have ported them to Windows. So the probable answer is "buy Mac".
0
1
0
0
2013-03-18T19:47:00.000
1
0
false
15,485,567
1
0
0
1
Given that the code has been written indepdently of platform, how do I build a package for MAC OS when I am on Windows and the package has been successfully built there? I can use python setup.py bdist_msi on windows, but not python setup.py bdist_dmg, since I am not on MAC. What to do about that? Python 3.3, tkinter, ...
How to run python in different directory?
15,487,877
1
2
1,363
0
python,linux
Do /aaa/python2.5 python_code.py. If you use Python 2.5 more often, consider changing the $PATH variable to make Python 2.5 the default.
0
1
0
1
2013-03-18T22:06:00.000
3
0.066568
false
15,487,848
1
0
0
1
I am doing maintenance for a python code. Python is installed in /usr/bin, the code installed in /aaa, a python 2.5 installed under /aaa/python2.5. Each time I run Python, it use /usr/bin one. How to make it run /aaa/python2.5? Also when I run Python -v; import bbb; bbb.__file__; it will automatically show it use bbb ...
Pymodbus (Serial) over a tcp serial connection
15,494,099
0
0
1,866
0
python,serial-port,tty,modbus
There is no straightforward solution to trick your linux server into thinking that a MODBUS RTU is actually of MODBUS TCP connection. In all cases, your modem will have to transfer data from TCP to serial (and the other way around). So I assume that: 1) somehow you can program your modem and instruct it to do whatever ...
0
1
0
1
2013-03-19T00:20:00.000
2
0
false
15,489,371
0
0
0
2
I will be creating a connection between my Linux server and a cellular modem where the modem will act as a server for serial over TCP. The modem itself is connected to a modbus device (industrial protocol) via an RS232 connection. I would like to use pymodbus to facilitate talking to the end modbus device. However, I c...
Pymodbus (Serial) over a tcp serial connection
16,742,894
0
0
1,866
0
python,serial-port,tty,modbus
I actually was working on something similar and decided to make my own Serial/TCP bridge. Using virtual serial ports to handle the communication with each of the modems. I used the minimalmodbus library although I had to modify it a little in order to handle the virtual serial ports. I hope you solved your problem and...
0
1
0
1
2013-03-19T00:20:00.000
2
0
false
15,489,371
0
0
0
2
I will be creating a connection between my Linux server and a cellular modem where the modem will act as a server for serial over TCP. The modem itself is connected to a modbus device (industrial protocol) via an RS232 connection. I would like to use pymodbus to facilitate talking to the end modbus device. However, I c...
Create a fake TTY device from a serial-over TCP connection
15,680,046
1
1
1,308
0
python,serial-port,tty,modbus
if i do understand, you need make a connection of this manner: [pyModbus <-(fake serial)->process]<-(tcp/ip)->[modem<-(serial)->device] I suggest use socat for this
0
1
0
1
2013-03-19T04:07:00.000
1
0.197375
false
15,491,308
0
0
0
1
I have a library (PyModbus) I would like to use that requires a tty device as it will be communicating with a device using serial connection. However, the device I am going to talk to is going to be behind a modem that supports serial over tcp (the device plugs into a com port on the modem). Without the modem in the w...
while downloading app from google app engine its throwing error <400>
15,499,700
0
0
304
0
python,google-app-engine,sdk
@Bharadwaj Please check if the version number you have specified in the command actually exists in the appengine. Also Make sure that you are providing your right appengine credentials.
0
1
0
0
2013-03-19T09:48:00.000
2
0
false
15,496,065
0
0
1
1
my app name is nfcVibe but still i am getting error like below.anyone suggest me to download my app. i think i gave the command correct only. but where it is going wrong that i dont know. C:\Program Files\Google\google_appengine>appcfg.py download_app -A nfcVibe -V 1 "e:\nfcvibe1" 03:11 PM Host: appengine.google.com 0...
File Mod Time Discrepancies On Upload
15,529,123
1
0
77
0
python,unix,python-2.7,unix-timestamp,dropbox-api
The modified time on the Dropbox server isn't necessarily going to be the modified time on the client, but rather the time the file was uploaded to the server. You can use the 'rev' property on files from the /metadata call to keep track of files instead.
0
1
0
1
2013-03-19T20:55:00.000
1
0.197375
false
15,510,254
0
0
0
1
I'm doing a file sync between a client, server and Dropbox (Mac client, Debian server). I'm looking at the mod times of files to determine which is newest. On the client I'm using os.path.getmtime(filePath) to get the modified time. When I check the last modification time of the file on the client and then, after uplo...
how to check the request is https in app engine python
44,672,760
0
1
428
0
google-app-engine,python-2.x
If you are using GAE Flex (where the secure: directive doesn't work), the only way I've found to detect this (to redirect http->https myself) is to check if request.environ['HTTP_X_FORWARDED_PROTO'] == 'https'
0
1
1
0
2013-03-20T04:24:00.000
3
0
false
15,515,299
0
0
1
1
I would like to know if is there a way to validate that a request (say a POST or a GET) was made over https, I need to check this in a webapp2.RequestHandler to invalidate every request that is not sent via https best regards
AppEngine 1.7.6 and Django 1.4.2 release
15,525,796
0
0
154
0
python,django,google-app-engine,python-2.7,django-nonrel
The django library built into GAE is straight up normal django that has an SQL ORM. So you can use this with Cloud SQL but not the HRD. django-nonrel is up to 1.4.5 according to the messages on the newsgroup. The documentation, unfortunately, is sorely behind.
0
1
0
0
2013-03-20T07:33:00.000
2
0
false
15,517,766
0
0
1
1
AppEngine 1.7.6 has promoted Django 1.4.2 to GA. I wonder how and if people this are using The reason for my question is that Django-nonrel seems to be stuck on Django 1.3 and there are no signs of an updated realease. What I would like to use from Djano are controllers, views and especially form validations.