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

learn more… | top users | synonyms

1
vote
0answers
40 views

how to find default SMTP server name?

I have a python script which uses smtplib to send out an email. I am not sure what to use for mail server name in the smtplib.SMTP initialization. On my test server I use the below and it works fine. ...
0
votes
3answers
46 views

Extract Strings from Web Log file

Given a file containing web access logs for a YouTube video, every line is a hit and is in the format. 62.172.72.131 - - [02/Jan/2003:02:06:41 -0700] "GET /random/html/riaa_hacked/ HTTP/1.0" 200 ...
1
vote
0answers
53 views

Python installation fails in chroot

I tried to install Miniconda Python in a chroot: chroot $1 wget -q https://repo.continuum.io/miniconda/Miniconda3-3.19.0-Linux-x86_64.sh -O /tmp/miniconda.sh ...
0
votes
2answers
30 views

Program run from udev cannot open a window [duplicate]

I have a script, written in python: #!/usr/bin/python3 from tkinter import messagebox variable = messagebox.showinfo('title', 'question') This python script does nothing else than showing a message ...
1
vote
3answers
74 views

Program cannot resolve host name if it's started before first successful internet connection

This is related to a stackoverflow post I posted. Basically I have a Python script that I'm running on an embedded system (Buildroot-based). The python script runs on startup, but I cannot guarantee ...
1
vote
1answer
30 views

Set maximum number of processes started by incrond

I am using incrond to monitor a directory for incoming files. After each file arrives in the directory a python script is called to process it. A problem arises when the rate of incoming files is ...
0
votes
0answers
93 views

uwsgi , application not found

Ok so I have been trying to find a solution to this for 2 days now but I cannot seem to make much progress. I am running this on a nginx server but that appears to be fine. I copied over a python ...
1
vote
1answer
63 views

ImportError: No module named '_struct' when installing setuptools

I've installed separate Python versions on Centos 6.7 using the instructions listed here, using a local install (not my package manager). When I tried to install [setuptools][2] (e.g. python3.5 ...
3
votes
1answer
74 views

Permission denied error without ssh connection

I have an Ubuntu 12.04 server which runs a python application. The application is started manually in tmux or automatically when the server starts. Application processes http requests from android ...
19
votes
5answers
3k views

Why is there an EOF in the middle of the arguments?

I wanted to write a little bash function such that I can tell bash, import os or from sys import stdout and it will spawn a new Python interpreter with the module imported. The latter from function ...
0
votes
3answers
1k views

Getting Error updating CentOS 6.7

I am trying to update CentOS and getting errors as follows. I tried to remove Python and I couldn't. [root@csc ~]# cat /etc/issue CentOS release 6.7 (Final) Kernel \r on an \m Error updating Cent-...
3
votes
2answers
261 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 ...
0
votes
2answers
123 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 ...
1
vote
0answers
12 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 fbpanel-master>&...
1
vote
1answer
140 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
50 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 OVS001....
0
votes
0answers
65 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
50 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
52 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 ...
1
vote
0answers
22 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
0answers
216 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
145 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 (...
3
votes
1answer
79 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
57 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
0answers
137 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
1answer
120 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
42 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
133 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 ...
2
votes
1answer
68 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
1answer
47 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 ...
1
vote
2answers
199 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
0answers
38 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
113 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
482 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
97 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 etree....
2
votes
1answer
359 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 ...
1
vote
2answers
220 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
194 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/ ...
1
vote
1answer
82 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
2answers
897 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 (/usr/...
0
votes
2answers
36 views

Shell script - blanks are not always recognized as such?

I'm confused on how bash interprets blanks while executing a script. In the end, I want a script that is fed by a csv file containing software used by an organisation and it should return the CVEs for ...
0
votes
0answers
42 views

Track command line with timestamps

I want to create a program that audits the command line I/O of a terminal session using its PID. I found out about script command which is pretty much the same to what I want, but the problem is that ...
0
votes
1answer
24 views

Problems with terminal opening URL

I am using soundcloud API with python and I'm trying to open url of the song with my browser. I use this code client = soundcloud.Client(client_id=clientIdEntry.get()) track_url = urlEntry.get() if ...
0
votes
0answers
21 views

problem locating module in ubuntu, visible through Anaconda but not accesible

I have Ubuntu 12.04. I have installed Anaconda3 latest version. It has python3.5 which is default for the system now. Some of the programs require using python2.7 which I invoke as follows /usr/bin/...
0
votes
3answers
541 views

apt-get install bluez only installing documentation

I've been struggling for the past two days to get my Bluetooth keyboard to work with my Raspberry Pi 2, with Kali 2.0 installed (I have gotten Adafruit's PiTFT software from http://adafruit-download....
0
votes
1answer
29 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
146 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
80 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
234 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
17 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-...