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

learn more… | top users | synonyms

3
votes
2answers
89 views

echo $PATH shows path to python scripts, but they cannot be executed

I am new to using the shell, and wanted to create a directory in $HOME where I can put all my python scripts, set a path to that directory, so that I can go into any folder on my Mac and execute those ...
3
votes
1answer
183 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
2answers
96 views

Using embedded python script in Makefile

I'm trying to run a Python snippet inside a Make target, but I'm having trouble trying to figure out how these things work in Make. Here is my attempt so far: define BROWSER_PYSCRIPT import os, ...
8
votes
2answers
31k views

Running Python on ChromeOS

Is it possible to run the Python interpreter on a ChromeOS machine? I've found various editors you can use, but I would like the ability to run python applications as well. I would like to purchase ...
1
vote
2answers
908 views

Invoke python script through make command

I have a tool with 5 python scripts say A.py, B.py, C.py, D.py and E.py. I have to run this program in Linux. A.py is the one program I run which imports other files and uses them. For running A.py, I ...
0
votes
1answer
18 views

CentOS 6, having hard time with yum, repos and installing packages

I'm having some hard time with yum and hoped to get some help. My end goal is to install the pymssql library for Python. It fails because it needs freetds install. yum install freetds fails with ...
0
votes
0answers
8 views

How to add a counter in a list comprehension expression? [migrated]

Is it possible to do a list comprehension expression on the following? end_pieces = ['ATCGCTGCAATG', 'CCTACGGCATGG', 'AGTACTTTATTA', 'TAACAGTTCTTC'] genome_ht = {'ATCGCTGCAATG': [18], ...
1
vote
0answers
5 views

trying to get fbpanel installed but getting confusing errors

I'm not too keen on these python errors to figure them out. this is the error I am getting, but I'm using alsa/pulseaudio so I have no idea how to read python errors. %mike@voidz ...
-1
votes
0answers
14 views

Python script to delete emails in mutt

Is there a way to write a Python script to delete a bunch of emails, say that have been received on a particular date and time, in mutt?
3
votes
4answers
505 views

How can I disable the new history feature in Python 3.4?

Since upgrading to Python 3.4, all interactive commands are logged to ~/.python_history. I don't want Python to create or write to this file. Creating a symlink to /dev/null does not work, Python ...
2
votes
3answers
1k views

installing eric5 in CentOS 6.4

I am trying to install Eric Python IDE 5 in my CentOS 6.4. The problem here is even I have installed PyQT4 its again saying that module is missing. what I am supposed to do ? here is the terminal log ...
0
votes
0answers
3 views

Python script to convert adblock list in a forbidden file for Polipo proxy (regex) [migrated]

On my system I currently running Polipo proxy, mainly for adblock purposes. By a search on internet I've found many shell scripts to convert adblock plus lists in Polipo forbidden file format; most of ...
1
vote
1answer
40 views

How do you list number of lines of every file in a directory in human readable format.

I have a list of directories and subdirectories that contain large csv files. There are about 500 million lines in these files, each is a record. I would like to know How many lines are in each ...
0
votes
2answers
47 views

Need help in data arrangement

Could you please help me to sort this out, I have data which i would like get output in below format using shell/perl script. Data: Virtual Machine Test status Running. Assigned Server ...
-3
votes
0answers
18 views

Removing intermediate line breaks in muliple columns except the last new line character [closed]

Suppose If I have the data like this Col1|Col2|Col3 <br\> 123|abc\n<br\> xyz\n<br\> |abc\n<br\> def\n<br\> other rows<br\> <br\> In the above newline ...
1
vote
1answer
2k views

Trouble installing lxml with custom install location for libxml2/libxslt

I am attempting to install a python module called lxml to my account on a supercomputer running RHEL. I do NOT have root access or super user status. lxml requires the dev/devel versions of libxml2 ...
4
votes
2answers
5k views

Installing python modules for python2.6

On my CentOS 5.8 system (el5 , 64bit), I had python2.4 after OS install and I installed python2.6 now. Now I want to install python modules using yum. But whenever I install a new python module it ...
42
votes
3answers
16k views

How does /usr/bin/env know which program to use?

When I use the shebang #!/usr/bin/env python to run a script, how does the system know which python to use? if I look for a python bin path in the environment variables I find nothing. env | grep -i ...
0
votes
0answers
15 views

Equivalent to OS X's py2app and Windows's py2exe?

I'm writing an application in Python. I don't expect my end users to be particularly tech-savvy, so I'd like to package it up like a familiar native executable. For OS X, that means running it ...
1
vote
0answers
16 views

Build xpra on local directory without root priviledges

I am trying to build xpra on local directory without root priviledges. The xpra official site says: https://www.xpra.org/trac/wiki/Building Building with distutils For installing into a local ...
1
vote
0answers
14 views

Can I copy output from sage to my clipboard?

I run sage from the terminal. One nice feature of sage is that it can automatically latex-ify results. I would like to be able to pipe these results to my clipboard (I run Ubuntu 14.04). I have ...
0
votes
1answer
697 views

Django can not connect to MySQL database over ubuntu 10.04

I am newbie in Django. I got a simple Django 1.3.* project, i would like to run it over my localhost. I installed all necessary modules like: python-mysqldb, rptz etc... I have ubuntu 10.04 ...
1
vote
0answers
18 views

Can I change owner of a tunnel after creating it?

I've been trying to finagle pytun to do my bidding in creating persistent ssh tunnels, but I very much do not want these to be owned by root and unless I modify the python package myself (which as a ...
0
votes
1answer
1k views

Debian Stable (“wheezy”): was trying to build Python 3.4, and I ran sudo make install — am I in trouble now?

So, I wanted to run Python 3.4.x inside a virtualenv virtual environment. I learned that the first step should be to build Python 3.4.x. I was doing so in /usr/bin/Python3.4.x (a folder I created), ...
1
vote
2answers
2k views

“except (IOError, OSError), e: SyntaxError: invalid syntax” when configuring python-lockfile

I am having trouble installing any new packages in Ubuntu because of python. I tried sudo apt-get install python3 python3-dev but I am getting the following output :: dpkg: error processing ...
0
votes
0answers
59 views

FreeBSD Selenium PhantomJS - Can not connect to the Service

i am stuck to run PhantomJS with selenium. So i have prepared a FreeBSD Jail and installed phantomjs via ports. whereis phantomjs > phantomjs: /usr/local/bin/phantomjs /usr/ports/lang/phantomjs ...
0
votes
2answers
67 views

Script for ssh automatic login to a specific port

So currently, the "traditional" way to connect through SSH is the following one: ssh USERNAME@HOST -p PORT I would like to create a script in which I will include all the appropriate information ...
11
votes
1answer
126 views

How do I activate Xorg record module on Raspbian?

I'm trying to automate some tests on my RaspberryPi and I'm using python's pymouse to perform some emulated clicks. On my Debian it works fine, but when it comes to Raspbian it keeps failing with this ...
3
votes
1answer
72 views

Bulk downloading PDFs

This may/may not be possible using bash happy for a suggestion in Python if there is one. But I would like to download all the PDFs/ePubs from the following link https://mises.org/library/books ...
0
votes
0answers
30 views

wget changes downloaded file size

I'm using wget to download Excel file with xlsx extension. The thing is that when I want to deal with the file using openpyxl, I get the following error: "BadZipfile: File is not a zip file" But when ...
0
votes
1answer
57 views

How do I print the data received on a serial port?

Below is the python code I have written : import serial,time #initialization and open the port ser = serial.Serial() ser.port = "/dev/ttyUSB0" ser.baudrate = 1152000 ser.bytesize = serial.EIGHTBITS ...
0
votes
0answers
44 views

Email generated with Python stuck in mailq, times out (Debian)

I want to send emails out, originating from my Debian computer. I do NOT want the emails to originate from my gmail account, like in most Python smtplib examples. I called my ISP regarding port 25, ...
0
votes
0answers
39 views

Cronjob python script

I have a python script that parses some html and then writes it to output file. I want that cronjob would execute that python script. When I run this script from command line it works fine (python ...
0
votes
1answer
20 views

OPENSSL_1.0.0 not found when running PyPy 4.0.1 on Amazon Linux (AWS EC2)

I want to run PyPy 4.0.1 on Amazon Linux (AWS EC2), and then downloaded and unzipped the tar.bz file. Also, I created the symbolic links to fix problems, such as pypy: error while loading shared ...
1
vote
0answers
235 views

Run git pull from a shell start-up script

I have Raspberry Pi that loads a shell script on start up. This script runs a python script, boot_camera.py, which is found in a repository. I Have a server which sends the Raspberry Pi a command ...
3
votes
0answers
31 views

What is wrong with my systemd unit file?

Here is my unit file: [Unit] Description=Backend Service After=mariadb.service Requires=mariadb.service [Service] Type=simple ExecStart=/var/www/html/pythonscripts/Backend.py [Install] Alias=BEd ...
1
vote
2answers
52 views

FreeBSD: using python3 in uwsgi instead of python2

I have a server with FreeBSD 10.1 installed. I want to deploy a Django site on it using uwsgi+nginx+python3 and got some problems. The site was written for python3, I installed python3.4 then python3 ...
1
vote
1answer
23 views

How to Load data to one table from Multiple excel files?

I have to load data from multiple excel file into one table , Please help me to achieve the solution. We are getting excel file from different retail shop which contain multiple column , each file is ...
0
votes
1answer
10 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
2answers
45 views

How to specify the python path for pip?

With pip installed, I am trying to install matplotlib in Ubuntu 12.04.4 LTS. I got the following error when executing "sudo pip install matplotlib" I guess this is because the python version is too ...
0
votes
1answer
1k views

qmake error when installing PyQt5

I'm trying to install PyQt5 for python3 from source files. I install SIP correctly. Then when I want to prepare the make file for installing PyQt, I get this error: #python3 configure.py Error: ...
1
vote
1answer
37 views

Building python with openssl support

I have the following directory structure: nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la 2to3 cpp-5.3.0 gcov-5.3.0 grmid-5.3.0 objcopy-2.25.1 ...
0
votes
0answers
23 views

Building python with openssl support

I have the following directory structure: nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la 2to3 cpp-5.3.0 gcov-5.3.0 grmid-5.3.0 objcopy-2.25.1 ...
0
votes
1answer
34 views

Running a command on all servers using Fabric

I am not sure , whether i should i ask this question here or some other stack-exchange community , but i am trying some simple commands to run on a list of servers , using python fabric. The code ...
0
votes
1answer
52 views

Upgrading from Python to 2.7.10 to 2.7.11 on OSX

How can I upgrade Python from 2.7.10 to 2.7.11 on OSX (Yosemite)?
1
vote
2answers
42 views

How can I run this python script on all html files under a directory? [duplicate]

I have a python script $ cat ~/script.py import sys from lxml import etree from lxml.html import parse doc = parse(sys.argv[1]) title = doc.find('//title') title.text = span2.text.strip() print ...
1
vote
1answer
30 views

Install Python package in linux OpenSUSe

I am using this weird SuSE machine. I need to install a python package in my python 2.7. I downloaded it from the site and then untar it and cd to the directory.. Tried: cd /python-package_Pyxnat/ ...
0
votes
2answers
67 views

Make python 2.7 the default python in centos, making an alias didn't work

I am trying to install llvm on my centos 6.7. While running the configure file it says it throws the error checking for python >= 2.7... not found configure: error: found python 2.6.6 ...
1
vote
1answer
41 views

How to provoke a broken pipe

I try to debug a python script that interfaces MPD using python-mpd2. When the script tries to perform an action after being idle for a couple of hours, it terminates with an exception ...
0
votes
1answer
39 views

Using hex colors in Ranger file manager

I would like to change the colors in a ranger colorscheme to some custom hex colors I defined. However, in the python file the colors are set by their names, like "blue" or "red". I tried to swap them ...