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

learn more… | top users | synonyms

0
votes
1answer
21 views

mysql error.log centralize logs

I'm developing a script where it will look into logs every 10 minutes and if there's any critical error it will send an e-mail to a certain adress. I have this problem i would like to solve more ...
-1
votes
1answer
44 views

Why are my emails generated with Python stuck in mail queue

I'm trying to send emails programmatically with Python. The emails stay in the mail queue (mailq). Details are below. My diagnosing abilities have reached their limit. Perhaps the issue is my ISP ...
0
votes
2answers
42 views

how to write python code to change display color

I want to change display color. I have a simple script: #!/bin/bash sleep 50 xrandr --output VGA1 --gamma 1.28:1:1.28 # for purple How can I write it in python?
0
votes
2answers
56 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
12 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 ...
2
votes
2answers
212 views

How to use vim-slime from within a single tmux session?

I'm trying to integrate ipython and vim through a single tmux session using the popular vim plugin "vim-slime." The problem is that while I can get it to work fine provided that vim is opened in a ...
1
vote
0answers
23 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
19 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
0answers
65 views

installing dsc30 - python 2.6 fights back

Im trying to upgrade some systems to Cassandra 3.x. The installer want Python(abi) >= 2.7 so I installed it. Still seeing this error: Resolving Dependencies --> Running transaction check ---> ...
1
vote
0answers
32 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 ...
0
votes
0answers
15 views

problem with Ubuntu server 12.04 updates, internet access problem but i can ping Local Area network

when I type the following commands on the terminal the following is displayed wget http://prdownloads.sourceforge.net/webadmin/webmin_1.580_all.deb Here is out put connecting to ...
0
votes
1answer
107 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
31 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 ...
2
votes
1answer
88 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 ...
0
votes
0answers
21 views

ImportError python script

import requests File "/usr/local/lib/python2.7/dist-packages/requests-2.7.0-py2.7.egg/requests/__init__.py", line 58, in <module> from . import utils File ...
2
votes
5answers
6k 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 > ...
1
vote
1answer
874 views

How can i fix the following gmp library dependency error while trying to install Charm?

I am trying to install Charm crypto python framework in ubuntu 11.04 with python 2.7. Requirements say that i should have gmp installed 5.*. I have successfully installed gmp lib and i have run all ...
0
votes
1answer
60 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
56 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
56 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 ...
6
votes
2answers
5k views

How to display the name of the current Virtualenv?

I'm using virtualenv, virtualenvwrapper, zsh, oh-my-zsh, terminator, on Crunchbang. I'm trying to display the name of the current virtualenv like so workon example (example)... I've tried many ...
2
votes
0answers
40 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
10 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
37 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
57 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
25 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? ...
1
vote
1answer
55 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
212 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 ...
0
votes
1answer
25 views

Does file directory/folder your code is in matter when using python3 modules ? I had an Issue

I am asking as lately while doing python GUI programing I installed tkinter by doing apt-get install python3-tk everything went well and when I opened python3 console while I was in the following ...
-1
votes
1answer
30 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
26 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
24 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
74 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 ...
1
vote
2answers
72 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
32 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
55 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
52 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
71 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 ...
1
vote
2answers
50 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
74 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
52 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 ...
1
vote
0answers
40 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 ...
3
votes
0answers
160 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 ...
7
votes
3answers
16k 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 ...
8
votes
6answers
11k 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
34 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
437 views

How to monitor the screen lock/unlock in the Ubuntu 14.04

I need to implement a function that monitors the screen lock/unlock. I referred to the following article: Run script on screen lock/unlock My python script code works fine in Ubuntu 12.04, but it ...
1
vote
2answers
84 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
128 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
1answer
115 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 ...