Tagged Questions
0
votes
0answers
5 views
keyboard interrupt with with python gtk?
So just like the question says, I'm trying to let keyboard interrupts happens while Gtk.main() is in progress, however, it just doesn't seem to notice that the keyboard interrupt happens until after ...
0
votes
6answers
51 views
Finding all palindromic numbers within a range
I need some help with below:
write a function (main) which will ask the user to enter a starting and ending number range (inclusive). Count through the numbers using a while loop. Add the number ...
4
votes
1answer
63 views
Is the file closed? [duplicate]
I see regularly this kind of code:
filecontent = open(thefilename).read()
I wonder what becomes the file object created by open in this situation: is it implicitly closed, or does it stay open ...
0
votes
0answers
13 views
Why sfml does not play the file inside a function in this python code?
from tkinter import *
import sfml
window = Tk()
window.minsize( 640, 480 )
def sonido():
file = sfml.Music.from_file('poco.ogg')
file.play()
test = Button ( window, text = 'Sound ...
0
votes
1answer
14 views
SyntaxError: unexpected character after line continuation character using .format(\*\*vars())
I am getting started with my first cherrypy app. I am using the example from the docs http://docs.cherrypy.org/dev/progguide/REST.html
import cherrypy
class Resource(object):
def ...
0
votes
0answers
10 views
How can I implement QThread into my python code
I have looked up the references and can not seem to get it to work correctly. Have been stuck in the same spot for 2 weeks. I would like to add threading to my code so I can dynamically update a ...
0
votes
1answer
34 views
How to get number of objects in a pickle?
Is there a short way to get number of objects in pickled file - shorter than writing a function that opens the file, keeps calling pickle.load method and updating num_of_objs by 1 until it catches ...
2
votes
1answer
36 views
splitting up strings to x amount of characters
I am trying to make a decrypter that decrypts code from the encrypter I made. I am getting this type error when I run the code though
getcrypt = ...
-3
votes
0answers
18 views
Take numbers as input and display a sequence? [closed]
How would I make a python program to ask for a starting number, ending number, and a unit to count by and have it display the answer
I need to make a program for a school project that does the above. ...
-1
votes
0answers
23 views
Socket issues, no sending or receiving of packets over multiple pc's
It only recieves or sends packets when we move the pygame window or exit the pygame window... need help trying to figure out why... Not all of the code is ours and our code works properly when running ...
1
vote
2answers
49 views
Python Dictionary from text file
Hello I have a file text that holds a sequence like this:
TCA:DateIn,TimeIn,Content,Quantity,Company,TankerName,Country,PortFrom
26/02/2013,15:00,Natural gas,30000,Linkers, Blue Ice, China,Shanghai
...
0
votes
1answer
22 views
How to update Ttk.Progressbar in Python?
I have a siplme GUI that performs a few time-consuming operations. I would like to make a progressbar that would update after each of this operations. However it seems impossible to be done.
No ...
0
votes
0answers
12 views
cx_freeze can't find Module ElementC14N for my project with xml.etree.ElementTree
I am using xml.etree.ElementTree in my project and it seems cx_freeze has some troubles with it. Other modules (from python and my own) are included correctly - the application does even start from ...
2
votes
1answer
74 views
Regular expression to split a huge string into multiple sets of key-value pairs
I've a huge string which contains many sets, each is separated by ,. Each set has key-value pairs in it, each pair is separated by &.
Here is small example,
...
0
votes
1answer
56 views
Python 3: how to compare multiple strings in one line of code?
I'm trying to make a category select (by text interface) in Python 3, and I was wondering how I can compare if multiple strings are not true, and then print something along the lines of "that is not a ...