Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

learn more… | top users | synonyms

2
votes
1answer
14 views

Python failing to import winregistry

I'm trying to use secretsdump.py, which relies on winregistry.py. The error I'm getting is: Traceback (most recent call last): File "secretsdump.py", line 41, in <module> from impacket ...
3
votes
2answers
67 views

Unable to pass a bash variable as a python argument in bash

For some reason I cannot pass the bash variable $FOLDER as a python argument on the following code. The python script downloads some files from amazon s3. Bash script: #!/bin/bash FOLDER=$(./aws get ...
0
votes
0answers
11 views

subversion not working with pycharm

In pycharm, there is an option to upload changes to a remote svn repository. However, it does not ask for password. How do I provide it?
0
votes
1answer
45 views

How can I recover deleted data from a partition [on hold]

I want to recover deleted data from a partition with the help of a Python program. I know that on deletion, only the inode information of that file is deleted, but the bits are not overwritten by ...
1
vote
1answer
34 views

“make test” failed while compiling Python

I compiled Python 3.4.1 on an emulated Debian 7 ARM system. make test failed on test_multiprocessing_fork: FAIL: test_semaphore_tracker (test.test_multiprocessing_fork.TestSemaphoreTracker) ...
0
votes
0answers
5 views

Is there any prompt decoration package available for iPython?

One can argue, that IPython can be a productive replacement for bash. I wonder, if anyone here have seen some sort of prompt decoration for IPython, that can be compared to the standard bash prompt, ...
4
votes
2answers
40 views

Tilling window manager written in Python

Is there any tiling manager like XMonad but written with Python? I think Haskell was too hard for me. But I know python a little.
2
votes
2answers
59 views

How to change my script to replace and add new variable in a configuration?

Well this is my script. It is to configure my systems sysctl.conf. infile = open('sysctl.conf') outfile = open('sysctl.conf.new', 'w') replacements = {'Net.ipv4.icmp_echo_ignore_all' :'1', ...
-1
votes
1answer
26 views

add groups from external file

I want to write a script which add groups to the system, specified in groups.txt file. content of groups.txt : group01 : computer group02 : electronics group03 : IT . ...
3
votes
1answer
47 views

Grepping a variable

I've written a simple init script to start and stop a Python script as a service. I have to be explicit about the version of Python I'm running, because this is on a CentOS 5 box with Python 2.4 & ...
1
vote
1answer
16 views

'altinstall' python-devel; can't install psycopg2 on centos

I installed python2.7 on my centos 2.6.32-431.17.1.el6.x86_64 following these directions: http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/ #after the yum stuff... # Python ...
0
votes
2answers
30 views

Why can't my python script change umask?

This is my script #!/usr/bin/python import os print "hello world from python" os.system("echo 'hello world from bash'") os.system("umask 055") os.system("ls -alh > test") If I run this code ...
0
votes
3answers
29 views

Python compile error on openSUSE: no module named wx

I'm new to Linux. After installing openSUSE I'm trying to make my VPN software running. I've followed the site's direction: Unpack the general package [Other / Source code], install OpenVPN and ...
5
votes
2answers
230 views

how to read and modify fstab in python?

I want to automatically configure my fstab in python by running a script. I thought of using ConfigParser in python, but I am unable to use it properly.
2
votes
1answer
114 views

Convert xml subtitle file to srt format

I have a xml subtitle that looks like this: <?xml version="1.0" encoding="utf-8" ?><transcript> <Item from="1.16" duration="4.68"><![CDATA[(Dong-hyuk is coming to see you now.) ...
1
vote
2answers
83 views

Do all Linux processes write EOF to stdout when they are terminating/have finished terminating?

I'm having trouble with sending shutdown -h 0 to a lxc Debian container (i.e. executing this command in the lxc) with with the python pexpect module (in a python script). In this module the user can ...
2
votes
3answers
100 views

Unable to access CentOS setup Network Configuration after attempting Python update

I attempted to update Python on my CentOS 5.6 VM and have encountered some issues afterward. Initially, yum wouldn't work, but I have resolved that. However, now I am unable to access the Network ...
2
votes
1answer
81 views

How to install Node.js in CentOS 5.10 with Python 2.4?

I want to use Grunt on websites we have hosted on our WHM dedicated server. It is running CENTOS 5.10 x86_64 standard with WHM 11.42.1 (build 21). It is critical that things do not break, as we have ...
1
vote
1answer
79 views

Trouble installing lxml with custom install location for libxml2/libxslt

I am attempting to install a python module called lxml to my account on a supercomputer running RHEL. I do NOT have root access or super user status. lxml requires the dev/devel versions of libxml2 ...
1
vote
1answer
28 views

Identify python script is waiting for a manual input

I'm writing a shell script which executes a Python script. The Python script halts for a manual enter to be provided. However, I don't wan't to have to press enter each time to the script. Instead, I ...
1
vote
2answers
83 views

How to change the default version of Python in Debian 7.5?

I'm using Debian 7.5, and I've installed Python 3.3 and 3.2. How do I make 3.3 the default for when someone types python in the command line?
2
votes
2answers
112 views

How does a parallelized Python program look with top command?

I work on a shared cluster. I've seen people run parallelized c code on this cluster which, when I use top to see what processes are running, are shown to be using (for example) 400% of the CPU, ...
2
votes
2answers
42 views

How do I remove the new environment commands that were created by the virtualenvwrapper script?

I've installed and run virtuarenvwrapper.sh to try to configure an alternate version of python on my system. This script has placed somewhere a series of commands that are now executed whenever I ...
2
votes
3answers
75 views

Linux - preventing an application from failing due to lack of disk space

Due to an unpredicted scenario I am currently in need of finding a solution to the fact that an application (which I do not wish to kill) is slowly hogging the entire disk space. To give more context ...
0
votes
1answer
71 views

Python3 error “no module named bluetooth” on Linux Mint

I am trying to connect my Lenovo S10E to a Nintendo Wiimote via bluetooth. I am using a simple Python script, reproduced below. I am calling it from the Linux Mint (version 16, "Petra") command line ...
0
votes
2answers
61 views

shell or python script to transpose rows to columns [duplicate]

I have a big file with numbers like: 1 2 3 4 5 6 7 8 9 9 9 9 I want to tranpose it into 1 5 9 2 6 9 3 7 9 4 8 9 I have search on google for solutions, but those solutions simply don't ...
1
vote
1answer
32 views

Uninstall a python software properly

I installed a little python software (pycarddav) before to notice there is a packaged version for Debian sid... Now, I would like to uninstall properly this software and then, install the packaged ...
3
votes
5answers
170 views

Listing directories based on size from largest to smallest on single line

I can use the following command to get a list of directories and their sizes and sort them from largest to smallest (in the example I renamed the directories to numbers to make this easier to ...
0
votes
1answer
57 views

Python file issue from root path

I have a script that is well-tested and known to be working. I am running into an issue with it where when I try to run it from /root/backup/script.py or ~/backup/script.py I get a file not found ...
0
votes
0answers
59 views

Installing iPython3 Fedora 20

It was very easy to install ipython and upgrade it to the newest version (2.0) using pip. However, I want to set up ipython3, which uses Python 3, and found it more difficult. I finally installed it ...
0
votes
1answer
35 views

install python module for particular python instance

I have 2 python instance on a CentOS machine, i.e. /usr/bin/python2.4 and /usr/bin/python2.7. Modules for 2.4 are in /usr/lib/python2.4, and modules for 2.7 are in /usr/local/python27. When I do ...
1
vote
1answer
76 views

Modoboa 1.1.1 Deployment Errors

I try to install modoboa follow this steps: http://modoboa.readthedocs.org/en/latest/getting_started/install.html I installed modoboa with pip install modoboa Traceback (most recent call last): ...
0
votes
1answer
85 views

python xml parsing

I have to delete particular tags from an xml file. Sample xml below. <data> <tag:action/> </data> I want to delete all contents between data and /data. ...
0
votes
1answer
69 views

How to install QGIS from source into user space?

I want to install QGIS from source on Ubuntu 13.10. (saucy). into ~/bin. There is Python 2.7.5+ installed. Therefore, I cloned the repository to my machine and checked out the master branch. First I ...
0
votes
1answer
25 views

Python: Move lines backward in a textfile

Imagine a text file which contains random text and two unique markers 01 text text text 02 text text text 03 __DELETE_THIS_FIRST__ 04 text text text 05 text text text 06 text text text 07 text text ...
5
votes
3answers
96 views

How to grab the oldest unread message from `mail` in a script?

In a script I am trying to finish writing now, I need to get the oldest unread message from the current user's mailbox (specifically, I need the subject line for this project). After extracting the ...
4
votes
4answers
287 views

How do I get 'realpath' to find my symbolic link?

I am on MacOSX using bash as my shell. I have symbolic link, created like this: ln -s /usr/bin/python python2 I have a package that uses python2 and I want to create a symbol link in my current ...
1
vote
1answer
95 views

Why does PyCrypto require a C compiler?

Is there a python crypto library that does not rely on anything besides python? Or pre-complied bundles of PyCrypto for Linux?
3
votes
1answer
93 views

fail2ban permission denied on script

I've just upgraded from RHEL 5 to 6.5 and setup fail2ban anew. I can't seem to get my custom action to work now, supposedly because of a permission issue. I wan't to know what am I doing wrong, and ...
0
votes
1answer
111 views

makehuman gives “ImportError: No module named numpy”

I installed 1.0.0 on slackware 14.1 makehuman 64bit slackbuilds through the site, but the makehuman does not open, the program appears in the KDE menu but does not open. I do not know why it happens, ...
0
votes
0answers
46 views

Installation location of python modules?

How does one get python modules working on a local machine? I followed the doc here: https://docs.python.org/2/install/ to no avail. I tried putting a known working module in the following locations ...
3
votes
1answer
222 views

apt python error prevents me from resolving dependency problems for apt-get install

On Debian 6 servers dependency issues are preventing me from installing nis (or any package). When I try to resolve that issue I get a python error. How do I get past this issue and re-gain the ...
3
votes
2answers
158 views

Rescue value from second last line

After I run a script, I've got the following lines: PyMOL(TM) Molecular Graphics System, Version 1.4.1. Copyright (c) Schrodinger, LLC. All Rights Reserved. Created by Warren L. DeLano, ...
1
vote
0answers
63 views

Unexpected behavior from an “os.system”call in Python [closed]

I want to save the file type of the file sample in a text file called type.txt. I wrote the following for that in Python: os.system('file sample > type.txt') When I run this code, type.txt shows ...
1
vote
2answers
128 views

pipe function arguments to command line arguments in python

I have a python code (cmd.py) which accepts files as command line arguments and process using parse_args. I want to pass files from another code (files.py) to cmd.py, just like passing function ...
2
votes
2answers
85 views

why cpulimit makes process STOPPED?

I'm running a python script which uses networkx package to run some algorithms on graphs. the script is import networkx as nx from networkx.algorithms.approximation import clique G = ...
0
votes
0answers
30 views

Need a different header path for compiling

I'm trying to update numpy, a python package, on my fresh install of debian. I have installed from source the latest version of python in /usr/local When trying to update numpy via pip, I get an ...
1
vote
0answers
61 views

Why is the Debian package I've created for a single Python script empty?

I have a quite simple Python project that might be very useful for some people. So I thought about packaging it. The project is called maptool and is a tool that allows people who have Panasonic ...
1
vote
1answer
246 views

E: python-setuptools upgrade fails, apt-get broken

I wanted to install gnome-maps with apt-get, and then I got this error: Preparing to unpack .../python-setuptools_3.4.1-1_all.deb ... Unpacking python-setuptools (3.4.1-1) over (3.3-1) ... dpkg: ...
0
votes
3answers
94 views

Most accurate disk usage report? [duplicate]

Since disk space is allocated in blocks, is it a more accurate representation of the actual space consumed by a directory to report it in blocks vs bytes? If a file of size 1,025 bytes resides on a ...