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

learn more… | top users | synonyms

0
votes
2answers
247 views

How to set up Python path?

I have uninstall anaconda2. but now when I run Python command in terminal it says "bash: /home/user/anaconda2/python: No such file or directory" now how can I set to Python when I have python 2.7 in "/...
0
votes
0answers
20 views

OpenStack EC2 API url in API access tab

I want to configure open-stack ec2 API , such that the ec2 API url apears in API access tab in project settings as other urls appear , such as urls for other services. Do i need to install some plug-...
0
votes
1answer
16 views

FreeBSD install python31 over python27

Hi I had installed python27 and after python31, I tried to deinstall python27 but it seems that this version is standing on host. How can I set python31 to become main python ?
1
vote
0answers
51 views

Installing armhf libboost-python-dev in amd64 cross environ

I'm trying to install libboost-python-dev for armhf in amd64 cross compilation build environment. apt install libboost-python-dev:armhf libboost-python-dev depends on python2.7-minimal, which ...
1
vote
0answers
20 views

How to view WIFI devices names and signal strength [duplicate]

I want a cli utility or script that shows all the Wifi devices or hotspots or access points and their signal strength. I want to log this data using Python. I will write the logging script myself. ...
2
votes
2answers
309 views

installing dsc30 - python 2.6 fights back

I'm trying to upgrade some systems to Cassandra 3.x. The installer wants Python(abi) >= 2.7, so I installed it. Still seeing this error: Resolving Dependencies --> Running transaction check --->...
1
vote
0answers
47 views

How to get all files of a certain type from a virtual web path?

I try to use wget to download certain files from a website. But probably the virtual locations of the files do not represent their actual location. For example, if the link to the file is http://file....
0
votes
1answer
530 views

Installing Dependency for epel from yum update on Centos 6.5

I think that I'm not quite understanding where epel repo reads dependency for a python update. For example when I run sudo yum update I get the below and then successfully run pip install requests and ...
1
vote
1answer
41 views

why does setgid permission on an SO cause failures?

When I load a particular version of Python on a server, I get the following error: python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file ...
0
votes
1answer
216 views

How to install Python module dependencies from my RPM?

I have an application that I am packaging as an RPM and installing on CentOS 7. When I install the RPM I want it to install some compiled binaries as well as some Python modules with their ...
0
votes
1answer
80 views

How do I replace my “base system shell” with IPython?

I'd like to replace bash with IPython on my system, so that even files like .profile are in Python rather than shell script. I have some confusion on the topic, even though asking a few questions on ...
1
vote
1answer
162 views

.profile is written in shell script — can I instead make my system understand that I want it to execute a Python script instead?

I get Python. I don't get shell script. I could learn shell script, but I would rather not if I can use Python in its place. A good place for me to start would be the .profile script. Currently, for ...
1
vote
1answer
96 views

Python 26 pkg missing in CentOS 5

Getting following error while accessing :--- --> Missing Dependency: python26 is needed by package ambari-server-1.2.3.7-1.noarch (Updates-ambari-1.2.3.7) Error: Missing Dependency: python26 is ...
1
vote
0answers
61 views

How do I emulate a virtual keyboard with an arbitrary character set?

I am writing a couple applications that change how your keyboard works. (One that allows key-chording, and another that allows you to say syllables out loud to type individual characters.) The "...
0
votes
0answers
12 views

Apache2 custom errorLogger buffer

I'm currently using this: ErrorLog "|/var/www/HClogger.py >> /var/log/apache2/web-error.log" This allows me to have a file log, but also send the log to a HipChat room. The script is: #!/...
0
votes
0answers
52 views

Reading Serial Data with Python

I am trying to read a line of serial data from a MaxBotix sonar sensor with Python. The sensor spits out R0300 The integers after the "R" are the distance read in millimeters. I am trying to write a ...
0
votes
1answer
305 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
48 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
122 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
votes
1answer
58 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
163 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 ...
1
vote
2answers
117 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
1answer
30 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
115 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]...
0
votes
0answers
91 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
81 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
68 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
81 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-...
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 ...
0
votes
0answers
80 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 "%(...
1
vote
2answers
37 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
254 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 ...
4
votes
1answer
476 views

is there a way to get the url from current tab in google-chrome?

I used to do that on firefox using a python command, but recently something changed and I can't get the URL anymore! What used to work with firefox: #!/bin/bash current_tab_num () { python2 <...
1
vote
1answer
378 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 ...
0
votes
2answers
540 views

import: unable to open X server `' @ error/import.c/ImportImageCommand/361

I am trying to run a python script to generate heatmap and clustering dendrogram. But I got an error message saying : import: unable to open X server @ error/import.c/ImportImageCommand/361 I am a ...
1
vote
1answer
67 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 ...
2
votes
0answers
44 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
40 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
1answer
117 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
59 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 ...
0
votes
2answers
881 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
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 ...
0
votes
2answers
268 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 ...
1
vote
2answers
83 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
3answers
163 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
1answer
87 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'...
6
votes
5answers
41k views

Execute shell commands in Python

I'm currently studying penetration testing and Python programming. I just want to know how I would go about executing a Linux command in Python. The commands I want to execute are: echo 1 > /proc/...
0
votes
0answers
147 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
50 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.
2
votes
2answers
144 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 ...