Re: [Tutor] Pychecker

2005-04-22 Thread Mike Hansen
Thanks Danny. I'll make sure I use pychecker so I don't shoot myself in the foot with not so easy to catch typos in variable names and syntax blunders. I might check with the pychecker devs to see if there's any effort to get it put into the standard distribution. I think it's too handy to not h

[Tutor] Re: [Pythonmac-SIG] Re: Weird import problem with PythonIDE on Mac (was 'import problem')

2005-04-22 Thread gandreas
On Apr 22, 2005, at 12:21 AM, Bob Ippolito wrote: On Apr 21, 2005, at 9:06 PM, Chris Smith wrote: ### def y1(): pass def foo(): from __main__ import y1 pass foo() ### Here is a version of the code, stripped of the timeit code. The above segment exhibits the same symptoms as the previo

Re: [Tutor] Tracking URL in browser location bar

2005-04-22 Thread Danny Yoo
On Fri, 22 Apr 2005, Gautam Saha wrote: > A newbie here..I was wondering if python can help me to track the URL in > browser (IE6+, FF, Mozilla) location bar. > > What I want is to get each URL from the the browser location bar, as > user clicks from links to link in the web (or types an URL) an

Re: [Tutor] Tracking URL in browser location bar

2005-04-22 Thread Kent Johnson
Gautam Saha wrote: Hi: A newbie here..I was wondering if python can help me to track the URL in browser (IE6+, FF, Mozilla) location bar. You might find some hints here: http://wwwsearch.sourceforge.net/bits/GeneralFAQ.html Kent ___ Tutor maillist - Tut

Re: [Tutor] Re: [Pythonmac-SIG] Weird import problem with PythonIDE on Mac (was 'import problem')

2005-04-22 Thread Max Noel
On Apr 22, 2005, at 11:41, Chris Smith wrote: Do you have a suggestion as to what can I give a module so it has enough information to execute a function that resides in __main__? Here is a visual of what is going on: --__main__ def y1(): pass import foo foo.run(string_from_main) #what shou

Re: [Tutor] Tracking URL in browser location bar

2005-04-22 Thread Marcus Goldfish
> > A newbie here..I was wondering if python can help me to track the URL in > > browser (IE6+, FF, Mozilla) location bar. I think browser helper objects may also be useful. ASPN has a thread at: http://aspn.activestate.com/ASPN/Mail/Message/ctypes-users/2263094 Marcus __

[Tutor] Re: [Pythonmac-SIG] Re: Weird import problem with PythonIDE on Mac (was 'import problem')

2005-04-22 Thread Bob Ippolito
On Apr 21, 2005, at 9:06 PM, Chris Smith wrote: ### def y1(): pass def foo(): from __main__ import y1 pass foo() ### Here is a version of the code, stripped of the timeit code. The above segment exhibits the same symptoms as the previously submitted one. Even though I am running this

[Tutor] Newbie Question:Regarding Command line Parsing and Run Unix Shell Command

2005-04-22 Thread Prasad Kotipalli
Hello evryone I am a newbie to python. I have a makefile which i can compile in UNIX/LINUX, But i I am planning to write a python script which actually does what my MAKEFILE does. The make file is #Makefile and some scripts to give output #numbers #Change till sign #END var1:=564-574 a1 = 23

Re: [Tutor] CLS? (Joseph Quigley)

2005-04-22 Thread Kent Johnson
Joseph Quigley wrote: In QBASIC there was the command "CLS" this wiped the screen and "started printing letters to the screen at the top " of the console window. On Windows you can import os os.system('cls') Kent ___ Tutor maillist - Tutor@python.org h

[Tutor] Re: Installation Routines (Joseph Quigley) (Jay Loden)

2005-04-22 Thread Joseph Quigley
Interesting. So several distros use rpms? I though only red hat used 'em. Rpm does in fact have dependency resolution, and rpm-based distributions use a package manager that can download the dependencies and install them for you - urpmi on mandrake, yum or apt4rpm on Fedora and Redhat, Yast on Su

[Tutor] Re: CLS? (Joseph Quigley)

2005-04-22 Thread Andrei
Joseph Quigley wrote on Thu, 21 Apr 2005 18:15:51 -0600: > In QBASIC there was the command "CLS" > this wiped the screen and "started printing letters to the screen at the > top " of the console window. With a quick Google, it does indeed appear to be in the cookbook: http://aspn.activestate.com/

Re: [Tutor] Building application namespaces.

2005-04-22 Thread Kent Johnson
OK, here is a brief, working example. In my working directory I have the file test.py containing: # test.py import mypackage c=mypackage.MyClass() c.foo() In the mypackage directory I have __init__.py and MyClass.py containing: # __init__.py from MyClass import MyClass # MyClass.py class MyClass:

[Tutor] CLS? (Joseph Quigley)

2005-04-22 Thread Joseph Quigley
In QBASIC there was the command "CLS" this wiped the screen and "started printing letters to the screen at the top " of the console window. Is there any such command in Python? Would a Python cook book have this (I have pay-by-the-minute dial-up Internet so I can't go online for long)? Thanks i

Re: [Tutor] A simple Perl to Python regex xlation question

2005-04-22 Thread Gavin Henry
On Wednesday 20 Apr 2005 20:07, Kent Johnson wrote: > Smith, Jeff wrote: > > What's the quickest (and most Pythonic) way to do the following Perlism: > > $str = s/d+/d/; > > > > (i.e. collapsing multiple occurrences of the letter 'd' to just one) > > import re > s = re.sub('d+', 'd', s, 1) > >

[Tutor] Re: [Pythonmac-SIG] Re: Weird import problem with PythonIDE on Mac (was 'import problem')

2005-04-22 Thread Jack Jansen
On 22 Apr 2005, at 03:06, Chris Smith wrote: ### def y1(): pass def foo(): from __main__ import y1 pass foo() ### Here is a version of the code, stripped of the timeit code. The above segment exhibits the same symptoms as the previously submitted one. Even though I am running this as

[Tutor] Re: Installation Routines (Joseph Quigley) (Jay Loden)

2005-04-22 Thread Andrei
Joseph Quigley wrote on Fri, 22 Apr 2005 13:45:05 -0600: > Interesting. So several distros use rpms? I though only red hat used 'em. Yeah, including some major ones like Mandrake and Suse. -- Yours, Andrei = Real contact info (decode with rot13): [EMAIL PROTECTED] Fcnz-serr! Cyrnfr qb abg

[Tutor] iterator question for a toy class

2005-04-22 Thread Marcus Goldfish
I'm trying to understand custom iterators in Python, and created the following toy class for sequence comparison, which seems to work: class Foo(object): """A toy class to experiment with __eq__ and __iter__""" def __init__(self, listA, listB): self.head, self.tail = listA, listB de

Re: [Tutor] Building application namespaces.

2005-04-22 Thread Kent Johnson
David Driver wrote: I have generally used python for tasks that are scripty and not appish. I have found that I don't know the language very well even though I have been scripting with it for about two years. To remedy this I am in the process of laying out a mock up for an accounting system (GL, A

Re: [Tutor] Pychecker

2005-04-22 Thread Danny Yoo
On Fri, 22 Apr 2005, Danny Yoo wrote: > > > In Perl, you can perl -c somehardtoreadperlprogram.pl that will just > > check the syntax. The above problem would have been caught in Perl > > since I always use strict. Is there a command line option in Python to > > do a Pychecker-like syntax check?

Re: [Tutor] Pychecker

2005-04-22 Thread Danny Yoo
> In Perl, you can perl -c somehardtoreadperlprogram.pl that will just > check the syntax. The above problem would have been caught in Perl since > I always use strict. Is there a command line option in Python to do a > Pychecker-like syntax check? Hi Mike, Unfortunately, no, because there are s

[Tutor] Building application namespaces.

2005-04-22 Thread David Driver
I have generally used python for tasks that are scripty and not appish. I have found that I don't know the language very well even though I have been scripting with it for about two years. To remedy this I am in the process of laying out a mock up for an accounting system (GL, AR, AP). This is the

[Tutor] SOAPPy - server and threading?

2005-04-22 Thread Kristian Rink
Hi all; just hope I'm not completely OT with this here; if so, I sincerely apologize... At the moment, I am trying to implement a small client/server system that communicate using SOAP, and for each client to connect to the SOAP server (via HTTP) I wanted to run a thread which exclusively is re

[Tutor] Pychecker

2005-04-22 Thread Mike Hansen
I had a frustrating time yesterday with a small Python program I wrote. I wasn't getting the results I expected, so I sprinkled print statements through it. I wasn't getting anywhere. I tossed it into Komodo to see if the background syntax checker would pick up something I was missing. I then st

Re: [Tutor] incomprehension in type of classes.

2005-04-22 Thread Kent Johnson
Cedric BRINER wrote: in my python code I have changed some classes like the following from (I): class CYear: def __init__(self, year): self.__year=year print str(self.__year) <<---(*) print 'dir of: '+str(dir(self)) print 'type of: '+str(type(self)) def __s

Re: [Tutor] Is self.__init__() call bad style?

2005-04-22 Thread Alan Gauld
> I am working on a script at the moment, in which I seem to need to > re-initialise a class instance from within some of its methods. Before I go > too much further down this route - could anyone comment on whether the call > self.__init__() is in itself considered bad style or 'unpythonic'? NO

[Tutor] incomprehension in type of classes.

2005-04-22 Thread Cedric BRINER
hello, I have 2 questions. the first one is maybe not directly related to python (it's about eric3), and the second oneis about what the command `type' give back for two instances in my python code I have changed some classes like the following from (I): class CYear: def __init__(self, yea

[Tutor] Re: [Pythonmac-SIG] Weird import problem with PythonIDE on Mac (was 'import problem')

2005-04-22 Thread Chris Smith
On Friday, Apr 22, 2005, at 03:52 America/Chicago, Just van Rossum - [EMAIL PROTECTED] wrote: Importing __main__ is a very silly thing to do anyway, if you ask me. All comments from you, Bob, and Jack have been *very* helpful. I think I understand better what is going on. What's got me scratch

Re: [Tutor] Is self.__init__() call bad style?

2005-04-22 Thread Kent Johnson
Barnaby Scott wrote: I am working on a script at the moment, in which I seem to need to re-initialise a class instance from within some of its methods. Before I go too much further down this route - could anyone comment on whether the call self.__init__() is in itself considered bad style or 'unpyt

Re: [Tutor] Weird import problem with PythonIDE on Mac (was 'import problem')

2005-04-22 Thread Kent Johnson
This looks like a bug in PythonIDE to me. I fired up my Mac and tried this in PythonIDE with Python 2.3.3: def f(): print 'executed f' code = ''' print 'name:', __name__ import __main__ print dir(__main__) from __main__ import f f() ''' exec code in globals(), {} It prints name: __main__ then

[Tutor] Is self.__init__() call bad style?

2005-04-22 Thread Barnaby Scott
I am working on a script at the moment, in which I seem to need to re-initialise a class instance from within some of its methods. Before I go too much further down this route - could anyone comment on whether the call self.__init__() is in itself considered bad style or 'unpythonic'? For instance