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

learn more… | top users | synonyms

0
votes
0answers
17 views

Error, Integer is Required in date python [migrated]

please how to handle my python program error ? I have file date.py from datetime import date as D day=input ("Input Day : ") month=input ("Input Month : ") year=input ("Input Year : ") ...
0
votes
0answers
14 views

does Python 2.6.6 support RHEL version 6.6

# python --version Python 2.6.6 # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.6 (Santiago) I am using the script to parse xml file which is working fine on RHEL 5.6. but i am ...
0
votes
0answers
18 views

Python Check day entered by user [migrated]

Can help make my python script to check what day of the date entered by the user? Idk how to create the script example : if user input date 22-11-2016 output is tuesday
0
votes
0answers
15 views

How do I add a program to the firewall in Tails (Linux)

I am using a new install of Tails OS (Debian based Linux distribution) on a CD (Live) and it won't let me use Python 2.7, I'm getting an error: "socket error: connection refused". I think it is ...
0
votes
2answers
32 views

How to execute a command requiring “sudo” if it's executed on a remote server by a ruby/python or bash script? [closed]

I have a python/bash or ruby script which login to my remote server via SSH with no password, via a certificate. And it should execute a certain command which requires "sudo". But it's impossible to ...
-1
votes
0answers
34 views

Translating Bash code to Python

I'm trying to "translate" this bash code into python and I need a little help with this.. #!/bin/bash dpkg-scanpackages ./debs > Packages bzip2 -fks Packages So what this code do is checking and ...
0
votes
1answer
28 views

Error importing numpy - ImportError: No module named mtrand

I have compiled and installed numpy-1.11.2 from source as follows: python setup.py install When I try to import it from Python, it gives me following error : python Python 2.7.10 (default, Mar ...
0
votes
0answers
25 views

How to remove the sql comments [duplicate]

fileName: file.tx , It contains below data select * from tab; select * from tab where tname like '%111116%'; /* select * from salary; select * from paid; this is a comment */ update family set lname ...
0
votes
0answers
18 views

Install pydev on Eclipse in Linux Mint

i want to install pydev on eclipse Neon in Linux Mint. I have installed it sucessfully but when i try to create a phyton project i cant chose to create a new Python Project. Why?
1
vote
0answers
9 views

python program freezing maybe because of split() [migrated]

I have a java program communicating with a python program. Everything's works fine, but after a certain time I get no more outputs from the python program. Then I added a log to see where my code ...
1
vote
1answer
25 views

Running a terminal command permanently [closed]

I am currently hosting my database for free on Openshift and have my program running on a Raspberry Pi on my local network. I need to pass the data from the program to my openshift database. I want to ...
0
votes
1answer
19 views

Nohup not recording the output to the screen

I try to use nohup to record the output of my python script. However, I can see the output to the screen when I am not using nohup. Start at XX:XX:XX Finished at XX:XX:XX But then I use ...
-1
votes
0answers
11 views

Passing argparse variable to function [migrated]

Trying to figure out, how can I pass variables from argparse to a function. I have 3 functions: read, search and remove. I don't know where I am going wrong within this section of code. class ...
-1
votes
2answers
54 views

Passing Command line arguments to Python [closed]

i am trying to write a command line argument that will take in a File name, that will then try to open the file and read the contents of the file within the Linux command line, if there is no argument ...
-3
votes
1answer
45 views

Update Python version

When I type python, I get this: When I type find . -name \python*, I get this: When I type locate -b \python, I found this: I do not understand why I have multiple versions of Python installed ...
-1
votes
0answers
28 views

Vim problem installing python 3.5 from source [migrated]

I have installed python 3.5 from the official source, and everything was working. I decided to try vim as a sort of command line IDE. Most plugins worked with vim, but when I tried YouCompleteMe for ...
0
votes
1answer
31 views

Serial/SSH Communication

I have a Linux module. I need to receive messages via SSH and transmit them using serial and vice versa. Basically I want a pipe or a gateway between a SSH and Serial device. Can anyone provide ...
0
votes
0answers
55 views

Anaconda python and Zsh issue on macOS Sierra

I have Anaconda installed on my Macbook Pro with macOS Sierra with Zsh as a shell and Oh My Zsh. GUI is working fine, but I have problem with commands in terminal. When I want so start jupyter, I ...
1
vote
2answers
29 views

Install python library on non-default python version

The system (RHEL 6.5) already have python installed in /usr/bin/python I installed another version(3.3) in another directory /data/tools/python3, as I do not have root permission. Now, I have 2 ...
2
votes
1answer
42 views

python3_5 in PYTHON_TARGETS not working in Gentoo?

I've added PYTHON_TARGETS="python2_7 python3_5 python3_4" to my /etc/portage/make.conf. When trying to install any program that supports python targets the following happens: sudo emerge --ask dev-...
1
vote
0answers
132 views

libGL error: No matching fbConfigs or visuals found over ssh

I am trying to run tflearn (debian 8) When I run that code locally , it runs fine (its shows the windows). But when I do ssh , i get errors. Note that I am able to open other gui applications over ...
4
votes
2answers
72 views

Find files by character encoding

I have a long-running python script that failed to utf-8 decode a file. The error message doesn't tell me what file it failed on, only that it couldn't decode byte 0x81 in position 194. I know which ...
1
vote
0answers
13 views

Virtual environment discovery Via vCenter in pYvmomi

I need a pYvmomi script which will provide the following information: Get all VM’s from vCenter Get the attributes of vCenter Get the attributes of VM’s in vCenter. I am using Python 2.6.6. Would ...
0
votes
2answers
34 views

Help With Cron/Python

I was wondering if my crontab jobs were written correctly. I am hoping to run them on a VPS and monitoring them isn't really possible. Without further ado here are my cron jobs: # cd into directory ...
0
votes
1answer
34 views

Can't use latest youtube-dl outside the install folder

I recently installed youtube-dl from github: https://github.com/rg3/youtube-dl It works if I run it inside the install folder, like this: $ cd /home/max/software/youtube-dl $ bin/youtube-dl <url&...
1
vote
1answer
50 views

Running program in .profile prevents GUI startx

I want to run a python program that polls the keyboard on startup/login to my raspberry pi. Previous attempts included cron jobs (failed due to lack of stdin or stdout). rc.local also failed as it ...
0
votes
0answers
32 views

Install Openpyxl in Correct Directory

I'm trying to install the openpyxl module for python on my RHEL 7 box. I wget the tar file from this URL: https://pypi.python.org/packages/7e/75/...
0
votes
1answer
19 views

ODBC Authentication with .pem files on Ubuntu server with Python

Using the below 3 PEM files I am able to connected successfully to a MySQL database on windows threw setting up a Data Source. (No problems here) client-key.pem client-cert.pem ca-cert.pem But I ...
0
votes
0answers
32 views

Python script executing MySQL SP ends with Errcode 28 - need help interpreting log

Tue Oct 18 16:49:59 2016|Traceback (most recent call last): File "Python-Script_0.py", line 156, in <module> main() File "Python_script_0.py", line 110, in main update_Database() File "...
0
votes
1answer
51 views

How to import python variable in shell script

I have a shell script like below. If I have a test.py that has a variable a=5, how can I import the variable to the following shell script? python test.py b=10 if [ $a == $b ] then echo "a is ...
5
votes
2answers
189 views

How to disable processor's L1 and L2 caches?

Is it possible to disable L1 and/or L2 cache on Ubuntu 14.04 (preferably in a higher level language like Python)? If so, how? In addition, will disabling the cache differ significantly between ...
0
votes
0answers
32 views

Env Variable different from user to root

I'm trying to correctly install qutip, but python is giving me a very hard time. I have kubuntu. I have installed python 2.7.12, with kubuntu there already was python 3 but this is not giving me ...
1
vote
0answers
22 views

Error creating virtual environment using venv

I am trying to setup Python development environment on Centos7 , I am relatively new to both Linux and Python. I am following this guide to setup the environment but I am getting error when I have to ...
0
votes
1answer
48 views

Process name 'masked' by /usr/bin/python and /bin/su

I'm trying to use the pidof command to see my script is already running as I only want this executable if the script is not already running, however, it seems the pidof command is not returning the ...
0
votes
0answers
51 views

Python packages installation problem

I'm new to python and I have problems installing python packages. The one that's giving me a hard time is numpy. When i try to install QuTip, it gives me the error: Traceback (most recent call last): ...
0
votes
2answers
36 views

How to strip reliably most comments in Matlab code?

I want to remove comments reliably without removing newlines (\n) and any piece of essential Matlab code by Unix commands, not by extensions/gadgets/... existing for the target etc here. Test cases ...
1
vote
1answer
86 views

How to plot a CDF from array using matplotlib python

I wrote a python program that basically takes a text file with 86400 lines containing web server ping responses. I extract the round trip from each line and add it to an array called roundtriptimes. I ...
0
votes
0answers
15 views

Processes killed when performing actions in a specific directory

I have a project folder, /home/myuser/git/project, and whenever I try to perform an operation there from the command line, the process gets killed. e.g. $ rm -Rf .tox Killed $ python setup.py ...
0
votes
0answers
90 views

Automatically create start menu entries for Anaconda-Python on Ubuntu-based distributions

When I installed Anaconda on Windows 10, I got a whole lot of start menu entries for the Navigator, Jupyter Notebook, etc. On a fresh install of Linux Mint 18 (Cinnamon), however, I didn't get a ...
0
votes
0answers
6 views

some question about build package for launchpad ppa

I have some basic question about ppa . we have a python project that can be used on every distro from git . so i try and build deb package with bzr (acording to Packaging New Software in ubuntu site)...
0
votes
0answers
15 views

Quitting Linux Screen does not stop loop

I'm running a loop of Mplayer commands (reading the paths from an array) in a detached screen: screen -S music -d -m sudo mp3_player.py The loop commands and output work perfectly and if the loop is ...
1
vote
0answers
32 views

Arch Nginx Uwsgi no app loaded

I am trying to get django working but uwsgi is having problems loading anything. Most likely do to my ignorance. I would love some help troulble shooting. I have been looking at similar posts on the ...
1
vote
0answers
21 views

How to plot CDF from a sorted list

So I have written shell script to ping a web server 86,400 times and write the output into a text file. Example of one ping below: 64 bytes from a104-100-153-112.deploy.static.akamaitechnologies.com (...
0
votes
2answers
47 views

How do Install Python to run in Linux [closed]

I recently installed xfce4 on my Dell Chromebook, through the crouton project. so I could run more programs on it. And possibly start to try some programming. I heard about Python but there isn't a ...
0
votes
1answer
40 views

Run GDB command line multiple times

Due to my mother language is not English. So, excuse me for this bad introduction of my question. I would explain what I need through figure shown below. As you can see, we have a folder which ...
0
votes
0answers
10 views

errors with setup.py for sIBL-GUI

I am trying to install sIBL-GUI, a standalone application for rendering hdri with 3D programs. I am using openSUSE Leap 42.1. I've googled for answers and also search the community at hdrlabs (sIBL-...
2
votes
2answers
51 views

Realtime print statements with tee in interactive script

I have a program long_interactive_script.py which has thousands of print statements. I want to pipe the program through tee (or an alternative) so that I can save the output. If I do ...
0
votes
0answers
88 views

Python script to tar and scp files

I am trying to come up with a Python script that can tar a file and copy (like scp?) it from Host A to a remote host B at a particular destination /foo, and rename it to a particular time format we ...
0
votes
2answers
33 views

How to print the matrix part of a file [closed]

I have a file that has strings and float numbers. I want to load this file and then print the matrix part of the file to can access to the matrix elements. file.text laimfnllvbms ksdvkdv=ksmgfgmf ...
0
votes
1answer
24 views

admin vs. sudo user: program not working for user (sudo env problem?)

I'm working on a QNAP NAS-system (which alone is troublesome; firmware: 4.1.1 (not that new)) and installed duplicity through some community-package. Problem Logged in as admin (which is the ...