Forum: Python Jun 12th, 2008 |
| Replies: 6 Views: 259 Re: Basic Cryptography Program Help encode = lambda txt: ".".join([str(ord(letter)-96) for letter in txt if ord(letter) in range(97,123)])
decode = lambda txt: "".join([chr(int(char)+96) for char in txt.split(".") if int(char) in... |
Forum: Python Jun 6th, 2008 |
| Replies: 5 Views: 390 |
Forum: Python Jun 2nd, 2008 |
| Replies: 1 Views: 221 Re: bind method in socket when you create a socket, you need to bind it with a port, address so other sockets have something to connect to.
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((address, port)) |
Forum: Python Jun 2nd, 2008 |
| Replies: 2 Views: 393 Re: Py2exe help try GUI2exe, it's a gui wrapper for py2exe.
http://xoomer.alice.it/infinity77/main/GUI2Exe.html |
Forum: Python May 30th, 2008 |
| Replies: 5 Views: 260 Re: Threading Error Hmm.. Well strangely enough it works on my machine (XP)
From idle and from cmd.
Not sure what the problem is, but if you need to get the address of a messege sender then just do that in the thread... |
Forum: Python May 17th, 2008 |
| Replies: 4 Views: 320 Re: Lists & Passwords python has a keyword function in that would be useful in your example.
if password in pass_list1:
# do something |
Forum: Python May 16th, 2008 |
| Replies: 1 Views: 194 |
Forum: Python May 15th, 2008 |
| Replies: 4 Views: 281 Re: List Problem there must be something else going on. When you make a copy of a list list2 = list1[:] it fills list2 with list1's values, but when you change either list1 or list2, the change isn't mirrored so... |
Forum: Python May 8th, 2008 |
| Replies: 6 Views: 419 |
Forum: Python May 8th, 2008 |
| Replies: 6 Views: 498 Re: Tkinter: button not responding immediately # This is meant to draw Start and Stop buttons and a label
# The Start button should start a loop in which the label
# is configured to change colour and text.
# At each pass through the loop the... |
Forum: Python May 7th, 2008 |
| Replies: 10 Views: 867 |
Forum: Python May 7th, 2008 |
| Replies: 10 Views: 867 Re: How to parse in tricky .csv file content? You don't need to get a fileobject though. As solsteel pointed out, the csv module doesn't need a fileobject, it just needs something to iterate through, so if you split the self[filename] string by... |
Forum: Python May 7th, 2008 |
| Replies: 10 Views: 867 |
Forum: Python May 7th, 2008 |
| Replies: 4 Views: 882 Re: A List of Class Objects def function(*args):
print type(args)
print args
function('arg1', 'arg2', 'arg3')
output
<type 'tuple'>
('arg1', 'arg2', 'arg3') |
Forum: Python May 7th, 2008 |
| Replies: 6 Views: 498 Re: Tkinter: button not responding immediately You should definitely use tkinters .after() function, it enters a local event loop which means it doesn't block your program.
def blink(self):
if not self.stop: # check self.stop is... |
Forum: Python May 7th, 2008 |
| Replies: 2 Views: 335 |
Forum: Python May 7th, 2008 |
| Replies: 6 Views: 419 Re: how do you skip inputs if nothing is entered? Well you could just use a Thread object to do the counting for you and then in your main program everytime the user enters a key, you just call a function of the Thread object counting that returns... |
Forum: Python Apr 25th, 2008 |
| Replies: 3 Views: 386 |
Forum: Python Apr 24th, 2008 |
| Replies: 6 Views: 251 Re: Like function in Python >>> string = "A simple example string."
>>> if 'example' in string:
print 'the word \'%s\' is in: "%s"' % ('example', string)
the word 'example' is in: "A simple example string."
>>> |
Forum: Python Apr 24th, 2008 |
| Replies: 3 Views: 373 Re: Multiple tasks in Tkinter http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/
An excellent relatively short tutorial about threads, it's brief (4 pages) but i found it very useful.
As much as... |
Forum: Python Apr 23rd, 2008 |
| Replies: 3 Views: 215 Re: Executing a string >>> exec("print 2")
2
>>> exec("print 2+2")
4
>>> exec("vars = (var1, var2, var3, var4) = 'a', (1,'2',3.0), 44, 0.7\nfor v in vars:\n print v, '=', type(v)")
a = <type 'str'>
(1, '2', 3.0) = <type... |
Forum: Python Apr 22nd, 2008 |
| Replies: 1 Views: 179 Re: Declaring a winner playerScores = {"player1":0, "player2":0}
...
...
if player1 won:
playerScores["player1"] += 1
elif player2 won:
playerScores["player2"] += 1
for player in playerScores.keys():
if... |
Forum: Python Apr 22nd, 2008 |
| Replies: 3 Views: 373 Re: Multiple tasks in Tkinter Well if your running your tkinter gui by calling: root.mainloop() or something similiar then you should change that to:
while 1:
root.update()
#repeat code here
You do everything as normal... |
Forum: Python Apr 17th, 2008 |
| Replies: 2 Views: 253 Dropping files onto Tk windows Hi all!
Just wondering if it was possible to be able to create a Tkinter window that can handle files being 'dropped' on it.
What i want is to be able to drag a file from an explorer window to a... |
Forum: Python Apr 15th, 2008 |
| Replies: 3 Views: 311 |
Forum: Python Apr 15th, 2008 |
| Replies: 3 Views: 311 Re: "Online" Game Planning Help Personally i would use threading (thats the short answer)
As far as how to go about it, you've got a big project on your hands. |
Forum: Python Apr 15th, 2008 |
| Replies: 7 Views: 405 Re: Easy Question (For You) don't hijack eggowaffles thread ramakrishnakota, if you need help and it's not related to this guy start a new thread |
Forum: Python Apr 6th, 2008 |
| Replies: 8 Views: 479 |
Forum: Python Apr 4th, 2008 |
| Replies: 70 Views: 3,769 Re: Is it too late to learn Python competition?
easier for a giant like MS to keep python in 'check' than allow another powerful open source language like python which could result in a drop in sales if software becomes easier to... |
Forum: Python Apr 4th, 2008 |
| Replies: 70 Views: 3,769 |
Forum: Python Apr 3rd, 2008 |
| Replies: 70 Views: 3,769 Re: Is it too late to learn Python java is just like python, it's just that java's virtual machine is a hell of a lot more widely spread, known and used than pythons interpretter.
why do you think Jython is so good at what it does. |
Forum: Python Apr 2nd, 2008 |
| Replies: 7 Views: 536 |
Forum: Python Apr 2nd, 2008 |
| Replies: 7 Views: 536 Re: [Program Query]Classes and Methods i'm not sure, i havn't used the double underscore methods much (if at all) but as far as i am aware, the __str__ method links with the 'print' keyword, so if print object is called then that objects... |
Forum: Python Apr 2nd, 2008 |
| Replies: 7 Views: 536 Re: [Program Query]Classes and Methods well, if you want to be able to 'print' the kangaroo instance in your case your trying to print 'kanga' then just make the '__str__' method return a string and that string will get... |
Forum: Python Apr 2nd, 2008 |
| Replies: 7 Views: 536 Re: [Program Query]Classes and Methods not sure what you mean exactly, but why are you creating a temporary instance of Kangaroo in the put in pouch function?
I thought you meant you wanted roo's pouch added into kanga's pouch?
if thats... |
Forum: Python Mar 30th, 2008 |
| Replies: 2 Views: 355 |
Forum: Python Mar 30th, 2008 |
| Replies: 70 Views: 3,769 |
Forum: Python Mar 30th, 2008 |
| Replies: 2 Views: 355 How to find out a widget's width in Tkinter Hi,
I'm wondering how your supposed to find out a widget's width in tkinter..
Little example code to explain (doesnt do anything at all)
class CustomWidget(Tkinter.Frame):
def __init__(self,... |
Forum: Python Mar 30th, 2008 |
| Replies: 70 Views: 3,769 Re: Is it too late to learn Python python has defiantly spioled me!
i hate the look of other languages even tho i'd love to learn them.. whenever i try.. i end up going back to python just cause it's so much clearer and quicker to... |
Forum: Python Mar 30th, 2008 |
| Replies: 4 Views: 409 Re: Scrolling Ticker... thanks.
Yea i'm using the text version for now, for simplicity and so i can get the rest of the program running, but i'll probably try to work out a canvas method later. i'll post it if it works,... |