In the 2.x series of the Python programming language, 2.7 is the latest, and last, major release.
2
votes
1answer
9 views
Invalid MIDI message Data when I'm trying to send Control Change Messages
I'm using pygame.midi library to send MIDI Messages (Control Change messages, not notes).
The idea is to send from the output (from this python program) to the input of another program.
>>> ...
0
votes
1answer
17 views
Validate a argument value based on another argument
I want to validate a argument based on the value of another argument.
SampleScript.py
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--arg1', ...
0
votes
0answers
6 views
Custom Django VM Control Panel - LDAP Questions/Insight needed
I am an intern at a company for the summer. I have been assigned a project that must be done in Django. I have a rough setup going and I need some feedback of how I should further set things up. ...
0
votes
1answer
7 views
Can you dynamically create the arguments for the zip() function in python 2?
I am passing in a variable number of lists in *args to a function. What I'd like to accomplish is to pass this args to zip().
def amv(db, *args):
x = zip(args)
return x
I would like to ...
0
votes
1answer
35 views
Continuously looping, unable to work out what's going wrong
My code below isn't working how I want it to, I've tried to comment it a little to make it easier.
Basically, I want it to try a maximum of three times to access the website and if it is successful ...
0
votes
0answers
12 views
ZMQ: socket_send/recv blocking
So I'm trying to set up some simple communication between ZMQ in Python and ZMQ in a C/C++ extension. Python sets up the context, binds an inproc socket, and passes the context and socket name to the ...
0
votes
0answers
7 views
Python PyQt QMdiArea subwindow scroll not working in TabbedView
I have setup simple example using PyQt designer.See below.
I have mdiarea in in which i am adding a form as subwindow. I made form a bit lengthier than mainwindow to see if scroll-bar appears for ...
0
votes
4answers
42 views
How to find the two indexes from a list whos values are closest to zero
I'm working on a piece for my GA (fitness calculation actually) and I need to get the indexes of two values from a list whos values are closest to zero. I have been looking for about an hour all over ...
1
vote
1answer
17 views
How to convert a string with hexadecimal characters in a string to a full unicode in Python 2.7
After searching around for about two hours i'll finally ask here. Im using Python 2.7 with the csv module, which unfortunately doesn't support unicode output, so when i'm reading something like ...
1
vote
2answers
24 views
Randomly select from a dictionary for proxy use
With the following data how can I randomly select one of the dictionary items and pull both the xtest and the yblob?
{"xtest": "yblob", "xtest1": "yblob1", "xtest2": "yblob2", "xtest3": "yblob3", ...
0
votes
0answers
22 views
Map of antarctica - labels overlapping
I'm starting to get my hands dirty with topojson and mapping, as I'd like them to be part of my master's degree project on global warming.
I tried to do a map of Antarctica with the research stations ...
0
votes
0answers
16 views
Replacement for Tornado with not async server
I wrote server app using Tornado and SQLAlchemy and MySQL(my mistake, I am new to python and didn't check that sqlalchemy cannot be async, no mature async driver for mysql for torando). Now when I ...
0
votes
1answer
15 views
Local Time To UTC time pytz
I converted python datetime with help of pytz.
Convertion is like this
2013-08-23T09:53:03 to 2013-08-23T15:23:03+05:30 (time is changed
according timezone)
now the problem is "At at ...
0
votes
1answer
10 views
Python: Open outlook compose instance with attachments
I know that this exist: compose email in outlook with attachment - but it's not python.
I want to use python to open an Outlook compose instance with some files attached and recipients in To and CC ...
0
votes
0answers
20 views
Python 2.7: subprocess in a thread causes copystat to fail on Windows
I'm trying to process files in multiple threads. Basically I'm copying them, then calling a subprocess to check it. (Originally there's lots of stuff, but this is the part causing problems.)
...
0
votes
0answers
10 views
pkg_resources.DistributionNotFound when zipping 3rd party modules
I'm trying to add third party modules to a 2.7.2 Python installation.
To optimize that installation in terms of memory, I'm zipping the whole /lib/python2.7/ directory into /lib/python27.zip (except ...
0
votes
2answers
43 views
grouping by items in a list
>>> with open('Book2.csv', 'rb') as f:
inpreader = csv.reader(f, delimiter=',')
for row in inpreader:
print ','.join(row)
IdNo, skillsList
...
1
vote
2answers
37 views
Python: select() returns immediately without no data to read (telnetlib)
I want to use select.select() to block the loop until some data is ready to be read from a list of telnet sessions. However, the below code does not work and the call to select.select() returns ...
-1
votes
2answers
31 views
preparing data into python readable format
I have a file with 2 columns("IdNo", "skillsList") in a csv file. when I read the file. It reads the entire file as a string. IdNo has a serialNumber and skillsList has a list of user specified ...
0
votes
0answers
5 views
How to download data using Youtube Analytics API
I want to download the results into a CSV file and am unable to figure out how to get this done.
The Youtube Analytics API Reference states as follows:
"For example, the standard alt parameter ...
0
votes
0answers
7 views
Copy data from Cloud SQL to Cloud Storage using GAE
I'm new to both GAE and Python so I may be approaching this completely the wrong way.
I need to periodically copy data (every 5 minutes) from a Cloud SQL instance to a bucket in Cloud storage. I'm ...
-1
votes
3answers
43 views
grouping on tems in a list in python
I have 60 records with a column "skillsList" "("skillsList" is a list of skills) and "IdNo".
I want to find out how many "IdNo's" have a skill in common.
How can I do it in python. I am not knowing ...
0
votes
0answers
11 views
Pattern recognition in python
I have a string dataframe in python, can please let me know how to recognize the pattern and calulate the length of dataframe, as we do in Trillium or any other Data Quality tool. I am using pandas ...
0
votes
0answers
35 views
ubuntu 13.04 python2.7 cannot import matplotlib and other module
I have just installed matplotlib to generate some plots. but this module cannot be imported in python interpreter. although it can be imported in ipython, when i use ipython to execute those examples. ...
0
votes
1answer
17 views
How to prefix image processing result with the name of the image in Python?
def generalarea(self):
for filename in glob.iglob ('*.tif'):
img = np.asarray(Image.open(filename).convert('L'))
img = 1 * (img < 127)
garea = (img == ...
0
votes
2answers
33 views
Class inheritance, super()
I'm just starting to get the hang of classes so I thought I'd try to practice it making a simple population-dynamics program. I don't quite understand how to implement super(). I was reading some old ...
0
votes
1answer
16 views
Scikit-Learn Not Properly Updating in IPython
I am attempting to update scikit-learn within IPython to version 0.14 from 0.13 using the following command in the IPython shell:
!pip install scikit-learn --update
Everything appears to be ...
0
votes
1answer
11 views
OpenERP How to make a button invisible on button click event
In python, I have the following field:
'permit':fields.selection([('new', 'New'),
('applied', 'Applied'),
('received','Received')], 'Permit', select=True),
def ...
-1
votes
0answers
25 views
Windows 7 switch from Python 2.7.5 to 2.7.2
I have multiple machines that I test my program on. One is running Python 2.7.5 and exhibiting a bug that another is not which is running Python 2.7.2. I'd like to change the machine running Python ...
-2
votes
0answers
10 views
Pandas Package Cannot be Downloaded [on hold]
I have attempted to down load the following pandas file from https://pypi.python.org/pypi/pandas/0.12.0 without success.
pandas-0.12.0.win32-py2.7.exe
It seems that the Norton 360 antivirus software ...