Re: [Tutor] [tutor] Python magazines?

2005-12-16 Thread Kent Johnson
CPIM Ronin wrote: > Is there a monthly Python hardcopy magazine? Otherwise what general > programming mags carry the most python articles? PyZine seems to be resuming publication: http://www.pyzine.com/index_html I don't know any mags with good Python coverage. I read comp.lang.python and many

Re: [Tutor] How do I fix this IndexError?

2005-12-16 Thread Kent Johnson
Nathan Pinno wrote: > Danny, > > 'conv' is for the name of the conversion [i.e 'can_us'] and rate is for the > conversion rate [i.e. 0.80276] Look at the pickle docs and my previous example. These are not the correct arguments to dump(). Kent ___ Tu

Re: [Tutor] ElementTree in Python 2.5!

2005-12-16 Thread Gabriel Farrell
This is great news. And the thread on comp.lang.python is awesome. The eff-bot and the martelli-bot and everyone's just talking about how great it would be to have it in the core, and, then, it just ... happens. Wow! gsf On Wed, Dec 14, 2005 at 03:20:38PM -0500, Kent Johnson wrote: > By some m

[Tutor] [tutor] Python magazines?

2005-12-16 Thread CPIM Ronin
Is there a monthly Python hardcopy magazine? Otherwise what general programming mags carry the most python articles? Thx! RC _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-u

Re: [Tutor] How do I fix this IndexError?

2005-12-16 Thread Nathan Pinno
Danny, 'conv' is for the name of the conversion [i.e 'can_us'] and rate is for the conversion rate [i.e. 0.80276] Thanks, Nathan Pinno, MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705 -Original Message- From: Danny Yoo [mailto:[EMAIL PROT

Re: [Tutor] How do I fix this IndexError?

2005-12-16 Thread Danny Yoo
> import pickle > rates = {'can_us' : 0.80276, > 'us_can' : 1.245702, > 'can_euro' : 1.488707, > 'euro_can' : 0.671724} > > def save_rates(exch): > store = open("exch.txt",'w') > pickle.dump(conv,rate) > store.close() Hi Nathan, You may want to double check

[Tutor] How do I fix this IndexError?

2005-12-16 Thread Nathan Pinno
Kent and all, Here is the latest code: import pickle rates = {'can_us' : 0.80276, 'us_can' : 1.245702, 'can_euro' : 1.488707, 'euro_can' : 0.671724} def save_rates(exch): store = open("exch.txt",'w') pickle.dump(conv,rate) store.close() def load_rates(exch)

Re: [Tutor] synchronized enumeration

2005-12-16 Thread Kent Johnson
Chris or Leslie Smith wrote: > Has anyone else run into the desire to synchronize the indices that are being > used during an enumeration with the true indices of the list that is being > enumerated when you use a slice of the list? > > e.g. more than a couple of times, I want to use the enumera

[Tutor] synchronized enumeration

2005-12-16 Thread Chris or Leslie Smith
Has anyone else run into the desire to synchronize the indices that are being used during an enumeration with the true indices of the list that is being enumerated when you use a slice of the list? e.g. more than a couple of times, I want to use the enumeration function, but I don't want to sta

Re: [Tutor] Accessing next and previous items during iteration

2005-12-16 Thread Kent Johnson
Chris or Leslie Smith wrote: > I just did this :-) What I did was > > 1) use the glob module to get a list of the files in the directory (*.htm) > 2) sort this using a special sort function (in my case the files were named > as #_# where # was a number and I wanted to sort according to the first

Re: [Tutor] Accessing next and previous items during iteration

2005-12-16 Thread Chris or Leslie Smith
| Is it possible to access the next and previous items during an | iteration? | | I want to use it to iterate through html files in a folder and add | links in to the next and previous pages. | I just did this :-) What I did was 1) use the glob module to get a list of the files in the directory

Re: [Tutor] Accessing next and previous items during iteration

2005-12-16 Thread Chris or Leslie Smith
| Is it possible to access the next and previous items during an | iteration? | | I want to use it to iterate through html files in a folder and add | links in to the next and previous pages. | I just did this :-) What I did was 1) use the glob module to get a list of the files in the directory

Re: [Tutor] Accessing next and previous items during iteration

2005-12-16 Thread Chris or Leslie Smith
| Is it possible to access the next and previous items during an | iteration? | | I want to use it to iterate through html files in a folder and add | links in to the next and previous pages. | I just did this :-) What I did was 1) use the glob module to get a list of the files in the directory

Re: [Tutor] Python - SQL paradigm (Will I need a hammer to make it fit?)

2005-12-16 Thread Liam Clarke
On 12/16/05, bob <[EMAIL PROTECTED]> wrote: > At 02:14 AM 12/14/2005, Liam Clarke wrote: > >Hi all, > > > >Just contemplating. > > > >If in Python I were organising a data index along the lines of - > > > >j = { > > > >"k_word1" : ["rec1","rec2","rec3","rec4"], > >... > >"k_wordn" :["recX","rec4"]

Re: [Tutor] Accessing next and previous items during iteration

2005-12-16 Thread Kent Johnson
Ed Singleton wrote: > Is it possible to access the next and previous items during an iteration? There is nothing built in to support this directly. > I'm currently using: > > prev = 0 > current = 0 > next = 0 > for page in folder: > prev = current > current = next > next = page

Re: [Tutor] Codehelp: confused by the output in IDLE

2005-12-16 Thread Wolfram Kraus
vikas mohan wrote: > Hi again! > > The following is a piece of code that I have written: > > def funcA(x): # function describiing the oddness or eveness of an x number > if x%2 == 0: > print x, "is even" > else: > print x, "is odd" > > def funcB(y): # function describiing the odd

Re: [Tutor] Codehelp: confused by the output in IDLE

2005-12-16 Thread Alan Gauld
> def funcA(x): # function describiing the oddness or eveness of an x number > if x%2 == 0: >print x, "is even" > else: >print x, "is odd" >def funcB(y): # function describiing the oddness or eveness of an y number > if y%2 ==0: >print y, "is even" > else: >print y, "is odd" T

Re: [Tutor] How to open a file with images

2005-12-16 Thread Kent Johnson
vikas mohan wrote: > Hi everybody! > > In Java we have the appletviewer and frames, through which we can access > image files. In python, if I want to open an image file in IDLE, how can > I do that, and what should my command look like? Here is a simple program to open an image file and displ

Re: [Tutor] Simple XML parsing

2005-12-16 Thread Kent Johnson
Tim Wilson wrote: > Hi everyone, > > I've got a little project that requires me to parse a simple XML > file. The file comes from the browser history of Apple's Safari and > includes the URL that was visited, the title of the Web page, the > date and time it was last visited, and the total n

Re: [Tutor] How do I fix this StopIteration error?

2005-12-16 Thread Kent Johnson
Nathan Pinno wrote: >>store = open(filename,'r') >for line in store: > conv = line.strip() > rate = float(store.next().strip()) > exch[conv] = rate > > When I ran the program, I got this: > > Traceback (most recent call last): > File "D:\Python24\

[Tutor] Accessing next and previous items during iteration

2005-12-16 Thread Ed Singleton
Is it possible to access the next and previous items during an iteration? I want to use it to iterate through html files in a folder and add links in to the next and previous pages. For example for page in folder: #add link to previous page #add link to next page I'm currently using: p

[Tutor] Codehelp: confused by the output in IDLE

2005-12-16 Thread vikas mohan
Hi again!   The following is a piece of code that I have written: def funcA(x): # function describiing the oddness or eveness of an x number  if x%2 == 0:     print x, "is even"   else:     print x, "is odd"    def funcB(y): # function describiing the oddness or eveness of an y number   if y%2 ==0

[Tutor] How to open a file with images

2005-12-16 Thread vikas mohan
Hi everybody!   In Java we have the appletviewer and frames, through which we can access image files. In python, if I want to open an image file in IDLE, how can I do that, and what should my command look like?   Many thanks   Vikas ___ Tutor maillist -