Python is an interpreted, general, high-level programming language. The design emphasizes readability. It is notable for using tabs to indicate block levels. As a dynamic language, it shares many similarities to Ruby, Perl, and Scheme. The language is very popular for scientific computing and ...

learn more… | top users | synonyms

7
votes
11answers
18k views

Scripting: what is the easiest to extact a value in a tag of a XML file?

I want to read a pom.xml ('Project Object Model' of Maven) and extract the version information. Here is an example: <?xml version="1.0" encoding="UTF-8"?><project ...
0
votes
0answers
38 views

URLField in django models allowing users to submit blank records, why?

This is what my models.py file looks like: from django.db import models class accounts(models.Model): url = models.URLField(max_length=200, blank=False) The database is still allowing blank ...
1
vote
2answers
268 views

What's the exit code for “curl -I” when not HTTP 200?

I want to check what HTTP status code is returned for an HTTP(S) URL. I don't care about content, so I just request head with curl -I $url or curl --head $url But what's the exit code I should ...
9
votes
2answers
11k views

Python / Selenium / PhantomJS: “Unable to start phantomjs with ghostdriver.”

I'm trying to get Selenium to use phantomjs on a Windows machine. My code compiles without any error: from selenium import webdriver from selenium.webdriver.common.desired_capabilities import ...
0
votes
0answers
27 views

Powershell - Set-alias doesn't accept paramters - python

Following this tutorial i want to set an alias for python autopep8. the syntax described is. Set-Alias gs Get-Service <enter> So o copy that format i have done. PS C:\Users\sayth> ...
4
votes
8answers
13k views

Trying to edit a python file but the “edit with IDLE” has disappeared when i right click the file. How do I restore that command?

Trying to edit a python file but the "edit command" has disappeared all of a sudden when i right click the file. How do I restore the edit command so i can continue working on my python files? I am ...
2
votes
1answer
327 views

Installing pymedia on OSX

Trying to install the most recent version of pymedia available at sourceforge. python setup.py install I get the error: In file included from sound/sound.cpp:33: sound/audio_unix.h:29:10: fatal ...
0
votes
0answers
49 views

Windows: add python scripts folder to path

On windows, I have some python scripts in a folder. How can I do to invoke a script without having to specify its full path? I tried adding the folder to the PATH environment variable but it's not ...
0
votes
0answers
13 views

How to connect psql to the forumdb.py(a python file) in ubuntu?

I have my system with UbuntuOS installed. I am following an online course where it indicates the use of Vagrant and connects your Windows/Mac system using the Virtual Box having Linux installed in it. ...
1
vote
1answer
94 views

how to install autotest on linux?

I'm looking at the autotest software suite found here: https://github.com/autotest/autotest I follow the instructions in the documentation here: ...
1
vote
0answers
47 views

Adjusting 10.10 Desktop Change Python Script

I'm not fantastic in Python and I'm currently using a script based off of https://gist.github.com/gregneagle/6957826. I'm looking to make one change to the Desktop Image Dictionary Keys option in ...
1
vote
1answer
47 views

.zshrc doesn't export variable for anaconda

I installed Anaconda Python on my Mac today and following line was added to .bash_profile by Anaconda. Since I am using zsh so I moved this line to .zshrc. However, it doesn't work properly even if I ...
0
votes
0answers
105 views

Sublime text 3 and PYTHONPATH environment variable (windows)

It seems that sublime text 3 on my machine isn't respecting the PYTHONPATH environment variable, meaning I cannot easily import modules in to sublime text. I've written a script to get around this ...
0
votes
0answers
7 views

download complete when run from command line but not complete run from launchd

Curious thing. I have a Python script that I've set up through launchd on my Mac to run every 5 minutes. All it does is download a file from a website. My issue/question is that when it's run that ...
0
votes
0answers
180 views

Python setup failed Unspecified error

I'm install python 3.5.0a3 first time on windows 8.1 64 bit and at just starting of installation it just says "Setup failed". Here is the log file.
1
vote
1answer
464 views

My computer can't find the git command

I recently installed git on my computer (OSX 10.10.1) and when I run git I get git: error: unable to find utility "git", not a developer tool or in PATH. So I checked, found that I didn't have the ...
15
votes
3answers
59k views

How to globally modify the default PYTHONPATH (sys.path)?

On a Ubuntu (10.10) system, I have a Python package that installs itself into /usr/local/lib/python2.6/site-packages/. This isn't contained in the default path (sys.path). How do I add this directory ...
1
vote
1answer
158 views

How to set up flask server startup?

I have a web-server that is based on flask+tornado combination. It works inside of a virtual environment (set up with python virtualenv). I want the server to launch automatically on start up, from a ...
13
votes
6answers
3k views

What is the best method to remove duplicate image files from your computer?

I have a lot of duplicate image files on my Windows computer, in different subfolders and with different file names. What Python script or freeware program would you recommend for removing the ...
3
votes
1answer
90 views

how to include python modules not under distribution root in setup.py?

I am new to python and am figuring out and using distutils to create a distribution for a python project, in the setup.py file you indicate which python modules to be included with the option ...
8
votes
5answers
44k views

Updating Python on Ubuntu system

I want to update the Python build on my Linux box, but the only way I know how to do it is uninstalling the current version and installing the new one. My system is already up to date (I updated ...
1
vote
1answer
107 views

Why doesn't my Python script save the file when I use Task Scheduler?

I have a Python script that uses csv.writer to create a csv file. This works fine when I run it from the command line, but no file is created when I run the script using Windows Task Scheduler. The ...
0
votes
0answers
37 views

Disconnect and reconnect dongle in Linux

Do any one know how to disconnet and reconnect dongle in linux through command line (will be great if told using Ppython too). Tried to use mount, unmount command but error occurs as mount: special ...
1
vote
0answers
98 views

Is it possible to install llvmlite Python package on Cygwin?

When trying to install llvmlite Python package on cygwin, I get the following errors: $ pip install llvmlite Downloading/unpacking llvmlite Downloading llvmlite-0.4.0.tar.gz (69kB): 69kB downloaded ...
15
votes
3answers
18k views

easy_install will not connect through proxy

I'm running Ubuntu Server 10.04 64-bit under VirtualBox, and it seems that everything except easy_install and pip can connect to the Internet. I have set and exported the http_proxy environment ...
3
votes
1answer
2k views

apt-offline on Windows

Following this tutorial, I don't know how to reproduce step 2 on a windows machine: apt-offline get C:\apt-offline.sig --threads 5 How do I install apt-offline on a Windows machine so I can run ...
0
votes
0answers
68 views

ImportError: liblapack.so.3gf: cannot open shared object file: Input/output error

I am importing numpy into python on Ubuntu 12.04 using a PCDuino3. For some odd reason, several of my links in the /etc/alternatives/ go bad after running my code. When I type ls -l in ...
2
votes
1answer
766 views

Looping on image2pipe with FFMPEG

I have a Python program that generates images at various intervals. I'd like to be able to create a streaming video of each image as it appears. Previously I was using an ffmpeg command like ffmpg ...
1
vote
2answers
332 views

OpenBSD 'device not configured' error in chroot-ed environment

I have asked this question on StackOverflow but given the comment there it seems like it fits here better. This is almost certainly a system configuration issue—you didn't set up the jail ...
0
votes
0answers
42 views

How to configure 'user-data-dir' in PhantomJS WebDriver

I currently have a working script with the following code: chrome_options = Options() chrome_options.add_argument("user-data-dir=" + os.path.dirname(sys.argv[0])) browser = ...
4
votes
4answers
4k views

Where can I find a gallery of Pygments CSS files [closed]

I googled every possible combination but I couldn't find a list of syntax files. Is there a list of good ones?
0
votes
1answer
46 views

Keeping en0 down while I change IP address mac

I have a DHCP server which assigns myself a new IP address. What I'm wanting to do is power down the wireless adaptor, then change the ip address manually. What's happening is as soon as I set the new ...
1
vote
3answers
4k views

Is there a way to install GeoIP from source code on Mac OS X?

I want to install the MaxMind GeoIP C library, so that I can use GeoIP as part of Django. I’m working on Mac OS X. I’ve downloaded GeoIP-1.4.8.tar.gz from here and run: ./configure make make check ...
2
votes
2answers
415 views

Error Compiling Python 2.7.3 on CentOS5

I'm trying to install Python 2.7.3 on my CentOS 5.50 machine. Download, extract, configure (with --prefix=/usr/local) are fine. Its the make that throws this error: gcc -pthread -c ...
1
vote
3answers
91 views

Is python server side or client side? [closed]

I am debating on using python or work with JavaScript & PHP. Basically what I am trying to do is run an algorithm against some data pulled from my database. ( the algorithm can be very demanding ...
0
votes
0answers
53 views

Install scipy on blender

I'm working with windows 64-bit and I have Blender 2.73 (so python 3.4.2). I tried downloading scipy's executables for python 2.7 (spicy exe available on the site doesn't accept 3.x) on my system, ...
0
votes
1answer
90 views

cronjob not executing python script - tried strace

I'm having trouble making a python script run via cronjob. I can run the python script (it's supposed to connect to a database, pull a few records, save that to a csv, then email it) manually just ...
0
votes
1answer
569 views

Apache serves .py as downloadable file instead of executing it

Ubuntu machine. Installed mod_python using apt-get. added <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order ...
0
votes
0answers
28 views

.py file downloads instead of executing

I am mint 17.1, apache2, php3.4.0 I reloaded mint new. Modified apache2.conf file to have: <Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride None ...
0
votes
2answers
114 views

How to recursively delete all .DS_STORE files from a directory on a Windows Machine?

I extracted a .zip file compressed on a Mac and discovered that the compression included all the .DS_STORE meta-directory files (I think used to speed up spotlight search, but besides the point?). Is ...
9
votes
1answer
942 views

Why is Python for Windows not installed in %PROGRAMFILES% (“C:\Program Files”)?

Python was originally installed in C:\Program Files\Python, but that changed around 1.5. What was the reasoning behind that decision? Is it a bad idea to change the directory back, and if so, why?
0
votes
0answers
69 views

Should I delete all these Python frameworks? (cross-post from Ask Different where nobody is answering)

I'm just getting started with web development and I'm trying to set up my environment, and I can't do that until Dr Homebrew has discharged me from N00bcake Hospital. This is what I'm getting: ...
0
votes
0answers
52 views

XMPP chat room logger

I was wondering how I would go about getting something for my server that would login to a XMPP server, join a chat room, and just sit there and log all the chat and then save it on my server on the ...
1
vote
2answers
834 views

Restore Mac preinstalled Python to standard

I have been hacking away at getting packages to work in my initial coding stages. I only recently stumbled upon virtualenv and found the need to install Python using Homebrew. I have installed ...
0
votes
1answer
32 views

Compress software installers into one executable

How am I going to compress (I don't know what's the right term for this) different software installer into one? When I click the executable file, all the installer I have is there, then I can proceed ...
1
vote
5answers
29k views

How to manually stop a Python script that runs continuously on linux

I have a Python script that is running and continuously dumping errors into a log file. I want to edit the script and run it again, but don't know how to stop the script. I'm currently logged on ...
0
votes
1answer
483 views

How to install python-pip in CentOS7 Docker Container

I am trying to build a docker container that includes pip. I am on CentOS 7. Here is the fragment from running the docker build command: Step 3 : RUN yum -y install python-pip ---> Running in ...
1
vote
0answers
37 views

Compiling this (C++) git repository code [closed]

I'm reading a statistical paper and the author was kind enough to post his code publicly on github at the following link https://github.com/mosco/crossing-probability I have a Windows operating ...
0
votes
1answer
27 views

Multiple commands, but not at the same time

I want to execute 4 different files in the background with python, but not simultaneous. There should be ~5 seconds between each evaluation, but I can't get it to work. I tried: python cmd1 &; ...
0
votes
0answers
16 views

Program is not opening, launchd.peruser 501 code in the console

On Macintosh. From Console: 2015-03-21 5:27:03.107 PM com.apple.launchd.peruser.501[170]: (com.schrodinger.Maestro.5840[11665]) Exited with code: 1 When trying to opening the program from the ...