Re: [Tutor] Python in HTML

2005-05-21 Thread Liam Clarke
Oops, I'm lazy - https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&category=Developer%20Tools&numpg=10&id=216 There's a _javascript_ debugger.On 5/22/05, Liam Clarke <[EMAIL PROTECTED]> wrote: Well Orri, I found one bug, but I don't know if this'll fix it, it's in your co

Re: [Tutor] Python in HTML

2005-05-21 Thread Liam Clarke
Well Orri, I found one bug, but I don't know if this'll fix it, it's in your copy playlist bit though. > for (var index = 0; index < songs.length; playable++) >{ >playable[index] = songs[index]; >} >} I believe you want to increment index, not playable. Um, man, that's what I hate about _javas

Re: [Tutor] Python in HTML

2005-05-21 Thread EJP
> Well, like I said, the darkplayer is on an online journal, which means > that the only output possible is modifying the option strings of songs > as they are played or something similar. I do know that the random > number generator works, and the songs played always match the option > selec

Re: [Tutor] Python in HTML

2005-05-21 Thread Orri Ganel
Alan G wrote: >OK, so what happened? >Did you start just making the copy and playing the songs from the >copy? >Did that work OK? > >Does the random number generation work - I assume you tested that by >just writing out the sequence of numbers first? > >And finally when you use the random numbvers

Re: [Tutor] Python in HTML

2005-05-21 Thread Alan G
> specific bit of code I'm having trouble with is the part that selects a > random song from the playlist. To make sure every song is selected at > least once, i tried to copy the playlist and have it choose songs from > the copy, removing each song as it is played, and refilling the copy > when i

[Tutor] While loop exercise

2005-05-21 Thread . ,
Hi, I just finished the chapter which includes while loop, if-else-elif structure and randrange(). Can anyone suggest me 3 exercises to remind of the chapter? Exercises shouldn't be too difficult because i'm newbie! Looking forward to writing some programs! Thanks. __

Re: [Tutor] Retrieving Webpage Source, a Problem with 'onclick'

2005-05-21 Thread Liam Clarke
Wow, I was going to give a rundown of how to use COM, but use that PAMIE instead to do it, it's way easier. If you do want to use COM & win32all instead, just bear in mind that the way to simulate an OnClick is to use taken from the blog you quoted) - ie.Document.frames(1).Document.forms(0).all.

Re: [Tutor] Python in HTML

2005-05-21 Thread Orri Ganel
Alan G wrote: > The problem lies not on the server but on the client. > JavaScript support is embedded in every popular browser so it just > works, but none of them know about python. Even if they did it would > require the user to have Python installed, which you can't assume. > > It is possible

Re: [Tutor] Debugger?

2005-05-21 Thread Alan G
> I see so many errors when i execute my programs. > > Where can i get debugger for python? or How can i debug a prgram? import pdb gets you the standard python debugger. But IDLE and Pythonwin etc have their own builtin graphical debuggers too. But if you are getting a lot of errors the debug

Re: [Tutor] main()

2005-05-21 Thread Alan G
> able to glean some information. When you call a script __name__ is set > to the "Name" of the script called. example: python Hope.py > __name__ = Hope Actually no. When you *import* a file its name is set to the file name(or more acurately the module name) When you run a file from the command

Re: [Tutor] main()

2005-05-21 Thread Roel Schroeven
Servando Garcia wrote: > > if __name__ == '__main__': > > what is the meaning and importance of this code line. I have been > able to glean some information. When you call a script __name__ is set > to the "Name" of the script called. example: python Hope.py > __name__ = Hope Whe

[Tutor] Checking and showing all errors before of exit

2005-05-21 Thread Jonas Melian
Is there any way of checking all possible errors, show you all error messages, and then exit. If i use :: sys.exit("error message") :: it only shows this error message before of exit. Thanks in advance! ___ Tutor maillist - Tutor@python.org http://mai

[Tutor] Debugger?

2005-05-21 Thread . ,
Hi, I see so many errors when i execute my programs. Where can i get debugger for python? or How can i debug a prgram? Thanks. _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-u

Re: [Tutor] Running RPG game again.

2005-05-21 Thread R. Alan Monroe
> I'm trying to make the RPG game to be able to run again. > But, when I type "run", nothing happens. It's because your continue statement on line 45 loops around to line 19 (I double checked in the debugger). Then it checks if the monster is still alive (AGAIN) on line 20, but the monster is al

Re: [Tutor] Retrieving Webpage Source, a Problem with 'onclick'

2005-05-21 Thread Kent Johnson
You may be interested in Pamie: http://pamie.sourceforge.net/ Kent Craig Booth wrote: > Hi, > >I am trying to loop over all of the links in a given webpage and > retrieve the source of each of the child pages in turn. > >My problem is that the links are in the following form: > > [begi

Re: [Tutor] difference between [[], [], []] and 3*[[]]

2005-05-21 Thread Kent Johnson
Mitsuo Hashimoto wrote: > Hello, > > What's the difference between "[[], [], []]" and "3*[[]]" ? [[], [], []] makes a list containing references to three different lists. 3*[[]] makes a list with three references to the *same* list. This can cause surprising behavior: >>> l=3*[[]] >>> l [[

[Tutor] main()

2005-05-21 Thread Servando Garcia
if __name__ == '__main__': what is the meaning and importance of this code line. I have been able to glean some information. When you call a script __name__ is set to the "Name" of the script called. example: python Hope.py __name__ = Hope but why would I want to do this if __n

[Tutor] Exceptions for checking root, files

2005-05-21 Thread Jonas Melian
Hi, I never haven't worked with exceptions, and I'm a little confused. In my programs I always build a function to check things as: - The user that runned the script is root - All the files and directories with whom I am going to work exist - etc else the program exits. Does this checks can be

Re: [Tutor] Python in HTML

2005-05-21 Thread Alan G
> it would be a smart idea if I could figure out how to somehow replace > the javascript in the html with python. However, everything I've seen > online seems to require installing something on the server, which I The problem lies not on the server but on the client. JavaScript support is embedde

[Tutor] Retrieving Webpage Source, a Problem with 'onclick'

2005-05-21 Thread Craig Booth
Hi, I am trying to loop over all of the links in a given webpage and retrieve the source of each of the child pages in turn. My problem is that the links are in the following form: [begin html] link1 link2 link3 link4 [end html] So clicking the links appears to call the Javascript funct

[Tutor] difference between [[], [], []] and 3*[[]]

2005-05-21 Thread Mitsuo Hashimoto
Hello, What's the difference between "[[], [], []]" and "3*[[]]" ? >>> a,b,c = [[], [], []] >>> id(a) 20609520 >>> id(b) 20722000 >>> id(c) 20721712 These ID is mutually different. But, >>> a,b,c = 3*[[]] >>> id(a) 20455728 >>> id(b) 20455728 >>> id(c) 20455728 >>> These are the same. On th

Re: [Tutor] "classmethods"

2005-05-21 Thread Kent Johnson
Kent Johnson wrote: > Try this: > > def fromFile(path): > adict = {} > alist = [] > #... > #some part to read a file and to process data > return MyClass(parameter1,parameter2,...,d) > fromFile = staticmethod(from

[Tutor] CGI-script and multilingual output (HTTP_ACCEPT_LANGUAGE)

2005-05-21 Thread Olli Rajala
Well, I'm thinking about providing my site (at least some part of it) both in Finnish and English and would like to do it right. So, I decided that maybe I should try to use HTTP_ACCEPT_LANGUAGE, or am I completely wrong? I have some questions about it, though. I can access it through os.environ['

[Tutor] Running RPG game again.

2005-05-21 Thread . ,
Hi, I'm trying to make the RPG game to be able to run again. But, when I type "run", nothing happens. thanks. --- import random print \ """ Warrio