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 do I make a python script executable? | 66,843,453 | 1 | 72 | 145,067 | 0 | python,command-line | The simplest way that comes to my mind is to use "pyinstaller".
create an environment that contains all the lib you have used in your code.
activate the environment and in the command window write pip install pyinstaller
Use the command window to open the main directory that codes maincode.py is located.
remember to k... | 0 | 1 | 0 | 0 | 2014-12-15T23:03:00.000 | 6 | 0.033321 | false | 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? |
py launcher does not find my Python 2.7 | 27,523,478 | 10 | 6 | 21,363 | 0 | python,installation | I found the solution. The registry had wrong entries. As I have a 32 bit version installed I went to HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER\SOFTWARE\wow6432node\Python\PythonCore\2.7\InstallPath and the value was set to C:\Python27 while my installation is in D:\Python27. So I changed all the registry values to match the... | 0 | 1 | 0 | 0 | 2014-12-16T10:55:00.000 | 4 | 1.2 | true | 27,503,003 | 1 | 0 | 0 | 1 | I'm on Windows 7. I have Python 2.7 installed for years. I installed recently Python 3.4. I'm trying to use the new py launcher. When I open the cmd terminal and type py -2, I get this error message: Requested Python version (2) not installed. How can make py aware of my python 2.7 installation?
Note: python 2.7 is ins... |
Backup in one and restore in another Google App Engine application by using Cloud Storage? | 34,706,288 | 4 | 8 | 961 | 1 | python,google-app-engine | Yes!! What you are trying to do is not possible. The reason is that there are absolute references in the backup files to the original backup location (bucket). So moving the files to another GCS location will not work.
Instead you have to leave the backup files in the original GCS bucket and give your new project read ... | 0 | 1 | 0 | 0 | 2014-12-16T22:17:00.000 | 2 | 0.379949 | false | 27,514,985 | 0 | 0 | 1 | 2 | My goal was to duplicate my Google App Engine application. I created new application, and upload all needed code from source application(python). Then I uploaded previously created backup files from the Cloud Storage of the source application (first I downloaded those files to PC and than uploaded files to GCS bucket ... |
Backup in one and restore in another Google App Engine application by using Cloud Storage? | 29,852,870 | 1 | 8 | 961 | 1 | python,google-app-engine | Given the message, my guess is that the target application has no read access to the bucket where the backup is stores. Add the application to the permitted users to that bucket before creating the backup so that the backup objects will inherit the permission. | 0 | 1 | 0 | 0 | 2014-12-16T22:17:00.000 | 2 | 0.099668 | false | 27,514,985 | 0 | 0 | 1 | 2 | My goal was to duplicate my Google App Engine application. I created new application, and upload all needed code from source application(python). Then I uploaded previously created backup files from the Cloud Storage of the source application (first I downloaded those files to PC and than uploaded files to GCS bucket ... |
Python console not launching properly from command line | 27,557,706 | 0 | 1 | 632 | 0 | python,windows,command-line,command | Issue resolved. Since no feasible solution was found in 2 days, I decided to wipe all keys containing 'python' from registry as well as some files that were not parts of other programs. This resolved the issue after re-installing python.
If anyone finds the true cause of this misbehavior and other - less brutal - solut... | 0 | 1 | 0 | 0 | 2014-12-17T02:05:00.000 | 2 | 0 | false | 27,517,255 | 1 | 0 | 0 | 1 | I seem to have problem launching python from command line. I tried various things with no success.
Problem: When trying to run python from the command line, there is no response i.e. I do not get message about 'command not found' and console does not launch. Only option to open python console is to run C:\Python34\pyth... |
Is there any way to use Google Protobuf on pypy? | 27,687,619 | 1 | 2 | 567 | 0 | python,c++,protocol-buffers | So this is a happy non-answer using my experience. The pure-python bindings for google protobuf are a terrible port of C/C++ stuff. However, I had quite a bit of success wrapping C google protobuf generated bindings using cffi. Someone should go ahead and create a more generic binding, but that would just a short consu... | 1 | 1 | 0 | 1 | 2014-12-17T03:40:00.000 | 1 | 0.197375 | false | 27,517,939 | 0 | 0 | 0 | 1 | Protobuf with pure python performance 3x slowly on pypy than CPython do.
So I try to use c++ implementation for pypy.
These are two error (PyFloatObject undefined and const char* to char*) when I compile protobuf(2.6.1 release) c++ implementation for pypy.
I compile successfully after I modify python/google/protobuf/py... |
Completion of App Engine Index Writes (Python) | 27,540,122 | 1 | 1 | 45 | 0 | python,google-app-engine,google-cloud-datastore | No, it is done asynchronously and you are not able to control this process. Hooks available only for by key gets, not for index queries. Try to build your datastore with parent-child relationships, so you can do ancestor queries, they are always consistent. | 0 | 1 | 0 | 0 | 2014-12-17T10:13:00.000 | 1 | 1.2 | true | 27,523,124 | 0 | 0 | 1 | 1 | Is there a way to know / detect if an object (after being put to the datastore) has been written to an index i.e. object would be visible in a relevant query? Maybe something like a hook method?
Thanks! |
Multiple Time Zones in Google Appengine Cron Job | 27,530,878 | 3 | 0 | 571 | 0 | python,google-app-engine,cron | You can schedule a cron job to run every hour, because every hour there is 9 am somewhere. | 0 | 1 | 0 | 0 | 2014-12-17T15:19:00.000 | 1 | 0.53705 | false | 27,528,859 | 0 | 0 | 1 | 1 | I want to schedule a task for 9:00 AM in every country. (basically 9:00 AM in every time zone). How can I schedule that in google appengine?
Will it take multiple timezones for time zone parameter?
Thanks in advance |
Keyboard emulation in python, cross platform | 28,269,358 | 0 | 0 | 509 | 0 | python,scripting,hotkeys,hid | Uinput is the definitive, Kernel-guru sanctioned way to do this on Linux.
Thanks to @Reily Grant for the Mac info! | 0 | 1 | 0 | 0 | 2014-12-18T03:03:00.000 | 1 | 1.2 | true | 27,538,582 | 0 | 0 | 0 | 1 | I couldn't find a way to do this on Mac and Linux. With Windows one could use ctypes and then use console.SendKeys. So far as I can tell there is certainly no way that Apple would let a humble user take over the mouse and keyboard, but how might an average Joe do this on Linux? Despite no findings, I would assume th... |
Jenkins: How to push build artifacts back to source control? | 27,594,747 | 1 | 0 | 620 | 0 | python,svn,jenkins | I'd not do this. There isn't an OOTB solution as this would generally be seen as a terrible idea - committing on at least two levels:
1. committing derived artifacts is sub-optimal
2. committing binaries is sub-optimal
However if I absolutely had too I'd setup a job that did the binary commit that shared the same work... | 0 | 1 | 0 | 0 | 2014-12-19T06:48:00.000 | 1 | 0.197375 | false | 27,561,003 | 0 | 0 | 0 | 1 | Is there any OOTB way to get a post build step to push the results of a Jenkins build back to a (Subversion) repository? We use one repository for sources and another to record the binaries for every commit to trunk (very useful for debugging). The Jenkins pull on the source SVN repository change works perfectly, the... |
ERROR: 'ogr2ogr' is not recognized as an internal or external command, operable program or batch file when running ogr2ogr in python script | 27,570,551 | 0 | 0 | 1,962 | 1 | python-2.7,subprocess | REINSTALLING the python bindings resolved my issue. I don't see GDAL on the paths below but its working now. Is it supposed to be there so since its not, I might probably have another round of GDAL head scratching in the future?
:::::::::::::::::::::::::::::::::::::::
THIS is what I currently have when I type in sys.pa... | 0 | 1 | 0 | 0 | 2014-12-19T13:48:00.000 | 1 | 0 | false | 27,567,450 | 0 | 0 | 0 | 1 | I get an error when trying to run ogr2ogr thru subprocess but I am able to run it using just the windows command prompt. The script will be part of a series of processes that start with batch importing gpx files unto a postgres db. Can somebody please tell me what's wrong? Thanks!
::::::::::::::::::::::::::::
Running T... |
Changing between Python 2.x and 3.x in windows CMD? | 27,572,488 | 3 | 4 | 6,850 | 0 | python,windows,cmd | You'll have to make changes to the PATH environmental variable. To do this, click the Start button, right click on "Computer", hit "Properties", click "Advanced System Settings" in the left sidebar. Then click the Environmental Variables button.
Under User or System variables, there will be a variable called "PATH" tha... | 0 | 1 | 0 | 0 | 2014-12-19T19:04:00.000 | 3 | 0.197375 | false | 27,572,366 | 1 | 0 | 0 | 2 | I have both Python 2.7 and 3.4 installed on my Windows Machine. When I type Python in CMD it defaults to Python2.7. How do I switch to 3.4? |
Changing between Python 2.x and 3.x in windows CMD? | 33,028,953 | 2 | 4 | 6,850 | 0 | python,windows,cmd | Simply changing the name of the python.exe to anything (ex:pytoioion.exe) in your C:/Python34 or C:/Python27 will switch between the two versions. To verify, run this on your command prompt
C:Users/(your_name)>python | 0 | 1 | 0 | 0 | 2014-12-19T19:04:00.000 | 3 | 0.132549 | false | 27,572,366 | 1 | 0 | 0 | 2 | I have both Python 2.7 and 3.4 installed on my Windows Machine. When I type Python in CMD it defaults to Python2.7. How do I switch to 3.4? |
Installing modules with PyPM on ActiveState | 27,667,123 | 2 | 0 | 320 | 0 | python,ssh,paramiko,activestate,pypm | I feel really foolish.
After reading that paramiko has replaced ssh module there still is an ssh module available.
Ooops!! | 0 | 1 | 0 | 1 | 2014-12-26T19:25:00.000 | 1 | 1.2 | true | 27,661,082 | 0 | 0 | 0 | 1 | I am new to python scripting and started to look into a script to allow me to SSH to a box and check it is still running.
I have installed ActiveState (Python 2.7) on my windows desktop.
Using PyPM I have installed paramiko and pycrypto
but when I try to execute my scripts I get the following error:
Script: python C:... |
Where To Test Python Code | 27,664,945 | 0 | 0 | 629 | 0 | python,terminal,ide | As soon as you don't mess up with the system files, you might not do any damages. Be sure what files you might be disturbing. If your code is too, ummmm, core, try to give ideone.com a try. This might help you with the things you might b touching.
Terminal might not give you enough interactions, but as you told that yo... | 0 | 1 | 0 | 1 | 2014-12-27T05:55:00.000 | 1 | 1.2 | true | 27,664,809 | 1 | 0 | 0 | 1 | I get slightly nervous posting in here because these are not my waters yet. Please bear with, I am very new to the world of code. I do my best to find answers to questions before I ask them; time is very valuable so I appreciate yours.
When I run code under Python in Terminal do I run the risk of damaging my system if... |
Public Client App Port Forwarding with OpenShift | 27,665,587 | 0 | 0 | 211 | 0 | python,c++,linux,openshift,openshift-client-tools | all the 'rhc port-forward appname' does is set up SSH tunnels behind the scenes. If you want people to tunnel into your appication you will need to get their public SSH key into your application as an approved key. Then you can set up an SSH tunnel whatever way you chose. | 0 | 1 | 0 | 1 | 2014-12-27T06:12:00.000 | 1 | 1.2 | true | 27,664,896 | 0 | 0 | 0 | 1 | I'm trying to test and distribute my python application in script or executable form (client). I already have my openshift server setup and running. I'm confused on setting up port forwarding with other users to test it out with.
Do other clients (publicly) need to download rhc and run 'rhc port-forward appname' on the... |
How to open files from a very large folder quickly? | 27,667,551 | 0 | 1 | 516 | 0 | python,file,ntfs | This is a problem of the underlying file system. Use a file system that is better suited for large amount of files. Built a directory tree, sort the files into directories after the first, second, third ... character of the filename. | 0 | 1 | 0 | 0 | 2014-12-27T13:06:00.000 | 2 | 0 | false | 27,667,517 | 0 | 0 | 0 | 1 | I have a folder with about 220,000 text files. I need to open them in a certain order, and do something with the content. At the moment, I just use open, and it takes, on average, about half a second to open a file. Is there any faster way to do it?
If it matters - I'm on Windows. |
How to compile linux application into win *.exe file | 27,685,003 | -1 | 0 | 257 | 0 | python,linux,windows,ubuntu,exe | if you can't get the python to run on windows a packaged exe version is impossible. | 0 | 1 | 0 | 0 | 2014-12-29T07:17:00.000 | 2 | -0.099668 | false | 27,684,920 | 1 | 0 | 0 | 1 | I have python program that I've been writing on Ubuntu. For some reasons I could not properly installed on windows few libraries that I used, there are some problems I can't solve in libraries. I used PyInstaller to build run file in Ubuntu. And it is works perfectly. But now I faced a problem, I need to run this appli... |
Should I delete temporary files created by my script? | 27,708,677 | 3 | 2 | 1,430 | 0 | python,bash,shell,operating-system,temp | As a general rule, you should remove the temporary files that you create.
Recall that the $TEMP directory is a shared resource that other programs can use. Failure to remove the temporary files will have an impact on the other programs that use $TEMP.
What kind of impacts? That will depend upon the other programs. ... | 0 | 1 | 0 | 1 | 2014-12-29T13:51:00.000 | 2 | 1.2 | true | 27,690,197 | 1 | 0 | 0 | 1 | It's a common question not specifically about some language or platform. Who is responsible for a file created in systems $TEMP folder?
If it's my duty, why should I care where to put this file? I can place it anywhere with same result.
If it's OS responsibility, can I forgot about this file right after use?
Thanks and... |
Python network communication with encryption and password protection | 27,719,872 | 0 | 0 | 595 | 0 | python,encryption,https | if you have no problem rolling out a key file to all nodes ...
simply throw your messages into AES, and move the output like you moved the unencrypted messages ...
on the other side ... decrypt, and handle the plaintext like the messages you handled before ... | 0 | 1 | 0 | 1 | 2014-12-31T10:20:00.000 | 2 | 1.2 | true | 27,719,695 | 0 | 0 | 0 | 1 | I want to create a python program that can communicate with another python program running on another machine. They should communicate via network. For me, it's super simple using BasicHTTPServer. I just have to direct my message to http:// server2 : port /my/message and server2 can do whatever action needed based on t... |
How to `pip install` a package that has non-Python dependencies? | 27,735,671 | 1 | 35 | 4,418 | 0 | python,pip | For most popular packages, There is a workaround for recent ubuntu systems. For example, I want to install matplotlib. When you order pip install matplotlib, it usually fails because of a missing dependency.
You can use apt-get install python-matplotlib instead. For python3, you can use apt-get install python3-matplot... | 0 | 1 | 0 | 0 | 2015-01-01T19:44:00.000 | 2 | 0.099668 | false | 27,734,053 | 1 | 0 | 0 | 1 | Many python packages have build dependencies on non-Python packages. I'm specifically thinking of lxml and cffi, but this dilemma applies to a lot of packages on PyPI. Both of these packages have unadvertised build dependencies on non-Python packages like libxml2-dev, libxslt-dev, zlib1g-dev, and libffi-dev. The websit... |
Set aliases in bash.bashrc | 27,763,299 | 0 | 0 | 853 | 0 | python,bash,cygwin,alias | The error indicate that the bash.bashrc file was not loaded.
Check these:
The bashrc filename is usually .bashrc / .bash_profile and it's in the user's home directory. Or it should exists as /etc/bash.bashrc.
The file is not loaded automatically, restart the shell to load it. | 0 | 1 | 0 | 0 | 2015-01-04T07:01:00.000 | 2 | 0 | false | 27,763,265 | 1 | 0 | 0 | 1 | When I try to set aliases, I get two different results using two different methods. I'm using cygwin.
METHOD 1:
In cygwin I execute the following:
alias python='/cygdrive/c/python27/python.exe'
python <name of python file>
...and it runs just fine, as expected
METHOD 2:
In my bash.bashrc file I add the following line:... |
Google Drive / App Engine for Document Management System | 27,791,624 | 0 | 1 | 1,208 | 0 | google-app-engine,google-drive-api,document-management,google-apps-for-education,google-app-engine-python | Since you'll be building your own software, the answer to "will it do what I want" is always "yes, eventually".
You'll need to make a decision about document formats, which in turn will influence your indexing mechanism. Specifically, you have two primary options:-
convert the files to Google document formats (doc, s... | 0 | 1 | 0 | 0 | 2015-01-05T19:53:00.000 | 1 | 1.2 | true | 27,786,842 | 0 | 0 | 1 | 1 | I administer a University's document management system. The system is a 3rd party that integrates with another 3rd party database that acts as our ERP system. The DMS is quite clunky and has a wide array of terrible bugs / lacks features & support. I've been playing around with Google App Engine / Drive SDK in my free ... |
Python development in Windows | 27,790,624 | 0 | 0 | 139 | 0 | python,windows | Any good programmer's text editor will do. I personally use SublimeText 3, but I've used Eclipse + PyDev before to great success, and the usual suspects (emacs, vim, Notepad++) will work just fine too. | 0 | 1 | 0 | 0 | 2015-01-06T00:16:00.000 | 4 | 0 | false | 27,790,165 | 1 | 0 | 0 | 1 | I've been writing and using short Python scripts (~100 lines) for various tasks in Ubuntu using the Geany text editor, which I like for it's simplicity (setup, F5 to run, etc.) and syntax highlighting.
I would like to know if there is a similar application for Windows. Because what I've found so far requires downloadi... |
How can I get the PORT number when using Nginx + Tornado? | 27,880,443 | 0 | 0 | 96 | 0 | python,nginx,tornado | Each of these ports is a different python process, right? At some point you must be passing in the port number to each process and calling app.listen(port) (or one of the related bind/listen methods). Just save the port number at that time (could just be a global variable if you only have one server per process) | 0 | 1 | 0 | 0 | 2015-01-08T08:06:00.000 | 1 | 1.2 | true | 27,835,528 | 0 | 0 | 1 | 1 | Nginx make PORT 8000:8003 to Tornado server.py
I want to get the PORT number in MainHanlder and print it in the browser when someone visit my site.
And I don't want to make several copies of server.py to server8000.py, server8001.py, ..., I want just one main entrance to solve this problem.
How can I do it? |
Python34.dll is missing | 34,793,148 | 0 | 2 | 13,987 | 0 | python,dll,cython | Just installed PyInstaller - it has the option to compile to one file. | 1 | 1 | 0 | 0 | 2015-01-08T22:48:00.000 | 2 | 0 | false | 27,850,953 | 1 | 0 | 0 | 1 | I had created an application in Python and then I tried to make an executable from it.
Works well in Ubuntu and Windows but only when on this system I have Python installed.
In other case (Tried only for Win) I get the error that "The application can't start because python34.dll is missing"
What I do (filename is curr.... |
Accessing windows registry Python | 27,867,537 | 1 | 0 | 230 | 0 | python,windows,registry | Fixed it be deleting python 32 bit and installing python 64 bit, works like a charm | 0 | 1 | 0 | 0 | 2015-01-09T18:21:00.000 | 1 | 1.2 | true | 27,866,775 | 1 | 0 | 0 | 1 | I am stuck here trying to make a python script to access windows registry. My issue is that I get an error file not found using the following path:
"SOFTWARE\Microsoft\Windows
NT\CurrentVersion\NetworkList\Signatures\Unmanaged"
It works until NetworkList and afterwards it just returns the error of file not found. I... |
pip install: Please check the permissions and owner of that directory | 57,711,516 | 0 | 156 | 189,575 | 0 | python,pip,sudo,osx-yosemite | If you altered your $PATH variable that could also cause the problem. If you think that might be the issue, check your ~/.bash_profile or ~/.bashrc | 0 | 1 | 0 | 0 | 2015-01-09T22:05:00.000 | 5 | 0 | false | 27,870,003 | 1 | 0 | 0 | 2 | While installing pip and python I have ran into a that says:
The directory '/Users/Parthenon/Library/Logs/pi' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
be... |
pip install: Please check the permissions and owner of that directory | 39,810,683 | 61 | 156 | 189,575 | 0 | python,pip,sudo,osx-yosemite | pip install --user <package name> (no sudo needed) worked for me for a very similar problem. | 0 | 1 | 0 | 0 | 2015-01-09T22:05:00.000 | 5 | 1 | false | 27,870,003 | 1 | 0 | 0 | 2 | While installing pip and python I have ran into a that says:
The directory '/Users/Parthenon/Library/Logs/pi' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
be... |
how to setup virtualenv to use a different python version in each virtual env | 27,885,868 | 1 | 0 | 572 | 0 | python,virtualenv,virtualenvwrapper | When creating virtual environment, you can specify which python to use.
For example,
virtualenv -p/usr/bin/python2.7 env
Same for mkvirtualenv | 0 | 1 | 0 | 0 | 2015-01-11T09:36:00.000 | 1 | 0.197375 | false | 27,885,666 | 1 | 0 | 0 | 1 | using autoenv and virtualenvwrapper in python and trying to configure in it the specific python version.
the autoenv file (called .env) contains (simply)
echo 'my_env'
is there a way to configure it's python version? |
When I try to run ipython on powershell, I get the error "Failed to create process" | 35,580,619 | 1 | 2 | 1,609 | 0 | python-2.7,ipython | I had this problem on Windows after I had 2 version of Python installed. Even after I uninstalled one version of Python through Control Panel, the folder C:\Python2.7 still existed. After I deleted this folder manually, ipython started work normally. | 0 | 1 | 0 | 0 | 2015-01-12T01:20:00.000 | 3 | 0.066568 | false | 27,894,077 | 1 | 0 | 0 | 3 | I installed pythonxy (2.7.9), but when I try to run ipython from windows powershell, I get an error "failed to create process." What steps can I take to solve this problem.
Thanks, |
When I try to run ipython on powershell, I get the error "Failed to create process" | 42,178,769 | 1 | 2 | 1,609 | 0 | python-2.7,ipython | Go to cmd and type where iPython. if it results in two locations, delete one and proceed with other. Usually this happens when you have installed Anaconda distribution after installing python in your local system. Deleting python version locally would be a better solution. And then go to the root folder, (Ex: C:\Users\... | 0 | 1 | 0 | 0 | 2015-01-12T01:20:00.000 | 3 | 0.066568 | false | 27,894,077 | 1 | 0 | 0 | 3 | I installed pythonxy (2.7.9), but when I try to run ipython from windows powershell, I get an error "failed to create process." What steps can I take to solve this problem.
Thanks, |
When I try to run ipython on powershell, I get the error "Failed to create process" | 42,316,996 | 0 | 2 | 1,609 | 0 | python-2.7,ipython | You can also rename folders, for example C:\Python27_ , so that they are not found. This way you don't have to delete your libraries! Then you remove the underscore depending on the project you are working in.
Make sure you have the relevant directories in the path, otherwise the version you do want won't be found at ... | 0 | 1 | 0 | 0 | 2015-01-12T01:20:00.000 | 3 | 0 | false | 27,894,077 | 1 | 0 | 0 | 3 | I installed pythonxy (2.7.9), but when I try to run ipython from windows powershell, I get an error "failed to create process." What steps can I take to solve this problem.
Thanks, |
Is it bad to use the built-in python on mac? | 27,895,907 | 1 | 0 | 1,327 | 0 | python,macos,python-2.7,python-3.x,pillow | You can use the built-in Python, there's nothing "bad" about it. If someday you run into some limitation (unlikely), you can always switch then. | 0 | 1 | 0 | 0 | 2015-01-12T05:32:00.000 | 2 | 1.2 | true | 27,895,863 | 1 | 0 | 0 | 1 | I started learning python on a PC, by installing Python 3, and so when I switched to mac I thought "Look at that, you can just type idle in the terminal and there's Python 2, let me just use that," not wanting to have to deal with two versions on the same machine. However, I read that it's recommended to install a newe... |
How can I send mail via Python on Yosemite... without an outside server? | 27,913,491 | 0 | 1 | 291 | 0 | python,email,osx-yosemite | adding this an answer cause not enough space in comments.
It might work, but highly unlikely, and if you can send outbound mail, it will most likely be spam folder'd or dropped. The reason most apps use a dedicated mail server or smart host is that there are lots of other things that need to be setup besides the mail... | 0 | 1 | 0 | 1 | 2015-01-12T19:36:00.000 | 1 | 1.2 | true | 27,909,442 | 0 | 0 | 0 | 1 | I have set up an unused Macbook Pro as a shared server on our internal company intranet. I'm kind of running it as a skunkworks; it can access the internet, but doesn't have permission to access, say, Gmail via SMTP. It's also unlikely to get that access anytime soon.
I'd like to be able to run processes on the machine... |
How to show realtime results of multiple python scripts in 1 window | 27,957,366 | 0 | 0 | 40 | 0 | python,python-2.7 | This is a shot in the dark, I haven't done much python, but could you not have your background scripts dump their results in a file and then have your window focus on updating when that file updates.
In linux you could write to a text file and then open another console window to tail that file. | 0 | 1 | 0 | 0 | 2015-01-15T05:30:00.000 | 1 | 1.2 | true | 27,957,335 | 1 | 0 | 0 | 1 | I need to run several python scripts simultaneously in the background, and have all the results be shown in 1 window, real time. The background scripts will continue running, but as more info is outputted it should be shown inside 1 window.
I've tried os and subprocess, but to no avail. This needs to work on all plat... |
scons - delete some of the built files after the compilation process | 28,020,565 | 0 | 0 | 408 | 0 | python,c++,swig,scons | It seems like using the "Delete" function as a Command, after the SharedLibrary line, allows me to delete the unwanted files. | 0 | 1 | 0 | 0 | 2015-01-16T11:59:00.000 | 1 | 1.2 | true | 27,983,493 | 1 | 0 | 0 | 1 | I have a scons setup where I can choose to run SWIG and build a python module from c++.
this creates files such as
x_wrap.cc
x.lib
x.obj
etc.
When all I want to have at the end of the process are theses files:
_x.pyd
x.py
Is there a way I can get scons to delete the unwanted files after the build process? |
How to get WXpython 2.8 on Ubuntu? | 27,988,300 | 2 | 0 | 2,485 | 0 | python,ubuntu,wxpython | Run this:
sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n | 0 | 1 | 0 | 0 | 2015-01-16T16:13:00.000 | 3 | 0.132549 | false | 27,988,150 | 0 | 0 | 0 | 1 | I'm using python and anaconda to work on some code, which turns out to requires wx2.8, but all I can find is installer for wx3.0.
I looked into it, and the process for building an older version of wx from source is very unclear. It's not as simple as python setup.py install for example. Does anyone have experience ... |
Gspread and python on windows mobile or windows CE | 28,018,470 | 0 | 0 | 151 | 0 | python,windows-mobile,windows-ce,gspread | Although gspread source code is available and a python modul it depends on urllib and that depends on various other modules that are not part of PythonCE.
So, I fear, you will not success in getting gspread running on the windows mobile device.
Best solution to this seems to use a web server that hosts the html pages. ... | 0 | 1 | 0 | 0 | 2015-01-17T03:46:00.000 | 1 | 1.2 | true | 27,995,942 | 0 | 0 | 0 | 1 | I am working on an inventory project for work that will use a mobile computer and have run into a problem. I have written a program using Python and the Gspread library, but forgot to check if it will even work with either the windows mobile or windows CE operating systems. From what I have found there is a version of ... |
How do I deploy a python application to an external server? | 28,012,820 | -1 | 0 | 452 | 0 | python,deployment,packaging | Just turn your computer into a server. Simply set up your router for port forwarding so that your server's content's will display when the router's IP is entered. You can of course purchase a DNS domain to give that IP a human readable URL. | 0 | 1 | 0 | 0 | 2015-01-18T17:44:00.000 | 2 | -0.099668 | false | 28,012,791 | 1 | 0 | 0 | 1 | I have written a python script on my local laptop which uses several third party packages. I now want to run my script regularly (via a cron job) on an external server.
The external server most likely does not have all the dependencies installed, is there is a way to package and deploy my python script and dependencie... |
./stack.sh failed while installing Openstack | 28,060,641 | 0 | 1 | 2,026 | 0 | python,linux,pip,openstack,devstack | Edit the script and append --allow-unverified
ie pip install package_name==version --allow-unverified package_name | 0 | 1 | 0 | 0 | 2015-01-21T05:01:00.000 | 2 | 0 | false | 28,059,948 | 0 | 0 | 0 | 2 | I am not able to install OpenStack. I executed the script stack.sh and there was Error on exit. I looked at the log, the error is during the execution of the command: sudo -H -E python /home/sagar/devstack/files/get-pip.py :
This is the error during the execution of the below command:
sudo -H -E python /home/sagar/dev... |
./stack.sh failed while installing Openstack | 28,063,958 | 1 | 1 | 2,026 | 0 | python,linux,pip,openstack,devstack | I got the problem. The system date was not correct. | 0 | 1 | 0 | 0 | 2015-01-21T05:01:00.000 | 2 | 0.099668 | false | 28,059,948 | 0 | 0 | 0 | 2 | I am not able to install OpenStack. I executed the script stack.sh and there was Error on exit. I looked at the log, the error is during the execution of the command: sudo -H -E python /home/sagar/devstack/files/get-pip.py :
This is the error during the execution of the below command:
sudo -H -E python /home/sagar/dev... |
Linux PC: How to let other Linux devices copy files | 28,070,608 | 0 | 0 | 56 | 0 | python,linux,wifi,ftp-server | On Linux the most straightforward way would be to either use SSH (SCP), for which you only need SSH daemon enabled on the server machine, or to run a trivial webserver.
No coding required in either cases. | 0 | 1 | 0 | 0 | 2015-01-21T15:07:00.000 | 1 | 0 | false | 28,070,431 | 0 | 0 | 0 | 1 | My application running under Linux creates four to seven data files in a directory whose name includes the client and datetime.These need to be copied by other devices - usually a Linux PC/laptop and potentially an Android phone. Currently the copying is done via a cable connection. I now need to make this wireless and... |
Hadoop streaming with Bash - how slow? | 28,112,455 | 2 | 0 | 481 | 0 | python,bash,hadoop,mapreduce,apache-spark | The main idea why Hadoop Streaming is considered to be slow is that for both mapper and reducer you have to pass arguments via stdin, which means you have to serialize them as a text, and to get the output of both mapper and reducer you have to deserialize them from the text back to Java structures, which usually consu... | 0 | 1 | 0 | 0 | 2015-01-23T02:12:00.000 | 1 | 0.379949 | false | 28,101,995 | 0 | 0 | 0 | 1 | I have heard from several articles that Hadoop streaming with bash is significantly slower than a compiled code or python. Is this only true for sort commands and the like? My script needs to
-copy file to node
-on node execute a commercial program with file as argument
-pass output back to folder
My intuition is tell... |
How to run celery beat as daemon? | 51,928,073 | 0 | 3 | 4,649 | 0 | python,django,celerybeat | celery -A your-project beat --detach -l info -f beat.log | 0 | 1 | 0 | 0 | 2015-01-23T07:56:00.000 | 2 | 0 | false | 28,105,364 | 0 | 0 | 0 | 1 | I know there is a command for celeryd to run as daemon, i.e; celeryd_detach. But how can I run celery-beat as daemon using any command? Please help me in this.
TIA |
Python import packages under chroot environment | 28,114,840 | 0 | 0 | 133 | 0 | python | You can do all necessary imports before os.chroot. | 0 | 1 | 0 | 0 | 2015-01-23T16:26:00.000 | 1 | 0 | false | 28,114,303 | 1 | 0 | 0 | 1 | I am writing some Python script and I would like to use os.chroot to execute some code under chroot environment. The problem is after calling os.chroot, paths in sys.path lie outside of the chroot jail, so import won't work. What's the best way to do it? |
How to fix "cc: error: unrecognized command line option '-Wshorten-64-to-32'" issue on Mac | 28,121,167 | 9 | 4 | 5,118 | 0 | python,macos | Solution is to run commands below:
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++ | 0 | 1 | 0 | 0 | 2015-01-24T00:59:00.000 | 2 | 1 | false | 28,121,148 | 0 | 0 | 0 | 1 | You may have following issue while compiling python packages on Mac:
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes... |
Proper way to change bashrc when making a ubuntu package or python package | 28,131,853 | 1 | 0 | 57 | 0 | python,bash,package | assuming ubuntu is somewhat like debian.
/etc/profile.d is probably the best way.
Don't edit any files just drop a file into profile.d that checks for bash and that your package is installed and then does whatever it needs. | 0 | 1 | 0 | 0 | 2015-01-24T23:55:00.000 | 1 | 1.2 | true | 28,131,654 | 1 | 0 | 0 | 1 | I'm planning to make a program which should edit the users bashrc.
In the case of python library, I'd like to add a binary to /bin/ automatically. When it is executed, then it should add a function and call it every time when a user is loggd in to bash, so I definitely should change bashrc.
In the case of ubuntu packag... |
In python os library, process was blocked | 28,143,351 | 1 | 1 | 39 | 0 | python | The file you're deleting might be in use or requires administrative privileges to remove. You can use a subprocess to call you script as an administrator. | 0 | 1 | 0 | 0 | 2015-01-26T00:44:00.000 | 1 | 0.197375 | false | 28,143,334 | 1 | 0 | 0 | 1 | I am using os.remove in a for loop. Sometimes, the process was blocked, like a dead lock, but I'm not using a thread.
I want to know why process was blocked, and what can I do to prevent it? |
How to run a script that logs in to the internet at boot (before user login) on ubuntu | 28,151,615 | 0 | 0 | 38 | 0 | java,python,ubuntu | If you put it in ~/.bashrc it will run at the same time you log in | 0 | 1 | 0 | 1 | 2015-01-26T14:01:00.000 | 2 | 0 | false | 28,151,557 | 0 | 0 | 0 | 1 | I have made a script in Java and Python that logs in to my internet. I want to run one of it on my Ubuntu 14.10 at boot (before user login). How do I do it? |
GitPython - clone_from not working | 28,179,875 | 0 | 0 | 1,005 | 0 | python,gitpython | You might not have git.ext in your PATH, but that can easily be tested by executing it yourself.
If you see an error, you can either add it to the PATH, or set the GIT_PYTHON_GIT_EXECUTABLEto the executable git-python should execute for git commandline services. | 0 | 1 | 0 | 0 | 2015-01-27T00:53:00.000 | 1 | 0 | false | 28,161,508 | 1 | 0 | 0 | 1 | I am facing an issue while cloning a git repo.
I am using function clone_from from GitPython library
from git import Repo
Repo.clone_from("git://github.com/facebook/buck.git", "D:\sample")
I am getting error
WindowsError: The system cannot find the file specified
Can someone please tell me if this is how to clone a... |
How to execute a remote script using ssh | 28,223,316 | 0 | 1 | 865 | 0 | python,linux,bash,ssh | The solution to my problem is to use PATH=/cygdrive/c/WINDOWS/system32:/bin cmd /c in front of the script call, sth like: ssh user@host "PATH=/cygdrive/c/WINDOWS/system32:/bin cmd /c script" .This will run the script using in Windows env.
In my case the problem was that the script was run under cygwin env and I wanted ... | 0 | 1 | 0 | 1 | 2015-01-27T02:26:00.000 | 2 | 1.2 | true | 28,162,229 | 0 | 0 | 0 | 1 | I know I can find multiple answers to this question but I have a problem with the result.
I have a Windows PC with a script on it and a Linux PC that has to start the script using ssh.
The problem I am seeing is that for some reason it's using the Linux environment to run the script and not the Windows env. Is this exp... |
Passing values to KSH scripts from Python | 28,246,101 | 0 | 0 | 1,004 | 0 | python,shell,input,ksh | You can save your parameters in Python and give them on the commandline each time you call the script.
Your script can store them in a file (or database, service, ..) and read them when started again. | 0 | 1 | 0 | 0 | 2015-01-27T14:22:00.000 | 2 | 0 | false | 28,172,741 | 0 | 0 | 0 | 1 | I'm using Python to run a .ksh script, using subprocess.call().
This script requires the user to enter text at certain points - whatever the equivalent of Python's input() is in KSH I guess.
The problem I'm having is that I have to run the script ~200 times, and I don't want to have to enter this information each time.... |
Python kill scripts | 28,252,408 | 0 | 0 | 207 | 0 | python,windows,multithreading | My solution is place testing code in exe file. Now i can kill all python scripts, as previously. Maybe someone will offer another solution? | 0 | 1 | 0 | 1 | 2015-01-27T20:59:00.000 | 1 | 0 | false | 28,179,883 | 1 | 0 | 0 | 1 | I need to kill all python scripts except one. Unfortunattely, all scripts have similar name "pythonw.exe". Difference in PID only.
First time, i don't need to leave one script alive, thats why i just kill all python scripts in system by taskkill /F /T /IM "python*" command.
But now, i have one script, that automates al... |
View running application output in the browser, how? | 28,188,969 | 1 | 0 | 1,186 | 0 | java,c#,python,ide,desktop-application | You need a web application.Now this web application when loads send request to backend code that backend code will do SSH to remote machine and read the file from specific location.Now that read stream will be send back in response and displayed on web based UI. In these type of application few thinks matters.
1) Like ... | 0 | 1 | 0 | 0 | 2015-01-28T09:34:00.000 | 2 | 0.099668 | false | 28,188,783 | 0 | 0 | 1 | 1 | I have a simple cloud IDE,I want to make it able to build and run applications remotely, the target application's source files will be in a remote server in isolated virtual machine (e.g Windows 8.1,or Ubuntu 14.04). It's not difficult to build that application but how to run it and view its output to users ?
What if i... |
Cannot find PIP in a newly-installed Python3.4 (redhat linux 4) environment | 28,203,008 | 1 | 0 | 752 | 0 | python-3.x,pip | In Python 3 the program will be installed as pip3.
So you should be able to find it using which pip3. | 0 | 1 | 0 | 0 | 2015-01-28T21:35:00.000 | 2 | 0.099668 | false | 28,202,854 | 1 | 0 | 0 | 1 | Cannot locate PIP in a newly-installed Python3.4 (redhat linux 4) environment.
$ python -V
Python 3.4.1
$ which pip
/usr/bin/which: no pip in (/usr/
$ python -m pip install requests
/usr/local/bin/python3.4: No module named pip
I installed this as an alternate installation and am able to successfully create and run pyt... |
where's the equivalent of connfd (created socket in C) in python's BaseHTTPRequestHandler | 28,205,847 | 2 | 1 | 141 | 0 | python,sockets,http,webserver | Found it! It is "self.request"!! Confusing style of naming. | 0 | 1 | 1 | 0 | 2015-01-29T01:25:00.000 | 1 | 0.379949 | false | 28,205,527 | 0 | 0 | 0 | 1 | In C socket programming at the server-side, after a connection is accepted we can get a handle of the new socket (who is transmitting the data) by "connfd" which is the return value of "accept".
Now I'm trying to implement a web server with Python, I have a handler based on BaseHttpRequestHandler, who handles the requ... |
Run replace command on svn:externals (python) | 28,215,771 | 2 | 0 | 153 | 0 | python,svn,externals | First of all, don't use sed. Use Python's string methods or the re module.
Second, I recommend to run svn propget ... first, to fetch the old value. Then, you manipulate it (within Python, no need to run sed). Finally, you run svn propset.
Alternatively, you could run a second Python script as editor for svn propedit. ... | 0 | 1 | 0 | 0 | 2015-01-29T13:05:00.000 | 1 | 1.2 | true | 28,215,502 | 0 | 0 | 0 | 1 | I am currently writing a python script which needs to run a sed command to replace stuff from the svn:externals data.
I tried to run sed on "svn propedit svn:externals ." but the outcome is not the one expected.
Does anyone know how to do this ? |
Python in Cygwin | 28,230,732 | 0 | 0 | 1,910 | 0 | python,python-2.7,cygwin | No, you don't need to do so. In fact, CYGWIN will inherit the PC's PATH, plus with virtual PATH, you can input "echo $PATH" in CYGWIN and input "PATH" and the windows console, you could find that CYGWIN has more PATH setting than the windows. However, as you already overwrite the bash_profile, so it might not looks as... | 0 | 1 | 0 | 0 | 2015-01-30T06:40:00.000 | 2 | 0 | false | 28,230,528 | 1 | 0 | 0 | 1 | I would like to know the difference in
installing Python, Paramiko packages in Cygwin and
Python is already installed in my Windows PC. I have installed Cygwin too (but without Python package) and in Cygwin terminal I do the following:
$echo "PATH=\$PATH:/cygdrive/c/Python27" >> .bash_profile
then,
source .bash_profi... |
Unable to locate package virtualenv in ubuntu-13 on a virtual-machine | 47,263,684 | 6 | 9 | 24,270 | 0 | python,ubuntu-13.10 | It's also possible that you may not have run sudo apt-get update. It worked for me. | 0 | 1 | 0 | 0 | 2015-01-31T21:47:00.000 | 7 | 1 | false | 28,256,891 | 1 | 0 | 0 | 1 | When i try do the given code below:
"sudo apt-get install virtualenv"
the error given in response to the ubuntu-shell is:
E: Unable to locate package virtualenv |
Google App Engine Python Search Api's Location-based queries (Geosearch) Issues | 29,008,682 | 0 | 0 | 248 | 0 | python,google-app-engine,google-search-api,google-app-engine-python | There can be two reasons for this :
1 - miles instead of km
2 - conversion numbers (for example 35,322.2 is 35322.2 ? km ? miles ?)
i suggest to check what exactly are the numbers processed when executing distance function, you can programmatically output this data in some logs
Hope it helps | 0 | 1 | 0 | 0 | 2015-02-02T06:30:00.000 | 1 | 0 | false | 28,272,226 | 0 | 0 | 1 | 1 | I have implemented GAE's Python Search Api and am trying to query based on distance from given geopoint.
My query string is: "distance(location, geopoint(XXX, YYY)) < ZZZ". However, for some reason on the production server, this query string is returning items where the distance is greater than the ZZZ parameter.
Below... |
What is the Debian equivalent of "requirements.txt" in Python for managing packages? | 28,322,460 | 1 | 1 | 1,881 | 0 | python,linux,debian,pip,dpkg | You can certainly dump all the packages installed by dpkg, but that's probably not what you want to do - you'll end up getting thounsands of packages unrelated to your software, and possibly breaking the system, if it's a different debian version.
My advice is getting your software to a fresh debian machine and try to ... | 0 | 1 | 0 | 0 | 2015-02-04T13:04:00.000 | 2 | 0.099668 | false | 28,322,139 | 1 | 0 | 0 | 1 | I'm shipping a Python app for deployment on Debian servers. Providing a requirements.txt file with a list of all needed Python packages is very convenient when installing the app, especially when accompanied with a Makefile to automatically install from it using pip.
But as you know some Python packages depend on Linux... |
How to prevent OSX popup for incoming connections for Python app? | 54,770,045 | 0 | 9 | 2,455 | 0 | macos,python-3.x | For Anaconda users who have updated to Mojave, you may be running an outdated/unsigned version of Python.
Simply run conda upgrade conda to update Python to the latest version, which should also be signed, and the problem should go away. If it doesn't, then you may need to contact Anaconda's support to get them to buil... | 0 | 1 | 0 | 0 | 2015-02-04T19:17:00.000 | 2 | 0 | false | 28,329,562 | 0 | 0 | 0 | 1 | I am developing a simple python3 server app. I invoke it like this:
python3 bbserver.py
Each time after doing this I get the OSX popup:
Do you want the application “Python.app” to accept incoming network connections?
I've tried making an exception for python3 executable (there is no python3.app) in the firewall and hav... |
GoogleAppEngine error directory not found | 28,340,241 | 1 | 0 | 95 | 0 | google-app-engine,python-2.7,google-app-engine-python | Your full project path contains two space characters and needs to be quoted, also, a trailing slash might be required i.e.:
C:\Python27\python.exe appcfg.py update "C:\Users\alastair\Desktop\School Files\Proxy Files\mirrorrr-master\mirrorrr-master\" assuming that's where you have your app.yaml file.
In your case it's t... | 0 | 1 | 0 | 0 | 2015-02-05T08:57:00.000 | 1 | 0.197375 | false | 28,339,778 | 0 | 0 | 1 | 1 | Ive been working on get a proxy working for when im school, to access sites that i use alot for work but my school dont like.. This is the error it comes up with when i try to upload the files to googles app engine..
C:\Program Files (x86)\Google\google_appengine>"C:\Python27\python.exe" appcfg.p
y update C:\Users\ala... |
How to install python weka wrapper on ubuntu 32 bit? | 35,519,213 | 0 | 0 | 359 | 0 | python,weka | Before installing weka wrapper for python you are suppose to install the weka itself using sudo apt-get install weka or build from source code and add the path the enviroment variable using export wekahome="your weka path" this will make sure you have the required weka jar file in the directory | 0 | 1 | 0 | 0 | 2015-02-05T09:21:00.000 | 3 | 0 | false | 28,340,224 | 0 | 0 | 0 | 1 | The official website shows how weka-wrapper can install on ubuntu 64 bit. I want toknowhow it can be install on ubuntu 32 bit? |
I used self.transport.write function to write to tcp stream, How to use flush with it? | 28,348,066 | 1 | 1 | 74 | 0 | python-2.7,twisted | There's no need and no way to flush either the read buffer or the write buffer. | 0 | 1 | 0 | 0 | 2015-02-05T13:59:00.000 | 1 | 0.197375 | false | 28,345,878 | 0 | 0 | 0 | 1 | I created a simple tcp connection server with Twisted framework. I use the self.transport.write function to write data to the client, but I need to flush the data. Is there a way to do this? In addition, is there a way to flush incoming data? |
Why did I get a Segmentation Fault in Python when /tmp is mounted with noexec? | 60,442,126 | 1 | 2 | 636 | 0 | python,debugging,gdb,segmentation-fault,strace | For those who would have the same problem as I had and find this page:
My CherryPy server.py ran fine on my Win10 system on python3.8 but failed with segmentation fault on my Linux system which had python3.6.1.
Switching to python3.8 on Linux solved my problem. | 0 | 1 | 0 | 0 | 2015-02-05T22:20:00.000 | 1 | 0.197375 | false | 28,355,169 | 0 | 0 | 0 | 1 | I am running a custom Python 2.7.3 application on CherryPy in Linux. When I used a service script in /etc/init.d/ to start or stop the service, I encountered a Segmentation Fault (SIGSEGV). Strangely, I did not receive a SIGSEGV if I ran the start or stop command manually from the shell, using "python /path/to/file.py ... |
How to change icon of a MAC OS folder using Python Script and Terminal commands? | 39,163,917 | 2 | 3 | 1,414 | 0 | macos,python-2.7,icons,xattr | Let we have a icon.icns file:
Read the com.apple.ResourceFork extended attribute from the icon file
Set the com.apple.FinderInfo extended attribute with folder icon flag
Create a Icon file (name: Icon\r) inside the target folder
Set extended attributes com.apple.FinderInfo & com.apple.ResourceFork for icon file (name:... | 0 | 1 | 0 | 0 | 2015-02-06T14:58:00.000 | 1 | 0.379949 | false | 28,368,533 | 0 | 0 | 0 | 1 | I am trying to write the Code in Python to Change the Icon of a Mac OS X folder using just the Python Script (Without XCODE or any other API).
The procedure is that I have a icon.icns file , I need to change the folder icon to the icon.icns file using the python script. |
How to use remote python modules | 29,157,556 | 1 | 0 | 32 | 0 | python-3.x,python-import,python-module | You would be better off to install those modules locally.
Can you create packages of those modules (either using pip or something similar) then you can distribute them to your local box.
Of what I know, there is nothing similar. | 0 | 1 | 1 | 1 | 2015-02-07T06:30:00.000 | 1 | 1.2 | true | 28,379,325 | 0 | 0 | 0 | 1 | How I can use some 'extra' python module which is not located localy but on a remote server? Somthing like using maven dependencies with Java |
python - How to share files between many computers | 28,388,912 | 1 | 2 | 516 | 0 | python | Okay, first point is that you can't share memory among machines unless you're on a very specialized architecture. (Massively parallel machines, Beowulf clusters, and so on.)
If you mean to share code, then package your code into a real Python package and distribute it with a tool like Chef, Puppet or Docker.
If you mea... | 0 | 1 | 0 | 0 | 2015-02-07T23:46:00.000 | 1 | 0.197375 | false | 28,388,896 | 1 | 0 | 0 | 1 | My python process run on different machines. It consists of a manager and many workers. The worker in each machine are multi threaded and needs to update some data such as its status to the manager residing on another machine. I didn't want to use mysql because many other processes are already executing many queries o... |
Webpage ping when active | 28,397,610 | 1 | 0 | 47 | 0 | python,google-app-engine,web | The best way is to ping the server while the user is online. Using other methods such as the Channel API with GAE proves to be unreliable since you are not constantly sending a ping message but rather just sending a disconnect message. If the browser crashes, no disconnect message is sent. | 0 | 1 | 0 | 0 | 2015-02-08T03:29:00.000 | 1 | 1.2 | true | 28,390,253 | 0 | 0 | 1 | 1 | I want a way for users to open this webpage, and whenever they are on that page, it updates the server that they are on the page. It should only work when the user is actually looking at the webpage (not inactive, like from switchings tabs). One way to do this which I have implemented is to keep pinging the server sayi... |
Fail to install Python 2.7.9 on a Windows google compute engine instance | 30,692,067 | 7 | 7 | 7,533 | 0 | python-2.7,windows-server-2008,google-compute-engine | Install python EXCEPT "pip"
Run the python install msi again and select "change"
Select "pip" and install the pip
It would be works...
I think it is a priority problem into the msi package...the package seems to try to install the pip before installing python.exe. So, pip can not be installed... | 0 | 1 | 0 | 0 | 2015-02-09T07:35:00.000 | 4 | 1 | false | 28,404,878 | 1 | 0 | 0 | 2 | I fired up a new Windows google compute engine instance. It's running Windows 2008 R2, service pack 1.
I download and try running the Python .msi installer for version 2.7.9, and it fails with this error:
There is a problem with this Windows Installer package. A program required for this install to complete could no... |
Fail to install Python 2.7.9 on a Windows google compute engine instance | 31,103,137 | 0 | 7 | 7,533 | 0 | python-2.7,windows-server-2008,google-compute-engine | It seems to be a dependency issue, please try to install "Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)" | 0 | 1 | 0 | 0 | 2015-02-09T07:35:00.000 | 4 | 0 | false | 28,404,878 | 1 | 0 | 0 | 2 | I fired up a new Windows google compute engine instance. It's running Windows 2008 R2, service pack 1.
I download and try running the Python .msi installer for version 2.7.9, and it fails with this error:
There is a problem with this Windows Installer package. A program required for this install to complete could no... |
Python subprocess.check_call terminate and start from where it terminated | 28,411,277 | 0 | 0 | 58 | 0 | python,subprocess,terminate | So, this is not a question involving code, so you get a general answer, not involving code.
The solution to your problem requires you to keep protocol. This protocol must survive the lifetime of your test processes.
So, there must be some place where you can write to about the state of your tests, and this place must e... | 0 | 1 | 0 | 0 | 2015-02-09T13:38:00.000 | 2 | 0 | false | 28,411,082 | 0 | 0 | 0 | 1 | I am trying to automatize some test cases using subprocess_check.call() by calling another python script with an input and output files. I have approx. 10 input files. When I started to test, for example, first and second files were tested successfully but in the third file I got an error and the script was terminated.... |
Packaging python scripts to .exe on Ubuntu | 28,415,565 | 1 | 0 | 45 | 0 | python,windows,ubuntu,exe | cx_freeze is another option for freezing cross-platform. | 0 | 1 | 0 | 0 | 2015-02-09T17:17:00.000 | 1 | 1.2 | true | 28,415,460 | 1 | 0 | 0 | 1 | I have been trying to package my python scripts into .exe setup for Windows. Is that any way I can do the same while running Ubuntu? |
Setting path for Python in PowerShell? | 28,416,220 | 3 | 5 | 15,527 | 0 | python,powershell,path | Python 2.6.1 is already in your path as demonstrated by item number 2 in your list. On number 3, you're adding Python 2.7 to your path after Python 2.6.1's entry. You need to remove Python 2.6.1 from your environment variable, or at a minimum, set it so that 2.7 is listed first. | 0 | 1 | 0 | 0 | 2015-02-09T17:55:00.000 | 2 | 0.291313 | false | 28,416,182 | 1 | 0 | 0 | 1 | I have two Python versions on my machine (Windows Vista), 2.6 (located in C/Program files) and 2.7 (located in C/).
1- I open PowerShell
2- I type python, and it calls python 2.6.1.
3- I want to change the path for Python 2.7, so I type:
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User")
4-... |
Mac OSX Trouble Running pip commands | 35,575,253 | 0 | 0 | 797 | 0 | python,django,macos,pip | Try adding sudo. sudo pip install Django | 0 | 1 | 0 | 0 | 2015-02-10T01:19:00.000 | 2 | 0 | false | 28,422,520 | 0 | 0 | 1 | 2 | I recently installed Python 3.4 on my Mac and now want to install Django using pip. I tried running pip install Django==1.7.4 from the command line and received the following error:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-6.0.8-py2.7.egg/pip/basecommand.py", line ... |
Mac OSX Trouble Running pip commands | 70,606,374 | 0 | 0 | 797 | 0 | python,django,macos,pip | Try to create a virtual environment. This can be achieved by using python modules like venv or virtualenv. There you can change your python path without affecting any other programs on your machine. If then the error is is still that you do not have permission to read files, try sudo pip install. But only as a last res... | 0 | 1 | 0 | 0 | 2015-02-10T01:19:00.000 | 2 | 0 | false | 28,422,520 | 0 | 0 | 1 | 2 | I recently installed Python 3.4 on my Mac and now want to install Django using pip. I tried running pip install Django==1.7.4 from the command line and received the following error:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-6.0.8-py2.7.egg/pip/basecommand.py", line ... |
How to get network path from local path? | 28,432,344 | 0 | 1 | 1,113 | 0 | python,python-2.7 | Having thought about the problem itself: No, it's not possible to do this in any general way, because there's absolutely no reason why C:\path\to\file should correspond to \\PCNAME\C:\path\to\file; that requires that the folder C:\ has the share name C:, which might be canonical on windows machines, but not fixed. In f... | 0 | 1 | 1 | 0 | 2015-02-10T12:55:00.000 | 3 | 0 | false | 28,432,231 | 0 | 0 | 0 | 1 | I have a local path like C:\Users\some_user\Desktop\some_folder\attachments\20150210115. I need to generate network path with python like \\PC_NAME\C:\Users\some_user\Desktop\some_folder\attachments\20150210115 or something like this to get this folder from other windows pc. Is it possible to do in python automatically... |
How do i stop process running a certain Python script? | 31,284,981 | 0 | 0 | 194 | 0 | python,linux,ps | Easiest way to keep it simple would be to create a screen for each. screen -S prod and screen -S test, then run the python script in the background of each and detach the screen (using ctrl +a+d) then when you need to stop one screen -r prod then kill it/restart then detach again. | 0 | 1 | 0 | 1 | 2015-02-10T17:18:00.000 | 2 | 0 | false | 28,437,813 | 0 | 0 | 0 | 2 | I am running two different Python scripts on a Ubuntu VPS. One of them is the production version, and the other one is for testing purposes.
From time to time, I need to kill or restart one of them. However ps does not show which script does each Python process runs.
What is the conventional way to do this? |
How do i stop process running a certain Python script? | 28,437,903 | 2 | 0 | 194 | 0 | python,linux,ps | ps -AF will give you All processes (not only the ones in your current terminal, or run as your current user), in Full detail, including arguments. | 0 | 1 | 0 | 1 | 2015-02-10T17:18:00.000 | 2 | 0.197375 | false | 28,437,813 | 0 | 0 | 0 | 2 | I am running two different Python scripts on a Ubuntu VPS. One of them is the production version, and the other one is for testing purposes.
From time to time, I need to kill or restart one of them. However ps does not show which script does each Python process runs.
What is the conventional way to do this? |
Error while installing Icehouse openstack using devstack | 28,613,401 | 1 | 0 | 636 | 0 | python,python-2.7,ubuntu-12.04,openstack,devstack | artemdevel is right!
Run the following and you should be good to go :
sudo rm /usr/lib/python2.7/dist-packages/setuptools.egg-info
sudo apt-get install --reinstall python-setuptools | 0 | 1 | 0 | 0 | 2015-02-10T21:00:00.000 | 1 | 0.197375 | false | 28,441,674 | 0 | 0 | 0 | 1 | I am trying to install the icehouse openstack on Ubuntu 12.04 amd64, which is in VirtualBox. I am using devstack to do so. So, I am executing the script "stack.sh". While executing it throws this error:
IOError:[Error 2]No such file or directory: '/usr/lib/python2.7/dist-packages/setuptools.egg-info'
I even updated a... |
Passing shell command to a terminal application from an App in Mac | 28,468,268 | 1 | 0 | 814 | 0 | python,macos,argument-passing,exit-code,py2app | Quoting from Py2app 0.6.4 minor feature release:
Issue #15: py2app now has an option to emulate the shell environment you get by opening a window in the Terminal.
Usage: python setup.py py2app --emulate-shell-environment
This option is experimental, it is far from certain that the implementation works on all systems.... | 0 | 1 | 0 | 0 | 2015-02-10T23:57:00.000 | 2 | 1.2 | true | 28,444,173 | 0 | 0 | 0 | 2 | I have frozen a python based GUI script using Py2app successfully but I run into trouble using this app on Mac. This app is supposed to send arguments/parameters to Clustal, a terminal-based application, but it instead returns an error non-zero exit status 127, '/bin/sh: clustal: command not found'.
I found that my fr... |
Passing shell command to a terminal application from an App in Mac | 28,464,729 | 1 | 0 | 814 | 0 | python,macos,argument-passing,exit-code,py2app | [Based on the discussion in comments] This isn't a problem with the arguments, it's due to the spawned shell not being able to find the clustal executable. I'm not sure why this is, since it's in /usr/local/bin/clustal, and since /usr/local/bin is in OS X's default PATH (it's listed in /etc/paths). Using the full path ... | 0 | 1 | 0 | 0 | 2015-02-10T23:57:00.000 | 2 | 0.099668 | false | 28,444,173 | 0 | 0 | 0 | 2 | I have frozen a python based GUI script using Py2app successfully but I run into trouble using this app on Mac. This app is supposed to send arguments/parameters to Clustal, a terminal-based application, but it instead returns an error non-zero exit status 127, '/bin/sh: clustal: command not found'.
I found that my fr... |
Python - Check if linux partition is read-only or read-write? | 28,456,469 | 6 | 0 | 2,297 | 0 | python,linux | EDIT: The answer makes the assumption that you plan to write to /mnt.
I would just try to write to it and catch OSError exception to handle the read-only case. | 0 | 1 | 0 | 1 | 2015-02-11T14:04:00.000 | 3 | 1 | false | 28,456,349 | 0 | 0 | 0 | 1 | I have a python application running on a beaglebone. How do I (in Python) check if the "/mnt" partition is mounted as read-only or read-write? |
Is CapeDwarf compatible with Python GAE? | 28,474,564 | 1 | 1 | 105 | 0 | python,google-app-engine,capedwarf | Yes, as Alex posted - CapeDwarf is Java only. | 0 | 1 | 0 | 0 | 2015-02-12T01:08:00.000 | 2 | 0.099668 | false | 28,467,558 | 0 | 0 | 1 | 1 | I'm trying to deploy my GAE application - written with Python - on CapeDwarf (WildFly_2.0.0.CR5).
But all the documentation talking only about Java Application.
So is CapeDwarf can deploy Python Application ?
if it is, how to do it ?
else any other application that can ? |
why cmd can not run "python a.py",but "python E:\python\python2.79\a.py"is ok..."python a.py"is taught by a python book | 28,492,782 | 1 | 0 | 41 | 0 | python | It seems like you are not in the same directory as a.py. If so, you will need the absolute path rather than the relative path. That is probably why python (location of a.py) runs but python a.py will not. Make sure that you are running a.py from the same directory as you saved it in. | 0 | 1 | 0 | 0 | 2015-02-13T04:53:00.000 | 2 | 1.2 | true | 28,492,747 | 1 | 0 | 0 | 2 | Just like I ask in the title
I try to run "python a.py" in cmd but it says no such file or directory
"python E:\python\python2.79\a.py" can run..
..I am a newbie in python...I will appeciate for your answers |
why cmd can not run "python a.py",but "python E:\python\python2.79\a.py"is ok..."python a.py"is taught by a python book | 28,492,784 | 0 | 0 | 41 | 0 | python | Usually, when you're using a shell, you're positioned in a directory in the filesystem. The first example, python a.py uses a relative path; it says "the file I want to run is a.py in the very same directory I'm currently in". The second example, python E:\python\python2.79\a.py uses an absolute path; it says "no matte... | 0 | 1 | 0 | 0 | 2015-02-13T04:53:00.000 | 2 | 0 | false | 28,492,747 | 1 | 0 | 0 | 2 | Just like I ask in the title
I try to run "python a.py" in cmd but it says no such file or directory
"python E:\python\python2.79\a.py" can run..
..I am a newbie in python...I will appeciate for your answers |
Python - techniques for reverting changes to a folder? | 28,500,816 | 0 | 0 | 96 | 0 | python,package-managers,revert | You could have two solutions
First is to
1. copy the files into a temp folder and on success
2. remove the old folder
3. move the temp folder into the new one if
Second is to
1.copy the files into a directory, versioned by name, something like C:\Programs\v2, v3, v4 etc.
2. If everything is ok, you create a junctio... | 0 | 1 | 0 | 0 | 2015-02-13T12:31:00.000 | 2 | 0 | false | 28,499,705 | 1 | 0 | 0 | 1 | I am writing a package manager in python for users to install programs we write at work.
When 'installing' a new tool (which is just a process of copying files/folders from locations on a server to the users' computer), it may fail before completion for whatever reason.
If this happens, I need a way to 'undo' all the c... |
Getting output files from external program using python | 28,502,174 | 0 | 0 | 100 | 0 | python,output | I can not comment on your question because my reputation is too low.
If you use os.system or subprocess.check_output or os.popen, you will just get the standard output of your xyz program (if it is printing something in the screen). To see the files in some directory, you can use os.listdir(). Then you can use these fi... | 0 | 1 | 0 | 0 | 2015-02-13T13:49:00.000 | 3 | 0 | false | 28,501,107 | 0 | 0 | 0 | 2 | I am using Python 2.7.3 in Ubuntu 12.04 OS. I have an external program say 'xyz' whose input is a single file and two files say 'abc.dat' and 'gef.dat' are its output.
When I used os.system or subprocess.check_output or os.popen none of them printed the output files in the working directory.
I need these output files... |
Getting output files from external program using python | 28,558,974 | 0 | 0 | 100 | 0 | python,output | Thank you for answering my question but the answer to my question is this -
import subprocess
subprocess.call("/path/to/software/xyz abc.dat", shell=True)
which gave me the desired the output.
I tried the subprocess-related commands but they returned error " No such file or directory". The 'shell=True' worked like a ... | 0 | 1 | 0 | 0 | 2015-02-13T13:49:00.000 | 3 | 0 | false | 28,501,107 | 0 | 0 | 0 | 2 | I am using Python 2.7.3 in Ubuntu 12.04 OS. I have an external program say 'xyz' whose input is a single file and two files say 'abc.dat' and 'gef.dat' are its output.
When I used os.system or subprocess.check_output or os.popen none of them printed the output files in the working directory.
I need these output files... |
checking whether the C compiler works... no when installing python 2.6 (mac os x lion) | 28,530,379 | 2 | 4 | 6,376 | 0 | c,xcode4,osx-lion,python-2.6 | Actually I found the problem. The problem was with the ld: library not found for -lgcc_ext.10.5
The gcc version given by Xcode 4.6.3 on Mac OS X Lion is 4.6.
I installed the new gcc via homebrew, brew install gcc.
I symlink my gcc to gcc-4.9 by doing ln -s /usr/local/bin/gcc /usr/local/bin/gcc-4.9.
make sure the that ... | 0 | 1 | 0 | 1 | 2015-02-13T18:25:00.000 | 1 | 1.2 | true | 28,506,217 | 0 | 0 | 0 | 1 | I'm trying to install python 2.6 using pyenv but when doing pyenv install 2.6.9I get the following:
checking MACHDEP... darwin
checking EXTRAPLATDIR... $(PLATMACDIRS)
checking machine type as reported by uname -m... x86_64
checking for --without-gcc... no
checking for gcc... gcc
checking whether the C compiler works..... |
Google NDB: Adding an entity with non existing parent | 28,513,820 | 4 | 1 | 168 | 0 | python,google-app-engine,google-cloud-datastore | You can create a key for any entity whether this entity exists or not. This is because a key is simply an encoding of an entity kind and either an id or name (and ancestor keys, if any).
This means that you can store a child entity before a parent entity is saved, as long as you know the parent's id or name. You cannot... | 0 | 1 | 0 | 0 | 2015-02-14T08:18:00.000 | 2 | 0.379949 | false | 28,513,774 | 0 | 0 | 1 | 1 | I am working on a web application based on Google App Engine (Python / Webapp2) and Google NDB Datastore.
I assumed that if I tried to add a new entity using as parent key the key of a no longer existing entity an exception was thrown. I have instead found the entity is actually created.
Am i doing something wrong?
I... |
Problems using psycopg2 on Mac OS (Yosemite) | 60,101,069 | 13 | 48 | 17,998 | 1 | python,eclipse,macos,postgresql,psycopg2 | I was able to fix this on my Mac (running Catalina, 10.15.3) by using psycopg2-binary rather than psycopg2.
pip3 uninstall psycopg2
pip3 install psycopg2-binary | 0 | 1 | 0 | 0 | 2015-02-14T13:12:00.000 | 8 | 1 | false | 28,515,972 | 0 | 0 | 0 | 2 | Currently I am installing psycopg2 for work within eclipse with python.
I am finding a lot of problems:
The first problem sudo pip3.4 install psycopg2 is not working and it is showing the following message
Error: pg_config executable not found.
FIXED WITH:export PATH=/Library/PostgreSQL/9.4/bin/:"$PATH”
When I i... |
Problems using psycopg2 on Mac OS (Yosemite) | 28,949,608 | 4 | 48 | 17,998 | 1 | python,eclipse,macos,postgresql,psycopg2 | I am using yosemite, postgres.app & django. this got psycopg2 to load properly for me but the one difference was that my libpq.5.dylib file is in /Applications/Postgres.app/Contents/Versions/9.4/lib.
thus my second line was sudo ln -s /Applications/Postgres.app/Contents/Versions/9.4/lib/libpq.5.dylib /usr/lib | 0 | 1 | 0 | 0 | 2015-02-14T13:12:00.000 | 8 | 0.099668 | false | 28,515,972 | 0 | 0 | 0 | 2 | Currently I am installing psycopg2 for work within eclipse with python.
I am finding a lot of problems:
The first problem sudo pip3.4 install psycopg2 is not working and it is showing the following message
Error: pg_config executable not found.
FIXED WITH:export PATH=/Library/PostgreSQL/9.4/bin/:"$PATH”
When I i... |
How to call command line command (AFNI command)? | 28,565,218 | 0 | 0 | 411 | 0 | python,subprocess,dicom,pydicom | Oh this was due to syntax error using Pydicom.
I wanted to access 0019, 109c tag.
Syntax should be:
ds[0x0019,0x109c].value.
not ds[aaaa,bbbb].value | 0 | 1 | 0 | 0 | 2015-02-16T02:00:00.000 | 2 | 0 | false | 28,533,515 | 0 | 0 | 0 | 1 | I am trying to read a dicom header tag in dicom file.
Now, there are two ways to read this dicom header tag.
1) Using pydicom package in python which apparently is not working well on my python installed version(python 3).
2) or when i call AFNI function 'dicom_hinfo' through command line, i can get dicom tag value.... |
Hanging script and cmd won't close | 29,957,535 | -1 | 0 | 749 | 0 | python,python-2.7,windows-7,cmd | The filepaths I was pulling files from were through ClearCase directories. It turned out that I simply had to reinstall ClearCase. There must have been some configuration issue that was causing the cmd to hang and thus forcing a hard reboot. It's good to point out that I am no longer experiencing this problem and that ... | 0 | 1 | 0 | 0 | 2015-02-17T21:57:00.000 | 1 | 1.2 | true | 28,571,885 | 0 | 0 | 0 | 1 | I am trying to run a python script via cmd prompt on my work PC (Windows 7, Python 2.7). The script requires filepaths from different drives on my PC. I am correctly pulling all necessary filepaths and I press Enter to run the script but the script just hangs. The only thing that shows is a blinking underscore. I try t... |
Why use Python's os module methods instead of executing shell commands directly? | 28,583,621 | 327 | 158 | 27,738 | 0 | python,linux,operating-system | It's faster, os.system and subprocess.call create new processes which is unnecessary for something this simple. In fact, os.system and subprocess.call with the shell argument usually create at least two new processes: the first one being the shell, and the second one being the command that you're running (if it's not a... | 0 | 1 | 0 | 0 | 2015-02-17T23:00:00.000 | 6 | 1.2 | true | 28,572,833 | 0 | 0 | 0 | 3 | I am trying to understand what is the motivation behind using Python's library functions for executing OS-specific tasks such as creating files/directories, changing file attributes, etc. instead of just executing those commands via os.system() or subprocess.call()?
For example, why would I want to use os.chmod instead... |
Why use Python's os module methods instead of executing shell commands directly? | 28,582,402 | 11 | 158 | 27,738 | 0 | python,linux,operating-system | It's far more efficient. The "shell" is just another OS binary which contains a lot of system calls. Why incur the overhead of creating the whole shell process just for that single system call?
The situation is even worse when you use os.system for something that's not a shell built-in. You start a shell process which ... | 0 | 1 | 0 | 0 | 2015-02-17T23:00:00.000 | 6 | 1 | false | 28,572,833 | 0 | 0 | 0 | 3 | I am trying to understand what is the motivation behind using Python's library functions for executing OS-specific tasks such as creating files/directories, changing file attributes, etc. instead of just executing those commands via os.system() or subprocess.call()?
For example, why would I want to use os.chmod instead... |
Why use Python's os module methods instead of executing shell commands directly? | 28,573,425 | 16 | 158 | 27,738 | 0 | python,linux,operating-system | Shell call are OS specific whereas Python os module functions are not, in most of the case. And it avoid spawning a subprocess. | 0 | 1 | 0 | 0 | 2015-02-17T23:00:00.000 | 6 | 1 | false | 28,572,833 | 0 | 0 | 0 | 3 | I am trying to understand what is the motivation behind using Python's library functions for executing OS-specific tasks such as creating files/directories, changing file attributes, etc. instead of just executing those commands via os.system() or subprocess.call()?
For example, why would I want to use os.chmod instead... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.