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 to Accept Command Line Arguments With Python Using <
26,496,756
1
0
299
0
python,shell,terminal
< file is handled by the shell: the file doesn't get passed as an argument. Instead it becomes the standard input of your program, i.e., sys.stdin.
0
1
0
0
2014-10-21T21:30:00.000
3
1.2
true
26,496,708
1
0
0
2
Is it possible to run a python script and feed in a file as an argument using <? For example, my script works as intended using the following command python scriptname.py input.txt and the following code stuffFile = open(sys.argv[1], 'r'). However, what I'm looking to do, if possible, is use this command line syntax...
Python windows script subprocess continues to output after script ends
26,500,297
0
0
390
0
python,windows,subprocess
You need to call results.kill() or results.terminate() (they are aliases on Windows) to end your subprocesses before exiting your main script.
0
1
0
0
2014-10-22T04:07:00.000
3
0
false
26,500,184
1
0
0
1
Hi I am writing a python script in windows and using subprocess I have a line like results=subprocess.Popen(['xyz.exe'],stdout=subprocess.PIPE) After the script ends, and I get back to the promp carrot in cmd, I see more output from the script being printed out. I'm seeing stuff like Could Not Find xxx_echo.txt Be...
Adding Python to Windows environmental variables
70,948,379
0
0
1,498
0
python,windows,command-line,environment-variables
One quick solution to those who are still struggling with environment variable setup issue. Just Uninstall the existing python version and reinstall it make sure to enable checkbox as "Add Python 3.10 to PATH to the environment variable.
0
1
0
0
2014-10-22T05:16:00.000
2
0
false
26,500,725
1
0
0
1
I've been using Python for some time now, but I have never been able to properly run it from the Windows command line. The error shown is: C:\Windows\system32>python 'python' is not recognized as an internal or external command, operable program or batch file. I've tried to solve the problem many times. I understa...
Celery: Abort or revoke all tasks in a chord
26,513,120
0
4
3,818
0
python,task,celery,chord
Instead of chording the tasks themselves you may want to consider having the chords tasks that watch the A tasks. What I mean by this is the chord would contain tasks that check the running tasks(A) every so often to see if they are done or revoked. When all of those return successfully the chord with then chain into...
0
1
0
0
2014-10-22T16:24:00.000
2
0
false
26,512,324
0
0
1
1
I use the following setup with a Redis broker and backend: chord([A, A, A, ...])(B) Task A does some checks. It uses AbortableTask as a base and regularly checks the task.is_aborted() flag. Task B notifies the user about the result of the calculation The user has the possibility to abort the A tasks. Unfortunately, w...
PyUSB read multiple frames from bulk transfer with unknown length
26,553,765
1
0
2,500
0
python,python-3.x,usb,pyusb
Solved my own issue. After running my code on a full linux machine, capturing the data and comparing it to the wireshark trace I took on the windows application, I realized the length of the read was not the issue. The results were very similar and the windows app was actually requesting 4096 bytes back instead of 2 or...
0
1
0
1
2014-10-23T21:45:00.000
1
1.2
true
26,538,004
0
0
1
1
So I'm relatively new to USB and PyUSB. I am trying to communicate with a bluetooth device using PyUSB. To initialize it, I need to send a command and read back some data from the device. I do this using dev.write(0x02, msg) and ret = dev.read(0x81, 0x07). I know the command structure and the format of a successful res...
Make Tornado able to handle new requests while waiting response from RPC over RabbitMQ
27,069,239
0
0
199
0
python,asynchronous,rabbitmq,tornado,rpc
Use nginx with embedded perl.. It works like superman.. We are using this for our analytics tool.
0
1
0
0
2014-10-24T19:22:00.000
1
0
false
26,554,857
0
0
1
1
I have web-server listening clients and when someone hit handler server send an RPC message to RabbitMQ and waiting for response while keeping connection. When response from RMQ came server pass it to the client as response to request. All async examples in Tornado docs works with their own http.fetch_async() or someth...
Installation Errors + File Association Errors Python 3.4
26,827,960
0
1
36
0
python,python-2.7,python-3.x,installation
The problem can be fixed by doing a system restore to a point before, then installing again
0
1
0
0
2014-10-26T18:07:00.000
1
1.2
true
26,576,229
1
0
0
1
I uninstalled python 2.7.2 today as i have had both python 2 and 3 on my computer when it is only python 3 i use. After I uninstalled it all of my python files associated with notepad and it would not allow me to change it to python again - No Error Message but just wont register the change. I tried rebooting but that ...
system default python can't use homebrew installed package
26,588,821
2
0
3,822
0
python,pip,package,homebrew
Use the /usr/local/bin/python instead of the system installed python. brew doctor should tell you that /usr/local/bin is not early enough in your path. By putting /usr/local/bin first (or earlier than /usr/bin) in your path, your shell will find homebrew versions of executables before system versions. If you don't want...
0
1
0
0
2014-10-26T18:30:00.000
1
1.2
true
26,576,432
1
0
0
1
I have different versions of python installed on my mac. My system default python is ($ which python) "/Library/Frameworks/Python.framework/Versions/2.7/bin/python". And if I install something with pip command such as pip install numpy, the package will be installed in the system python's site-package "/Library/Framew...
Simple way to communicate between C# app and Python app
26,587,560
0
1
773
0
c#,python,mono,zeromq
You can always open up a TCP or UDP socket and communicate through that.
0
1
0
0
2014-10-27T09:46:00.000
2
0
false
26,584,752
0
0
0
1
I've got a C# app running under Windows and Linux. I would like to implement a way to communicate with it through a Python script. I've already tried using ZeroMQ library, and it was working right when the C# app was running on Windows - I could send/receive messages on both ends. But I failed miserably when I tried t...
Clicking on element in terminal
26,621,902
1
1
155
0
python,linux,terminal
URL support is hard coded in the individual terminal emulator. The terminal may support arbitrary URIs as registered in whichever environment it calls home, so that you can e.g. write a Gnome extension for myapp://something and have it work in gnome-terminal, but this is entirely terminal specific. It's also possible...
0
1
0
0
2014-10-29T02:24:00.000
1
0.197375
false
26,621,818
0
0
0
1
I've noticed that hyperlinks printed in my Debian/Linux terminal are clickable and open the browser when clicked. I was wondering if this could be used for other things or if this was just hard-coded in the terminal for hyperlinks only. Is it possible to print out a line in Python that when clicked will launch another ...
Can't uninstall Python 3.4.2 from Windows 7 after system restore
27,374,542
15
8
14,672
0
python,windows-7,uninstallation,python-3.4,system-restore
Just had this problem and solved it by hitting repair first then uninstall.
0
1
0
0
2014-10-29T11:39:00.000
2
1
false
26,629,379
1
0
0
2
A couple of days after uninstalling Python 3.4.2 I had to carry out a system restore (I'm using Windows 7) due to accidentally installing a bunch of rubbish-ware that was messing with my computer even after installation. This system restore effectively "reinstalled" Python, or rather a broken version of it. I now can't...
Can't uninstall Python 3.4.2 from Windows 7 after system restore
26,629,632
12
8
14,672
0
python,windows-7,uninstallation,python-3.4,system-restore
Just delete the c:\Python3.4\ directory, Reinstall python 3.4 (any sub version, just has to be 3.4), and uninstall that. Python is, for the most part, totally self-contained in the Python3.4 directory. Reinstalling python is only needed so you can get a fresh uninstaller to remove the registry keys installation create...
0
1
0
0
2014-10-29T11:39:00.000
2
1.2
true
26,629,379
1
0
0
2
A couple of days after uninstalling Python 3.4.2 I had to carry out a system restore (I'm using Windows 7) due to accidentally installing a bunch of rubbish-ware that was messing with my computer even after installation. This system restore effectively "reinstalled" Python, or rather a broken version of it. I now can't...
Common celery workers for different clients having different DBs
26,644,301
1
0
412
1
python,django,celery,django-celery
Eventually you will have duplicates. Many people ignore this issue because it is a "low probability", and then are surprised when it hits them. And then a story leaks how someone was logged into another uses Facebook account. If you require them to always be unique then you will have to prefix each ID with something th...
0
1
0
0
2014-10-29T18:06:00.000
1
1.2
true
26,637,631
0
0
1
1
I'm using celery with django and am storing the task results in the DB. I'm considering having a single set of workers reading messages from a single message broker. Now I can have multiple clients submitting celery tasks and each client will have tasks and their results created/stored in a different DB. Even though th...
urllib vs cloud storage (Google App Engine)
26,660,144
0
0
199
0
python,google-app-engine,parsing,google-cloud-storage,urllib
They will likely be very close. the AppEngine cloud storage library uses the URL fetch service, just like urllib. Nonetheless, like any performance tuning, I'd suggest measuring on your own.
0
1
1
0
2014-10-30T12:08:00.000
2
0
false
26,652,617
0
0
1
1
I'm developing an app (with Python and Google App Engine) that requires to load some content (basically text) stored in a bucket inside the Google Cloud Storage. Everything works as expected but I'm trying to optimize the application performance. I have two different options: I can parse the content via the urllib libr...
SGE: How to see the output in real time
26,760,309
0
3
1,042
0
python,linux,sungridengine
Instead of using qsub, use qrsh.
0
1
0
0
2014-10-31T03:13:00.000
1
0
false
26,667,008
0
0
0
1
I am submitting a job(script) to Sun Grid Engine. The job is a python program. It can take many hours to run, but it will periodically write to stdout and stderr to inform me its status (like how many iterations is finished, etc). The problem is that SGE is buffering the output and only writes to file at the end, which...
Stopping a autostarted python program started using crontab
26,667,793
0
0
525
0
python,raspberry-pi,raspbian
You must not add it to the crontab which will start it on a time scheduled base. Instead write an init script or (more simple) add it to /etc/rc.local !
0
1
0
1
2014-10-31T04:53:00.000
1
0
false
26,667,750
0
0
0
1
I am starting a python code once my system (debian based raspberry pi) starts by adding the statement sudo python /path/code.py in crontab -e. On boot up it does start. But I would like to know, how can I stop the thing from running using the command line once it starts up.
choosing language to work on very large text files (up to some terabytes)
26,684,332
3
0
103
0
java,python,bash,awk
As long as you process your file line by line and you assemble some statistics, it doesn't really matter what tool you choose. Java has some advantage in terms of speed, compared to scripting languages, but in the end it will be a difference only by a constant factor. What matters the most is the algorithm that you us...
0
1
0
0
2014-10-31T22:23:00.000
1
1.2
true
26,684,292
1
0
0
1
I am working on a project which uses text files (.txt) for input, reading them line by line but this files can go as large as 1 terabytes. I know some languages/technologies which I used for similar problems, those are Java, Bash, Awk, and Python. But I don't know which one can work with such large file, and what kind ...
Running Python 3 interpreter in PyCharm Community Edition
26,692,407
2
2
4,308
0
python,python-3.x,pycharm
When you go to Settings > Console > Python Console you can choose the standard interpreter for your console. The standard there is the chosen Project Interpreter you select under Settings > Project Interpreter. Don't forget to restart Pycharm. Or you can assign a different interpreter to each project. Go to Settings >...
0
1
0
0
2014-11-01T19:07:00.000
1
1.2
true
26,692,052
1
0
0
1
I am a new PyCharm user who switched from Wing. In Wing, if I configure Wing to use the "Python3" interpreter, the console would also run Python3. However, in PyCharm Community Version, even if I configure the project to use the Python 3.4 interpreter, the console would still use 2.7.5. (The program runs properly with ...
How do I set python environmental variables for Volatility
26,698,001
0
0
1,614
0
python,python-2.7,environment-variables,ubuntu-14.04,volatility
It looks like you added the vol.py to your PATH, which is incorrect. You need to only add the directory to it such as /mydir/volatility/ without the vol.py in it
0
1
0
0
2014-11-02T09:33:00.000
2
0
false
26,697,891
0
0
0
1
I'm trying to setup volatility so I can execute commands regardless of what directory I happen to be in at the time. I'm not sure what I'm doing wrong, I've set the environmental variables with the export command. I've double checked my my ~/.bashrc and even added the directory to /etc/enviroment. Running echo $PATH...
setuptools easy_install mac error
40,178,814
0
3
5,730
0
python,macos,setuptools,easy-install
You can add "sudo" before "python setup.py ..." in the install.sh.
0
1
0
1
2014-11-03T10:27:00.000
5
0
false
26,712,229
0
0
0
3
I'm trying to setup easy_install on my mac. But I'm getting the following error. Installing Setuptools running install Checking .pth file support in /Library/Python/2.7/site-packages/ error: can't create or remove files in install directory The following error occurred while trying to add or remove files in th...
setuptools easy_install mac error
26,712,371
8
3
5,730
0
python,macos,setuptools,easy-install
Try again using sudo python ... to be able to write to '/Library/Python/2.7/site-packages/
0
1
0
1
2014-11-03T10:27:00.000
5
1.2
true
26,712,229
0
0
0
3
I'm trying to setup easy_install on my mac. But I'm getting the following error. Installing Setuptools running install Checking .pth file support in /Library/Python/2.7/site-packages/ error: can't create or remove files in install directory The following error occurred while trying to add or remove files in th...
setuptools easy_install mac error
39,312,073
0
3
5,730
0
python,macos,setuptools,easy-install
Try curl bootstrap.pypa.io/ez_setup.py -o - | sudo python for access related issues.
0
1
0
1
2014-11-03T10:27:00.000
5
0
false
26,712,229
0
0
0
3
I'm trying to setup easy_install on my mac. But I'm getting the following error. Installing Setuptools running install Checking .pth file support in /Library/Python/2.7/site-packages/ error: can't create or remove files in install directory The following error occurred while trying to add or remove files in th...
Django delete superuser
67,849,420
-1
73
57,795
0
python,django
There is no way to delete it from the Terminal (unfortunately), but you can delete it directly. Just log into the admin page, click on the user you want to delete, scroll down to the bottom and press delete.
0
1
0
0
2014-11-03T11:36:00.000
7
-0.028564
false
26,713,443
0
0
1
2
This may be a duplicate, but I couldn't find the question anywhere, so I'll go ahead and ask: Is there a simple way to delete a superuser from the terminal, perhaps analogous to Django's createsuperuser command?
Django delete superuser
62,485,147
4
73
57,795
0
python,django
No need to delete superuser...just create another superuser... You can create another superuser with same name as the previous one. I have forgotten the password of the superuser so I create another superuser with the same name as previously.
0
1
0
0
2014-11-03T11:36:00.000
7
0.113791
false
26,713,443
0
0
1
2
This may be a duplicate, but I couldn't find the question anywhere, so I'll go ahead and ask: Is there a simple way to delete a superuser from the terminal, perhaps analogous to Django's createsuperuser command?
Import Data Efficiently from Datastore to BigQuery every Hour - Python
26,722,516
2
2
541
1
python,google-app-engine,google-bigquery,google-cloud-datastore
There is no full working example (as far as I know), but I believe that the following process could help you : 1- You'd need to add a "last time changed" to your entities, and update it. 2- Every hour you can run a MapReduce job, where your mapper can have a filter to check for last time updated and only pick up those...
0
1
0
0
2014-11-03T20:00:00.000
2
0.197375
false
26,722,127
0
0
1
1
Currently, I'm using Google's 2-step method to backup the datastore and than import it to BigQuery. I also reviewed the code using pipeline. Both methods are not efficient and have high cost since all data is imported everytime. I need only to add the records added from last import. What is the right way of doing it? ...
How to run f2py in macosx
30,111,058
0
1
2,795
0
python,bash
I had a similar problem (installed numpy with pip on macosx, but got f2py not found). In my case f2py was indeed in a location on my $PATH (/Users/username/Library/Python/2.7/bin), but had no execute permissions set. Once that was fixed all was fine.
0
1
0
0
2014-11-04T22:55:00.000
1
0
false
26,746,620
0
0
0
1
Hi I am trying to use f2py in macosx. I have a homebrew python instalation and I have installed numpy using pip. If I write on terminal f2py I get -bash: f2py: command not found but if I write in a python script import numpy.f2pyit works well. How can I solve this problem runing f2py directly from terminal? Thank you!
Call .bat file from anywhere in the directory using python
26,750,103
0
0
120
0
file,python-2.7,batch-file,directory,call
do you mean calling a script without specifying the exact location from commandline? there are two ways: add it to your path (eg: set it in your PATH environment variable) setup an alias/some sort of shortcut in your bashrc/whatever CLI you are using (since you are using windows, one example would be to setup a cmdlet...
0
1
0
0
2014-11-05T04:56:00.000
2
0
false
26,749,980
1
0
0
1
I need to call a .bat file from anywhere in the directory without including the specific directory in the script. You'll just need to specify the name of .bat file you want to call and then run. Is this possible?
python cryptography run-time bindings files in GCS
27,596,094
1
0
35
0
google-cloud-storage,google-api-python-client
Cause the compile errors occurred and could not solve easily, I finally use the previous pyOpenssl to solve this problem.
0
1
0
1
2014-11-05T15:05:00.000
1
0.197375
false
26,760,398
0
0
0
1
I am porting the GCS python client lib. and suffering some problems about dependency. Because I want to use gcs on the NAS without glibc, I got the error at the code: from oauth2client.client import SignedJwtAssertionCredentials the error shows the reason due to lack of gcc I trace the code and it seems to generate cr...
Port unrecognized in DOT file?
49,885,873
1
1
1,514
0
python,dot,pygraphviz
Your example is missing some information (a description of the nodes). Assuming those are somewhere and have just been omitted from your example, maybe the problem is that using node [shape=record] doesn't work with the port HTML attribute. For example, try node [shape=plaintext].
0
1
0
0
2014-11-06T09:13:00.000
2
0.099668
false
26,775,558
0
0
0
1
I am trying to create a PNG from DOT file dot -Tpng -o temp.png and I am getting the below errors: Warning: node s1, port eth2 unrecognized Warning: node s2, port eth2 unrecognized Warning: node s2, port eth3 unrecognized Warning: node s3, port eth2 unrecognized Warning: node s4, port eth4 unrecognized Warning: no...
port usage in the ipython notebook
27,171,998
0
0
327
0
ipython,ipython-notebook
I never did figure out the answer to my question -- why the port matters. However, I found that my ROI widgets had a rookie mistake on the JavaScript side (I'm fairly new to JS programming) that, when fixed, made all the problems go away. Ironically, the puzzle now is why it worked when I was using the default port!
0
1
0
1
2014-11-06T15:56:00.000
1
1.2
true
26,783,752
0
0
0
1
I'm having a problem with running an ipython notebook server. I've written a series of custom ROI (Region Of Interest) widgets for the notebook that allow a user to draw shapes like rectangles and ellipses on an image displayed in the notebook, then send information about the shapes back to python running on the server...
How can I map asynchronous operations to an ordered stream of data and obtain an identically-ordered result?
26,817,585
2
2
58
0
python,stream,twisted,frp
I don't know of any neat tricks that will help you with this. I think you probably just have to implement the re-ordering (or order-maintaining, depending on how you look at it) logic in your Stream.map implementation. If operation i + 1 completes before operation i then Stream.map will probably just have to hold on t...
0
1
0
0
2014-11-06T22:36:00.000
1
1.2
true
26,790,720
1
0
0
1
I'm currently designing an application using the Twisted framework, and I've hit a bit of a roadblock in my planning. Formal Description of the Problem My application has the following constraints: Data arrive in-order, but asynchronously. I cannot know when the next piece of my data will arrive The order in which da...
reactor design pattern in a single thread vs multiple threads
27,050,242
1
2
1,368
0
python,multithreading,twisted,reactor
But it seems that it's now impossible to block the main program, I'm not a Python guy but have done this in the context of Boost. Asio. You're correct—your callbacks need to execute quickly and return control to the main reactor. The idea is to only use asynchronous calls in your callbacks. For example, you wouldn't u...
0
1
0
0
2014-11-09T12:30:00.000
2
0.099668
false
26,828,181
1
0
0
2
I've been reading about the reactor design pattern, specifically in the context of the Python Twisted networking framework. My simple understanding of the reactor design is that there is a single thread that will sit and wait until one or more I/O sources (or file descriptors) become available, and then it will synchro...
reactor design pattern in a single thread vs multiple threads
26,829,543
3
2
1,368
0
python,multithreading,twisted,reactor
What are the pros and cons of this, compared to asynchronously looping through each source as they appear, i.e. launching a separate thread for each source. What you're describing is basically what happens in a multithreaded program that uses blocking I/O APIs. In this case, the "reactor" moves into the kernel and th...
0
1
0
0
2014-11-09T12:30:00.000
2
1.2
true
26,828,181
1
0
0
2
I've been reading about the reactor design pattern, specifically in the context of the Python Twisted networking framework. My simple understanding of the reactor design is that there is a single thread that will sit and wait until one or more I/O sources (or file descriptors) become available, and then it will synchro...
Interaction with a subprocess
26,847,231
1
1
76
0
python,multithreading,subprocess
Maybe this is a silly question, and you've probably done this already, but are you sure simply sending the "\n" to the process won't work? I would say it's likely that selftest.exe doesn't actually read the [ENTER] until it's done. That, of course, depends on how the programs reads the enter. You may also try sending S...
0
1
0
0
2014-11-10T15:27:00.000
1
1.2
true
26,847,130
0
0
0
1
I am trying to automate the running of a program called selftest.exe, which when it is done, asks the user to press [ENTER] to exit. Thus, calling this process through subprocess.Popen does not work, since it hangs forever until the user presses [ENTER], which he never will. Whilst I don't think it would be reasonably ...
How to use threading/multiprocessing to prevent program hanging?
26,870,615
1
1
78
0
python,multiprocessing,pyside
As you are speaking of PySide, I assume you program is a GUI one. In a GUI program all processing must occurs in a worker thread if you want to keep the UI responsive. So yes, the initial script must be start in a thread distinct from main thread (main one is reserved for UI)
0
1
0
0
2014-11-11T17:02:00.000
1
1.2
true
26,870,317
1
0
0
1
I am a bit confused with multiprocessing. I have a video processing script which can be run from the command line or launched from a PySide application using a subprocess call. The script seems to run fine from the command line and basically initializes a pool of workers which each process a separate video file. When ...
Lubuntu with python 2.7.8 and 3.4.2 import rrdtool
27,647,300
0
0
633
0
python,rrdtool
Unfortunately python-rrdtool package from Ubuntu/Debian is a python 2.x package only. So it will work in python 2.7 and not in python 3.4. If you must use rrdtool in python 3.x then you will have to use some alternative python to rrdtool binding. There are several to choose from if you look at pypi.python.org (which yo...
0
1
0
0
2014-11-12T09:45:00.000
1
0
false
26,883,774
0
0
0
1
due to problems when installing rrdtool on windows i decided to switch to Linux to solve many problems. I've installed Lubuntu (that has python 2.7.8 installed by default) and python 3.4.2. Than with packet manager i've installed python-rrdtool. The problem is: from the terminal when i write "python2" and than "import ...
Accessing python generators in parallel using multiprocessing module
26,898,024
8
2
1,768
0
python,parallel-processing,generator
I think you may be trying to solve this problem at the wrong level of abstraction. Python generators are inherently stateful, and thus you can't split a generator across processes without some form of synchronization, and that will kill any performance gains that you might achieve through parallelism. I would recommend...
0
1
0
0
2014-11-12T22:30:00.000
1
1.2
true
26,897,922
0
0
0
1
I have a Python generator which pulls in a pretty huge table from a data warehouse. After pulling in the data, I am processing the data using celery in a distributed manner. After testing I realized the the generator is the bottleneck. It can't produce enough tasks for celery workers to work on. This is when I have dec...
How to send data from raspberry pi to windows server?
26,941,321
0
0
2,420
0
python,mysql,raspberry-pi,windows-server
As long as you know the IP address of the windows machine, you can easily run a server on windows (Apache/MySQL -> PHP). You provide this IP address to the RaspberryPI and it can login and authenticate the same way as on any other server. Basically the WAMP stack will act as an abstraction layer for communication.
0
1
0
1
2014-11-13T11:13:00.000
1
0
false
26,907,588
0
0
0
1
In a project me and students are doing, we want to gather temperature and air humidity information in nodes that sends the data to a raspberry pi. That raspberry pi will then send the data to a mysql database, running on windows platform. Some background information about the project: As a project, we are going to des...
What is the most efficient way to write 3GB of data to datastore?
26,917,183
2
0
102
0
python-2.7,google-app-engine,google-cloud-datastore
If you need to store each row as a separate entity, it does not matter how you create these entities - you can improve the performance by batching your requests, but it won't affect the costs. The costs depend on how many indexed properties you have in each entity. Make sure that you only index the properties that you ...
0
1
0
0
2014-11-13T19:45:00.000
2
0.197375
false
26,917,114
0
1
1
1
I have a 3Gb csv file. I would like to write all of the data to GAE datastore. I have tried reading the file row by row and then posting the data to my app, but I can only create around 1000 new entities before I exceed the free tier and start to incur pretty hefty costs. What is the most efficient / cost effective way...
openshift python mongodb local
26,922,793
0
0
47
1
python,mongodb,openshift,bottle
Yes. You have to run your own Mongodb server locally or port forward and use the OPENSHIFT Mongodb.
0
1
0
0
2014-11-14T01:43:00.000
1
0
false
26,921,629
0
0
0
1
I have a bottle+mongo application running in openshift. when I git-clone the application to my local computer neither the database nor the env-variables get download on my computer --just the python files. Should I have to mimic the mongo part in my local computer to developed locally? Or I missing something here.
How to run Unix commands in python installed on a windows machine?
26,939,339
0
0
1,284
0
python,windows,shell,unix
You have to install Unix Bash for Windows, but not sure if it works correctly ... Better solution is install or virtualize some Linux distribution.
0
1
0
0
2014-11-14T21:22:00.000
2
0
false
26,939,090
0
0
0
1
I tried using some Unix command using the subprocess module on my Python interpreter installed on a windows 7 OS. However, it errors out saying command not found. It does recognize Windows commands though. Can I somehow use Unix commands in here too? Thanks, Vishal
Kivy app works on Windows 7 but not on ubuntu
26,946,523
3
1
268
0
python,ubuntu,kivy
It sounds like your kv file isn't being loaded. Does it have the correct name, and is in the right directory? You can check the output in the terminal to see whether the file is loaded. Edit: One possibility is case sensitivity - windows is not case sensitive, linux generally is. Make sure the kv filename is all lowerc...
1
1
0
0
2014-11-15T05:33:00.000
1
1.2
true
26,942,909
0
0
0
1
I have a kivy app that uses a kv file, main.py, and a py class that handles the database. Everything works fine in windows. When I run linux (ubuntu) I get a black window with the correct title, but there are no widgets in the window. What do I need to do different to run a kivy app, that was put together and runs win...
Why does GAE use classes and self.response.out.write over functions and print?
26,952,993
3
0
733
0
python,google-app-engine,webapp2
Using Methods Each handler class has methods with names like get and post, after the HTTP methods GET and POST etc. Those methods are functions that handle requests. Each request to your server will be routed to a request handler object, which is a new instance of some request handler class. So, a request handler insta...
0
1
0
0
2014-11-15T06:51:00.000
1
0.53705
false
26,943,368
1
0
1
1
I'm a beginner and am wondering why we use self.response.out.write instead of print, and why we use classes, instead of functions, for the request handlers in the first place. Are there any special reasons?
Install OpenCV for python building the source or with apt-get?
26,958,046
5
0
872
0
python,linux,opencv,apt-get
Of course, it's much easier to use the apt-get variant. Some drawbacks are, that you might not get the most recent version hence the apt-get package isn't updated as fast as the sources are. Furthermore you'll have a higher level of control according to modules that are going to be installed and the compile parameters,...
0
1
0
0
2014-11-16T14:15:00.000
1
1.2
true
26,957,894
0
0
0
1
I'm working with OpenCV using Python on Linux. I always installed OpenCV building the the Source with make. As you know there are many guides online which all say pretty much the same things. Now i found some guys which say to install OpenCV using apt-get with the command sudo apt-get install python-opencv Which are ...
Which version of Python did pip or easy_install refer to by default?
26,965,467
2
3
163
0
python,macos,pip,easy-install
There's an easy way around it - use pip2 or pip2.7 or pip-2.7 for Python 2, and pip3 or pip3.4 or pip-3.4 for Python 3. Both version ship with easy_install, but Python 2 does not contain pip by default - you have to install it yourself.
0
1
0
0
2014-11-17T04:17:00.000
2
1.2
true
26,965,450
1
0
0
1
I am a non-programmer who started to learn Python. My Mac OS X Yosemite shipped with Python 2.7.6. I installed Python 3.4.2 too. If I use pip or easy_install in the terminal to install a package, how do I know which Python I installed the package in? It seems Python 3.4.2 shipped with pip and easy_install, but I think ...
Monitor Management Command Execution in Django
26,971,741
0
0
142
0
python,django
You could create a file named "i_am_running.log" at the beginning of your management command and remove it at the end if it. When running same management command, check for its' presence. In case of no exist - go further. Otherwise - abort.
0
1
0
0
2014-11-17T06:15:00.000
2
0
false
26,966,645
0
0
1
1
I'm writing a Django app that uses a management command to pull data from various sources. The plan is to run this command hourly with cron, and also have it run on user command from a view (i.e. when they add a new item that needs data, I don't want them to wait for the next hour to roll around to see results). The qu...
IPython notebook fails to open any notebook
27,033,546
0
0
208
0
ipython,ipython-notebook
Thanks for your comment. I just tried to google "oleshell dll" and found this file is not related to ipython and windows. The ipython works again after I've renamed this file.
0
1
0
0
2014-11-19T07:43:00.000
1
0
false
27,011,508
1
0
0
1
I was using ipython notebook (packages in Anaconda-2.1.0 or Canopy-1.4.1) in "Windows Server 2008 R2 Enterprise" with browser (latest version of chrome or firefox). It was working perfectly. Once another user has started ipython notebook in his account. At first, his ipython notebook was failed to run any notebook. The...
Windows - Executing an executable (.exe) without the .exe extension
27,017,888
2
1
1,498
0
python,windows
I cannot imagine a valid reason to break Windows philosophy. Microsoft always said that on its system the file extension determined the type of file and its usage. There are already many cross platfomr programs, for example firefox in named firefox on Unix-like systems and firefox.exe on Windows system. EDIT That being...
0
1
0
0
2014-11-19T12:29:00.000
2
0.197375
false
27,016,867
1
0
0
1
I need to be able to execute a .exe file in Python that has been renamed without the file extension (for example, let's say .joe - it doesn't represent anything that I know of). Let's say I have "HelloWorld.exe", I then rename it to "HelloWorld.joe" and need to execute it. Looking around, os.system is often used to exe...
applying the same command to multiple files in multiple subdirectories
27,021,713
2
0
115
0
python,bash,fastq
You can try find . -name "*.fastq" | xargs your_bash_script.sh, which use find to get all the files and apply your script to each one of them.
0
1
0
0
2014-11-19T16:14:00.000
2
0.197375
false
27,021,617
1
0
0
1
I have a directory with 94 subdirectories, each containing one or two files *.fastq. I need to apply the same python command to each of these files and produce a new file qc_*.fastq. I know how to apply a bash script individually to each file, but I'm wondering if there is a way to write a bash script to apply the comm...
Unable to run Jug in windows
27,031,081
0
0
136
0
python,multiprocessing
I figured it out myself. It is related to python's relative import.
0
1
0
0
2014-11-19T20:24:00.000
1
0
false
27,026,298
1
0
0
1
I want to use Jug for parallel processing. I have a Canopy installed and I also installed Jug using command pip install jug according to the documentation online. In order to find where jug is installed, I installed jug again using the same command as above, it showed me: Requirement already satisfied (use --upgrade t...
PyDev not appearing in Eclipse after install
27,035,599
0
3
7,516
0
python,eclipse
Had this same problem a few days ago. You might have downloaded the wrong version of PyDev for your python version (2.7.5 or something is my python version, but I downloaded PyDev for version 3.x.x) 1) Uninstall your current version PyDev 2) you have to install the correct version by using the "Install New Software", ...
0
1
0
0
2014-11-20T08:11:00.000
3
0
false
27,034,666
1
0
1
1
I have Java version 7 and had installed PyDev version 3.9 from Eclipse Marketplace..but it's not showing up in New project or in Windows perspective in Eclipse..Can some one please tell me what i need to do ???
How to set sys.argv in a boost::python plugin
27,047,900
2
3
795
0
python,command-line-arguments,boost-python
Prior to your call to exec_file() (but after Py_Initialize(), you should invoke PySys_SetArgv(argc, argv); giving it the int argc and const char *argv[] from your program's main().
0
1
0
1
2014-11-20T19:05:00.000
1
1.2
true
27,047,518
0
0
0
1
I use boost::python to integrate Python into a C++ program. Now I would like that the Python program that is executed via boost::python::exec_file() can obtain the command line arguments of my C++ program via sys.argv. Is this possible?
Sudo does not find new python version
27,052,957
7
4
9,548
0
python,linux
How about export PATH+=:/usr/local/bin, try it, maybe helpful.
0
1
0
0
2014-11-21T00:20:00.000
3
1.2
true
27,052,140
1
0
0
2
I had python2.6 on my linux box but installed python3.4 to use new modules. I installed it using sudo access. The new version was installed in /usr/local/bin. Without root access, I can use the new python3.4, both by just using python3.4 in the command line or using the shebang in the .py file #!/usr/local/bin/python3 ...
Sudo does not find new python version
27,052,211
2
4
9,548
0
python,linux
Well you could have given the location to install Py 3.4 to be in /usr/bin. An easy approach could be to copy the Py 3.4 bin to /usr/bin from /usr/local/bin. Secondly You can also install again with the prefix params.
0
1
0
0
2014-11-21T00:20:00.000
3
0.132549
false
27,052,140
1
0
0
2
I had python2.6 on my linux box but installed python3.4 to use new modules. I installed it using sudo access. The new version was installed in /usr/local/bin. Without root access, I can use the new python3.4, both by just using python3.4 in the command line or using the shebang in the .py file #!/usr/local/bin/python3 ...
How to run PyCharm in Ubuntu - "Run in Terminal" or "Run"?
27,064,195
71
38
153,289
0
python,ubuntu,pycharm
To make it a bit more user-friendly: After you've unpacked it, go into the directory, and run bin/pycharm.sh. Once it opens, it either offers you to create a desktop entry, or if it doesn't, you can ask it to do so by going to the Tools menu and selecting Create Desktop Entry... Then close PyCharm, and in the future y...
0
1
0
0
2014-11-21T14:15:00.000
8
1.2
true
27,063,361
1
0
0
4
When I double-click on pycharm.sh, Ubuntu lets me choose between "Run in Terminal" and "Run". What is the difference between these options?
How to run PyCharm in Ubuntu - "Run in Terminal" or "Run"?
71,020,778
0
38
153,289
0
python,ubuntu,pycharm
I did the edit and added the PATH for my Pycharm in .bashrc but I was still getting the error "pycharm.sh: command not found". After trying several other things the following command resolved the issue which creates a symbolic link. sudo ln -s /snap/pycharm-community/267/bin/pycharm.sh /usr/local/bin/pycharm The first ...
0
1
0
0
2014-11-21T14:15:00.000
8
0
false
27,063,361
1
0
0
4
When I double-click on pycharm.sh, Ubuntu lets me choose between "Run in Terminal" and "Run". What is the difference between these options?
How to run PyCharm in Ubuntu - "Run in Terminal" or "Run"?
52,049,395
12
38
153,289
0
python,ubuntu,pycharm
The question is already answered, Updating answer to add the PyCharm bin directory to $PATH var, so that pycharm editor can be opened from anywhere(path) in terminal. Edit the bashrc file, nano .bashrc Add following line at the end of bashrc file export PATH="<path-to-unpacked-pycharm-installation-directory>/bin:$P...
0
1
0
0
2014-11-21T14:15:00.000
8
1
false
27,063,361
1
0
0
4
When I double-click on pycharm.sh, Ubuntu lets me choose between "Run in Terminal" and "Run". What is the difference between these options?
How to run PyCharm in Ubuntu - "Run in Terminal" or "Run"?
69,640,211
0
38
153,289
0
python,ubuntu,pycharm
Yes just go to terminal cd Downloads ls cd pycharm-community-2021.2.2 (your pycharm version) ls cd bin ls ./pycharm.sh It will open your continued pycharm project
0
1
0
0
2014-11-21T14:15:00.000
8
0
false
27,063,361
1
0
0
4
When I double-click on pycharm.sh, Ubuntu lets me choose between "Run in Terminal" and "Run". What is the difference between these options?
python-dev installation without package management?
36,137,101
1
7
21,320
0
python-2.7
Does python-dev source contain C/C++ code? Yes. It includes lots of header files and a static library for Python. Can I download python-dev source code as a .tar.gz file, for direct compilation on this machine? python-dev is a package. Depending on your operation system you can download a copy of the appropriate f...
0
1
0
1
2014-11-22T00:40:00.000
3
0.066568
false
27,072,734
0
0
0
1
I must install python-dev on my embedded linux machine, which runs python-2.7.2. The linux flavor is custom-built by TimeSys; uname -a gives: Linux hotspot-smc 2.6.32-ts-armv7l-LRI-6.0.0 #1 Mon Jun 25 18:12:45 UTC 2012 armv7l GNU/Linux The platform does not have package management such as 'yum' or 'apt-get', and for va...
Descover IPC interface for undocumented program?
27,088,750
2
2
163
0
python,c++,c,linux,wine
Discovery of IPC interface / IPC mechanisms for undocumented program can involve gathering of lot of information by various means, putting it together and mapping the information. The ipcs command can be used to get the information about all ipc objects. It shall provide information about currently active message que...
0
1
0
0
2014-11-23T07:47:00.000
2
1.2
true
27,086,731
0
0
0
2
I have a program without documentation. I am wondering if there is a way to discover if it has any interface for interprocess communication. Are there any tools that search through an executable to discover such interfaces? I am interested in learning anything about such a program, like if it supports any command line ...
Descover IPC interface for undocumented program?
27,086,912
1
2
163
0
python,c++,c,linux,wine
Some Windows Programs use DCOM for interprocess-communication. There are some few programs to extract this interface from DLL- and EXE-Files. Otherwise you have to disassemble the program, and look at the code directly, which is non-trival. For your last question: Windows programs use a message system to communicate wi...
0
1
0
0
2014-11-23T07:47:00.000
2
0.099668
false
27,086,731
0
0
0
2
I have a program without documentation. I am wondering if there is a way to discover if it has any interface for interprocess communication. Are there any tools that search through an executable to discover such interfaces? I am interested in learning anything about such a program, like if it supports any command line ...
celery: programmatically queue task to a specific queue?
27,100,098
0
0
283
0
python,celery
you should do something like that: sometask.apply_async(args = ['args1','args2'], queue = 'dev')
0
1
0
0
2014-11-24T06:40:00.000
1
1.2
true
27,099,187
0
0
1
1
When I do sometask.async_apply(args=['args1','args2'], kwargs={'queue': 'dev'}) nothing ends up on the queue 'dev'. I'm wondering if I am missing a step somewhere? I have created the queue 'dev' already and it shows up under queues when I check the rabbitmq management.
how to get python 2.7 into the system path on Redhat 6.5 Linux
27,115,695
0
1
18,214
0
python,linux,ipython,redhat
You have your $PATH fine, as you can run python without specifying full path, aka /usr/bin/python. You get 2.6.6 in Ipython directory because it has python executable in it, named, wild guess - python. 2.7.5 is installed system-wide. To call 2.7.5 from the Ipython dir, use full path /usr/bin/python, or whatever which ...
0
1
0
0
2014-11-24T22:41:00.000
4
0
false
27,115,526
1
0
0
2
I have installed (or so I think) python 2.7.5. When I type "Python --version" I get python2.7.5 I've narrowed this down to: When I run "python" in a terminal in my /Home/UsrName/ directory it is version 2.7.5 However when I run "python" in a terminal in /Home/UserName/Downloads/Ipython directory I get 2.6.6 I went in...
how to get python 2.7 into the system path on Redhat 6.5 Linux
27,116,633
0
1
18,214
0
python,linux,ipython,redhat
I think I know what is happening - abarnert pointed out that the cwd (".") may be in your path which is why you get the local python when you're running in that directory. Because the cwd is not normally setup in the global bashrc file (/etc/bashrc) it's probably in your local ~/.bashrc or ~/.bash_profile. So edit thos...
0
1
0
0
2014-11-24T22:41:00.000
4
0
false
27,115,526
1
0
0
2
I have installed (or so I think) python 2.7.5. When I type "Python --version" I get python2.7.5 I've narrowed this down to: When I run "python" in a terminal in my /Home/UsrName/ directory it is version 2.7.5 However when I run "python" in a terminal in /Home/UserName/Downloads/Ipython directory I get 2.6.6 I went in...
Python socket.getdefaulttimeout() is None, but getting "timeout: timed out"
27,116,549
0
1
536
0
sockets,python-2.7,timeout
Not knowing anything more my guess would be that NAT tracking expires due to long inactivity and unfortunately in most cases you won't be able to discover exact timeout value. Workaround would be to introduce some sort of keep alive packets to your protocol if there's such a possibility.
0
1
0
0
2014-11-24T23:49:00.000
1
0
false
27,116,358
0
0
0
1
How can I determine what the numeric timeout value is that is causing the below stack trace? ... File "/usr/lib/python2.7/httplib.py", line 548, in read s = self._safe_read(self.length) File "/usr/lib/python2.7/httplib.py", line 647, in _safe_read chunk = self.fp.read(min(amt, MAXAMOUNT)) File "/usr/lib/p...
Python program needs full path in Notepad++
27,117,505
2
1
510
0
python,file-io,cmd,notepad++
In the properties of the shortcut that you use to start Notepad++, you can change its working directory, to whichever directory you're more accustomed to starting from in Python. You can also begin your python program with the appropriate os.chdir() command.
0
1
0
0
2014-11-25T01:47:00.000
2
0.197375
false
27,117,461
1
0
0
1
Not a major issue but just an annoyance I've come upon while doing class work. I have my Notepad++ set up to run Python code straight from Notepad++ but I've noticed when trying to access files I have to use the full path to the file even given the source text file is in the same folder as the Python program being run....
How to change the console font size in Eclipse-PyDev
55,985,898
1
1
2,839
0
python,eclipse,fonts
Solution: Help > Preferences > General > Appearance > Colors And Fonts > Structed Text Editors > Edit
1
1
0
1
2014-11-25T09:18:00.000
2
0.099668
false
27,122,732
0
0
0
1
I am trying to use the PyDEV console in eclipse for a demonstration of some Python code. For this demonstration I need to resize the default font size used in the PyDev console window. Some googling led me to change the 'General/Appearance/Colors and Fonts/Debug/Console Font', but that didn't work. I tried changing al...
SSH into EC2 Instance created by EBS
27,139,451
1
1
723
0
python,amazon-web-services,ssh,amazon-ec2,amazon-elastic-beanstalk
Hi you have to declare the keypair to use on the web console. Go to elasticbeanstalk > your application > edit configuration > Instances > select keypair Alternatively, this sounds like a hack but you can write a python script file that call for the modules that you installed and throws an error if the module is not ...
0
1
0
1
2014-11-26T00:21:00.000
2
1.2
true
27,139,271
0
0
0
1
I am using python and Amazon EC2 I am trying to progrmamtically SSH into the instance created by the Elastic Beanstalk Worker. While using 'eb init' there is no option to specify the KeyPair to use for the instance and hence I am not able to SSH into it. Reason for me to do this is that I want to check if the dependenc...
nc.traditional -e script.py Not printing anything
27,194,201
0
0
136
0
python,netcat
So, I finally found the solution In the shebang, add the option -u to the interpreter to unbuffer stdin stdout and stderr Shebang line: #!usr/bin/python -u
0
1
0
0
2014-11-27T13:40:00.000
1
1.2
true
27,172,062
0
0
0
1
I am starting a basic netcat server with the command nc.traditional -l -e server.py -p 4567 Problem is when I'm connecting to it (telnet 127.0.0.1 4567), the script starts but nothing gets on screen. I have print instructions on the beginning of the script that are read by the interpreter (I tested that it starts via f...
To run python script in apache spark/Storm
27,195,171
1
0
1,217
0
python,hadoop,apache-spark
First and foremost what are you trying to achieve? What does running on Hadoop technology mean to you? If the goal is to work with a lot of data, this is one thing, if it's to parallelize the algorithm, it's another. My guess is you want both. First thing is: is the algorithm parallelizable? Can it run on multiple piec...
0
1
0
0
2014-11-28T16:35:00.000
1
0.197375
false
27,192,852
0
1
0
1
I am having an algorithm written in python (not hadoop compatible i.e. not mapper.py and reducer.py) and it is running perfectly in local system (not hadoop). My objective is to run this in hadoop. Option 1: Hadoop streaming. But, I need to convert this python script into mapper and reducer. Any other way? Option 2:...
Storing client secrets on Django app on App Engine
27,214,235
0
7
812
0
python,django,google-app-engine
You can hardly hide the secret keys from an attacker that can access your server, since the server needs to know the keys. But you can make it hard for an attacker with low privileges. Obfuscating is generally not considered as a good practice. Your option 5 seems reasonable. Storing the keys in a non-source controlled...
0
1
0
0
2014-11-30T14:06:00.000
2
0
false
27,214,104
0
0
1
2
I have a Django app that uses some secret keys (for example for OAuth2 / JWT authentication). I wonder where is the right place to store these keys. Here are the methods I found so far: Hardcoding: not an option, I don't want my secrets on the source control. Hardcoding + obfuscating: same as #1 - attackers can just r...
Storing client secrets on Django app on App Engine
37,824,536
0
7
812
0
python,django,google-app-engine
A solution I've seen is to store an encrypted copy of the secret configuration in your repository using gpg. Depending on the structure of your team you could encrypt it symmetrically and share the password to decrypt it or encrypt it with the public keys of core members / maintainers. That way your secrets are backed ...
0
1
0
0
2014-11-30T14:06:00.000
2
0
false
27,214,104
0
0
1
2
I have a Django app that uses some secret keys (for example for OAuth2 / JWT authentication). I wonder where is the right place to store these keys. Here are the methods I found so far: Hardcoding: not an option, I don't want my secrets on the source control. Hardcoding + obfuscating: same as #1 - attackers can just r...
How do i pass on control on to different terminal tab using perl?
27,242,918
1
0
134
0
python,perl,ubuntu,automation,perl-module
The main thing to understand is that each tab has a different instance of terminal running, more importantly a different instance of shell (just thought I would mention as it didnt seem like you were clear about that from your choice of words). So "passing control" in such a scenario could most probably entail inter-pr...
0
1
0
1
2014-12-01T10:39:00.000
1
0.197375
false
27,226,551
0
0
0
1
I am trying to automate a scenario in which, I have a terminal window open with multiple tabs open in it. I am able to migrate between the tabs, but my problem is how do i pass control to another terminal tab while i run my perl script in a different tab. Example: I have a terminal open with Tab1,Tab2,Tab3,Tab4 open in...
How can I find out what different versions of Python installed on OSX?
27,246,214
0
0
132
0
python
you can use which python command to find what python you are using. This gives the output as path to symlink, you can find the original python by reading the symlink.
0
1
0
0
2014-12-02T09:27:00.000
3
0
false
27,245,890
1
0
0
1
It looks like there is more than one Python installed on my mac. Modules installed are not recognized by python interpreter (2.7.6) until I add them to PYTHONPATH. Could anyone show me how I can locate all the Pythons installed on my mac? Thank you
Unexpected EOF for https with python requests under nginx
28,087,767
0
0
1,403
0
python-2.7,nginx,python-requests,pyopenssl
Many TLS clients and servers consider it reasonable to abruptly close the TCP connection without finishing the TLS disconnect handshake. They may not do it all the time. It may depend on very specific, esoteric network conditions (eg, how quickly certain sends are executed). When this happens, you get the error you'...
0
1
0
0
2014-12-03T12:26:00.000
1
0
false
27,271,747
0
0
0
1
After installing pyopenssl, ndg-httpsclient and pyasn1 to support SSL with SNI. I get the following error, for certain https urls: (-1, 'Unexpected EOF') only when running under nginx tried: removing the gzip from nginx.
set thread affinity in python and java
27,275,002
0
1
1,814
0
java,python,c++,multithreading,affinity
I'm not sure I understand what you want exactly, but in Java I remember that I could launch multiple JVM and run my java programs on different OS processes, using inter-processes communication (socket, pipe or whatever you want) to do multi-core processing and syncronization. Knowing that, it might be possible to then ...
0
1
0
0
2014-12-03T13:54:00.000
2
0
false
27,273,499
0
0
0
1
When I create a thread with Java or Python I can't find the pid among the operating system threads. In fact get_ident() in Python gives me a very large number that can't be the PID. In fact I need to set the process affinity of all other threads to the first processor core then I want to dedicate the other cores to my ...
Find C:\Programs path (not scripts path)
27,278,464
2
0
124
0
python,windows,path,directory
I second @iCodez's answer to use os.getenvto get the path string from a system environment variable, but you might want to use the paths defined for APPDATA or LOCALAPPDATA instead. Windows permissions settings on the Program Files directory may prevent a standard user account from writing data to the directory. I be...
0
1
0
0
2014-12-03T17:39:00.000
2
0.197375
false
27,278,145
0
0
0
1
I've made a game and I'd like to save the highscore. So I need a place to do that. I chose to put it in the C:\All Programs directory. My problem is that that directory name isn't the same on every computer. For example on mine it's C:/Program Files (x86). So my question: Is there a way, to discover that path on any c...
can I combine NDB and mysqldb in one app on google cloud platform
28,197,823
0
1
62
1
google-app-engine,google-cloud-storage,google-cloud-datastore,mysql-python,app-engine-ndb
MySQL commands cannot be run on NoSQL. You will need to do some conversions during manipulation of the data from both DBs.
0
1
0
0
2014-12-03T17:47:00.000
1
0
false
27,278,297
0
0
1
1
Is it just about creating models that use the best fitting data store API? For part of the data I need relations, joins and sum(). For other this is not necessary but nosql way is more appropriate.
Plone Unified Installer missing Python
27,300,059
4
1
226
0
linux,python-2.7,plone,sles
The installer command: ./install.sh standalone --build-python --static-lxml=yes worked perfectly for me. The installer downloaded and built the Python and libxml2/libxslt components necessary to remedy the terribly out-of-date (and vulnerable) versions included with sles11sp3. System packages needed for the build wer...
0
1
0
0
2014-12-04T11:42:00.000
1
0.664037
false
27,293,173
0
0
1
1
I'm trying to install plone 4.3.4 on a SLES 11 SP3 64bit server via the Unified Installer. I've fullfilled all the dependencies listed in the readme.txt, but when I try to get the installer running with the command sudo ./install.sh --password=******* standalone I get the error message: which: no python2.7 in (/usr/bin...
/usr/bin/python vs /opt/local/bin/python2.7 on OS X
27,308,244
8
6
10,161
0
python,macos,python-2.7,numpy,matplotlib
Points to keep in mind about Python If a script foobar.py starts with #!/usr/bin/env python, then you will always get the OS X Python. That's the case even though MacPorts puts /opt/local/bin ahead of /usr/bin in your path. The reason is that MacPorts uses the name python2.7. If you want to use env and yet use MacPort...
0
1
0
0
2014-12-05T03:25:00.000
2
1.2
true
27,308,234
1
1
0
2
Can you shed some light on the interaction between the Python interpreter distributed with OS X and the one that can be installed through MacPorts? While installing networkx and matplotlib I am having difficulties with the interaction of /usr/bin/python and /opt/local/bin/python2.7. (The latter is itself a soft pointer...
/usr/bin/python vs /opt/local/bin/python2.7 on OS X
27,400,616
0
6
10,161
0
python,macos,python-2.7,numpy,matplotlib
May I also suggest using Continuum Analytics "anaconda" distribution. One benefit in doing so would be that you won't then need to modify he standard OS X python environment.
0
1
0
0
2014-12-05T03:25:00.000
2
0
false
27,308,234
1
1
0
2
Can you shed some light on the interaction between the Python interpreter distributed with OS X and the one that can be installed through MacPorts? While installing networkx and matplotlib I am having difficulties with the interaction of /usr/bin/python and /opt/local/bin/python2.7. (The latter is itself a soft pointer...
Log in to Windows from a Python service?
27,330,723
0
0
46
0
python,windows,login
So I've found a way to do it from a Windows service (written in C++) and presumably the ctypes library will permit me to use it. Simple as using LogonUser from Win32API so far as I can see. Yet to actually set up and test it but it does seem to be exactly what I need. The difficulty being that session0 can only be acce...
0
1
0
0
2014-12-05T11:47:00.000
1
1.2
true
27,315,254
1
0
0
1
I'm theory crafting a Python service which will manipulate domain joined machines into running tests as part of a suite. Details of requirements We must be logged in as a domain user, and we must not have the automatic login enabled We need to reboot machines a few times, so it's a requirement for this to be sustainab...
Starting a python script at boot and loading GUI after that
27,344,131
0
0
1,590
0
python,linux,boot,raspbian,autostart
Try to use bootup option in crontab: @reboot python /path/to/pythonfile.py
0
1
0
1
2014-12-06T23:03:00.000
2
0
false
27,337,587
0
0
0
1
Can anyone tel me how to start a python script on boot, and then also load the GUI ? I am debian based Raspbian OS. The reason I want to run the python script on boot is because I need to read key board input from a RFID reader. I am currently using raw_input() to read data from the RFID reader. The 11 character hex va...
uWSGI --http :80 doesn't listen IPv6 interface
27,342,634
7
3
1,462
0
http,python-3.x,ipv6,uwsgi
In your INI config file specify something like this [uwsgi] socket = [::]:your_port_number Or from the CL, ./uwsgi -s [::]:your_port_number The server shall now listen along all the interfaces (including IPv4, if the underlying OS supports dual stack TCP sockets)
0
1
0
1
2014-12-07T11:41:00.000
1
1.2
true
27,342,256
0
0
1
1
Why doesn't uWSGI listen on IPv6 interface, even if system is 100% IPv6 ready? As far as I could see there aren't parameters nor documentation covering this issue.
Creating installers or executables on Linux for every supported platform for a Kivy game
27,349,249
2
3
464
0
python,python-3.x,packaging,kivy
All are possible, but I'm not sure what people are recommending right now - the Kivy website has instructions for pyinstaller (specifically on windows as I remember, but it works well on other platforms too), with the disadvantage that pyinstaller only supports python2 right now. You can use other tools too, I've seen ...
1
1
0
0
2014-12-07T20:20:00.000
1
1.2
true
27,347,356
0
0
0
1
Is there a tool that creates installers from the source code of a Kivy game for all the different supported platforms with a single button press? Linux: .deb, .rpm or just a portable .zip file that contains a .sh script Windows: .exe (installer or portable executable) Mac: .app (installer or portable executable) and p...
speed limit of syn scanning ports of multiple targets?
29,195,455
0
0
126
0
python,linux,performance
Months ago I found out that this problem is well known as c10k problem. It has to do amongst other things with how the kernel allocates and processes tcp connections internally. The only efficient way to address the issue is to bypass the kernel tcp stack and implement various other low-level things by your own. All go...
0
1
1
1
2014-12-08T04:18:00.000
1
1.2
true
27,351,360
0
0
0
1
I've coded a small raw packet syn port scanner to scan a list of ips and find out if they're online. (btw. for Debian in python2.7) The basic intention was to simply check if some websites are reachable and speed up that process by preceding a raw syn request (port 80) but I stumbled upon something. Just for fun I star...
create apscheduler job trigger from cron expression
27,396,550
0
1
3,162
0
python,cronexpression,apscheduler
Given that APScheduler supports a slightly different set of fields, it's not immediately obvious how those expressions would map to CronTrigger's arguments. I should also point out that the preferred method of scheduling jobs does not involve directly instantiating triggers, but instead giving the arguments to add_job(...
0
1
0
0
2014-12-09T11:30:00.000
3
1.2
true
27,377,908
0
0
0
1
I'm trying to run some scheduled jobs using cron expressions in python. I'm new to python and I've already worked with quartz scheduler in java to achieve almost the same thing. Right now, I am trying to work with apscheduler in python. I know that it is possible to do this using crontrig = CronTrigger(minute='*', sec...
online documentation for old versions of nose
27,390,659
1
1
41
0
python,nose
You should be able to upgrade nosetests via pip, while still staying with python 2.6. At least, nose 1.3.4 (latest as of this writing) installs cleanly inside the py2.6 virtualenv I just threw together. I don't have any py2.6-compatible code to hand to show that it's working correctly, though.
0
1
0
1
2014-12-09T23:07:00.000
2
0.099668
false
27,390,553
0
0
0
1
The Question Where can I access the documentation for legacy versions of the nose testing framework? Why I have to support some python code that must run against python 2.6 on a Centos 6 system. It is clear from experimentation that nosetests --failed does not work on this system. I'd like to know if I'm just missing...
How to use docker for deployment and development?
27,399,888
0
2
286
0
python,git,docker
In the development case I would just use docker's -v option to mount the current working copy into a well known location in the container and provide a small wrapper shell script that automates firing up the app in the container.
0
1
0
0
2014-12-10T10:22:00.000
2
0
false
27,398,538
0
0
0
2
Suppose I have a python web app. I can create docker file for installing all dependencies. But then (or before it if I have requirements for pip) I have like two different goals. For deployment I can just download all source code from git through ssh or tarballs and it would work. But for a developer machine it wouldn'...
How to use docker for deployment and development?
27,402,917
1
2
286
0
python,git,docker
Providing developer with a copy of repository to work with is not docker's responsibility. Many people do the other way - you put Dockerfile or a script to pull (or build) and run your container into the sources of your project.
0
1
0
0
2014-12-10T10:22:00.000
2
0.099668
false
27,398,538
0
0
0
2
Suppose I have a python web app. I can create docker file for installing all dependencies. But then (or before it if I have requirements for pip) I have like two different goals. For deployment I can just download all source code from git through ssh or tarballs and it would work. But for a developer machine it wouldn'...
Running Out of Threads: UWSGI + Multithreaded Python Application with GeventHTTPClient
27,436,888
1
1
777
0
python,multithreading,uwsgi,gevent
Mixing non-blocking programming (geventhttpclient) with blocking one (a uWSGI thread/process) is completely wrong. This is a general rule: even if your app is 99% non blocking it is still blocking. This is amplified by the fact that gevent makes use of stack switching to simulate blocking programming paradigms. This i...
0
1
0
0
2014-12-11T21:52:00.000
1
1.2
true
27,433,087
0
0
1
1
I'm currently running a python web API that is NOT multithreaded with much success on the uWSGI + NGINX stack. Due to new operational needs, I have implemented a new build that includes multithreaded requests to external data sources. However, when I deploy this new multithreaded build under uWSGI with --enable-threads...
Python 3.4.2 AND pip Permission Issues
27,470,901
0
1
98
0
python,pip
After many days of trying a workaround, I finally got down to debugging the setup.py script and setuptools and distutils. Figured out the problem was a missing "svn.exe" on my workstation, which caused the "svn_finder" function in setuptools core to hang up. Can someone point me in the right direction as to how I can m...
0
1
0
0
2014-12-12T07:45:00.000
1
1.2
true
27,439,027
1
0
0
1
I've been struggling with an issue with Python and pip installs (python version 3.4.2, same with x86 or x64 MSIs, Windows 7 x64). I'm using the CPython installer available from the Python.org website. When I install, I get the UAC prompt, which I approve, and it installs fine to D:\opt\python34 (along with pip, as adde...
Send packet and change its source IP
28,396,576
1
7
31,903
0
python,ip,packet,scapy
You basically want to spoof your ip address.Well I suggest you to read Networking and ip header packets.This can be possible through python but you won't be able to see result as you have spoofed your ip.To be able to do this you will need to predict the sequence numbers.
0
1
1
0
2014-12-12T17:26:00.000
2
0.099668
false
27,448,905
0
0
0
1
Lets say I have an application written in python to send a ping or e-mail. How can I change the source IP address of the sent packet to a fake one, using, e.g., Scapy? Consider that that the IP address assigned to my eth0 is 192.168.0.100. My e-mail application will send messages using this IP. However, I want to manip...
How to debug python tornado
27,455,651
1
1
1,832
0
python,tornado
Use Eclipse, PyDev, PyCharm, or whatever to set a breakpoint at the misbehaving line of code and step through your code from there. Tornado applications are relatively difficult to debug because the stack trace is less clear than in multithreaded code. Step through your code carefully. If you use coroutines, you should...
0
1
0
0
2014-12-13T02:22:00.000
1
1.2
true
27,454,876
1
0
0
1
I already set the debug=Truethen what is the next ? I use eclipse + pydev for develop environment Give me some details about tornado debugging will be very appreciate
Configuring Remote Python Interpreter in Pycharm
29,901,664
0
4
2,553
0
python,raspberry-pi,pycharm,remote-debugging,interpreter
It works in PyCharm if you deploy a remote SFTP server. Tools > Deployment > Add > Enter name and SFTP > Enter host, port, root path (I said "/" without quotes) username and password. Then, when creating a new project, change your interpreter to 'Deployment Configuration', and select your SFTP server. Press OK, then c...
0
1
0
1
2014-12-13T16:07:00.000
1
1.2
true
27,460,843
1
0
0
1
I would like to connect to my raspberry pi using a remote interpreter. I've managed to do it just fine in windows 7 using Pycharm, but having recently upgrading to windows 8.1 it no longer works. I've tried to connect to the raspberry pi (where it worked in win 7) and another one with a fresh install of Raspbian (relea...
Pyephem: time of a planet will be closest to the horizon
29,810,773
0
2
75
0
python,pyephem
Wouldn't that be the, for lack of a better term, anti-transit? It seems to me that if it's cicumpolar, what you're looking for would be roughly 12 hours before/after transit.
0
1
0
0
2014-12-15T08:18:00.000
1
0
false
27,479,855
1
0
0
1
Is it possible to calculate time of a planet will be closest to the horizon, when pyephem throws AlwaysUpError and NeverUpError?
Ejabberd server not getting started?
27,539,662
0
0
75
0
python-2.7,ubuntu-14.04,openfire,ejabberd
Solved the issue problem wan with my settings,and then restarted the server using sudo service ejabbers restart.It worked
0
1
0
0
2014-12-15T13:33:00.000
1
1.2
true
27,485,296
0
0
1
1
I have re-installed ejabberd server in my localhost.When i run sudo service ejabberd restart its no getting restarted.Instead its craeting error.The following error is shown in erl_crash.dump.All my configurations in conf file is correct. Kernel pid terminated (application_controller) ({application_start_failure,kernel...
Python on system start up
27,494,641
0
0
82
0
python,ssh,raspberry-pi,raspbian
You should modify your python script to write its output to a file instead of to the screen (which you can't see). I.e., I think that a log file is your best (possibly only) bet. You can write to a file in /tmp on the raspberry pi if you just want a temporary log file that you can check once and a while. Also, as Tim s...
0
1
0
1
2014-12-15T18:59:00.000
2
0
false
27,491,173
0
0
0
2
I am running Python on a Raspberry Pi and everything works great. I have a small script running on the system start up which prints several warning messages (which I actually cannot read since it is running in the background)... My question is: Is there a way via SSH to "open" this running script instance and see what ...
Python on system start up
27,492,567
1
0
82
0
python,ssh,raspberry-pi,raspbian
Try using the Python logging library. You can configure it to save the output to a file and then you can use tail -f mylogfile.log to watch as content is put in. EDIT: An alternative is to use screen. It allows you to run a command in a virtual console, detach from that console, and then disconnect from the machine. ...
0
1
0
1
2014-12-15T18:59:00.000
2
1.2
true
27,491,173
0
0
0
2
I am running Python on a Raspberry Pi and everything works great. I have a small script running on the system start up which prints several warning messages (which I actually cannot read since it is running in the background)... My question is: Is there a way via SSH to "open" this running script instance and see what ...
How do I make a python script executable?
27,494,871
118
72
145,067
0
python,command-line
Add a shebang line to the top of the script: #!/usr/bin/env python Mark the script as executable: chmod +x myscript.py Add the dir containing it to your PATH variable. (If you want it to stick, you'll have to do this in .bashrc or .bash_profile in your home dir.) export PATH=/path/to/script:$PATH
0
1
0
0
2014-12-15T23:03:00.000
6
1.2
true
27,494,758
1
0
0
2
How can I run a python script with my own command line name like 'myscript' without having to do 'python myscript.py' in the terminal?