Tagged Questions

0
votes
0answers
13 views

PyQt v4.8.2 + Python 3…Icons only showing on dev-machine

I wrote a little app with a gui to analyze xml files. I have 2 .py files where 1 is the GUI and the second handels the xml. My Problem is that the Icons i set and also a gif that i show using QMovie ...
-2
votes
5answers
63 views

How would I re-run code in Python?

I have this word un-scrambler game that just runs in CMD or the python shell. When the user either guesses the word correctly or incorrectly it says "press any key to play again" How would I get it ...
0
votes
1answer
18 views

Logging subprocess.Popen calls

I want to log all calls to subprocess.Popen, so that I can create a batch/shell file that is equivalent. How does python turn the list of arguments into a command? Is it equivalent to ' ...
0
votes
1answer
26 views

Python outputs CR CR LF?

I am in the process of writing a testing script that will simply run an *.EXE file with a few arguments, and then output the result to a file. I have one *.sh testing script that correctly runs the ...
0
votes
1answer
10 views

Skip unittest if some-condition in SetUpClass fails

I was playing with pyUnit framework for unittest testing of my application. Is there any any way to skip all the tests in class if certain condition in setUpClass fails? Currently, I am setting up ...
12
votes
2answers
162 views

Multiple keys per value

Is it possible to assign multiple keys per value in a Python dictionary. One possible solution is to assign value to each key: dict = {'k1':'v1', 'k2':'v1', 'k3':'v1', 'k4':'v2'} but this is not ...
0
votes
1answer
11 views

Python 3, PyQt 4: split large class for GUI controls

My class MainWindow(QMainWindow) for PyQt4 GUI has grown now and I want to split it somehow. The problem is that all numerous functions handling signals are very interconnected and influence other ...
1
vote
2answers
36 views

How to make a custom Number class convertible to int & float?

I have implemented a number class in python 3. What do I need to do so that float(mynumber) works correctly?
1
vote
3answers
52 views

Regex passes in Rubular but not in Python

import re import urllib.request file_txt = urllib.request.urlopen("ftp://ftp.sec.gov/edgar/data/1408597/0000930413-12-003922.txt") pattern_item4= re.compile("(Item\\n*\s*4.*)Item\\n*\s*5") ...
0
votes
2answers
32 views

Matplotlib histogram2d normalize not equal 1

Having one of those days, I can't get my head around what is going on. I have a tool which generates 2D histograms from arrays (Numpy arrays) of X,Y,Z coords (Z is unimportant at the minute). I need ...
2
votes
1answer
23 views

Python3: inheriting from list breaks automagically provided __ne__ when __eq__ is defined?

In Python 3, if you provide an __eq__ method, a sensible __ne__ is also typically provided which makes use of your __eq__. However, I have (in Python 3): class ...
1
vote
2answers
31 views

draw candlesticks(matploblit)

#!/usr/bin/env python from pylab import * from matplotlib.finance import candlestick from datetime import datetime data2 = [(datetime(2012, 2, 1), 3103, 3102.01, 3103.62, 3101.90), ...
3
votes
3answers
39 views

Python Timer crashes the interpreter

I'm new here and this is my first question. I'm making a game in Python 3.2.3 and I've come to a problem where a Timer object sometimes crashes the interpreter after calling it's start() method (it ...
1
vote
2answers
19 views

decoding bytes from urllib using python3, is there a better way?

I was recently re-writing some code to python3 and in search for a clean pythonic solution to decode bytes returned by urllib.request.urlopen to be passed to csv.reader I came up with the following: ...
0
votes
0answers
37 views

Python3 pdf parsing

I have python3.2 installed (I'm not sure if it matters, but it's a 64-bit version) on a Windows machine. I need to open a bunch of pdf files, find certain numbers from the text and store them. Work I ...

1 2 3 4 5 124
15 30 50 per page