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

learn more… | top users | synonyms

0
votes
2answers
24 views

zipimport.ZipImportError: can't decompress data; zlib not available

On RHEL 6.6, I installed Python 3.5.1 from source. I am trying to install pip3 via get-pip.py, but I get Traceback (most recent call last): File "get-pip.py", line 19177, in <module> ...
0
votes
1answer
32 views

yum is broken because of missing Python module (RHEL 6.4)

When I run $ yum I see: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib64/libssh2.so.1: symbol EVP_aes_128_ctr, ...
0
votes
0answers
24 views

Shell script invoking python does not resume on MacOS

I have a shell script that invokes Python on my MacOS. After that invocation completes successfully, the script execution is not continued by terminated: curl "https://s3.amazonaws.com/aws-cli/...
0
votes
1answer
30 views

Various scripts I see will not run through python

I am very confused as to why I get syntax errors when attempting to run scripts such as the one contained in the answer below: How do I download PDFs from PubMed, given their IDs? Am I not supposed ...
0
votes
0answers
15 views

server load and performance testing

Dears, there are some cluster of servers that are responsible for a telecommunication company databases. the OS's was Linux Redhat installed on bare metal till now, but all the clusters are migrating ...
2
votes
0answers
10 views

How do you install Django when there is a problem with scl?

scl is installed on RedHat 6. The man pages for scl work. I want to install Django. I believe that a prerequisite is to install SCL for Python. $scl -l returns nothing. I believe that this is ...
1
vote
1answer
15 views

Enable SCL python27 so other RPMs can see it

Trying to create an RPM that uses Python 2.7 on a RHEL 6 machine. I'm using SCL to enable Python2.7 and building the RPM with it fine. However, when I try to install that RPM on a different system ...
0
votes
0answers
26 views

My python code does not print histograms in the terminal as designed

I'm using Cygwin64 Terminal to run a Linux putty to conduct scientific analysis. I have little to no experience programming experience. I am trying to run an analysis program to using python code and ...
0
votes
1answer
21 views

How do i run my python file from any directory on my computer [Arch]

I am currently trying to run gprof2dot on the gmon.out created by using the -pg option while compiling. Now I have already done pip install gprof2dot. How am I supposed to run this on the gmon.out ...
3
votes
1answer
23 views

Can't use global shorcuts for Python applications

I'm using bash on a Mac. My problem is every time I try to run an installed Python application I just get a message that the command can't be found. Like so: -bash: gcloud: command not found Doesn'...
-1
votes
0answers
9 views

I am getting a syntax error when trying to lock a label in ClearCase in a python script [migrated]

I am new to python and I am trying to execute a cleartool lock command. Here is my code: def lock_label(lname): os.system('cleartool lock lbtype:' + lname'@vob:/cm_data/jupsw') lname is ...
1
vote
0answers
27 views

How to install mailman when it needs an older version of Python?

I am working on an install of mailman 3.0.3 on Ubuntu Server 16.04 which ships with Python 3.5.1 and 2.7.11. Per Barry Warsaw that version of mailman requires Python 3.4.n. https://gitlab.com/mailman/...
1
vote
0answers
18 views

How do I run a supervisor command in a Eclipse PyDev project without being asked for a password?

So I've got the following code that should check whether an npm package is installed: def is_installed(name, as_global=True): # Returns whether NPM package is installed. s = shell(...
1
vote
1answer
48 views

pass arguments to python program in shell

I am unable to run python script within a shell script. Following is the script.sh file where 3 arguments are being passed to the python script. python main.py 1.0 0.1 10 The python program is not ...
-1
votes
0answers
39 views

File edition after glob function through python

I wanted to find every instances of a file under different directories and search for value 0 in each of those files and replace them with 500. Please find the code below #!/usr/bin/python import ...
3
votes
2answers
64 views

obtain shell prompt in python

I want to obtain the (zsh) shell prompt in a python script. Simply using import os prompt = os.environ['PS1'] seems not to be the right way, because PS1 is usually not forwarded to subprocesses. In ...
0
votes
1answer
41 views

I installed python 2.7 on RHEL6 server, want to go back to 2.6

I am on RHEL6 and I installed python27 using these commands: sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo' sudo yum install python27 ...
1
vote
1answer
40 views

Updating Python on CentOS

I am running 64 bit CentOS 7 on an Oracle VirtualBox. The CentOS ISO that I downloaded came with Python 2.7.5 and I am trying to update to 2.7.11, but the normal steps are not working. I downloaded ...
0
votes
1answer
8 views

python3-pyds9 package missing in Jessie

In Sid there is a package python3-pyds9 but it seems this disappeared in Jessie. How do I get ds9 package for Python in Jessie?
0
votes
0answers
23 views

Trying to use Python SpeechRecognition on Ubuntu 14.04 but flac-linux-x86 not found

When I try to run the example script audio_transcribe.py on my Ubuntu 14.04 virtual machine I get a FileNotFoundError: [Errno 2] No such file or directory. The thing is, I can see the exact file ...
0
votes
0answers
11 views

How to Do Trigonometric Range of Floats in Python? [migrated]

Matlab x = 0:pi/100:2*pi; y = sin(x); plot(y) I think range() cannot work here because it only accepts end arguments as integers but I need floats (0.0; 2*pi). Pseudocode in Python 2.7.11+ import ...
0
votes
1answer
13 views

Switching from a downloaded version of python to a Homebrew one

I've recently decided I'd like to switch from my downloaded versions (as in downloaded from python.org) of python 2 and 3 to Homebrew installs. I've installed both python 2 and 3 from Homebrew using a ...
1
vote
1answer
25 views

What is ${PYTHON_REL} FreeBSD

I have an error whilst making a port, so I checked the makefile, and found the problematic line. The issue is that I don't know how to fix it, as I don't know how to change the Python_Rel variable. ...
-1
votes
1answer
51 views

I SSH into a linux server via putty, and i have a linked drive on my windows machine. How can I access files on other drives?

I am using a linux server to run scripts and manage a database. I get to this using a SSH through PuTTY. On my windows machine there is a mapped drive to a directory (/mapped_drive/) on this server (X:...
0
votes
1answer
27 views

Is there such a notion as broadening where find searches?

I'm trying to identify redundant installations of the site package matplotlib in my python3.5 environment. A contributor to the library (GitHub issue) is advising that I use python3.5 -m site ...
1
vote
1answer
47 views

How to find my pip? [closed]

Yesterday I installed the pip with python get-pip.py and it can be regular used. Now it shows this. -bash: pip: command not found so I try to use python get-pip.py to install it again. ...
-1
votes
0answers
25 views

Automating yum install using python

yum install (package-name) How can I write a python script to execute the command above and see if its successful or not? This should be the algorithm: run command yum install <package-name> ...
0
votes
0answers
6 views

change multiple filenames - python script [migrated]

first i am newbie in python. i have a bulk of files (117 files), i think their names are UTF-8 .Here is one filename sample: 1|جاÙا JAVA : ÙÙÙÙ٠اÙخصائص Attributes Ù٠اÙبرÙجة|...
0
votes
3answers
42 views

How do non-interactive programs get the permission to edit files in /etc

I'm writing a program in python that needs to edit some files in /etc. Some system some its own. How do I get those permissions from within the program itself without running sudo as the program ...
1
vote
3answers
42 views

how to spawn a separate process in the background while running a foreground process

e.g., I want run a python -m HTTPSimpleServer in the background while running a watch in the background python -m HTTPSimpleServer; watch -n (my awesome test command) how can I run both in ...
0
votes
1answer
39 views

CentOS: How to force pip to install Django with latest Python 3.5

I'm running CentOS, and it has pre-installed Python 2.6.6. But I want to use Python 3.5, the latest version. So I have installed Python 3.5 on my server. It's working properly. I just compile Python ...
0
votes
0answers
27 views

save outputs and errors to external file from lxterminal

I run compiled python program like this on my linux box (runs automatically after start lxterminal LXDE lxsession autostart): @lxterminal -e sudo /home/user/app.exe > /home/user/app.out 2>&...
2
votes
1answer
48 views

Systemd Python service not sending all output to syslog

I have a custom service and have explicitly called for all stdout & stderr to be sent to syslog in the config file, however only some of the output appears in both syslog and the journal (they are ...
2
votes
0answers
30 views

Why does tar list multiple entries for some files? [duplicate]

In a folder with a single file (image.jpg) I run the following commands $ ls -a . .. image.jpg $ tar cf target.tar image.jpg Listing contents of the archive $ tar tvf target.tar -...
0
votes
1answer
33 views

Running a discord.py, pyenv python 3.5.1 script on an apache2 webserver

I'm running into difficulty getting a python based discord bot to run on my apache2 webserver. I'm using the discord.py api wrapper and I installed python 3.5.1 using pyenv. Here is my code #!/usr/...
0
votes
3answers
27 views

How to make python3 the default version on WING IDE

I'm new to python and I've been trying to update from python 2 to 3 by doing apt-get install python3 and it installed but when I type python --version on my terminal the version is 2.7.9. How can I ...
-1
votes
3answers
44 views

Insert array of years into a list of URLS

I have a list of URLS like the example below. /test/test I also have an array of years [1999, 2000, 2001]. I am trying to find a way to automate the task of printing out a list of URLS with ...
1
vote
0answers
29 views

PyOpenCL on Linux Mint: PLATFORM_NOT_FOUND_KHR

I've been trying to get PyOpenCL and PyCUDA running on a Linux Mint machine. I have things installed but the demo scripts fail with the error: pyopencl.cffi_cl.LogicError: clgetplatformids failed: ...
2
votes
1answer
36 views

can't find documentation on json.tool [closed]

I can find scattered articles online that use json.tool to produce pretty python, but no clear documentation on usage. I checked docs.python. but there is no formal documentation of json.tool. I ...
2
votes
2answers
79 views

Why won't this bash command run when called by python?

The command $ find ~/foo/ -type f -iname "*.txt" -print0 | parallel -0 cat uses GNU Parallel to print all the .txt files under ~/foo/. I have a python script where I want to call this bash ...
1
vote
2answers
28 views

Can python extract org-mode tables from org documents?

I'm trying to write some python code that reads specified tables in org mode documents. For example, I have a file ~/foo.org $ cat ~/foo.org #+Title: Example Org Document * Section One Proin quam ...
3
votes
3answers
97 views

How can I get a python script to “remember” user input?

I have a script that asks the user for the path to their desired directory default_path = '/path/to/desired/directory/' user_path = raw_input("Enter new directory [{0}]: ".format(default_path)) or ...
0
votes
0answers
13 views

How to restore initial configuration, files… of python on Linux Mint

Due to a mistake when compiling Python sources (Python 2.7.11), my Python installation is broken. I can solve the problem partially by recompiling the initial version of Python (2.7.6). This solution ...
0
votes
0answers
14 views

bpython installation trouble

I have a problem with bpython: studio@linux:~> sudo pip install bpython==0.15 Requirement already satisfied (use --upgrade to upgrade): bpython==0.15 in /usr/lib/python3.4/site-packages ...
0
votes
0answers
55 views

wkhtmltopdf and pdfkit issues in python

Hello I am developing an web with python Flask in a linux server, in doing so I am trying to use pdfkit and wkhtmltopdf. I am using a linux server(ubuntu). In Putty, after logging into my server, at ...
0
votes
0answers
49 views

How to install linux-gpib Python bindings inside virtual environment?

I'm working on developing Python code to control GPIB devices, and am realizing the more I learn the less I know. So here's my question: I believe I've installed linux-gpib properly, and I have ...
0
votes
1answer
41 views

NS-3.25 PyViz visualizer install on CentOS 6.5

I'm installing Network Simulator 3.25 on a CentOS 6.5 machine. In my environment I cannot use any repository, every single packet have to be downloaded from a machine and then transferred to the ...
2
votes
2answers
74 views

Make python file accessible from anywhere by all users

I installed a program that requires you to execute a python script like this: python fit_locus.py --help I want to make the file acessible to all users without requiring them to navigate to the ...
3
votes
1answer
55 views

Create table with frequency of unique names retrieved from multiple .csv files

I have 32 CSV files containing fetched information from a database. I need to make a frequency table in TSV/CSV format, where the names of the rows are the name of each file, and the names of the ...
3
votes
3answers
52 views

Sudo-like remembrance of passwords for own scripts

I have a script which requires a password for authenticating a web service. A single password for a pre-defined user will suffice, and the password should if possible be stored securely (not plain ...