[Tutor] Why is this only catching one occurance?

2006-10-26 Thread Chris Hengge
Here is my code:for unWantedItem in directoryList:    try:    if "hex" in unWantedItem.lower():    if not "bmc" in unWantedItem.lower():   print unWantedItem + " removed!"    directoryList.remove(unWantedItem)This only seem

Re: [Tutor] Why is this only catching one occurance?

2006-10-26 Thread Luke Paireepinart
Chris Hengge wrote: > Here is my code: > for unWantedItem in directoryList: > try: > if "hex" in unWantedItem.lower(): > if not "bmc" in unWantedItem.lower(): >print unWantedItem + " removed!" >directory

Re: [Tutor] Mailing list question

2006-10-26 Thread Jonathon Sisson
Greetings everyone... I use Thunderbird, too. I've noticed that it handles threads a bit strange...for instance, I have pytutor set up to send me copies of my replies (so I can track threads better), but Thunderbird won't display my replies inline with the threads... If you go to the folder y

Re: [Tutor] Mailing list question

2006-10-26 Thread Luke Paireepinart
rolando wrote: > I just use the reply button in my Thunderbird, and then change the email > I want to send to tutor@python.org It's better to use reply-all, in my opinion, because then, if someone's involved in an e-mail thread, they'll get an instant update on it even if they only get the Tutor

Re: [Tutor] Self, Scopes and my unbelievable muddleheadedness.

2006-10-26 Thread Alan Gauld
Replying to my own post, how sad... "Alan Gauld" <[EMAIL PROTECTED]> wrote > First we need a way to create objects since we dont have > classes...so we write a function that returns a dictionary. > We'll make it simple and have a message class that stores > a string and has a display method. >

Re: [Tutor] Mailing list question

2006-10-26 Thread Alan Gauld
"Jorge Azedo" <[EMAIL PROTECTED]> wrote > How do I reply to a specific thread in the mailing list? Just hit Reply All. There should be a command or button in your mail tool to do that, even if you use web mail. -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.u

Re: [Tutor] Mailing list question

2006-10-26 Thread rolando
I just use the reply button in my Thunderbird, and then change the email I want to send to tutor@python.org Jorge Azedo escreveu: > Danny Yoo wrote: > >> Not so much a question about Python, but here goes: How do I reply to a specific thread in the mailing list? If I plac

Re: [Tutor] Self, Scopes and my unbelievable muddleheadedness.

2006-10-26 Thread Alan Gauld
> I ran onto the problem of the dictionary being changed globally, > when I > thought that use of "self" meant that any changes to that data were > limited > to the scope of the method in that particular class No, but you know that now :-) Let me try an alternative explanaytion for self, since

Re: [Tutor] cgi form field and popup window

2006-10-26 Thread Paulino
paulino wrote: I would like to have a popup window to show the possible options to a form field (supplier ID) and that by clicking on the desired item, the field is automatically filled. The options are a database field values. I wonder if this is possible to do with python (poi

Re: [Tutor] Mailing list question

2006-10-26 Thread Luke Paireepinart
>> > I'm trying to use the Reply All button on my mail client (I use > Thunderbird, by the way) like you guys suggested. Let's see if it > works :-P > That's what I use (Reply All and Thunderbird) and whenever I check my gmail account from the website, the messages I write appear threaded cor

Re: [Tutor] Fwd: Self, Scopes and my unbelievable muddleheadedness.

2006-10-26 Thread Luke Paireepinart
doug shawhan wrote: > [lots of stuff!] You seem to have a penchant for choosing entertaining, albeit confusing, words to explain what you're thinking. I have a similar inclination; however, I'll attempt to avoid this so that my explanation will make more sense :) Now we begin. First, an example

Re: [Tutor] Mailing list question

2006-10-26 Thread Jorge Azedo
Danny Yoo wrote: > > >>> Not so much a question about Python, but here goes: >>> >>> How do I reply to a specific thread in the mailing list? If I place >>> "Re:bla bla" in the subject line, I notice that I start a new >>> thread, I don't continue one that already exists. How do I go about >>>

Re: [Tutor] Help me.. problem in building calculator application

2006-10-26 Thread Paulino
> > Message: 7 > Date: Thu, 26 Oct 2006 13:31:37 +0100 > From: "Asrarahmed Kadri" <[EMAIL PROTECTED]> > Subject: [Tutor] Help me.. problem in building calculator application > To: pythontutor > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="iso-8859-1" > > Hi folks,

Re: [Tutor] Mailing list question

2006-10-26 Thread Danny Yoo
>> Not so much a question about Python, but here goes: >> >> How do I reply to a specific thread in the mailing list? If I place >> "Re:bla bla" in the subject line, I notice that I start a new thread, >> I don't continue one that already exists. How do I go about doing this? >> Thanks for an

Re: [Tutor] Mailing list question

2006-10-26 Thread Luke Paireepinart
Jorge Azedo wrote: > Not so much a question about Python, but here goes: > > How do I reply to a specific thread in the mailing list? If I place > "Re:bla bla" in the subject line, I notice that I start a new thread, > I don't continue one that already exists. How do I go about doing this? >

[Tutor] Mailing list question

2006-10-26 Thread Jorge Azedo
Not so much a question about Python, but here goes: How do I reply to a specific thread in the mailing list? If I place "Re:bla bla" in the subject line, I notice that I start a new thread, I don't continue one that already exists. How do I go about doing this? Thanks for any info __

[Tutor] Fwd: Self, Scopes and my unbelievable muddleheadedness.

2006-10-26 Thread doug shawhan
-- Forwarded message --From: doug shawhan <[EMAIL PROTECTED]>Date: Oct 26, 2006 1:45 PM Subject: Re: [Tutor] Self, Scopes and my unbelievable muddleheadedness.To: Alan Gauld <[EMAIL PROTECTED]> On 10/26/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "doug shawhan" <[EMAIL PROTECTED]> wr

Re: [Tutor] Self, Scopes and my unbelievable muddleheadedness.

2006-10-26 Thread doug shawhan
On 10/25/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: >> I'm sure this is so obvious that a crack-addled tapeworm head down in> a bucket of stupid could understand it, unfortunately, I'm not quite> at that level today. Sorry.Uh, I don't understand why you're passing Fields to the functions but

Re: [Tutor] problem importing class

2006-10-26 Thread Kent Johnson
Danny Yoo wrote: > Hi Shawn, > > It looks like people have identified the problem, that your site.py module > isn't being found because it conflicts with something from Python's > Standard Library. > > This isn't the first time this kind of problem has hit people. This > problem is well known

Re: [Tutor] New to programming and Python

2006-10-26 Thread Danny Yoo
On Thu, 26 Oct 2006, Jorge Azedo wrote: First off, I don't know if I'm doing this right, I've never used a mailing list before, so I'm not sure if I'm sending this to the right place. Thanks for all the help you guys gave me ( e vocês também pessoal, é bom saber que há pessoal português po

Re: [Tutor] problem importing class

2006-10-26 Thread shawn bright
Hey thanks for the help, gents,i renamed site.py to site_obj.py and my import and statement.everything is working now. Thank you guys very very much.shawnOn 10/26/06, Danny Yoo <[EMAIL PROTECTED]> wrote: Hi Shawn,It looks like people have identified the problem, that your site.py moduleisn't being

Re: [Tutor] New to programming and Python

2006-10-26 Thread Jorge Azedo
First off, I don't know if I'm doing this right, I've never used a mailing list before, so I'm not sure if I'm sending this to the right place. Thanks for all the help you guys gave me ( e vocês também pessoal, é bom saber que há pessoal português por aqui :-) ). I'll try and read as many tutor

Re: [Tutor] problem importing class

2006-10-26 Thread Danny Yoo
Hi Shawn, It looks like people have identified the problem, that your site.py module isn't being found because it conflicts with something from Python's Standard Library. This isn't the first time this kind of problem has hit people. This problem is well known and is the subject of a Python

Re: [Tutor] problem importing class

2006-10-26 Thread Kent Johnson
shawn bright wrote: > hey there > > i have written a module called site.py Use a different name, there is a library module called site that is automatically imported when Python starts up. So when you 'import site' you are getting the already-imported library module. Kent > in the file i have

Re: [Tutor] problem importing class

2006-10-26 Thread Jason Massey
Shawn,Python already has a module called site.  From http://docs.python.org/lib/module-site.html :This module is automatically imported during initialization. The automatic import can be suppressed using the interpreter's -S option. Importing this module will append site-specific paths to the mo

Re: [Tutor] problem importing class

2006-10-26 Thread Simon Brunning
On 10/26/06, shawn bright <[EMAIL PROTECTED]> wrote: > import site Try this for a clue: print site.__file__ -- Cheers, Simon B [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/m

[Tutor] problem importing class

2006-10-26 Thread shawn bright
hey therei have written a module called site.pyin the file i have this:import DbConnectorimport sensorclass Site(object):    "site object"        def __init__(self, id):     self.id = id    self.con = DbConnector.DbConnector()        id = str(self.id)    stats = self.con.getOne(

Re: [Tutor] Code with traceback...Re: Help me.. problem in buildingcalculator application

2006-10-26 Thread Alan Gauld
Kent has already pointed out the problem of overwriting the stringvar, but there is another problem too: >def oprClick(self,str11,oprt): >self.buttonPlu = Button(self.container3,text='+', command = lambda: self.oprClick('+',self.str1.get())) Check the position of the o

Re: [Tutor] Python and config files?

2006-10-26 Thread Andreas Kostyrka
Actually, for Unixish config files, shlex seems the better module. Andreas Am Donnerstag, den 26.10.2006, 09:24 -0400 schrieb Kent Johnson: > Basil Shubin wrote: > > Hi, friends! > > > > Is there exist a module for working with config file? Simple enough, > > just read/write config file (like f

Re: [Tutor] Code with traceback...Re: Help me.. problem in building calculator application

2006-10-26 Thread Kent Johnson
Immediately following the line self.str1 = StringVar() you have self.str1 = "0" at which point self.str1 is a string, not a StringVar. Maybe you mean self.str1.set("0") ? Kent Asrarahmed Kadri wrote: > > Traceback is as under: > > Traceback (most recent call last):

[Tutor] Code with traceback...Re: Help me.. problem in building calculator application

2006-10-26 Thread Asrarahmed Kadri
  Traceback is as under:   Traceback (most recent call last):  File "C:\python\lib\lib-tk\Tkinter.py", line 1345, in __call__    return self.func(*args)  File "calculator_version2.py", line 105, in     self.buttonPlu = Button(self.container3,text='+',command = lambda: self.oprClick('+',self.str1.g

Re: [Tutor] Python and config files?

2006-10-26 Thread Kent Johnson
Basil Shubin wrote: > Hi, friends! > > Is there exist a module for working with config file? Simple enough, > just read/write config file (like for most unix app), determine where > row is contain config words with it's parameters (like > 'config_word=parameter') or it's a comments (#)? Take a

Re: [Tutor] Help me.. problem in building calculator application

2006-10-26 Thread Kent Johnson
Asrarahmed Kadri wrote: > > > Hi folks, > > I am trying to build a rudimentary calculator application using Tkinter... > > I have used one Entry widget for displaying the input and output data. > All this is put in a class. > The porblem is when I click teh '+' button, teh callback function

[Tutor] Python and config files?

2006-10-26 Thread Basil Shubin
Hi, friends! Is there exist a module for working with config file? Simple enough, just read/write config file (like for most unix app), determine where row is contain config words with it's parameters (like 'config_word=parameter') or it's a comments (#)? -- Basil Shubin Freelance Software De

[Tutor] Help me.. problem in building calculator application

2006-10-26 Thread Asrarahmed Kadri
    Hi folks,  I am trying to build a rudimentary calculator application using Tkinter...   I have used one Entry widget for displaying the input and output data. All this is put in a class. The porblem is when I click teh '+' button, teh callback function is called but it gives me an error message

Re: [Tutor] cgi form field and popup window

2006-10-26 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I would like to have a popup window to show the possible options to a form > field > (supplier ID) and that by clicking on the desired item, the field is > automatically filled. The options are a database field values. > > I wonder if this is possible to do with python

Re: [Tutor] New to programming and Python (Jorge Azedo)

2006-10-26 Thread Kent Johnson
rolando wrote: > I tought that we could only speak English in here :D English is preferred and increases your chances of getting an answer :-) Kent > > Also I'm newer to python, about a mounth and a half since I started > studing it. > > [EMAIL PROTECTED] escreveu: >> Parece que ja temos elem

Re: [Tutor] New to programming and Python (Jorge Azedo)

2006-10-26 Thread rolando
I tought that we could only speak English in here :D Also I'm newer to python, about a mounth and a half since I started studing it. [EMAIL PROTECTED] escreveu: > Parece que ja temos elementos para estabelecer uma comunidade portuguesa de > Python ;-) > > Jorge, > > Sugiro os tutoriais do site w

[Tutor] cgi form field and popup window

2006-10-26 Thread paulino1
I would like to have a popup window to show the possible options to a form field (supplier ID) and that by clicking on the desired item, the field is automatically filled. The options are a database field values. I wonder if this is possible to do with python (point me some resources please), or h

Re: [Tutor] New to programming and Python (Jorge Azedo)

2006-10-26 Thread paulino1
Parece que ja temos elementos para estabelecer uma comunidade portuguesa de Python ;-) Jorge, Sugiro os tutoriais do site www.devshed.com. são simples e explicam bem o significado do codigo! Tb sou novo na programação, tenho ai 6 meses de Python. A Caixa Magica promove cursos de Python em Lisbo

Re: [Tutor] New to programming and Python

2006-10-26 Thread Kent Johnson
Jorge Azedo wrote: > Hi guys ( and gals ) > > I'm totally new to the whole programming scene (I decided to enter it > for many reasons, one of which is the fact that I *want* to know how to > program my computer) and I decided to start out with Python. I'm reading > lots of tutorials on it, try

Re: [Tutor] New to programming and Python

2006-10-26 Thread rolando
Jorge Azedo escreveu: > Hi guys ( and gals ) > > I'm totally new to the whole programming scene (I decided to enter it > for many reasons, one of which is the fact that I *want* to know how to > program my computer) and I decided to start out with Python. I'm reading > lots of tutorials on it, t

Re: [Tutor] Decimal truncation, rounding etc.

2006-10-26 Thread Alan Gauld
"Joe Cox" <[EMAIL PROTECTED]> wrote > A typical line of code for me to read and edit will look like: > G01 G91 X7.12345 Y7. Z-0.0086 > The underlines is what I need to edit, as above. What underlines? email and news readers do not necessarily support rich text formatting. Do not assume tha

Re: [Tutor] Self, Scopes and my unbelievable muddleheadedness.

2006-10-26 Thread Alan Gauld
"doug shawhan" <[EMAIL PROTECTED]> wrote > I'm having a rather difficult time understanding the proper use of > "self". Doug, I think you may be having a more fundamental problem. Looking at your code at the most superficial level it seems you may not understand objects. Classes are used to gene

Re: [Tutor] New to programming and Python

2006-10-26 Thread Chris Hengge
I'm sure I speak for us all when I ask what sort of things are giving you problems? Maybe that would help us point you in the right direction. Good Luck!On 10/25/06, Jorge Azedo <[EMAIL PROTECTED]> wrote: Hi guys ( and gals )I'm totally new to the whole programming scene (I decided to enter itfor