Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.
1
vote
1answer
32 views
Checking desktop environment from command line
I am using SSH to login into my Linux RedHat server from my Windows machine. I want to create a GUI in python on the server but I am not sure if there exists any Desktop environment on the server. I ...
0
votes
0answers
12 views
RuntimeError: You need gevent installed to use this worker
I need gevent to run docker-registry but i have this error:
Error: class uri 'gevent' invalid or not found:
[Traceback (most recent call last):
File ...
1
vote
1answer
36 views
Getting Python errors whenever I try to use terminal in Linux Mint
I've had Mint installed as a dual boot on my laptop for some time. I use it as my dev environment, for desktop and web related coding.
I recently started getting errors which have rendered my terminal ...
0
votes
0answers
12 views
My Python program generates an HTML page; how do I display a .jpg that's in the same directory? [migrated]
The generated HTML page works fine for text. But
does not find the file and displays the alt text instead. I know the HTML works because "view source" in the browser can be copied into a file, which ...
0
votes
1answer
29 views
Recommend a Python book [closed]
I'm a Linux system administrator and will be learning Python. I'm a ksh/bash expert. I never became good at perl, so I don't want a book oriented to perl programmers. What book would you recommend I ...
0
votes
0answers
8 views
Python equivalnt for a dbq? [migrated]
With bash I can extract the whole database with this command:
DataBaseQuery="SELECT * FROM my_database_list.database"
mysql -uUSER -p'PASSWORD'<< EndOfFile
$DataBaseQuery
EndOfFile
What ...
1
vote
0answers
19 views
How to get scapy to sniff on the correct interface?
The sniff function in scapy in python2.7 worked fine before upgrading my linux Operating System.
from scapy.all import *
client_mac="c4:3d:c7:8f:03:19"
wlan_mac="00:c0:ca:6d:ac:fa"
...
0
votes
0answers
20 views
Incorrect installation of python-2.7.2 - cannot use zlib
I am installing python 2.7.2 from Python-2.7.2.tar on Linux Ubuntu-14.04. I untar it, then ./configure --prefix=/apps/python/install/2.7.2. I then make and get :
Python build finished, but the ...
3
votes
2answers
67 views
Why can't I load modules while executing my bash script, but only when sourcing it?
I am using modules to control the packages on my system and I have python/2.7.2 installed as a module. I have simple python executable python_exe.py which I am going to call from a simple 'driving' ...
1
vote
0answers
23 views
Filter packets by mac address and “EAP” in scapy
Is there a way to filter packets by mac address and "EAP" protocol using scapy in python?
this is my sniff command line:
sniff(iface="mon0",prn=lambda x: x.summary())
-1
votes
0answers
8 views
How to get diff time from kernel input keyboard events(from key pressed to release)? [migrated]
I'm trying to write a Python code to capture events from /dev/input/event* on linux. With the events I want to filter event type, event value, event code and time(tv_sec and tv_usec).
PROBLEM: With ...
0
votes
1answer
93 views
“SyntaxError: invalid syntax” on File “goslate.py”, line 222 while installing goslate using pip
I fail to install goslate with sudo pip install goslate. Log of error message is below. What I am missing? Or what is my computer (Debian) missing?
It is possible to install the package in Python 2, ...
0
votes
0answers
11 views
Are there any Packet Sniffing tools other than scapy in python?
Are there any packet sniffing tools other than scapy in python3x that does the following:
sniff packets without being connected to a network
show packet structure, example fields/tags and their hex ...
0
votes
0answers
53 views
“socket.error: [Errno 99] Cannot assign requested address” in python
I tried creating an ICMP network sniffer as follows:
import socket,os
host="192.168.1.7"
#create a socket protocol
socket_protocol=socket.IPPROTO_ICMP
sniffer = socket.socket(socket.AF_INET, ...
0
votes
0answers
40 views
how to retreive all income information from serial port /dev/ttyUSB0 with python an pexpect
i'im trying to write a script in order to automate firmware flashing with commotion wireless router
when using serial:
import serial
import sys
import time
ser = ...
0
votes
0answers
29 views
csvkit Permission denied
I am on Mac and installed csvkit. When I run csvlook, I get a traceback with the following error message:
IOError: [Errno 13] Permission denied: '/Library ...
1
vote
0answers
22 views
Python embedded in bash not working [migrated]
I want to embed a small python script inside a bash script so that I can send a json object to a socket.
I have tried the following code:
python -c "$(cat << 'EOF'
import socket
import json
...
0
votes
0answers
40 views
Process Being Killed due to low swap
I'm running a python (2.7) script on mac osx yosemite.
The script is fairly computationally intensive, certainly bumping up against my machine's RAM limitations. The computer crashes and restarts ...
2
votes
2answers
67 views
Clone Python from one linux machine to another
I want to run some of my python scripts on my new Linux (Centos 6.5) machine that I developed on another Linux machine (also Centos 6.5). But my problem is that my new machine is not having internet ...
0
votes
0answers
13 views
Trigger a graphic window during kickstart
I have built some custom centOS instalaltion CD with the help of anaconda and kickstart, nothing really exciting here, everything is working fine, packet are installed, pre and post installation ...
0
votes
1answer
85 views
Yum Corrupted on RHEL 6
I really need help. I am encountering the issue with my yum command. It seems to be exactly the same as the issue described on this site, Yum corrupted on CentOS 6.2, Problem importing one the python ...
0
votes
0answers
47 views
Opening a TCP port in Linux
I am trying to establish a TCP socket between my linux server and my client running on my laptop. The TCP server code I am running is,
from socket import *
HOST = ''
PORT = 1999
...
2
votes
0answers
63 views
Can I connect to Multiple Bluetooth devices using a Bluetooth dongle?
I am using a usb bluetooth adapter on my PI 2 , which communicates to an arduino using HC-06 Bluetooth module. This script runs to connect to that module:
#! /usr/bin/python
import serial
from ...
2
votes
0answers
37 views
Catch/diagnose user process being killed - Inexplicably logged out automatically
Context: I'm using bash in Mac OSX Yosemite.
Problem:
I'm executing a (python) script that I expect to use alot of resources and take a few hours to run, redirecting stdout and stderr to a log file.
...
0
votes
0answers
31 views
Does python has a Key Derivation Function (kdf) module used in Wifi Protected Setup (WPS)?
I have tried browsing python's documentation website to determine if there is a Key Derivation Function (kdf) module. The kdf is a function used in the Wifi Protected Setup (WPS) to generate keys for ...
1
vote
0answers
20 views
Create new TCP Connection for every http requests in Python [migrated]
For my college project I am trying to develop a python based traffic generator.I have created 2 CentOS machines on vmware and I am using 1 as my client and 1 as my server machine. I have used IP ...
1
vote
0answers
31 views
Why won't my python scripts run without the python command when moved from Windows to Linux? [duplicate]
I have some Python files that I wrote on my Windows PC and then sent over to a Linux machine using pscp. They work as intended on Windows, but when I try to execute them on the Linux machine, I always ...
0
votes
0answers
25 views
Control TCP Connections in Python
For my college project I am trying to develop a python based traffic generator.I have created 2 CentOS machines on vmware and I am using 1 as my client and 1 as my server machine. I have used IP ...
0
votes
0answers
51 views
CentOS: Connection reset by Peer error while running python script
For my college project I am building one traffic generation tool using python. I have developed my own linux server and client on Vmware. I am using urllib2 for traffic generation in python. The ...
0
votes
0answers
58 views
How do I get Ubuntu to use Anaconda's python instead of the standard /usr/lib/python…?
I installed Anaconda using instructions provided on the main website, which are similar to those that can be seen here: http://askubuntu.com/questions/505919/installing-anaconda-python-on-ubuntu
...
2
votes
2answers
42 views
check “newness” / “is-read” of /var/spool/mail/$USER like pam_mail for custom motd script
How can I check with bash or python (preferred) if there are some unread mails in /var/spool/mail/$USER like pam_mail does?
I'd like to use this for my own custom motd script, motd.dynamic
0
votes
1answer
36 views
Local system doesn't forward to intended port defined in OpenShift proxy app
I've set up a proxy server via OpenShift based on this tutorial and used a few days by forwarding my local system's ports to remote app's ports:
$ rhc port-forward AppName
The result in the proper ...
0
votes
2answers
62 views
How to execute unix “jobs” command in python environment
I want to know currently running background process by using unix "jobs" command
in python environment.
I tried using
import os
os.system('jobs')
but it not works for me
1
vote
1answer
149 views
uninstall Python installed by compiling source?
I installed Python 2.7.9 on Ubuntu 14.04 by compiling its source, by .configre, make, and make altinstall. make altinstall is because I don't want to overwrite the default Python 2.7.6. My self ...
0
votes
3answers
39 views
How can I set up using a different version of Python from the OS?
my OS (Ubuntu 14.04) uses an older version 2.7.6 of Python as /usr/bin/python which points to /usr/bin/python2.7 I installed a new version 2.7.9 of python as /usr/local/bin/python2.7.
In my own ...
3
votes
2answers
127 views
how to execute a bash command in a python script
How can I launch a bash command with multiple args (for example "sudo apt update") from a python script?
0
votes
1answer
55 views
Adding commands in a shell script to add a python module path
I want to modify a linux shell script used to install a python module (setup.sh) to add the folder the an environment variable. This is needed so I can run the python module from a terminal. e.g. ...
1
vote
1answer
35 views
Enable cursor keys in python shell over ssh
I run OpenElec on a Pi.
I can ssh to the Pi and open a python shell.
How do I enable the cursor keys to work like up getting to last command in the python shell, like it does on my Ubuntu box.
Now ...
1
vote
3answers
62 views
Simple install script says it is unable to locate package
This install script is giving me the error Unable to locate package for most of the programs.
#! /bin/bash
apps=(
'python-dev',
'python-pip',
'python-numpy',
'python-scipy',
'python-matplotlib',
...
-2
votes
1answer
67 views
How to parse json output through shell / Python [closed]
I am running a curl command which gives me json response.
Now I want to parse the response output to get the keys and corresponding values from the output or getting value for a particular key.
I ...
0
votes
0answers
23 views
Do I have support for python in gdb or not?
I've been following this tutorial which requires running gdb with python support but I get following message:
┌─[wakatana@~] [63 files, 178Mb]
└──> gdb --python
gdb: unrecognized option '--python'
...
0
votes
1answer
47 views
Installing python library matplotlib on RedHat for second python installation
I can't seem to find documentation on this. Matplotlib says to run:
sudo yum install python-matplotlib
which installs all the dependancies and this version of matplotlib successfully:
...
1
vote
1answer
48 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
50 views
running a python script in termin os x
I do not know why but I cannot run a python script though the terminal.
my script:
define_regions.py
print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print ...
-2
votes
2answers
70 views
How can I find the name of my Network Interface [closed]
I have a project that requires me to scan the local network.
I found a program on the internet that allows the local network scanner condition, but I brought the gold @ IP argument in my network ...
0
votes
0answers
29 views
Using pyenv with sqlite3
I'm trying to install Python via pyenv and I would like to compile it with SQLite. I understand that this requires libsqlite3-dev or similar, but I don't have root access on this machine.
I ...
0
votes
0answers
45 views
Sign a soap message from a JKS dynamically using Python Unix
I am currently calling a webservice using Curl command from unix .
I have a requirement that I have to dynamically message sign the soap request every time I make a call to the webservice using my ...
1
vote
3answers
65 views
Do I have multiple python on my computer? and how to uninstall one of them?
I encountered the problem that pip install - U numpy did not update the numpy version in python, which is similar to ...
0
votes
1answer
70 views
Python function should print out something, does nothing
I wrote small script for my Raspberry Pi Project with an Adafruit 16x2 RGB LCD:
def KismetScanner():
print 'Kismet Scan'
#clearlogs = subprocess.Popen('rm -r /var/log/kismet; mkdir /var/log/kismet', ...
0
votes
2answers
80 views
How do I correct the path for pip?
I'm trying to get pip to point to a different install rather than the default. It is currently pointing to /usr/bin/pip, but I want it to point to /usr/local/bin/pip. I believe I have the path set ...