text stringlengths 226 34.5k |
|---|
Python matplotlib: Showing the same figure after plotting progressively more graphs
Question: I want to do something like this, where the figure is the same.
fig = plt.figure()
plt.plot(x1,y1)
plt.show()
So it'll show a point in figure 1 at x1, y1
Then if I do a mouse click or pr... |
Is there a way to minimize a window in Windows 7 via Python 3?
Question: I am running a program with a built-in Python interpreter. Periodically I want
that program to be able to go "full screen" or be minimized.
This will be running on Windows 7.
I am wondering if there is a way to do this in Python (so that I could... |
Use bool list to retrieve elements from another list - Python
Question: I have this situation:
main_list = [12, 10, 30, 10, 11,10, 31]
get_indices = [1, 0, 1, 1, 0, 0, 0]
What I want to do is, extract elements from `main_list` according to the
boolean value in `get_indices`. I tried the followi... |
ProgressBar with Threading in Python and Kivy
Question: I have following code
**main.py**
class ExampleRoot(BoxLayout):
def any(self,*args):
x=0
while x<10:
server.sendmail(c,g,e)
total_emails="activity done"
#### progressbar not ... |
how to improve efficiency of this Python code
Question: I have written a simple code in ABAQUS PDE to export results to csv files. I
put a part of it here and I am wondering how I may improve its efficiency.
I am so appreciated for your valuable comments.
from odbAccess import *
from abaqusConstants... |
python plot intersection of line and data
Question: I have a data file that looks something like this:
0 0
0.1 0.1
0.2 0.2
0.3 0.3
0.4 0.31
0.5 0.32
0.6 0.35
And I would like to find the the value that intersects with a slope. My code
looks like this so far:
... |
File I/O in Python
Question: I'm attempting to read a CSV file and then write the read CSV into another CSV
file.
Here is my code so far:
import csv
with open ("mastertable.csv") as file:
for row in file:
print row
with open("table.csv", "w") as f:
f.write(file)
I... |
lLoad fixture in django migrations using loaddata
Question: My django application needs data to work properly, so in certain migration I
loaded data using the recommended method by almost all stack overflow answers:
from django.core.management import call_command
def load_fixture(apps, s... |
Python Nesting Modules
Question: I have spent a lot of time researching this and still cannot understand why I
keep getting ImportErrors: No module named ...
My file structure is as follows:
/Package
/mode
__init__.py
moduletoimport.py
/test
__... |
Issue Setting Up Django Database Access API Using SQLite
Question: I just started using Django, and I am going through the documentation
[here](https://docs.djangoproject.com/en/1.8/intro/tutorial01/) to build my
first app, but I am running into some kind of issue related to the database
access API for SQLite.
My dire... |
Python - Delete the last line of a txt file while appending it
Question: I would like to specify a raw_input command to delete the last line of the txt
file while appending the txt file.
Simple code:
while True:
userInput = raw_input("Data > ")
DB = open('Database.txt', 'a')
if u... |
Portable python package to other platform?
Question: Suppose I have a Windows machine A, the python package x is installed and used
in script.py as:
#this is in script.py
import x
x.useit()
Then I can execute script.py in machine A like:
python script.py
Now if I copy ... |
For file in directories, rename file to directoryname
Question: I have let's say 5 directories, let's call them dir1, dir2, dir3, dir4, dir5.
These are all in the current directory. Each of them contains 1 files called
title.mkv. I want to rename the files to the directory name they are in, ie
the file title.mkv in di... |
How to send shortcut keys in the current web browser?
Question: I am trying to send some shortcut keys to open a new tab in chrome, using
selenium in python. I open up facebook, then I log in, then I want to open a
new tab where I can pass the url of one of my friend so that I can view his
profile. I wrote the followin... |
ImportError: No module named ceph_argparse
Question: I'am trying to run `ceph` command but I get the error
$ ceph
Traceback (most recent call last):
File "/usr/local/bin/ceph", line 100, in <module>
from ceph_argparse import \
ImportError: No module named ceph_argparse
I found... |
Python Pandas filtering and creating new dataframe
Question: I am filtering a list for those records that contain a key word in one column.
The overall list, outputs is given as:
outputs =
sent_name Name Lat Lng type
Abbey Road Station, London, UK Abbey Road, London E15, UK 51.53193 ... |
Extract specific string from Telnet output with Python
Question: I'm trying to write a Python script to telnet to a bunch of Cisco routers,
extract the running configuration and save it. Each router has a different
name so what I would like to do is to extract the device name and save the
output file with that name. Fo... |
Quick Python method to get neighbouring elements in 2D grid
Question: Is there a method somewhere in a Python package that returns the elements and/
or indexes of an element in a 2d grid. E.g. if we have:
[[1, 2, 3, 4],
[5, 6, 7, 8],
[7, 8, 9, 0]]
..and we give the method the in... |
python datetime.astimezone behavior incorrect?
Question: Here is the code which first parses time from string in IST and then converts
that to UTC. So when it 4:00 pm in India the time in GMT / UTC is 10:30 am.
While the following code prints it as 9:30 pm. So instead of subtracting the
offset it is adding the offset. ... |
Change localtime from UTC to UTC + 2 in python
Question: How I can change this code from localtime UTC to UTC+2. Now `hours()` function
print 13 but I need to write 15.
import time;
def hours():
localtime = time.localtime(time.time())
return localtime.tm_hour
... |
How to extract correct data from Sqlite database using Python?
Question: I have a database of people names and their birthdays. The format of birthday
is `mm/dd/yyyy`, like "3/13/1960".
I want to extract a list of people who are born after a specific date. I
called this date "base".
The program that you see below, fi... |
How to check if a specific port is listening using Python script?
Question: I want to check if api and app are running before running tests on them. I
know I can get a list of open ports in CLI using
`sudo lsof -iTCP -sTCP:LISTEN -n -P`
But I want to write a python script to do so. Any ideas on what library should
I ... |
What is the right way to manage namespaces in Python 3?
Question: Most of my programming background is in C++ and Java, but for professional
reasons I'm starting to learn Python. One of the first things that I noticed
was Python's new approach to packages and namespaces, but after googling
around for awhile and doing s... |
Why does setuptools not understand git+https URLs?
Question: According to [Dependency section in the setuptools
manual](https://pythonhosted.org/setuptools/setuptools.html#dependencies-that-
aren-t-in-pypi) `git` repository URLs can be specified in the
`dependency_links` argument to `setup` with `git+URL`. Yet,
... |
Trouble Graphing Data with Python
Question: I'm trying to create a program that will allow me to create a line graph of
random 10 year intervals of stocks. I'm able to get the data into a DataFrame
using pandas, but when I try to plot the information it won't pull up any
graph. There's no error so I'm stuck as to what ... |
Python 2.7 Output from text files without last blank line
Question: I've started to learn Python and I stucked on one task - I have 10 text files
and I am trying to write from them two outputs: Output 1 should look like
folder and name of file header folder and name of file header ...
Output 2 should look like folder ... |
Python error: TypeError: '_csv.reader' object is not subscriptable
Question: I am working on creating a change calculator that has to output a result
similar to this:
{'TWENTY':1, 'TEN':1, 'FIVE':1, 'PENNY’ : 2}
{‘ONE’:1,'FIVE':1}
{‘ONE’:1}
{'PENNY':4,'NICKEL':1}
I am having issues with... |
Python decode nested JSON in JSON
Question: I'm dealing with an API that unfortunately is returning malformed (or "weirdly
formed," rather -- thanks @fjarri) JSON, but on the positive side I think it
may be an opportunity for me to learn something about recursion as well as
JSON. It's for an app I use to log my workout... |
Unable to install modules for anaconda
Question:
abhigenie92@ubuntu:~/Desktop/pygame-1.9.1release$ which python
/home/abhigenie92/anaconda/bin/python
abhigenie92@ubuntu:~/Desktop/pygame-1.9.1release$ sudo apt-get install python-pygame
Reading package lists... Done
Building dependency tree
... |
ValueError("No JSON object could be decoded") Python googlemaps
Question: I am using Google app engine (v1.9.24) with flask (v0.10.1) and python
(v2.7.5).
I'm trying to get the googlemaps (v2.2) API to work with my app.
I know the JSON returned is badly formatted but I don't why.
My code is below:
imp... |
How to make Python's multiprocessing Queue's .empty() method return the correct value? Or alternatives?
Question: I have this snippet that uses the `Queue` class from the `multiprocess`
module. I am very confused that the `.empty()` method of an instance of
`Queue` does not give me a correct value as i would expect. Th... |
When is a variable released from memory?
Question: Say I define a function, which builds a list, and then prints the items of the
list one by one (no practical use, just an example:
import os
def build_and_print():
thingy = os.walk('some directory')
for i in thingy:
p... |
Converting text file to list and getting at it using indexes:
Question: Can anyone tell me why this doesn't work (Python 3) and what I need to do to
fix it. Code and error message below:
def verifylogin():
fin=open("moosebook.txt","r")
data=fin.readlines()
line=data
allData = []... |
Python wand drawed polygons instead of rectangle when stroke_width > 2
Question: I'm not sure what I did wrong, but this is really strange. Not sure whether I
should submit a new issue to wand's Git repository.
edit: I am trying to draw a rectangle.
Consider the following code:
from wand.drawing import... |
How to calculate frequency of each number and display results as a table
Question: I have the following numbers:
x = [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9]
Now I want to calculate frequency of each number and display results as a
table using... |
Major Difference in 2D kernel Density Plots: Seaborn and R
Question: I am trying to plot data using the 2D kernel density plot of Seaborn's
jointplot function (using statsmodels' KDEMultivariate function to calculate a
data-driven bandwidth). I've plotted a 2D kernel density in R using the same
data and the result look... |
Gspread & Oauth2 on Python 3.4 - Oauth does not support indexing
Question: I want to use gspread and since client authentication is outdated, I'm trying
with Oauth2. I'm new to both gspread & Oauth2.
Piecing together [from this basic Oauth2
example](https://developers.google.com/api-client-
library/python/guide/aaa_oa... |
winshell.shortcut(parent) giving 'module has no attribute 'shortcut'
Question: -Update at the bottom-
pywin32 & winshell installed with no apparent errors, but the following test
code (extracted from the example here: [winshell
examples](https://winshell.readthedocs.org/en/latest/cookbook/shortcuts.html#read-
details-... |
error while writing to a Mysql wih python NetCDF
Question:
#!/usr/bin/env python3
import datetime as dt # Python standard library datetime module
import numpy as np
from netCDF4 import Dataset # http://code.google.com/p/netcdf4-python/
import matplotlib.pyplot as plt
#from mpl_toolkits.basem... |
How to route an url to an specific method of a class Django and DRF
Question: I am very new in the python world and now I building an application with
Django 1.8 with the Rest Framework and I want to create a class view to DRY my
code.
For example I want to have a class view for the students in my system
... |
How do I open a document (eg. .txt) in another app from a Python Script mac
Question: How and is it possible to open a document in a GUI text editor such as Word
from a python script on a Mac? For example, do something like this:
Open x.txt in Word.app
Answer: ## Here is how you can do it on Mac OS:
If you want to ... |
inserting a line in a file using python
Question: I have a file which contains data like this:
$ yum -- to install package
admin1,group,n,0123456,/usr/bin
user2,group,n,0123456,/usr/bin
group,n,0123456,/usr/bin
----->#i have to insert a new line here
$cat -- to read contents of a fil... |
Why does unicode to string only work with try/except?
Question: Just when I thought I had my head wrapped around converting unicode to strings
Python 2.7 throws an exception.
The code below loops over a number of accented characters and converts them to
their non-accented equivalents. I've put in an special case for t... |
python matplotlib: drawing 3D sphere with circumferences
Question: I'm trying to draw a sphere like this one using matplotlib:
[](http://i.stack.imgur.com/vXLle.png)
but I can't find a way of having a dashed lines on the back and the vertical
circumfe... |
Finding specific URLs from a list of URLs using Python
Question: I want find if specific links exist in a list of URLs by crawling through
them. I have written the following program and it works perfectly. However, I
am stuck at 2 places.
1. Instead of using an array, how can I call the links from a text file.
2. ... |
Python csv processing
Question: i have an python exercise that require write a program that extract
information from 5 csv file name QLD2010.csv, QLD2011.csv, QLD2012.csv,
QLD2013.csv and QLD2014.csv In each file there some data like that:
Girl Names,Count of Girl Names,Boy Names,Count of Boy Names
R... |
Python TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Question: I have looked into this before asking my question, but haven't been able to
find anything that fits in with my situation.
I'm writing a Python program - a text editor; using Python and Gtk+3.
Here is the error I'm getting:
... |
Python 2.7 : global with imported modules
Question: In Python 2.7, depending on how I import a module, global variables can become
unreachable.
I have a file test.py which contains the following:
x = None
def f():
global x
x = "hello"
print x
I get the following ex... |
Interrupts with Raspberry Pi and PiFace Digital
Question: I have just set up a Raspberry Pi with the PiFace Digital element14 I/O board.
So far, I've followed several steps to get it working such that I can
interface with the I/O ports (control the LED's and operate the switches to do
stuff) The python code I wrote wor... |
Python string search - starting from a specific position within a string
Question: I have the following text stored in a variable which has additional text
before and after it:
`'content="80.96"abcd'`
I have a search variable from which I find out the location of: content="
But then I need another search to find the... |
How/where to use os.path.sep?
Question: `os.path.sep` is the character used by the operating system to separate
pathname components.
But when `os.path.sep` is used in `os.path.join()`, why does it truncate the
path?
Example:
Instead of `'home/python'`, `os.path.join` returns `'/python'`:
>>> import os... |
I want to store the Python shell data into a database
Question: I am new to Python. I'm using this code to get the details of a user (in a
Python shell currently).
import tweepy
import time
import sqlite3
import os
from datetime import datetime
auth = tweepy.OAuthHandler(key,secret)
... |
There was a error importing one of the Python modules
Question: I am trying to run a yum command `# yum install mod-pagespeed` but I am
getting this error
> There was a problem importing one of the Python modules required to run yum.
> The error leading to this problem was:
>
> cannot import name Repository
>
> Please... |
Python merging two lists with all possible permutations
Question: I'm trying to figure out the best way to merge two lists into all possible
combinations. So, if I start with two lists like this:
list1 = [1, 2]
list2 = [3, 4]
The resulting list will look like this:
[[[1,3], [2,4]... |
python how to return to the start of the code
Question: I'm fairly new to python 3 but I'm making a simple program where I can select
the class of a pupil and choose to display their scores based on
averages,highest score etc... what I would like to know is how I can return to
the start of the code so I can select anot... |
Check if post request logged me in
Question: I am trying to log in with a post request using the python requests module on
a MediaWiki page:
import requests
s = requests.Session()
s.auth = ('....', '....')
url = '.....'
values = {'wpName' : '....',
'wpPassword' : '.....'}... |
Conditional probability with sympy
Question: Since it is not a math related question but about using a library to do
symbolic computation, SO is better suited to answer this than
{math|stats}.stackexchange.com
I want to use Sympy to calculate the following:
[](... |
Combining matplotlib's mouse button events with pick events
Question: Based on combination of mouse button and key events, different functionalities
are applied to the points of a scatter plot. When the left mouse button is
pressed matplotlib's
[Lasso](http://matplotlib.org/examples/event_handling/lasso_demo.html) widg... |
How to make correct TCP request using python
Question: I am trying to make request but google.com returns status 400, but It should
be 302. What's wrong with my request? Do i need additional request header? Any
ideas?
Current code:
import socket
host = "www.google.com"
port = 80
client ... |
Python - import error in matplotlib raindrop example
Question: I'm trying to run [Nicolas Rougier's raindrop
animation](http://matplotlib.org/examples/animation/rain.html) using
`matplotlib` (version 1.4.3) on my Python 2.7.10 IDLE (running on a Mac, OS X
10.10.5) but am getting the following import error:
... |
In Python, does `is not int` ever return false?
Question: I am using argument parser to allow passing port number to my program. I then
try to validate the value, and one of the first tests is the `is int` test:
parser = argparse.ArgumentParser(description='Provides XML-RPC API.')
parser.add_... |
SSH identity key ignored when using gitpython under supervisor
Question: I have a simple Flask app that waits for webhooks from my repository host. The
webhook triggers a `git.pull()` of the latest revision from a predefined
repository using `gitpython`. The `gitpython` code is something like:
import git... |
Python 3.4 - how to get properties of an open window (size, position on screen e.t.c) and gui automation
Question: Python 3.4 . I want to get the properties of an open window (size, position on
screen e.t.c) if possible. is there an easy way to do this?. Also is there a
good module for simulating mouse clicks and key p... |
Reading and writing CSV files into a data structure suitable for Excel-style column/row manipulations
Question: So I am currently working on a web-application with a few other people for a
client, and we've hit a stumbling block. Basically we need to be able to
upload a CSV file in a specific layout - and the applicati... |
How to get the Tor ExitNode IP with Python and Stem
Question: I'm trying to get the external IP that Tor uses, as mentioned
[here](http://stackoverflow.com/questions/9777192/how-do-i-get-the-tor-exit-
node-ip-address-over-the-control-port). When using something like
myip.dnsomatic.com, this is very slow. I tried what w... |
trouble when using coords function in python tkinter canvas to modify object coordinates
Question: I am trying to make a canvas with some items that can move and rotate, to do
this, i have functions to modify the coordinates, however i am having trouble
with moving the objects. I am trying to use the coords function to... |
Does eventlet do monkey_patch for threading module?
Question: Docs here in <http://eventlet.net/doc/patching.htm> says "If no arguments are
specified, everything is patched." and "thread, which patches thread,
threading, and Queue".
But with a simple test:
#!/bin/env python
import threading
... |
Every combination of list elements without replacement
Question: In Python 2.7 I'd like to get the [self-cartesian
product](http://stackoverflow.com/q/533905/2071807) of the elements of a list,
but without an element being paired with itself.
In[]: foo = ['a', 'b', 'c']
In[]: [x for x in itertools.... |
Python Eve - POST payload containing a list
Question: I am having trouble with the `list` type in my schemas. Whenever I try to
POST, I get a 422 response stating 'must be of list type'. Below is a simple
example that produces this problem.
from eve import Eve
people = {
'schema': {
... |
string.Formatter throws KeyError ''
Question: I want to print out key+value pairs like in [this
question](http://stackoverflow.com/q/28714510/5312756),
key a: 1
key ab: 2
key abc: 3
^ this colon is what I want
but I don't like the answer there and I tried to ... |
option mapping error with cfn-pyplates
Question: I am using cfn_pyplates to ingest a yaml file and spit out a json file but
have an issue with the option mapping of the cfn_pyplates here. I have this
particular piece of code at the start of the program. Now I have a yaml file
with “stack_role” in it which I used to acc... |
Convert from mac address to hex string and vice versa - both python 2 and 3
Question: I have MAC address that I want to send to dpkt as raw data. dpkt package
expect me to pass the data as hex stings. So, assuming I have the following
mac address: `'00:de:34:ef:2e:f4'`, written as: `'00de34ef2ef4'` and I want to
encode... |
Using and modifying global variables across multiple modules in Python
Question: Python is my newest language (Python-2.6), my background is in C/C++.
Normally, I would create a global variable and be able to modify and access it
across all of my files. I am trying to achieve that same functionality in
python.
Based o... |
Unable to install mysqlclient in python3 virtualenv
Question: I want to run django with MySQL and Python 3. I initialized virtual
environment with `virtualenv --no-site-packages -p python3 ./`. Then I
installed django and wheel using pip, so pip freeze gives
django==1.8.3
wheel==0.24.0
Then I t... |
wxPython threads blocking
Question: This is in the Phoenix fork of wxPython.
I'm trying to run a couple threads in the interests of not blocking the GUI.
Two of my threads work fine, but the other one never seem to hit its bound
result function. I can tell that it's running, it just doesn't seem to
properly post the ... |
TCP Proxy Using Python
Question: I am studying [Black Hat Python](https://www.nostarch.com/blackhatpython) and
trying to understand the TCP proxy code.
I now almost understand it, but it doesn't quite work when I try to test it
with
python proxy.py localhost 21 ftp.target.ca 21 True
in one termina... |
MariaDB, pypyodbc, "Unknown prepared statement handler" executing "SELECT" query on table loaded with "LOAD DATA LOCAL INFILE."
Question: Python 3.4.3, MariaDB 10.0.21, MariaDB ODBC Connector 1.0.0, pypyodbc 1.3.3,
all 64-bit on 64-bit Windows 7.
I've got a python script that's supposed to create a table, populate it ... |
Vigenere cipher corrupts some
Question: I am making a simple vigenere cipher encrypter/decrypter in python, and it
works for the most part. I'm not getting any errors, but some letters aren't
encrypted or decrypted (or both?) properly. Here is my code:
import sys
if not len(sys.argv) == 4:
pr... |
Python (Length input to draw star with a center point of 0,0)
Question: I have some code were the users input the length they want their star to be
and then it draws out the star. What I am trying to accomplish here, is that
every-time they make their input not only that it draws the star but it also
keeps it centered ... |
Python - Spyder gets hang while using Pandas DataFrame
Question: Recently I am facing serious issue with combination of spyder + pandas +
ipython.
I am using Spyder which is using iPython. I am trying following code which is
working well:
import pandas as pd
x = [list(range(5)) for i in range(1000)]... |
Using BeautifulSoup to extract specific dl and dd list elements
Question: My first time posting. I am using BeautifulSoup 4 and python 2.7 (pycharm). I
have a webpage containing elements and I need to extract specific elements
where the tags are either 'Salary:' or 'Date:', the page contains multiple
lists .
The probl... |
Multiple language datetime text to standard date format
Question: I'm using `dateutil.parser.parse` in Python to standardize dates. Not all of
the dates are in English. Therefore, the standardization process failed with
"unknown string format" error. Is there a way to process such dates or at
least avoid the error?
Sa... |
How do I write code to avoid error when windows service read config file?
Question: I have file tree:
f:/src/
restore.ini
config.py
log.py
service.py
test.py
the `test.py` code like this:
import service
import log
import config
clas... |
How do I upload full directory on FTP in python?
Question: Ok, so I have to upload a directory, with subdirectories and files inside, on
a FTP server. But I can't seem to get it right. I want to upload the directory
as it is, with it's subdirectories and files where they were.
ftp = FTP()
ftp.connect... |
problems with python nosetests
Question: I have problems with python nosetests. When I try to run the command, I get an
import error. I checked that the module is correctly installed on my machine.
In fact, if I run the interpreter from the directory where I run nosetests, I
am able to import the module. I checked that... |
delegate SIGINT signal to child process and then cleanup and terminate the parent
Question: I have a main python(testmain.py) script that executes another python
script(test.py) using subprocess.Popen command. When I press Ctrl-C , I want
the child to exit with exit code 2 and then the parent to display that exit
code ... |
Unit Testing for user input and expected output in Python
Question: I'm fairly new to unit test in Python, but have done a few so I understand the
basics of it. One problem I'm having is being able to mock input and then test
for the STDOUT based on that mocked input. I tried the solution in this post:
[python mocking ... |
Why do I get an error for incorrect number of arguments?
Question: I have:
import datetime
class Animal(object):
def __init__(self, dob, carnivore):
self.__dob = dob
self.__carnivore = carnivore
@property
def dob(self):
return self... |
How to I send keystroke to Linux process in Python by PID?
Question: One simple question: I have Linux process ID, which is 3789. How can I send
'ENTER' to this process by using Python?
Answer: You are able to do such thing but with proc name using Python
[subprocess](https://docs.python.org/2/library/subprocess.html... |
Why can Python not recognize spark when I import?
Question: Python spits out an error when I try to import spark:
import pyspark.context
And the error is
Traceback (most recent call last):
File "<pyshell#N>", line 1, in <module>
import pyspark.context
ImportError: N... |
Unknown error with running the nosetests from Learning Python the Hard Way Ex46
Question: I am working on [ex46](http://learnpythonthehardway.org/book/ex46.html) from
Learning Python the Hard way.
I first created tests/NAME_tests.py as the following:
from nose.tools import *
import NAME
def... |
unable to run scrapy in ec2
Question: I'm trying to run a code on an ec2 server. It is a python scrapy project which
is executed fine on my own pc. when trying to run it in the ec2 i get this:
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 4, in <module>
execute()
File ... |
PIL im.getdata file format
Question: I'm new for Python, so sorry for stupid question. When I call for
list(im.getdata()) the result looks like a list with triple-tuple inside.
Simple list commands such as sum() doesn't want to work, claiming:
Traceback (most recent call last):
File "C:\Users\Poos\... |
Eurostat SDMX dataflow description python
Question: Using python I want to collect a list of all possible dataflows from Eurostat.
I have the following code;
from pandasdmx import Request as rq
estat=rq('ESTAT')
cat_rsp=estat.get(resource_type='dataflow')
cat_msg=cat_rsp.msg
print [i.enco... |
stdin reading blocking when running sbt with python subprocess.Popen()
Question: I'm launching sbt via Popen(), and my python process stdin reading is not
working. Here is an example: On the first line I'm launching Popen, on the
second line I'm trying to browse throught the history with an arrow key. This
does not wor... |
wx script can't see numpy, but it's installed
Question: I had a wx script working on winxp (at work). it was upgraded to win7_64. I
installed python2 and wxpython (both 32bit). now my script doesn't want to
run. it says "ImportError: NumPy not found.". so I installed numpy from
numpy.org, but it didnt change anything. ... |
Python requests module is very slow on specific machine
Question: I've experienced too slow execution of Python requests on some machines and
with specific user while other tools (for instance curl) are quite fast.
Strange thing is that if run the script as another user then it runs as
expected. If I run the script on ... |
Matplotlib Basemap Plotting Lat/Lons
Question: I cannot for the life of me figure out how to animate points (earthquake
epicenters) on a Matplotlib basemap plot, using the animation function. I have
tried implementing
[this](http://stackoverflow.com/questions/21207513/matplotlib-basemap-
animation) example code into my... |
Finding server in LAN
Question: How to find, in python, server without having it's IP in LAN?
I assume that port will be configured in file so its doesn't have to find
port.
I tried to search on google but I couldn't find anything useful or that could
help me with it.
The server IP will be changing because it wil... |
Terminate sudo python script when the terminal closes
Question: How can I tell if the terminal running my python script was closed? I want to
safely end my python script if the user closes the terminal. I can catch
SIGHUP with a handler, but not when the script is run as sudo. When I start
the script with sudo and clos... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.