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

learn more… | top users | synonyms

0
votes
1answer
378 views

Unable to use source command within python script [closed]

I basically want to set path for some of the variables in Unix. But the source command does not work here. Any suggestions of the same?
1
vote
1answer
54 views

What is “site specific” data?

I have heard references in the FHS to "site-specific" data. Python also has the notion of "site packages". In FHS, is "site" just a general term for an instance of someone using an FHS filesystem? IE,...
1
vote
1answer
129 views

Unable to run Sugar on Arch Linux due to PyGIWarning

Installing Sugar environment on Arch. I just installed a fresh Arch Linux just to run Sugar on it. After downloading sugar from AUR using yaourt -S sugar I wanted to run Sugar using sugar-runner ...
1
vote
2answers
721 views

How can I switch between Python 2.7 and 3.4 that are installed on Debian 8 (Jessie)?

I'm using Debian 8.2 (Jessie), and have both Python 2.7 and 3.4 installed. Python 2.7 is the default and that's what is used when I run a Python script or interactively in the Terminal. How can I ...
-1
votes
1answer
63 views

Cron does not execute my Python script [closed]

I'm trying without success to execute a Python script using cron on a Debian Jessie Raspberry Pi. I can execute the script manually, but it fails to execute with cron. Here's what crontab -l shows: ...
1
vote
1answer
225 views

save output of a python script to a text file

how can i save output of this python script to a text file? this is a KMS server which clients connect to it and activates their windows or office. i wanted to save the log in a text file. I should ...
0
votes
1answer
33 views

Where is the actual executable of LiveUSB-Creator located on Fedora?

I don't really know how to phrase this question any better, so let's go with an example: I installed liveusb-creator on my Fedora a while ago and I wonder where the files it executes are located. I ...
1
vote
1answer
121 views

Saving process output to a file in systemd unit file

I created a systemd file unit (Centos 7) and I wanted to save the Python output to a file but the service won't start with the below code. [root@static ~]# cat /etc/systemd/system/pykms.service [Unit]...
1
vote
2answers
141 views

Random files selector in filesystem

Context : In order to test some backup process which are supposed to work all nights, i want to select a random files on a large amount of datas. (Around 7 millions of files. This is a NFS server with ...
0
votes
0answers
97 views

OpenCV for python

I am having some issues with importing cv2.cv inside of python2.7. I installed opencv2 and 3 from source (using make and make install) however when running "import cv2.cv" I am still told no module is ...
0
votes
0answers
83 views

Broken pip3.1 install

I just installed pip3 on my Debian and it return a python error every time I try to use it. I installed it like this : apt-get install python3-setuptools easy_install3 pip my version of pip : # ...
2
votes
1answer
69 views

VIM with Python - Multiple # do not get colored as a comment

Something changed on my system and now VIM screws up syntax highlighting of commented lines. This makes having 'debug' lines very difficult as it looks like the line is still active based on the ...
-2
votes
2answers
82 views

How to rename bulk of jpg files to png using convert

Let's say I have a bunch of .jpg files which I want to convert to .png. The file structure is as follow: 00-01.jpg 00-02.jpg 00-03.jpg 00-04.jpg 00-05a.jpg 00-05b.jpg 01-01.jpg 01-02.jpg 01-...
1
vote
2answers
64 views

If I want to create a GUI which displays exactly the same data as TOP command does in LINUX, where do I get the data from?

I found out that I can get the PID(first column) from the /proc/[pid]/stat file, first column. I am not sure where can I find the rest of the attributes. And my guess is we need to calculate the %CPU ...
2
votes
1answer
84 views

Is it possible somehow to tell if a laptop is moved in a bash or python script?

I'm trying to figure out if there's a way to use a bash or python script to tell if my laptop gets moved. I had the idea of using wifi signal strength to do it, but the problem with that is that you ...
2
votes
2answers
176 views

Is it possible to pass arguments into a Python script?

I know how to pass arguments into a shell script. These arguments are declared in AWS datapipeline and passed through. This is what a shell script would look like: firstarg=$1 secondarg=$2 How do I ...
0
votes
0answers
90 views

How to validate server credentials in python

I'm new to python scripting. This is my sample script import pexpect import getpass import sys host = sys.argv[1] user = sys.argv[2] password = sys.argv[3] child = pexpect.spawn("ssh -l %s %s "%(...
7
votes
3answers
20k views

Running python script from terminal without .py extension

I want to call a python script script.py from the terminal by simply typing script. Is this possible? If so, how? I know I can avoid typing python script.py by adding #!/usr/bin/env python to the top ...
10
votes
6answers
19k views

Using jq to extract values and format in CSV

I have the below JSON file: { "data": [ { "displayName": "First Name", "rank": 1, "value": "VALUE" }, { "displayName": "Last Name", "rank": 2, ...
1
vote
2answers
39 views

Rsync two “filepath” found by find commands [closed]

Original file /001day/backup/001m/name_test_v1.txt Destination file /001date/003m/name_test_v12.txt Method 1 rsync -av --progress /001day/backup/001m/ /001date/003m/ Method 2 ...
0
votes
2answers
309 views

How do I run a Python script on my web server

Hi I'm new to python programming. I have written python script and calling it in shell script. I want to run my script on my server that is hosted through somedomian.com I have tried by following ...
1
vote
1answer
422 views

How to programmatically add new crontab file without replacing previous one

I am working on a small home automation project using raspberry pi (OS -Raspbian). I want to know how to add more than one crontab file using python-crontab module without replacing the previous ...
2
votes
0answers
46 views

Why did this program install into ~/.local/bin … thats the first time I have seen that happen?

Why did this program install into ~/.local/bin ... thats the first time I have seen that happen? When I install this "Taurus Blazemeter 'bzt'" program, it ends up being installed into ~/.local/bin ...
1
vote
1answer
75 views

CGI error while trying to retrieve from sqlite3

I am trying to build a very simple login page, which asks the user for his register_no, username and password. And when he presses the submit button. I am trying to check whether it is an existing ...
0
votes
1answer
130 views

How to compile Python with (Active)Tcl 8.6?

I'm trying to compile Python 3.5.0 on CentOS 6 with Tcl 8.6. I did ./configure --with-tcltk-includes=I/opt/ActiveTcl-8.6/include --with-tcltk-libs=L/opt/ActiveTcl-8.6/libs --prefix=/home/aivar/...
2
votes
0answers
64 views

Why can't this Python script access XDisplay from Root terminal?

I need to run this Python script as below because it needs access to user's xdisplay: DISPLAY=:0 XAUTHORITY=/home/<USER>/.Xauthority su <USER> -c "python-script" The command above has no ...
1
vote
1answer
4k views

How to manually uninstall urllib, urllib2, requests python packages?

I'm having a problem with urllib, urllib2 and requests, three python libraries. I use Ubuntu 10.04.4 LTS and python 2.6.5 (we can use with python) (but I had installed manually, after the problem, ...
0
votes
1answer
504 views

Google App Engine alternative for CentOS, Fedora, Ubuntu?

I have written WebRTC Apps which is Python and Google App Engine. Google App Engine is not freely available to use for production release, so I am looking alternative of it for CentOS, Fedora. Can ...
2
votes
1answer
107 views

Make debian package to install python

I have two Python scripts, and I need to package them into a Debian package. I have tried quite a few things with some success. For example, I made a setup.py and then used python-stdeb to create a ...
1
vote
1answer
41 views

Can't run python libraries due to python 2/3 issues

I am running on a fresh install of OpenSUSE 13.2 tumbleweed which comes with python2.7 and python3.4. I am continually having problems running any python based libs in getting the following error ...
0
votes
2answers
312 views

How to check if a module or a package is already installed in python3?

Need to verify whether it is installed or not before the program can run.
0
votes
2answers
1k views

How to install Python on CentOS without root privileges?

For some reasons, I need to install Python on CentOS without root privileges. Since without root, one cannot use yum to install packages, so I tried ./configure --prefix=$HOME/tools/python make make ...
0
votes
2answers
327 views

Set Path for all Users (Login and Non-login Shells)

Ok. So, I'm used to Ubuntu and CentOS more than redhat, so I'm hoping there's some obvious solution to this that I'm missing. I've installed Anaconda (Python). I've placed it in: /opt/anaconda3 I ...
0
votes
0answers
18 views

unknown type name 'ffi_closure' while installing Python Ctypes

On my Media box I am trying to install python ctypes (needed to run some applications). When trying to install the package (via pip, easy_install or manually) I get the following error: unknown type ...
1
vote
3answers
184 views

what could be the reasons for shell scripts kill itself?

I have shell scripts like #!/bin/bash while true;do #Code HERE! #Pushing Data to DB echo "Data to DB"> /root/schip.log 2>&1 done This is script is continuously running and ...
1
vote
2answers
91 views

Best practice to update own application

We're developing app for raspberry PI in python. We don't have much experience deploying apps in linux and we need to figure out how to update this app after releasing. We came up with 2 ways: make ...
1
vote
1answer
466 views

Identify when 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 want to have to press enter each time to the script. Instead, I ...
1
vote
1answer
91 views

What does Requires: Python(package) do for RHEL spec files?

I'm packaging some Python packages currently without RPMs, and some of those depend on others that I'm packaging. While packaging I noticed a format where people do: Require: python(pkg-name), but I'...
0
votes
2answers
90 views

get values which only occur once in a vector

There is a vector of numbers I have which are in ascending order (it is called t8_) 2 7 8 9 11 15 34 91 91 92 94 The problem is that some numbers happen two times. I don't want to remove them, but ...
-1
votes
2answers
48 views

OpenDNS automatic diagnostics

I've contacted OpenDNS support because advertising is not filtered on this site http://www.backpackerboard.co.nz/ They asked me to read these manual instructions OpenDNS Diagnostic Tool: What to ...
3
votes
1answer
3k views

Install newer & older versions of python on debian?

How can I install extra versions of python on Debian (jessie). On Ubuntu I can use the "deadsnakes" PPA which will give me any python version I want, with the version name in the command (e.g. ...
0
votes
0answers
160 views

why md5 encrypted password insert into php ldap admin extra {md5}

I am using python script to inter encrypted password into php ldap admin but the problem I am facing is LDAP add extra {md5} before the encrypted password, I simulated the code by creating two files ...
-2
votes
1answer
55 views

What is posix, and how can I elevate my permissions using python? [closed]

I was wondering if I could elevate my permissions on a chromebook with the os posix using a python script. I was not given the administrative permissions when I was given the laptop for college.
0
votes
1answer
80 views

Unable to start Terminator in Fedora

I'm not a Unix-friendly user, so my question could be very dummy. I installed Terminator using this command: sudo dnf install terminator After some days of using without problem, for some reason, ...
0
votes
1answer
48 views

How do I make a Make, Make Install, and deb file for a python program?

I recently wrote a python program. Now the question: how do I go about making an installation script for it? From my understanding, you need to create a make file, I believe that a make file is made ...
5
votes
1answer
249 views

Running Deamon Involving GPIO on Pi

I have a daemon that monitors various things using the GPIO ports. I have used python to write the code for this using the RPi.GPIO module. I would like to ensure that the daemon is always running, i....
0
votes
1answer
221 views

syntax error while trying to execute python program in bash shell

I'm trying to use python to read in data from a text file but I keep getting "syntax" errors when I execute the program. Python Code: Test.py import os import numpy as np Ye,Eb,Tb = np.genfromtxt("...
1
vote
1answer
153 views

Running python script, error appears

https://github.com/g-oikonomou/sensniff/blob/master/host/sensniff.py The link above refers to a python script that is to be run on Ubuntu. When I run the script, the following error appears on the ...
0
votes
2answers
368 views

pexpect fails to match command is grater than 65 characters

Issue with pexpect, python module. Pexpect fails to do expected behavior if the length of the command is greater than 65. #!/usr/bin/python import pexpect sshCmd='ssh root@15.186.22.105' prompt='[...
0
votes
0answers
183 views

Install previous version of iceweasel (raspberry Pi)

I am trying to get selenium (python) working on the raspberry pi. I am using Iceweasel for lack of another browser, but there is some bug that I am not sure about in the current version that stops ...