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

1
vote
1answer
82 views

IDA PRO help — automation command line flags

I am trying to run IDA Pro (full version) remotely through a linux terminal as to automate the analysis and output process. I know there are plugins such as IDAPython and there is the use of the flags ...
1
vote
1answer
76 views

How can I write an .odt programmatically?

I would like to write an .odt file programmatically e.g. include figures from a directory or use different style writing code (like a LaTeX document). I wonder how can I compile an .odt file and, if ...
-4
votes
1answer
50 views

Someone is hooking me? [closed]

I have some ticket on customer site I'm dealing with. My application uses 3rd party app (written in Python & c++) which I don't have the code - and in my code is always failing on one server, and ...
2
votes
1answer
46 views

PyCharm: How to jump to top or bottom of script with keyboard shortcuts?

I'm looking for the VI/VIM equivalent of 'gg' and 'Shift+g' but within PyCharm. Searched through their docs and didn't find anything.
0
votes
2answers
135 views

Evaluate a Python one-line statement in GNU Emacs

I'm using run-python on GNU Emacs 24.3 for its "Inferior python shell" and am trying to get behavior similar to lisp-send-last-sexp, that sends and evaluates an expression in the running interpreter. ...
0
votes
1answer
221 views

Python 3.3.0. I get this error import error : no module named request. what to do ? i use windows 7

import urllib.request page = urllib.request.urlopen("http://www.beans-r-us.biz/prices.html") text = page.read().decode("utf8") print ("Buy!")
0
votes
1answer
70 views

Why does my path not default to using Python 2.7 instead of 2.6?

I am using Google App Engine but starting programs from its interface is not working. The logs in GAE indicate it is trying to use python 2.6 and it needs 2.7 so it fails to run. I have used python ...
0
votes
0answers
59 views

Install Pydev in Eclipse galileo

I had a eclipse which had pydev configured inside but I deleted it. Now I extracted the eclipse again but now after installing PyDev I can't see any Interpreter option. When I go to ...
0
votes
2answers
31 views

Using two python paths for vim in Windows

I wanted to simply :!python % in order to run the file im using in vim, but the obvious conflict is that there's no way for me to distinguish python2 and python3 since including both to $PATH$ would ...
1
vote
3answers
43 views

How to install alternative version of Python beside distro supplied?

Is there any official way to install a specific version of Python, at least 2.6, manually into my chosen directory? I do not necessarily have root privileges on the host that I am installing to. ...
0
votes
0answers
63 views

Find an xterm window by title, enter one command and press return using python/bash

I have an xterm window with a custom title. The xterm was fired up the following way: xterm -T customTitle I would like to enter a command (for example ls -l) into this xterm window from a ...
0
votes
2answers
91 views

Batch file rename script swapping substrings in filename?

I have a group of files named like title_december_word1_word2.png and want to iterate through the directory and swap word1 and word2 within each file. i.e. go from button_december_state_pressed.png ...
0
votes
4answers
85 views

Batch file rename script swapping substrings in filename?

I have a group of files named like title_december_word1_word2.png and want to iterate through the directory and swap word1 and word2 within each file. i.e. go from "button_december_state_pressed.png" ...
0
votes
1answer
30 views

Can I make key-binding add-on for a browser game?

I was adviced to post here from Programmers SE. So we got this Drakensang Online, a RPG browser game. I got 7 skill slots on the skill bar but the last skill slot is kinda far and uncomfortable for ...
1
vote
0answers
200 views

Half-installed python packages and circular dependency

Something went wrong while updating to ubuntu 12.04 to 12.10: root@ely:/sys/bus/usb/devices# dpkg -l | grep ^i[HUFW] iU libpython2.7 2.7.3-0ubuntu3.4 ...
1
vote
1answer
119 views

Accidentally deleted a module needed by yum - how to reinstall it?

I have a problem when trying to update yum. It gives me an error: After running yum update There was a problem importing one of the Python modules required to run yum. The error leading to this ...
0
votes
1answer
36 views

Log user detail who restarted a service

This is related to a question asked by me some time back. I want to log the details regarding who restarted a particular service on Linux. For example: If a user X restarts apache, then it would ...
0
votes
1answer
361 views

Dive into Python 3 - convert to ePUB

The ebook Dive into Python 3 is available on GitHub. This script creates the HTML and PDF versions. Is it possible to generate an ePUB version from this on Linux?
0
votes
1answer
142 views

Passing parameters to python -c inside a bash function?

I need to print the value of a Django setting while in a Bash shell. Basically, the command I'd like to run is python -c 'from django.conf import settings; print settings.MEDIA_ROOT'. I need to be in ...
0
votes
1answer
218 views

Setting Up a Python Cron Job

I hope you guys can help. I've never set up a cron job before but would like to run a daily Python script at 5am on my server. I'm using hosting from CrazyDomains.com.au (Linux server) and can't find ...
1
vote
1answer
153 views

extract characters between first and second underscores of filenames and count such files in linux folder

I would like to extract characters between first and second underscores of filenames in a folder and count such type of files present in it. The folder contains files in a particular format such as : ...
0
votes
1answer
54 views

Clean Python Uninstallation from Windows 7

On my Windows 7 (64bit) machine, there are 3 Python installations that I want to completely purge from my system (so I can begin from scratch). The environments/setups have been split between Admin ...
0
votes
0answers
32 views

Accessing decompiled python files during program run

I'm a newbie in python coding but currently trying to learn it. I'm trying to develop mods for a program which uses python as its main language. I can already compile mods for it but they are very ...
1
vote
2answers
459 views

Apple Mavericks - why doesn't this one-line BASH script set my Python virtual environment like I expect?

I have the following Bash script: #!/bin/bash echo $MYPROJECT_HOME/bin/myproject_venv/bin/activate source $MYPROJECT_HOME/bin/myproject_venv/bin/activate echo ...
0
votes
1answer
246 views

Why i can't run idle in python, while i am connected through putty

here is the the text it shows when I try to run idle: Traceback (most recent call last): File "/opt/epd/bin/idle", line 5, in <module> main() File ...
2
votes
2answers
475 views

How to increase Python's CPU usage

I use Python to execute some algorithms and no matter which Python I use, and I have tried many versions, the CPU usage goes to 25% max. Why doesn't Python take advantage of the rest of my CPU ...
0
votes
2answers
122 views

What is the proper way to upgrade Scrapy on a mac

I am trying to upgrade Scrapy v 0.18.4 to the latest version which I believe is 0.20.0 on a mac. I do not see in the docs how I should go about doing so. I tried running pip install --upgrade Scrapy ...
0
votes
2answers
658 views

How to install PyQT4 and what are the practical differences between PyQT4 and PyQT5?

I am about to start developing using PyQT, but there seem to exist two versions. Which one should I go for? Also, I cannot seem to be able to install either, using pip install PyQt4 I get the ...
1
vote
1answer
167 views

After exiting from ssh connection, process is killed/times out

I'm running a python script in the background on an Ubuntu ssh server. nohup python x.py & After a certain amount of time, maybe half an hour, the python script stops running when I come back into ...
0
votes
0answers
16 views

Compiling Python with Module Support

I am using Red Hat 5.5 and this requires Python 2.4.3 as its system python. I foolishly destroyed the system python doing what was supposed to be an 'altinstall'. Anyway, I have python 2.4.3 back as ...
1
vote
1answer
106 views

Python: select logical code blocks with VIM

How does one select logically indented code blocks with VIM? For instance, consider this bit of Python: 01:class Foo(object): 02: 03: def __init__(self, bar): 04: 05: if 'baz' in bar: 06: ...
0
votes
1answer
111 views

bash: syntax error near unexpected token `ex25'

all I have tried to make a program from 'learn python the hard way'. it's exercise 25. in the extra credit it tells me to go help(ex25), but when I type that in, I get this on linux mint 15 terminal: ...
2
votes
1answer
187 views

python2.7: can't open file '/usr/lib/python2.7/py_compile.py'

I'm getting lot's of error with apt-get. I've tried to install package manualy but everything seems stucked. mio@vm:~$ sudo apt-get install --reinstall python2.7-minimal Reading package lists... Done ...
2
votes
2answers
2k 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
1answer
237 views

How to delete a folder in Python when [Error 32] is present

I am using Python 2.7. I want to delete a folder which may or may not be empty. The folder is handled by a thread for file-monitoring. I am not able to kill the thread, but wanted to delete this ...
0
votes
1answer
76 views

How to add “create a new python file” to the registry [duplicate]

I have Python 3.2 on a windows 7 operating system. The other day I thought that it would be convenient to add a link to create a new .py file in the right hand click "new" menu. I had worked with the ...
0
votes
1answer
86 views

How to set file association in Windows Explorer?

I have installed the Canopy Python package, and when I double-click a python file it opens the Canopy editor. I want clicking the file to run it, not edit it. I have changed the file properties to ...
1
vote
1answer
75 views

With a bot, how do I avoid or handle IRC server MOTD's?

I have an IRC bot written in Python that works fairly well. I think the issue is with my limited knowledge of the IRC protocol, so IRC gurus are particularly welcome here :D When you first connect to ...
1
vote
0answers
116 views

pip install fails on guest Linux Mint 15

On my Windows 7 PC, I installed VMware VM for Linux Mint 15. Windows PC is behind corporate firewall /proxy server. Now inside Linux I issued: sudo apt-get install python-virtualenv Then created ...
1
vote
0answers
97 views

NumPy Matplotlib install error: ftheader.h: No such file or directory (Fedora/RHEL)

When I am trying to build matplotlib-1.3.1, I am getting the below freetype header errors. Probably it is not finding the ftheader.h Any idea on how to solve this problem. NOTE: I just installed ...
1
vote
0answers
397 views

Installing MySQL-python raises compiler warnings after Mavericks

I had many python modules installed before I upgraded Mavericks and were very disappointed when I noticed that they had been removed. I installed Mavericks, and I installed the command line tools. ...
0
votes
0answers
88 views

MacPorts pHash not showing up in Python

I am having a problem where python does not show pHash installed even though I installed it using macports. I made sure I am using the MacPorts version of Python by doing: sudo port select --set ...
0
votes
0answers
14 views

Python modules in Apple's Python packages directory?

I am trying to install the python packages installed on my computer and a few of them appear in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib Which as I read this python is ...
3
votes
1answer
99 views

setup vim so that it searches the python path

I'm using vim as my primary editor with python files; I'd like to be able to easily open python files. As an example: I'm looking at a particular module A.py, in it I see the line import funkyModule, ...
0
votes
1answer
111 views

Excel fails to open Python-generated CSV files

I have many Python scripts that output CSV files. It is occasionally convenient to open these files in Excel. After installing OS X Mavericks, Excel no longer opens these files properly: Excel doesn't ...
0
votes
0answers
31 views

Why is the Python interpreter provided by Django suddenly showing me Python tab completion upon a single Tab press?

This issue seems to have just started happening; basically I just noticed that whenever I press the Tab key in the Python interpreter that comes with Django, it gives me the Display all ... ...
1
vote
0answers
32 views

How do I get `set show-all-if-ambiguous on` in my .inputrc to play nice with the Python interpreter?

I noticed that after I added the set show-all-if-ambiguous on line to my ~/.inputrc, whenever I pressed tab to indent a block, it would show me the bash Display all ... possibilities? (y or n) prompt, ...
0
votes
1answer
52 views

Listing packages in a repositiory?

I'm working on Ubuntu 12.04 Server. I want to install OpenStack, so I enabled the Cloud Archive repo: sudo add-apt-repository cloud-archive:havana After the subsequent update and upgrade, I noticed ...
0
votes
2answers
30 views

Is there a way to make a certain device not need root to access

Apparently you need to be root to access devices through Python. Is there a way to identify a particular USB device and then set it up so I don't need to be root to access it?
0
votes
2answers
52 views

Automating python script on a mac not running

I have tried to have this question answered twice now(1, 2). While both were informative none of the solutions have worked, and I don't know why. The first solution was to use launchctl the second was ...