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

learn more… | top users | synonyms

2
votes
1answer
35 views

Convert TeX accents to UTF-8 in Python

edit below First of all, I am quite sure this is a duplicated question. But I have no idea how to search for it. I spent quite a long time already. I am reading with python from a .txt file the path ...
0
votes
0answers
15 views

Can I update python within a user scheme?

I'm running python on a shared server without root access. I've installed pip using the user scheme which allows me to install the packages I need. I can't find any documentation on how to do an ...
1
vote
0answers
18 views

Installing VIM with Python support locally without sudo

I'm trying to install VIM with Python support on Linux without sudo, but for some reason VIM always gets installed without python ( -python in vim --version ) I first installed Python locally by ...
2
votes
2answers
176 views

Why do I receive a “/bin/bash cannot find command” error for an alias?

I am using multiple python, I alias python3 to py: alias py="/opt/python3.4/bin/python3" I want to run python in vim so I write this: map <F9> :call SpecialCompileRun()<CR> func! ...
1
vote
1answer
31 views

Python now thinks arguments are files: Broken emerge, pip, livestreamer and most tools using Python

For these commands (in both bash and fish): sudo emerge eix emerge eix I get this error: usage: emerge [-h] [--version] [input [input ...]] emerge: error: argument input: can't open 'eix': [Errno ...
-2
votes
0answers
29 views

Which language is the “best” for Linux development? C, Go, or Python? [on hold]

When I refer to C, I'm talking about C11 and not ANSI C. Alright so a few months back I got really interested in Linux and played around with Ubuntu, Mint, Fedora, Lubuntu, and a few others. Then for ...
0
votes
1answer
50 views

Can't use apt because python encoding issue

I'm getting a python unicode error every time I try to install or update anything with apt or aptitude, preventing me to update my system. The error I'm getting is the following: File ...
0
votes
2answers
13 views

A file containing exports

I have a file containing the following: export PYTHONPATH=/home/myuser/squish-5.0-xyz/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/squish-5.0-xyz/lib I don't what to place it in my ...
2
votes
2answers
26 views

Cron job is writing the error to error log but fails to write outputs to output log file

I have 2 python codes which i schedule using cron. My codes actually runs from 10:30am to 4:20pm everyday. from 10:30am to 11:00am my codes outputs 2-3 lines every minute and after that they start ...
-1
votes
1answer
20 views

How do I set an environment variable in the shell to be result of python script? [duplicate]

If I run export TEST=script.py echo $TEST It outputs script.py script.py code: return 5 can TEST be set to 5? Obviously script will do something in future not just return a number
1
vote
2answers
43 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
18 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
47 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
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
24 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
23 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
71 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
32 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
104 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
67 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
32 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
43 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
68 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
92 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
51 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
73 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
39 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
32 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
32 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
53 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
77 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
46 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
39 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
63 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
177 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
41 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
139 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
59 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
37 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
65 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
24 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' ...