Forum: Python Oct 15th, 2009 |
| Replies: 4 Views: 217 Do you mean something like this??
numarray = [1,2,-3,4,5,-25]
for n in numarray:
print "The inverse of", num, "is", num * -1
#print("The inverse of", num, "is", num*-1)
# use the... |
Forum: Python Sep 29th, 2009 |
| Replies: 22 Views: 946 Not really, because in MS Windows the 'Program Files' folder is the system default folder for programs to be installed in (and there are usually a lot of programs installed there!).
Simply... |
Forum: Python Sep 29th, 2009 |
| Replies: 22 Views: 946 Dammit...I thought I'd tried that combination of string in string earlier..... Obviously that was one permutation I missed!
Hang on....Looking back at my failed scripts from when I was playing... |
Forum: Python Sep 29th, 2009 |
| Replies: 22 Views: 946 I've just done a bit of digging around on python.org and found this:
http://bugs.python.org/issue1524
Looks like I'm not the first person to come up with this workaround....See the post made by... |
Forum: Python Sep 29th, 2009 |
| Replies: 22 Views: 946 It took a bit of playing around, but think I've found a workaround for this....
I noticed in the docs for os.system() (Yes I RTFM!) it mentions that the subprocess.call() should be used instead.... |
Forum: Python Sep 26th, 2009 |
| Replies: 7 Views: 337 It's the only way I could access the strptime function.
The first datetime refers to the datetime package, the second refers to the datetime class.
In my import I could have used something like:... |
Forum: Python Sep 25th, 2009 |
| Replies: 7 Views: 337 Firstly 'input' is a reserved word in python, it's used to get input from the user, (rather like raw_input!). So that's why this line of code fails to do anything:
input = raw_input("Type Date... |
Forum: Python Sep 25th, 2009 |
| Replies: 4 Views: 254 OK, I started working on this when I saw your original post. But since I started, you made your second post. So I've modified it a little to give the line numbers; but I've not got it to output the... |
Forum: Python Sep 24th, 2009 |
| Replies: 3 Views: 418 Here's something I just knocked up in a few minutes....This isn't exactly what you're doing, but it should give you a few ideas to use in your game.
My variant uses one tower. The player starts... |
Forum: Python Sep 21st, 2009 |
| Replies: 9 Views: 391 I can't see a problem with the code you've posted!
However if you were using this before:
if x==1 or 2:
Then as gerard has said, the if statement would always evaluate to True...
for... |
Forum: Python Sep 21st, 2009 |
| Replies: 4 Views: 653 This block of code looks like it's presenting the problem:
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_UP:
elderly.moveup()
... |
Forum: Python Aug 8th, 2009 |
| Replies: 8 Views: 353 What have you got so far? |
Forum: Python Aug 6th, 2009 |
| Replies: 5 Views: 325 OK,
After this line:
label = Tkinter.Label(pg4_group.interior(), image=photo)
try adding the following:
label.photo = photo
This will create an instance of your image in the label,... |
Forum: Python Jul 8th, 2009 |
| Replies: 5 Views: 362 Do you need to convert the returned value to hex perhaps??
i.e.
byte = hex( abc.B_ABC_Function02(hex(p2), hex(p3)) )
The above code should set the value of byte to be a hexadecimal... |
Forum: Python Jun 23rd, 2009 |
| Replies: 5 Views: 362 If you're using the windows version of Python3.0 and for some reason you haven't got the shortcuts to idle (i.e. the installer failed to create them, you accidentally deleted them or you used a... |
Forum: Python Jun 19th, 2009 |
| Replies: 3 Views: 265 From what I can see it looks like it's because you are calling newName.ShowModal() twice in your code.
In the first call to DoModal in your if statement, a dialog is created and if the user presses... |