Re: [Tutor] Python in HTML

2005-05-22 Thread Alan G
HI Orri, > >OK, so what happened? You still aren't telling us what happens. Its very hard to find a fault in a program when you have no idea what the problem is. The code is very likely doing what you have asked it to do, so when we read it it will seem to 'work' at a superficial level. Without

[Tutor] installing python 2.4.1 over 2.4

2005-05-22 Thread Pujo Aji
Hello, I have python 2.4. I would like to install python 2.4.1, Should I uninstall python 2.4, or just install 2.4.1? Does it effect my ide such as pydev and komodo ? Sincerely Yours, pujo ___ Tutor maillist - Tutor@python.org http://mail.python.org/

Re: [Tutor] Python in HTML

2005-05-22 Thread Kent Johnson
Liam Clarke wrote: > Um, man, that's what I hate about Javascript, it fails silently. I've > never met a Javascript console... > > /me ponders Firefox plugin. Firefox has a JavaScript console that can be helpful... Kent ___ Tutor maillist - Tutor@p

Re: [Tutor] Python in HTML

2005-05-22 Thread Liam Clarke
Yeah, I just found it. Embarrassed... document inspector is kinda cool too. On 5/23/05, Kent Johnson <[EMAIL PROTECTED] > wrote:Liam Clarke wrote:> Um, man, that's what I hate about _javascript_, it fails silently. I've > never met a _javascript_ console...>> /me ponders Firefox plugin.Firefox has

Re: [Tutor] Python in HTML

2005-05-22 Thread Orri Ganel
EJP wrote: >>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 opti

Re: [Tutor] Python in HTML

2005-05-22 Thread Orri Ganel
Alan G wrote: >HI Orri, > > > >>>OK, so what happened? >>> >>> > >You still aren't telling us what happens. Its very hard to find >a fault in a program when you have no idea what the problem is. >The code is very likely doing what you have asked it to do, >so when we read it it will seem t

Re: [Tutor] Python in HTML

2005-05-22 Thread Orri Ganel
Kent Johnson wrote: Liam Clarke wrote: Um, man, that's what I hate about Javascript, it fails silently. I've never met a Javascript console... /me ponders Firefox plugin. Firefox has a JavaScript console that can be helpful... Kent Many thanks. I was not aware of this. -- Email: sing

Re: [Tutor] Python in HTML

2005-05-22 Thread Alan G
> >You still aren't telling us what happens. Its very hard to find > >a fault in a program when you have no idea what the problem is. > Well, the language being Javascript, I unfortunately don't know what > happened, because there are no IDE's for Javascript; it just fails > silently, as Liam put

Re: [Tutor] While loop exercise

2005-05-22 Thread Andrei
. , hotmail.com> writes: > 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? The standard exercise which includes all three would be a number guessing game where the computer picks a

[Tutor] FS: Python Books

2005-05-22 Thread nf6q
Hello Everyone. The following Python Books are in excess to my needs. I prefer to sell as one lot. XML Processing with Python by Sean McGrath. Web Programming in Python by Thiruvathukal,Christopher,Shafaee Programming Python by Mark Lutz The Quick Python Book. All books are in excellent cond

[Tutor] looking for a pattern in a lot of files

2005-05-22 Thread Jonas Melian
I've to looking for a pattern ('locale for') in a lot of files (/dir/*_[A-Z][A-Z]) it's goes ok any improvement about this code? how print the actual file? could i add an exception? by if there aren't files for line in fileinput.input(glob.glob(os.path.join (dir_locales, "*_[A-Z][A-Z]")

Re: [Tutor] Python in HTML

2005-05-22 Thread Orri Ganel
Thanks to all who helped. It looks like I figured out what the problem was, with the use of mozilla's DOM inspector, js debugger, and JSIDE (a javascript ide) that I downloaded after googling "javascript ide" (it appears to be quite good). In any case, the whole issue was checking whether or

Re: [Tutor] looking for a pattern in a lot of files

2005-05-22 Thread Max Noel
On May 22, 2005, at 21:07, Jonas Melian wrote: > for line in fileinput.input(glob.glob(os.path.join > (dir_locales, "*_[A-Z][A-Z]"))): > if re.search("locale for", line): > print line If you're only looking for the occurrence of a string and not a regex pattern, you do

[Tutor] [HELP]win32 shutdown, restart, logoff

2005-05-22 Thread Shidai Liu
Hi all, Any one know how to make a shutdown, restart, logoff call in windows os like 98, 2000 and xp? Implemented in python, can use python win32 extensions. But not os.system('rundll/shutodwn ...'). Thanks for your help.-- With best wishes!Shidai ___ T

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

2005-05-22 Thread Mitsuo Hashimoto
2005/5/21, Kent Johnson <[EMAIL PROTECTED]>: > 3*[[]] makes a list with three references to the *same* list. This can cause > surprising behavior: > > >>> l=3*[[]] > >>> l > [[], [], []] > >>> l[0].append(1) > >>> l > [[1], [1], [1]] I see. > Often using a dict is a good solution to thi

[Tutor] __init__.py

2005-05-22 Thread Joseph Quigley
I've seen many (python) "plugins" (some located in site-packages [windows here]) with the name __init__.py. What's their use? class foo: def __init__: print "this starts first" def foo1(): print "this comes later. Init initializes the chain of funct

Re: [Tutor] [HELP]win32 shutdown, restart, logoff

2005-05-22 Thread jfouhy
Quoting Shidai Liu <[EMAIL PROTECTED]>: > Any one know how to make a shutdown, restart, logoff call in windows os > like 98, 2000 and xp? Try this: win32api.InitiateSystemShutdown(None, 'Kaboom!', 2000, False, False) Parameters: 1. Computer to shutdown (None for lcoalhost) 2. Message to displa

Re: [Tutor] [HELP]win32 shutdown, restart, logoff

2005-05-22 Thread Shidai Liu
On 5/23/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Quoting Shidai Liu <[EMAIL PROTECTED] >:> Any one know how to make a shutdown, restart, logoff call in windows os> like 98, 2000 and xp?Try this: win32api.InitiateSystemShutdown(None, 'Kaboom!', 2000, False, False)Parameters: 1. Computer to

Re: [Tutor] __init__.py

2005-05-22 Thread Shidai Liu
On 5/23/05, Joseph Quigley <[EMAIL PROTECTED]> wrote: I've seen many (python) "plugins" (some located in site-packages [windowshere]) with the name __init__.py.What's their use?class foo:def __init__:print "this starts first" def foo1():print "this co

Re: [Tutor] [HELP]win32 shutdown, restart, logoff

2005-05-22 Thread Tony Meyer
> I have the local machine's administration privilege. [...] > When I run the command as you point out, I got the following > messages > > (5, 'InitiateSystemShutdown', 'Access is denied.') The process itself needs to have the privilege. This message has complete instructions:

Re: [Tutor] __init__.py

2005-05-22 Thread Joseph Quigley
>__init__.py will be executed when a package is imported. Oh. So it will (for instance) compile .py to .pyc after the installation is finished. Nice. Thanks, JQ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/

Re: [Tutor] __init__.py

2005-05-22 Thread Lee Cullens
Joseph, I'm relatively new to Python, but I might be able to help with your question. First, think of the convention "self" (or sometimes "me" in other languages) as a reference to a specific instance derived from a class. When you reference an inherited class method of an instance, the

Re: [Tutor] looking for a pattern in a lot of files

2005-05-22 Thread Kent Johnson
Jonas Melian wrote: > any improvement about this code? > how print the actual file? You can print the file name and line number using fileinput.filename() and fileinput.filelineno() > could i add an exception? by if there aren't files Set a flag if you print anything, check it at the end of the

Re: [Tutor] Checking and showing all errors before of exit

2005-05-22 Thread Kent Johnson
Jonas Melian wrote: > 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. I don't understand your question. Can you give an example of what you would like t

Re: [Tutor] installing python 2.4.1 over 2.4

2005-05-22 Thread Kent Johnson
The 2.4.1 installer will install over you existing 2.4 install. I don't think it will affect the ides. Kent Pujo Aji wrote: > Hello, > > I have python 2.4. > I would like to install python 2.4.1, Should I uninstall python 2.4, > or just install 2.4.1? > > Does it effect my ide such as pydev an