Re: [Tutor] TRULY NEWBIE - MENTOR NEEDED

2005-11-22 Thread Kent Johnson
Danny Yoo wrote: > > On Tue, 22 Nov 2005, mike donato wrote: > > >>Greetings, I am new student to programming and am experimenting with >>PYTHON. From what I have read, seems to be a very versatile language. >>In the following excercise I am getting an error >> >>class String(str, Object): > >

Re: [Tutor] TRULY NEWBIE - MENTOR NEEDED

2005-11-22 Thread bob
At 02:41 PM 11/22/2005, mike donato wrote: >Greetings, I am new student to programming and am experimenting with PYTHON. > >From what I have read, seems to be a very versatile language. In the >following excercise I am getting an error > >class String(str, Object): try -> class String(str, object)

[Tutor] Using py2exe

2005-11-22 Thread Hans Dushanthakumar
Hi, Im trying to convert a python program to a stand-alone executable that I can distribute. How do I use py2exe to do this? The python program consists of a py script that uses (imports) several other modules (py scripts) located in another directory. Heres what Ive tried so far: 1) Run

Re: [Tutor] Problem using easy_install

2005-11-22 Thread Danny Yoo
On Tue, 22 Nov 2005, Miguel Lopes wrote: > I'm trying to get a handle on Python eggs using Easy Install. [question cut] Hi Miguel, Unfortunately, I don't think we here at Tutor will be able to help effectively with setuptools. I see that you're trying to do stuff with the PEAK stuff: h

Re: [Tutor] TRULY NEWBIE - MENTOR NEEDED

2005-11-22 Thread Danny Yoo
On Tue, 22 Nov 2005, mike donato wrote: > Greetings, I am new student to programming and am experimenting with > PYTHON. From what I have read, seems to be a very versatile language. > In the following excercise I am getting an error > > class String(str, Object): [class definition cut] > > Tr

[Tutor] TRULY NEWBIE - MENTOR NEEDED

2005-11-22 Thread mike donato
Greetings, I am new student to programming and am experimenting with PYTHON. >From what I have read, seems to be a very versatile language. In the following excercise I am getting an error class String(str, Object): shift = 6 mask = ~0 << (31 - shift) def __hash__(self): r

Re: [Tutor] command in menu and button

2005-11-22 Thread alan . gauld
>>I'm puzzled by the 'command' option in menu and Button of >>Tkinter. With the following lines, The command value needs to be a *reference* to a function. That is not the function call itself but a reference to the function that will be \called. Let me illustrate the difference: def f(): print

Re: [Tutor] Newbie question

2005-11-22 Thread Liam Clarke-Hutchinson
Title: Message Ooer, weird keystrokes... my apologies Bob.   >This is preferred, since any exception traceback will remain visible.  That's a really good point... I believe associating a  Python batch file using pause would allow tracebacks to remain also.   @echo off c:\Python24\Python %1

[Tutor] command in menu and button

2005-11-22 Thread John Fouhy
Apologies to Double Six for getting this twice; I forgot to cc: tutor.. On 23/11/05, Double Six <[EMAIL PROTECTED]> wrote: > menu.add_command(label="Open Viewer", command=os.system("Open my > viewer &")) Hi Joe, This is a fairly common gotcha. Think about what happens when python executes a fun

Re: [Tutor] Newbie question

2005-11-22 Thread Hans Dushanthakumar
A short-cut if you dont want to use DOS to traverse to your directory or if you are feeling too lazy to type in the entire path & script name.   You can right-click on the script file in the Windows explorer and choose "Send to -> Command prompt". This opens a command prompt with the path al

Re: [Tutor] Newbie question

2005-11-22 Thread bob
At 12:20 PM 11/22/2005, Liam Clarke-Hutchinson wrote: Hi Eric,   Either -   add this line to the end of your scripts - discard = raw_input("Press enter to finish.")   Or -   Click on Start > Run... type cmd.exe and use DOS to move to the directory where your scripts are stored and run them via

[Tutor] command in menu and button

2005-11-22 Thread Double Six
Hi all, I'm puzzled by the 'command' option in menu and Button of Tkinter. With the following lines, menu.add_command(label="Open Viewer", command=os.system("Open my viewer &")) Button(toolbar, text='Open Viewer', command=os.system("Open my viewer &")).pack(side=LEFT) I wanted to open a g

Re: [Tutor] python-ldap

2005-11-22 Thread Dan Lowe
On Nov 22, 2005, at 2:08 PM, Pat Martin wrote: > I am new to python and fairly new to programming. I have written some > ldap scripts in perl and am trying to learn how to do that in > python. I > found some code on the net using the python-ldap module (the unaltered > code is at the bottom of

Re: [Tutor] python-ldap

2005-11-22 Thread Hugo González Monteverde
Hi, Looks like they are just constants. There is really no point in printing or making any sense of their content, just use them as they are defined in the module. This is like a C #define But this is all LDAP specific... let's see: > > ## The next lines will also need to be changed to suppor

Re: [Tutor] Newbie question

2005-11-22 Thread Carroll, Barry
Hello, Erik, Welcome to the maillist. >From your description, is sounds like you are attempting to run the scripts by double clicking on them from Windows Explorer, or from the Run dialog on the Start menu. Both these methods open a command window in a new process, run the script, then termina

Re: [Tutor] Delete an attribute using Beautiful Soup?

2005-11-22 Thread Danny Yoo
On Tue, 22 Nov 2005, Bob Tanner wrote: > Bob Tanner wrote: > > > I'd like to delete an attribute of tag, the BGCOLOR to the BODY tag to be > > exact. > > I believe I answered my own question. Looking for confirmation this is the > "right" solution. > > del(soup.body['bgcolor']) Yes, del should

Re: [Tutor] Newbie question

2005-11-22 Thread Liam Clarke-Hutchinson
Title: Message Hi Eric,   Either -   add this line to the end of your scripts - discard = raw_input("Press enter to finish.")   Or -   Click on Start > Run... type cmd.exe and use DOS to move to the directory where your scripts are stored and run them via Python there.   It's not trivi

Re: [Tutor] Newbie question

2005-11-22 Thread Danny Yoo
On Tue, 22 Nov 2005, Douglass, Erik wrote: > I am trying to follow some online first timer tutorials, and I am > writing the practice scripts in notepad (only w32 at work :-().. I save > the script with a .py extension, and when I run it it opens for a brief > moment in a command prompt then cl

[Tutor] Problem using easy_install

2005-11-22 Thread Miguel Lopes
Hi, I'm trying to get a handle on Python eggs using Easy Install. Because I'm behind an ISA server it seems that first I need to install NTLMAPS - as adviced by Easy Install How-to page. I did just that and I know it's working because I tested it with Firefox. Didn't manage to run ez_setup.py s

[Tutor] Newbie question

2005-11-22 Thread Douglass, Erik
I am trying to follow some online first timer tutorials, and I am writing the practice scripts in notepad (only w32 at work L)..   I save the script with a .py extension, and when I run it it opens for a brief moment in a command prompt then closes before I even have a chance to see what it

[Tutor] python-ldap

2005-11-22 Thread Pat Martin
I am new to python and fairly new to programming. I have written some ldap scripts in perl and am trying to learn how to do that in python. I found some code on the net using the python-ldap module (the unaltered code is at the bottom of this email) and have adapted it to my needs, the code wor

Re: [Tutor] Dynamic inheritance?

2005-11-22 Thread Jan Eden
Hi, Jan Eden wrote on 22.11.2005: >Hi, > >Kent Johnson wrote on 20.11.2005: >> >>Use getattr() to access attributes by name. SiteA is an attribute >>of Templates and Page is an attribute of SiteA so you can get use >>getattr() twice to get what you want: >> >>site = getattr(Templates, self.site_n

Re: [Tutor] about global definition

2005-11-22 Thread alan . gauld
>>I have a code here. I understand i can not draw lines without the >>global definition of lastX and lastY. But still confused by its use. >>when should we use global definition? If you don't use classes then you will need to use global variables any time you want to pass information between funct

Re: [Tutor] Help with objects

2005-11-22 Thread bob
At 09:04 PM 11/21/2005, Vincent Wan wrote: >Thank you bob. I fixed the errors where I tried to index a dictionary >with name() >so so that they say name[] > >>>Beyond the error I'm still not sure I understand how to make and >>>use a tree data structure using objects. > >There is a new error as wel

[Tutor] Application Templates?

2005-11-22 Thread Andrew Fant
I am about to start work on my first significant coding projects in some time (and first ever in python). Does anyone have any standard templates that they use to lay out new projects that they might be willing to share? By templates, I am not asking about complex libraries and OO things that

Re: [Tutor] Inheriting from parent object

2005-11-22 Thread Ed Singleton
Thanks for this. I hadn't really considered that I would have to explicitly store parent/child relationships. Having been browsing for something else, I came across this page about Unifying types and classes: http://www.python.org/2.2.3/descrintro.html >From it, it looks like I could do somethin

Re: [Tutor] Dynamic inheritance?

2005-11-22 Thread Jan Eden
Hi, Kent Johnson wrote on 20.11.2005: > >Use getattr() to access attributes by name. SiteA is an attribute of >Templates and Page is an attribute of SiteA so you can get use >getattr() twice to get what you want: > >site = getattr(Templates, self.site_name) self.template = >getattr(site, self.temp

Re: [Tutor] Delete an attribute using Beautiful Soup?

2005-11-22 Thread Bob Tanner
Bob Tanner wrote: > I'd like to delete an attribute of tag, the BGCOLOR to the BODY tag to be > exact. I believe I answered my own question. Looking for confirmation this is the "right" solution. del(soup.body['bgcolor']) -- Bob Tanner <[EMAIL PROTECTED]> | Phone : (952)943-8700 htt

[Tutor] Delete an attribute using Beautiful Soup?

2005-11-22 Thread Bob Tanner
I'd like to delete an attribute of tag, the BGCOLOR to the BODY tag to be exact. I see Tag.__delitem__(self, key), but I cannot seem to figure out how to use it. Any help? class Tag(PageElement): """Represents a found HTML tag with its attributes and contents.""" def __init__(self, n

Re: [Tutor] Help with objects

2005-11-22 Thread Danny Yoo
On Mon, 21 Nov 2005, Vincent Wan wrote: > Thank you bob. I fixed the errors where I tried to index a dictionary > with name() so so that they say name[] > > >> Beyond the error I'm still not sure I understand how to make and use > >> a tree data structure using objects. > > There is a new error