Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread John Fouhy
oesn't_ call the __init__ method of any superclasses. There are several good reasons for this --- it doesn't know what parameters you want to pass to the superclass __init__ methods, or when you want to call them. So, it is up to you to make that call. You can do that like this: class sub(

Re: [Tutor] my text adventure, saving and restoring

2005-12-04 Thread John Fouhy
w') pickle.dump(world,f) f.close() This is all you need, because 'world' contains all the information about your world. Then, when you load the data back, you will need to figure out some way of building your 'rooms' data structure from 'world'. Does thi

Re: [Tutor] Problems padding a string with 0's while deconcatonating

2005-12-05 Thread John Fouhy
5 of them, and 3 bits left over. But there's an easier way to do that calculation --- the modulo operator: >>> len(b) % 4 3 That's how many extra bits we have, so we can subtract that from n to get the number of '0's we need to pad with. Does that help? -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to Pass lists by value

2005-12-05 Thread John Fouhy
'30' will create a new (local) variable x and give it the value '30'. x.append('20') will call the .append() method on x. Calling this method has the side effect of changing the list x points to. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] terminology

2005-12-05 Thread John Fouhy
e of good python implementations around that you could google for.. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] bitwise manipulation

2005-12-08 Thread John Fouhy
n existing int. Also, if you're playing with stuff at that level, you might find the struct module helpful. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] information needed to make a connection between computers

2005-12-11 Thread John Walton
IP address, name, IP name)? Also, could you tell me how to find it on a computer? Since I'll be testing the instant messenger on the three computers in my house, I just need to know how to find the information on the computer I'd currently be on (not from any remote location). Thanks!  :

Re: [Tutor] writing list elements into a string

2005-12-15 Thread John Fouhy
27;re almost there... >>> a = ['apple', 'is', 'a', 'good', 'fruit'] >>> ' '.join(a) 'apple is a good fruit' >>> '...'.join(a) 'apple...is...a...good...fruit' >>> '\n'.join(a) 'apple\nis\na\ngood\nfruit' >>> print '\n'.join(a) apple is a good fruit HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Printing

2005-12-24 Thread John Corry
/FAQ page which deals with printing text files or is there simple code which prints a text file? Thanks, John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Printing

2005-12-26 Thread John Corry
;, 'The system cannot find the file specified .') I have played about with it and saved it in various places but I can't get it to work. Any suggestions? Do I need to import other modules? Do I need to use Pythonwin? Thanks, John. -Original Message- From: [EMAIL PROT

[Tutor] How to call mysqlcommand in Python , "mysqldump for backup "

2005-12-27 Thread John Joseph
Hi I am trying to execute some MySQL commands using some python scripts I want to do a “mysqldump” of my database “john” to a file backup.date.sql the normal command to take a dump is mysqldump john> backup.sql I tried python , by importing “import

Re: [Tutor] How to call mysqlcommand in Python , "mysqldump for backup "

2005-12-28 Thread John Joseph
"+target_dir+"/table.bak.sql") > > dont forget the p in front of your password ! > > hope this helps > > Hi it helped me a lot , I did my script like this for backing my zabbix database import os, time # difine the target directory target_dir = '/ho

[Tutor] SyntaxError while defining tuple : Guidance requested

2005-12-31 Thread John Joseph
Hi I am trying out learning python , using the book “Python Programming for the absolute beginner “ by Michael Dawson I get File "page114.py", line 12 inventory = ("Sword","Armor","Shield","Healing Potion") ^ SyntaxError: invalid syntax when I run the program

Re: [Tutor] SyntaxError while defining tuple : Guidance requested

2005-12-31 Thread John Joseph
--- Brian van den Broek <[EMAIL PROTECTED]> wrote: > Hi John, > > sometimes the syntax error indicator isn't quite > pointing to the > problem. In your case, the place it points was where > Python worked out > there was a problem, but the difficulty with yo

[Tutor] TypeError: object doesn't support item assignment [ Trying to learn how to enter value in array ]

2006-01-02 Thread John Joseph
Hi All I am trying to write a program in which I enter the no of students and then for the students I enter the marks and later on Display the marks The script which I wrote is given below , when I run the program I get error “TypeError: object doesn't support item assignment “ , my aim in

[Tutor] Printing error on Win 98SE

2006-01-02 Thread John Corry
ile will print to the printer. The code that I am using is below: import win32api filename = "testprint.txt" fileobj=open (filename, "w") fileobj.write ("This is a test") fileobj.close() win32api.ShellExecute ( 0, "p

[Tutor] Thanks , Now able to do Marks entry and display it using Histogram

2006-01-03 Thread John Joseph
more , I am adding the program which I had done Thanks to the list , I am getting more encouragement here ,it is fun over here Thanks Joseph John *** # This program

[Tutor] How to make to exit the loop, while typing Enter

2006-01-03 Thread John Joseph
Hi I am trying to write a program in which it ask for entries for the list , But if I press Enter it should exit the while loop without giving errors ,I have problem in making it work , right now if I press enter to exit , the program terminates showing error I am added my script wh

Re: [Tutor] HD/DVD/CD

2006-01-03 Thread John Fouhy
nter/scripts/python/pyindex.mspx useful to you? -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] HD/DVD/CD

2006-01-03 Thread John Fouhy
api.GetVolumeInformation('D:/') >>> '%X' % cdi[1] '49BC31DB' So, on my system (ActivePython 2.4, WinXPpro) there is no need for magic. I've got Mark Hammond's pywin32 book, but it doesn't talk about win32api.GetVolumeInformation(). -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to make to exit the loop, while typing Enter

2006-01-03 Thread John Joseph
Hi All I was able to exit the while loop , using sys module also I was able to find the maximum no of marks entered , I am adding my code , for comments and suggestions Thanks for the support Joseph John

[Tutor] Further help needed!

2006-01-04 Thread John Corry
o I have to do something different on the windows 98SE machine? Any help would be greatly appreciated. Thanks, John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Further help needed!

2006-01-04 Thread John Fouhy
[resending 'cause I forgot to address to tutor..] On 05/01/06, John Corry <[EMAIL PROTECTED]> wrote: > This code works on windows XP + Windows 2000. However it does not work on > windows 98SE. I have tried this code on 3 seperate machines with windows > 98SE. They all c

Re: [Tutor] Further help needed!

2006-01-05 Thread John Corry
Notepad opens and prints the text file. Regards, John. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John Fouhy Sent: 04 January 2006 21:54 To: Tutor Subject: Re: [Tutor] Further help needed! [resending 'cause I forgot to address to tutor..] On

Re: [Tutor] Excel files to Tab delim files

2006-01-05 Thread John Fouhy
h it is that it reads integers as strings, but I haven't looked at the latest version so this may be fixed, and if you're just writing out to CSV file that won't matter anyway. [be aware, though, that any dates in the spreadsheet will turn into integers] -- John. _

Re: [Tutor] Disabling a frame in Tkinter

2006-01-05 Thread John Fouhy
.selection_set(0) will select the first item (just make sure the listbox isn't empty). -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Syntax Error

2006-01-05 Thread John Fouhy
dule are deprecated in favour of calling methods on strings themeslves. So, instead of saying: > new_file_string = string.replace(file_string, ' ', '_SPACE_') You would say: new_file_string = file_string.replace(' ', '_SPACE_') HTH! -- John.

[Tutor] Nearly there

2006-01-06 Thread John Corry
quot;This is a test") fileobj.close() win32api.ShellExecute ( 0, "print", filename, None, ".", 0 ) The code above gives me the error: (31, 'ShellExecute', 'A device attached to the system is not functioning.') However

Re: [Tutor] Nearly there

2006-01-07 Thread John Corry
for win xp + win 2k. Onto my next problem. My text file is printing out in portrait. Is there any instruction that I can use so that notepad prints it in landscape? Thanks, John. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Terry Carroll Sent: 07 January

[Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread John Joseph
Hi All I am trying to find out the duplicates in a list , as for beginning I wanted to compare the adjacent elements in list , for this purpose I wrote a script for checking the adjacent elements in a list, if same , it prints the result that , the adjacent numbers are same , it not it wi

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread John Joseph
or loop for this message to go my for loop is as for j in range(length) : if seats[j] <> seats[j+1]: print " The Seat", j , "And the seat", j+1 , "value, which are", seats[j]," and", seats[j+1], "are not

[Tutor] Landscape Printing

2006-01-08 Thread John Corry
Hi, My text file is printing out in portrait. Is there any instruction that I can use so that notepad prints it in landscape? Thanks, John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread John Joseph
d Hat 3.4.2-6.fc3)] on linux2 THANKS Joseph John --- Brian van den Broek <[EMAIL PROTECTED]> wrote: > John Joseph said unto the world upon 08/01/06 06:36 We no longer need the continue clause, as converting to set ensures we won't ev

Re: [Tutor] need help with syntax

2006-01-10 Thread John Fouhy
because steps is not an integer Sounds like you want string substitutions.. You can read about them here: http://python.org/doc/2.4.2/lib/typesseq-strings.html For instance: >>> steps = 6 >>> ">%s" % steps '>6' HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] need help with syntax

2006-01-10 Thread John Fouhy
'xfooybarz' So, in your case, try something like '>%s+f'. > also this still requires me to reassign 6 to steps > > isnt this already done here ? > > >>> s = L[:4] > >>> s > ('\x00', '\x00', '\x00', '\x

Re: [Tutor] Returning multiple values from a script

2006-01-11 Thread John Fouhy
#x27;win32' [actually, it does a bit more than just that; read the docs] -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] defining __init__

2006-01-13 Thread John Fouhy
ss MyClass(object): ... def __init__(self): ... print 'Initialising MyClass instance now...' ... self.x = 3 ... >>> m = MyClass() Initialising MyClass instance now... >>> m.x 3 -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Complete programming newbie requires tutorial.

2006-01-14 Thread John Joseph
--- Chris Andrew <[EMAIL PROTECTED]> wrote: > Hi, all. > > I wonder whether you can help. I've just subscribed > to the list, so look > forward to participating. I have been using GNU/ > Linux since about 1999, > but am a complete newbie when it comes to > programming. > > I bought the O'Rei

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-14 Thread John Joseph
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > >I get the error for set > > >>> set((1,1,1,2,2,2,2,2,3,4,4,5)) > > Traceback (most recent call last): > > File "", line 1, in ? > > NameError: name 'set' is not defined

[Tutor] "while" loop for satisfing two conditions , advice requested

2006-01-15 Thread John Joseph
ed in this way while (condition no 1) & (condition no2): print “Results” I request guidance Thanks Joseph John ___ NEW Yahoo! Ca

Re: [Tutor] Design suggestion - is a cookie the answer?

2006-01-16 Thread John Fouhy
or GET. So, even if you are using POST, clever kids could, I think, construct a GET url to do the same thing. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] copyright statement

2006-01-18 Thread John Fouhy
Anyone know anything about the 'copyright' statement? help(copyright) is not ultra helpful, and I can't see anything in the docs (eg, http://python.org/doc/2.4.2/ref/simple.html doesn't list it). Is it ever intended to be used in n

Re: [Tutor] copyright statement

2006-01-18 Thread John Fouhy
7; and 'None' as well :-/ ) Open mouth, insert foot, echo internationally... -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How does [::-1] work?

2006-01-18 Thread John Fouhy
2 'usqom' And if you omit the start or stop parameters, and step is negative, then start defaults to the end of the list and stop to the beginning. So string.lowercase[::-1] will step backwards, starting at the end and finishing at the start. HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Links for programming using MySQL

2006-01-19 Thread John Joseph
Hi I wanted to try out python with MySQL databases , I would like to get info about the link to sites , which gives you examples on how to do python programming by using MySQL database Please guide Thanks Joseph John

[Tutor] Python + MySQL , my first simple program does not gives results

2006-01-19 Thread John Joseph
Please guide me , why I am not getting any results displayed Thanks Joseph John ***8 """ For learning for To connec

[Tutor] Searching for email id in MySQL giving wrong results

2006-01-22 Thread John Joseph
for the reason for this behavior I had added my script in this mail Thanks Joseph John * """ This program is for to learn how to enter data to MySQL using python

Re: [Tutor] Searching for email id in MySQL giving wrong results [ Try out pattern Search ]

2006-01-23 Thread John Joseph
thon , how to call the pattern matching inside mysql query I had added my code Thanks Joseph John *** import MySQLdb s_email= raw_input("Enter the some part of the Email to be

Re: [Tutor] Dictionaries

2006-01-25 Thread John Fouhy
On 26/01/06, Jon Moore <[EMAIL PROTECTED]> wrote: > Hi > > Is there anyway to print informtation from dictionaries better than this?: Well, you can print the value too if you want :-) eg: >>> pairs = {"Jon Moore": "Tony Moore", ...

Re: [Tutor] AttributeError - ChatServer

2006-01-26 Thread John Fouhy
init__ method. So I guess this is just a typo --- if you change "self.decriptors" to "self.descriptors", you might have more luck :-) -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-28 Thread John Joseph
Hi I am sending the code of the function "searchbyemail" and the output of the program when I run I am trying to search and display the results , even if we give a part of the email_id thanks Joseph John SEARCH by

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-29 Thread John Joseph
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > > Hi John, > > Ok; because the question you're asking looks a > little homework-y, we have > to be a little bit more cautious in our answers. > What part are you > getting stuck on? > > > Do you understa

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-29 Thread John Joseph
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > > the email id which starts with “j” is > > select * from contact where email_id like 'j%'; > > Hi John, > > Ok, looks good so far. So in a Python progr

Re: [Tutor] getting around ValueError in os.walk

2006-01-30 Thread John Fouhy
raceback (most recent call last): File "", line 1, in ? NameError: name 'x' is not defined which might give you a better clue as to where the problem is. HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] getting around ValueError in os.walk

2006-01-30 Thread John Fouhy
happy about whitespace either side of the '.' operator.. Some of the wxPython guys like their whitespace, eg: http://wiki.wxpython.org/index.cgi/DataAwareControlsMixin#head-d1249e34e446972c34012a866f67bc184db7bc52 :-) -- John. ___ T

[Tutor] Cannot run .py file from apache web server , Guidance requested

2006-01-31 Thread John Joseph
reshtml = '''Content-Type: text/html\n Friends CGI Demo (dynamic screen) Friends list for: Joseph Your name is: John You have 20 friends. ''' When I access this script from the url “http://192.168.20.99/~john/ sample-test.py” in the browser I see the contents of

Re: [Tutor] Documentation

2006-02-05 Thread John Fouhy
#x27;wraplength'] So, these are the possible things you can configure with a Tkinter.Button. Also, the online documentation at python.org is very good. I recommend going to http://www.python.org/doc/ and downloading the current documentati

Re: [Tutor] First Gui App - Please scrutinize

2006-02-06 Thread John Fouhy
> self.setstatus).grid(row=6,column=0,sticky=W) Why are you assigning these to self.test? (in particular, you realise that the results of these grid() calls will be None?) > if (self.costlistradial.get()): > self.e_list['state'] = 'di

Re: [Tutor] Syntax Question

2006-02-08 Thread John Fouhy
ry', finishing the string there. A triple-quoted string should work for you because lone single or double quotes in a triple-quoted string are passed literally. Otherwise, you need to escape them --- ie: 'insert on table \"category\" ...'. HTH! -- John. _

Re: [Tutor] soundfile picker & rating system

2006-02-08 Thread John Fouhy
song ranked 50 will be fifty times more likely to be chosen than a song ranked 1, while a song ranked 80 will be only 1.6 times more likely to be chosen than a song ranked 50. Maybe some kind of logarithmic transform might smooth things out a bit..? -- John. __

Re: [Tutor] Splitting long string into same len parts

2006-02-08 Thread John Fouhy
, for instance: >>> n = 'xb1jyzqnd1eenkokqnhep6vp692qi9tmag3owzqw0sdq3zjf' >>> n[0:3], n[3:6] ('xb1', 'jyz') Can you see how to generate the slice boundaries for the length you need? -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tkinter, widgets not displaying...

2006-02-09 Thread John Fouhy
programming with a GUI, one good way is to use .after_idle. ie, instead of myturns.insert(str(i)), do top.after_idle(myturns.insert, str(i)) (I think this is the right syntax). This will cause the mainloop thread to run the code instead. HTH! -- John. _

[Tutor] Gadfly Database Problems

2006-02-14 Thread John Corry
database files. I can see the database files in the dist folder. Are there other files which I have to manually copy into the dist folder such as the sql_mar.py? Any help or pointers would be greatly appreciated. I know that this is a py2exe specific question but I have

[Tutor] G'day

2006-02-15 Thread John Connors
G'day, I'm new to Python and new to the list and just thought I'd say a quick hello before asking my 1st dumb question. My name is John and I live in Australia, I've been using computers since about 1983. I haven't done any programming since the commodore 64 basic days

Re: [Tutor] G'day

2006-02-16 Thread John Fouhy
On 16/02/06, John Connors <[EMAIL PROTECTED]> wrote: > My 1st dumb question: I have a copy of Teach Yourself Python in 24 Hours, > printed in 2000 so I guess it's virtually usless but i was hoping to learn > some of the basics from it. There is a small bit of code near the &

Re: [Tutor] G'day

2006-02-18 Thread John Connors
round to printing it out sooner or latter (when the Mrs isn't here so she won't complain about me wasting ink and paper). John _ realestate.com.au: the biggest address in property http://ninemsn.realestate.com.au

[Tutor] First Try

2006-02-19 Thread John Connors
random numbers between 1 and 44 inclusive print games, lotto print else: print print "Hope you win!" I know this is a very simple program but... could I have done this a better way? John _ Search for loca

[Tutor] Bug in python

2006-02-19 Thread John Fouhy
d a function definition with an extra carriage return. (at least, that's the way it works in the console version) eg: >>> def foo(): ... pass ... def bar(): File "", line 3 def bar(): ^ SyntaxError: invalid syntax

Re: [Tutor] How can I make Python Shell see new version of function subroutine?

2006-02-19 Thread John Fouhy
hing short of closing the shell and re-opening it that I can do > to fix this? Have you tried restarting IDLE? The first thing to do would be to verify that the problem is what you think it is (as opposed to a bug in your code, for example). -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Generating small random integer

2006-02-19 Thread John Fouhy
hat randint is in the random module. ie, instead of calling randint(), call random.randint(). Have you been through the tutorial on python.org? It is quite helpful. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How can I make Python Shell see new version offunctionsubroutine?

2006-02-19 Thread John Fouhy
On 20/02/06, Kermit Rose <[EMAIL PROTECTED]> wrote: > >>> import factor30.py > > Traceback (most recent call last): > File "", line 1, in -toplevel- > import factor30.py > ImportError: No module named factor30.py Because the module is named

Re: [Tutor] simple list question

2006-02-20 Thread John Fouhy
>>> def p(): ... print 'foo' ... print 'bar' ... print 'baz' ... >>> def q(): ... print 'foo', ... print 'bar', ... print 'baz' ... >>> p() foo bar baz >>> q() foo bar baz As to formatting your list

Re: [Tutor] simple list question

2006-02-20 Thread John Fouhy
a minimal roguelike, intended to show how to get started. Written by Thomas Biskup (of ADOM fame). It might give you an idea of the kind of data structures you might be able to use to represent the map. -- John. ___ Tutor maillist - Tutor@python.org ht

Re: [Tutor] simple list question

2006-02-20 Thread John Fouhy
On 21/02/06, John Fouhy <[EMAIL PROTECTED]> wrote: > Have you looked at QHack? Oops, I forgot the link: http://adom.de/misc/qhack.php3 -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] First Try 1.1

2006-02-20 Thread John Connors
le('/home/mutt/lotto.txt','a').write('') file('/home/mutt/lotto.txt','a').write(str(lotto_numbers)) file('/home/mutt/lotto.txt','a').write('\n') print '\nHope you win!' file('/home/mutt/lotto.tx

[Tutor] First Try 1.2

2006-02-21 Thread John Connors
#x27;a').write('Game: ') file('/home/mutt/lotto.txt','a').write(str(game)) file('/home/mutt/lotto.txt','a').write('') file('/home/mutt/lotto.txt','a').write(str(lotto_numbers)) file('/home/mutt/lo

Re: [Tutor] Translator

2006-02-21 Thread John Fouhy
se (appropriately enough) a dictionary. You can read about dictionaries in the tutorial here: http://docs.python.org/tut/node7.html#SECTION00750 If you want to do genuine translation, like English to French or something, then, well, ask someone who works at Go

Re: [Tutor] First Try 1.2

2006-02-22 Thread John Connors
number_of_balls +1), 1) print '%3s\t%s \tPower Ball: %s\n' % (game, lotto_numbers, pwrball) save_numbers = 'Game: %3s\t%s \tPower Ball: %s\n' % (game, lotto_numbers, pwrball) f.write(save_numbers) print '\nHope you win!' f.write('\nH

[Tutor] Repeating a routine

2006-02-22 Thread John Connors
, bad habits but I'm starting to miss them. John _ New year, new job – there's more than 100,00 jobs at SEEK http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau&_t

Re: [Tutor] First Try 1.2

2006-02-22 Thread John Connors
better at reading the code. Very good point. I have to go away for 3 weeks in a couple of days and I was trying to leave helpful hints to myself in the code so I won't forget what I have learnt. But you are right, I got carried away and most were just

Re: [Tutor] Repeating a routine

2006-02-22 Thread John Connors
G'day, I think my peanut sized brain is starting to understand how to do this. I tried with a simple dice game where 4 dice are rolled, if the total of the last 2 dice rolled is 6 you win. It's kinda pointless using 4 dice rolls when only 2 are needed but I wanted to prove to myself I could cal

Re: [Tutor] Repeating a routine

2006-02-22 Thread John Connors
who assist in here. Sorry if I've done the wrong thing. John _ Search for local singles online @ Lavalife - Click here http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2Ecom%2Eau%2Fclickthru%2Fclickthr

[Tutor] Grepping a file for words in a list

2006-02-24 Thread John Purser
Hello, I'm writing a system admin script in python that checks recently accessed files for keywords like "failed, denied, error,..." etc. I'm using popen to call grep -F but it's VERY slow. Can anyone suggest a faster method to do this? Thanks, John Purse

Re: [Tutor] Grepping a file for words in a list

2006-02-24 Thread John Purser
On Fri, 24 Feb 2006 12:23:22 -0800 (PST) Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Fri, 24 Feb 2006, John Purser wrote: > > > I'm writing a system admin script in python that checks recently > > accessed files for keywords like "failed, denied, err

Re: [Tutor] list packing

2006-02-26 Thread John Fouhy
/snd/') if f.endswith('.aif')] Or, slightly more robustly (?), snd = [os.path.join('/Users/kevin/snd', f) for f in os.listdir('/Users/kevin/snd/') if f.endswith('.aif')] -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutorial for creating web server

2006-03-02 Thread John Fouhy
mpleHTTPServer, again both in the standard library. I've never used them, but it seems like they will drastically simplify the task of making a web server. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] [OT] Shells

2006-03-06 Thread John Fouhy
including Perl, Python, (ba)sh, and SQL, so the syntax sometimes seems to fight itself. But, overall, I'm very impressed. It looks a lot like the python interpreter, except customised to focus on file manipulation and process management (since that's what s

Re: [Tutor] [Fwd: Re: Indoor ultimate]

2006-03-14 Thread John Fouhy
Sorry guys, total brain fart there :-) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [Fwd: Re: Indoor ultimate]

2006-03-14 Thread John Fouhy
didas handball shoes. Expect to pay $200 or more, though. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tix: binding

2006-03-15 Thread John Fouhy
if the mouse is within the button, and then activate your callback. Something else you could try (which I haven't tested) --- instead of box.cancel.bind, do box.cancel.config(command= ...). -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Simulate Input from mouse and keyboard?

2006-03-15 Thread John Fouhy
playback engine! Pamie allows you to automate I.E. by manipulating I.E.'s Document Object Model via COM. This Free tool is for use by Quality Assurance Engineers and Developers. """ -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Help with re.sub()

2006-03-16 Thread John Clark
Hi, I have a file that is a long list of records (roughly) in the format [EMAIL PROTECTED] So, for example: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] What I would like to do is run a regular expression against this and wind up with: [EMAIL

Re: [Tutor] Alternative to nested loops

2006-03-19 Thread John Fouhy
use a generator expression (requires Python 2.4): >>> sum(x for y in foo for x in y) 45 This will be slightly faster, depending on how big your list is. But really, there are times when clarity and efficiency both come together and say "Write explicit for loops" :-) -- John. ___

Re: [Tutor] Renaming computers

2006-03-23 Thread John Fouhy
y of sample python scripts for automating WIndows: http://www.microsoft.com/technet/scriptcenter/scripts/python/default.mspx There may be something helpful there.. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Practice tomorrow

2006-03-23 Thread John Fouhy
On 24/03/06, Naomi Guyer <[EMAIL PROTECTED]> wrote: > Till just before 1pm would be good. That way I can make the practice at > Martin Luckie at 1pm. As a lifetime member of the Vic flying disc club, I can write you a note excusing you from being late if you like

Re: [Tutor] compilte python to an executable file.

2006-03-26 Thread John Fouhy
the flies needed to make it go. It still means you can run your programs on Windows systems without python installed, though. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Data Type with Dictionary and List Behavior

2006-03-27 Thread John Fouhy
return self.keys def setDefault(self, key): self.default = key HTH! -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python tutor

2006-03-28 Thread John Lesko
This actually sounds like very good idea. I have not heard of it before, but I think it would be a very good way to learn. Let me know if you find anything.JohnOn 3/28/06, Noufal Ibrahim <[EMAIL PROTECTED]> wrote: Greetings all,   Are there any programs for python that offer an "interactive" tutor

Re: [Tutor] Program for outputing the letter backward

2006-03-28 Thread John Fouhy
e exactly three letters long. Can you see how to write a loop to produe this output? Hint: the len() function will tell you how long a string is. eg: if vehicle == 'car' then len(vehicle) == 3. -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Bigrams and nested dictionaries

2006-03-28 Thread John Fouhy
} >>> D['d'] = {'a':7, 'b':0} >>> D['d']['c'] = 1 >>> D {'d': {'a': 7, 'c': 1, 'b': 0}} Are you sure you haven't mistakenly assigned something other than a dict to D or D['d'] ? -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

<    1   2   3   4   5   6   7   8   9   10   >