Forum: Python 19 Days Ago |
| Replies: 2 Views: 167 |
Forum: Python 20 Days Ago |
| Replies: 1 Views: 139 winsound SND_PURGE not working. Sorry to have to post two consecutive questions for other people to help me with, but I'm having a problem with winsound that I simply can't figure out. I've checked all the documentation I could,... |
Forum: Python 20 Days Ago |
| Replies: 2 Views: 167 |
Forum: Python 23 Days Ago |
| Replies: 1 Views: 141 Position in list from within for loop? It's always bugged me how it seems that the only way to find out where you are inside a for loop is to use a counter. For instance, suppose you want to iterate through a list, and print every entry... |
Forum: Python 25 Days Ago |
| Replies: 4 Views: 296 |
Forum: Python 28 Days Ago |
| Replies: 4 Views: 296 getch() woes... I've been trying to program a "press any key to continue" function, simply because raw_input feels noobish, but so far I haven't been having much luck.
I did a search and the opinions are nearly... |
Forum: Python Jun 3rd, 2008 |
| Replies: 5 Views: 191 |
Forum: Python Jun 3rd, 2008 |
| Replies: 5 Views: 191 Surely there's a better way? Iterating over a list, possibly deleting elements. It's the bane of my existence. Suppose, for instance, we have a list of numbers, and want to iterate over it and delete each and every odd one.... |
Forum: Python Jun 1st, 2008 |
| Replies: 3 Views: 242 No "instance" type...? Just noticed an odd little problem. Instead of explaining it, take a look at this IDLE run:
>>> ================================ RESTART ================================
>>> class test:
eggs =... |
Forum: Python May 23rd, 2008 |
| Replies: 2 Views: 157 Can someone help me improve this function? At various points in my text-based programs, I've had to write a function for use in multiple-choice menus. It needs to have the following qualities:
Ignores non-number input, repeating the request... |
Forum: Python May 21st, 2008 |
| Replies: 5 Views: 375 Re: Crazy question -- Python + Command Line Sorry--I just realized that wasn't worded very clearly. What I mean is this:
Is it possible for Python to store the output of calling os.system([command])? For instance, is it possible to store, in... |
Forum: Python May 21st, 2008 |
| Replies: 5 Views: 375 Re: Crazy question -- Python + Command Line That helps very much, thanks! One last thing, is it possible for Python to read the output of the commands it executes? For instance, storing the contents of a directory in a list? |
Forum: Python May 21st, 2008 |
| Replies: 5 Views: 375 Crazy question -- Python + Command Line This is probably totally absurd, but...is it possible to, through Python, access the command line and use it? For instance, write a program that outputted all of the files in a given directory, much ... |
Forum: Python May 18th, 2008 |
| Replies: 2 Views: 201 "break"ing out of multiple levels? For instance, if you have the following (random example):
w = input("Enter width")
h = input("Enter height")
for x in range(0,w):
for y in range(0,h):
print x,y
if... |
Forum: Python May 17th, 2008 |
| Replies: 1 Views: 152 Extremely odd error. Both fighters[0] and cell are object instances. How on earth does it see 3 arguments in this? I don't think wider context is needed, but just ask if it is. |
Forum: Python May 12th, 2008 |
| Replies: 3 Views: 430 Press Any Key to Continue A classic of early text-based interfaces... Any way to do it in Python? I tried getch(), but it doesn't really work (for instance, if you hit Enter to confirm a menu selection, and then it goes to a... |
Forum: Python May 10th, 2008 |
| Replies: 8 Views: 317 |
Forum: Python May 9th, 2008 |
| Replies: 8 Views: 317 "choose" in Python? There's a function that repeatedly shows up in languages, usually with more or less the following form (Python syntax):
var1 = raw_input("Input a number between one and three.")
choose var1:
case... |
Forum: Python May 6th, 2008 |
| Replies: 2 Views: 273 Controlling variable types? Python's system of deciding for you what type to give all your variables is nice and all, but is there a way to force it to give a variable a certain data type? For instance, if you give it the... |
Forum: Python May 3rd, 2008 |
| Replies: 4 Views: 405 A Python editor that runs under Ubuntu? Recently I downloaded Ubuntu v8.04 (Hardy Heron), and was delighted to find Python pre-installed. However, that pleasant surprise was soon dampened by the fact that IDLE would not run, and so I am... |
Forum: Python Apr 27th, 2008 |
| Replies: 1 Views: 184 I've been stumped for a week on this... Hey. I'm working on a simple project that requires a way to find all the empty grid cells accessible along a path that's <= n cells long (an analogy would be TBS movement), and I've got an... |