Re: [Tutor] Location of found item in list.

2006-10-18 Thread Luke Paireepinart
Chris Hengge wrote: > If that last post to Luke didn't clear anything up.. lets try this at > a smaller level... > I'm going to ignore the fact that my program already renames the file > properly.. > > I have list1 of filenames > I have list2 of filenames > > Item from list 1 needs to be found in

Re: [Tutor] Best GUI toolkit?

2006-10-18 Thread Alan Gauld
"Christopher Hatherly" <[EMAIL PROTECTED]> wrote > the application I'm after. However I'm now trying to turn my code > into a > (fairly complex) graphical app, and have found both Tkinter and > wxPython > to be much more complex than perhaps they need to be Both are actually quite simple compar

Re: [Tutor] Location of found item in list.

2006-10-18 Thread John Fouhy
On 19/10/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > I think this is overkill for what I'm trying to do, could you please refer > to what I just wrote luke? That might make things simpler.. Did you try my code? It doesn't seem like overkill to me. Remember, there are no prizes for writing the

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
If that last post to Luke didn't clear anything up.. lets try this at a smaller level... I'm going to ignore the fact that my program already renames the file properly.. I have list1 of filenamesI have list2 of filenames Item from list 1 needs to be found in list2, but I can't change cases, because

Re: [Tutor] Location of found item in list.

2006-10-18 Thread John Fouhy
Ok, so your question is: If nothing in directoryList matches item, how do I find the element of directoryList that should have matched? This is a bit tricky, because you need to define exactly what results you expect. (for example, suppose limitedLineList contained 'SL_39.sdr' and directoryL

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
I think this is overkill for what I'm trying to do, could you please refer to what I just wrote luke? That might make things simpler.. On 10/18/06, John Fouhy <[EMAIL PROTECTED]> wrote:Ok, so your question is: If nothing in directoryList matches item, how do I find theelement of directoryList

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
I've said in several of my emails that I understand that output is wrong... I just put it there until I had a fix... and so I could bold something to try and show people what I'm trying to do.. using this exact code:    count = 0    for item in lineList:    if item in directoryList:   

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
Well, if you refer to my thread where I mentioned that I had a screen capture of the output.. I want it to look like that.. now it yells at me for everything that doens't match and does match. =DI dont think this test is working though, because using your suggested method. Fail!   SL_39

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Luke Paireepinart
Chris Hengge wrote: > Well, if you refer to my thread where I mentioned that I had a screen > capture of the output.. I want it to look like that.. > > now it yells at me for everything that doens't match and does match. =D > > I dont think this test is working though, because using your suggested

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Luke Paireepinart
Chris Hengge wrote: > Yes, I tried what you suggested, I've changed my looping structure to > this: > > count = 0 > for itemLine in lineList: > for itemDirectory in directoryList: > if itemLine == itemDirectory: > print match.ljust(20) + itemLine.ljust(2

Re: [Tutor] Best GUI toolkit?

2006-10-18 Thread Luke Paireepinart
Christopher Hatherly wrote: > Hi Pythonistas, > > I'm a newbie. I've worked through some introductory python books, and > feel that I now understand the logic on the coding side enough to make > the application I'm after. However I'm now trying to turn my code into a > (fairly complex) graphical ap

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
Yes, I tried what you suggested, I've changed my looping structure to this:    count = 0    for itemLine in lineList:    for itemDirectory in directoryList:    if itemLine == itemDirectory:     print match.ljust(20) + itemLine.ljust(20) + itemDirectory.ljust(20)    e

[Tutor] Best GUI toolkit?

2006-10-18 Thread Christopher Hatherly
Hi Pythonistas, I'm a newbie. I've worked through some introductory python books, and feel that I now understand the logic on the coding side enough to make the application I'm after. However I'm now trying to turn my code into a (fairly complex) graphical app, and have found both Tkinter and wxPy

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Luke Paireepinart
Chris Hengge wrote: > I just replied to my original thread with output and real working code > and bolding and underlined items all over the place.. I dont see what > is so hard to explain... > > Please refer to that post, so I dont end up just copying and pasting. Please refer to my post so I ca

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Kent Johnson
Chris Hengge wrote: > Ok the example I gave here wasn't written as I had it in my head.. you > are right, the example only had 1 sentence. > > Inputs: > List1 ['a.exe','b.exe',c.exe'] > List2 ['A.exe',B.eXe',c.EXE'] > > for item in List1: > if item in List2: >print item + " " +

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
I just replied to my original thread with output and real working code and bolding and underlined items all over the place.. I dont see what is so hard to explain... Please refer to that post, so I dont end up just copying and pasting. On 10/18/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Chris Hen

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
For all who dont get what I'm trying to do... I've bolded what needs to change... This is the code...wanted result of the comparisons works, but I am unable to display correctly..    count = 0    for item in limitedLineList:     if item in directoryList:    print match.ljust(20) + item.

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Luke Paireepinart
Chris Hengge wrote: > Ok the example I gave here wasn't written as I had it in my head.. you > are right, the example only had 1 sentence. > > Inputs: > List1 ['a.exe','b.exe',c.exe'] > List2 ['A.exe',B.eXe',c.EXE'] > > for item in List1: > if item in List2: >print item + " " + li

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
Ok the example I gave here wasn't written as I had it in my head.. you are right, the example only had 1 sentence. Inputs:List1 ['a.exe','b.exe',c.exe']List2 ['A.exe',B.eXe',c.EXE']for item in List1: if item in List2:   print item + " " + list2thing that matched.I can't force to upper

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
Why even try to use the 'in' syntax if it's not working correctly?Maybe I still don't understand. -LukeBecause I've been up for 40 hours... 5 days of the week I'm up at 8:45AM and I dont get home until 10PM, once I'm home, I do homework trying to finish my senior year, on the weekends I am either t

Re: [Tutor] Location of found item in list.

2006-10-18 Thread John Fouhy
On 19/10/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > The point of this script is to read a text file that has a bunch of code > that calls external files. Then read the directory where all the files are.. > I build a list from the text file (this works correct), and I build a list > from the dire

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Luke Paireepinart
Chris Hengge wrote: > The point of this script is to read a text file that has a bunch of > code that calls external files. Then read the directory where all the > files are.. I build a list from the text file (this works correct), > and I build a list from the directory (this works correct). I

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
The point of this script is to read a text file that has a bunch of code that calls external files. Then read the directory where all the files are.. I build a list from the text file (this works correct), and I build a list from the directory (this works correct). I want to print out the result of

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Kent Johnson
Chris Hengge wrote: > Tried your first suggestion. > AttributeError: 'list' object has no attribute 'find' Sorry, it's index() not find(). Strings have both but lists only have index() > > Perhaps a better explanation... > > > for word in paragraph: > if word in sentence: > prin

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
Tried your first suggestion.AttributeError: 'list' object has no attribute 'find'Perhaps a better explanation... for word in paragraph: if word in sentence:  print word + sentence Assume that the word is only used once per paragraph. I can't figure out how to tell it to print the right

Re: [Tutor] Location of found item in list.

2006-10-18 Thread John Fouhy
On 19/10/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > What that should have said > > For clarification if I didn't provide enough earlier, > for item in list1: > if item in list2: > print item and list2[object that matched item] <-- need this > location. Um, I'm still a bit confused.

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Kent Johnson
Chris Hengge wrote: > Still no progress with this myself. > > For clarification if I didn't provide enough earlier, > for item in list1: > if item in list2: > print item and list[object at location where matched item] <-- > need this location. I still don't understand your question.

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
What that should have saidFor clarification if I didn't provide enough earlier, for item in list1:    if item in list2: print item and list2[object that matched item] <-- need this location. On 10/18/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Still no progress with this myself. For clarifi

Re: [Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
Still no progress with this myself. For clarification if I didn't provide enough earlier, for item in list1:    if item in list2: print item and list[object at location where matched item] <-- need this location. On 10/18/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I'm looking for a way to

[Tutor] Location of found item in list.

2006-10-18 Thread Chris Hengge
I'm looking for a way to do the following. for item in limitedLineList:    if item in directoryList:    print match.ljust(20) + limitedLineList[count].ljust(20) + directoryList[ count].ljust(20)    else:    print fail.ljust(20) + limitedLineList[count].ljust(20) + directoryL

Re: [Tutor] characters in python

2006-10-18 Thread Alan Gauld
"Gigs_" <[EMAIL PROTECTED]> wrote in message > here is the code: So where do you think you tell Python that you are using unicode strings? I'm no expert but I think, as a minimum you need: for i in S: S = S.replace(u'æ', u'ć') S = S.replace(u'è', u'č') S = S.replace(u'ð', u'đ') You might

Re: [Tutor] characters in python

2006-10-18 Thread Gigs_
Hugo Gonzalez M wrote: > >> I tried with unicode strings, but nothing. It says : unsoported > characters > >> > > They are supported. Are you using them literally in your code? Anything > other than ASCII or Latin-1 needs to be declared explicitly at the start > of the source code file. > > Ma

Re: [Tutor] characters in python

2006-10-18 Thread Hugo Gonzalez M
>> I tried with unicode strings, but nothing. It says : unsoported characters >> They are supported. Are you using them literally in your code? Anything other than ASCII or Latin-1 needs to be declared explicitly at the start of the source code file. Maybe you can use UTF-8 encoding. See:

Re: [Tutor] characters in python

2006-10-18 Thread Gigs_
here is the code: def changer(): """Changer from Serbian to Croatian for this letters: æ, è, ð in ć, č, đ """ whatfile = raw_input('Enter location of your file: ') # open and read file ofile = open(whatfile, 'r') S = ofile.read() ofile.close() # search file and replace æ, è in ć, č for i in S: S

Re: [Tutor] regexp help needed

2006-10-18 Thread János Juhász
Hi Kent, thanks your respond. > > I have to remove the thousand separator by moving the numbers before it to > > right. > > So the number and char groups has to be left in their original position. > > > > I have to make this kind of changes on the problematic lines: > > MOATOT79 47.2

Re: [Tutor] extracting numbers from a list

2006-10-18 Thread Danny Yoo
On Wed, 18 Oct 2006, kumar s wrote: > I am not sure if I got your opinion about the way I solved. Hi Kumar, I was replying to your question: http://mail.python.org/pipermail/tutor/2006-October/050064.html in which you showed a program that had problems. I'm assuming that you haven't f

Re: [Tutor] characters in python

2006-10-18 Thread Luke Paireepinart
Stanko wrote: > I tried with unicode strings, but nothing. It says : unsoported characters > Perhaps you could give us the code you were using? > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > >

Re: [Tutor] characters in python

2006-10-18 Thread Stanko
I tried with unicode strings, but nothing. It says : unsoported characters ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 32, Issue 72

2006-10-18 Thread Luke Paireepinart
>> I'm glad that you're not going to give up just yet! Don't worry, I >> have much more effort in store for you :) > [long and useful description of some basics of Python deleted] > > Wow, thanks very much! That was extremely useful. I had some time > late last night when it was quiet here an

Re: [Tutor] characters in python

2006-10-18 Thread Luke Paireepinart
Stanko wrote: > Can python handle this characters: ć, č, š, đ, ž? > If can, How? > Unicode strings. > And how to change tab spaceing in idle? I tried in idle properties. I > have set it to 4 character but it's still 8. > The default is 4. If it's 8, find out who changed it and ask them to ch

Re: [Tutor] extracting numbers from a list

2006-10-18 Thread kumar s
Thank you Danny. I am going over your email and trying to understand (i am a biologist with bioinformatics training). I am not sure if I got your opinion about the way I solved. do you mean that there is something wrong with the way i solved it. I am not sure If I explained the problem correctl

Re: [Tutor] regexp help needed

2006-10-18 Thread Kent Johnson
János Juhász wrote: > Dear All, > > I have a problem about the EDI invoices created by our erp system. > I have to make a small correction on them, just before sending them by > ftp. > > The problem is that, the big numbers are printed with thousand separator. > > U:\ediout\INVOIC\Backup>grep \

[Tutor] characters in python

2006-10-18 Thread Stanko
Can python handle this characters: ć, č, š, đ, ž? If can, How? And how to change tab spaceing in idle? I tried in idle properties. I have set it to 4 character but it's still 8. Thanks! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mai

Re: [Tutor] Tutor Digest, Vol 32, Issue 72

2006-10-18 Thread Pine Marten
>I'm glad that you're not going to give up just yet! Don't worry, I have >much more effort in store for you :) [long and useful description of some basics of Python deleted] Wow, thanks very much! That was extremely useful. I had some time late last night when it was quiet here and I could

[Tutor] regexp help needed

2006-10-18 Thread János Juhász
Dear All, I have a problem about the EDI invoices created by our erp system. I have to make a small correction on them, just before sending them by ftp. The problem is that, the big numbers are printed with thousand separator. U:\ediout\INVOIC\Backup>grep \, *.doc File 063091.doc: MOAL