Re: python & osgi

2007-09-13 Thread Marc 'BlackJack' Rintsch
On Wed, 12 Sep 2007 18:13:13 -0700, Andreas Wapf wrote: > Is there something like a osgi implementation in python? I am really > impressed by the bundle system and the possibility to load and unload > bundles without wasting memory. I'm really impressed by the about 1000 pages OSGi specification.

Re: An ordered dictionary for the Python library?

2007-09-13 Thread Antoon Pardon
On 2007-09-12, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 12 Sep, 13:46, Michele Simionato <[EMAIL PROTECTED]> > wrote: >> On Sep 12, 2:42 pm, Steven D'Aprano <[EMAIL PROTECTED] >> >> cybersource.com.au> wrote: >> > On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: >> > In fact, I'm

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread A.T.Hofkamp
On 2007-09-13, Amit N <[EMAIL PROTECTED]> wrote: > Hi guys, > > I tend to ramble, and I am afraid none of you busy experts will bother > reading my long post, so I will try to summarize it first: I haven't read the details, but you seem to aim for a single python program that does 'it'. A single

Re: Python 3K or Python 2.9?

2007-09-13 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : > On Sep 12, 4:40 am, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: >> Ivan Voras wrote: >>> What does "self" have to do with an object model? It's an >>> function/method argument that might as well be hidden in the >>> compiler without ever touching the role it has (if

Re: Implementing a fixed size stack for an RPN Calculator

2007-09-13 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > On Sep 12, 2:55 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Wed, 12 Sep 2007 20:55:22 +, [EMAIL PROTECTED] wrote: >>> I have implemented an RPN calculator in python but now I would like to >>> make the stack size fixed. how can I transform the user

Re: Python 3K or Python 2.9?

2007-09-13 Thread Bruno Desthuilliers
TheFlyingDutchman a écrit : >> >>> Foo.bar(foo, "spam") >> >>> foo.bar("spam") > > That looks like a case of "There's more than one way to do it". ;) Nope, on the contrary. The nice thing with this model is that you don't have distinct rules for functions and methods, since methods are j

cannot declare global vars!

2007-09-13 Thread Konstantinos Pachopoulos
Hi, i had posted earlier for not being able to declare global vars. No i followed the suggestions and created a class, but still the vars do not seem to have a global scope. I have tried pretty much everything. Any advice appreciated... Here:

hang in multithreaded program / python and gdb.

2007-09-13 Thread Jd
Hi I want to debug a locking situation in my program. http://wiki.python.org/moin/DebuggingWithGdb Where do I get binaries for ? - debug python 2.5 binary/rpm for FC7 Also, the description of the hang is as follows. 2 therads waiting in [EMAIL PROTECTED] ... from PyThread_ac

Re: Coming from Perl

2007-09-13 Thread Amer Neely
TheFlyingDutchman wrote: > On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: >> I'm a complete newbie with Python, but have several years experience >> with Perl in a web environment. >> >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's '

Re: MemoryError on reading mbox file

2007-09-13 Thread Christoph Krammer
On 12 Sep., 16:39, Istvan Albert <[EMAIL PROTECTED]> wrote: > This line reads an entire message into memory as a string. Is it > possible that you have a huge email in there (hundreds of MB) with > some attachment encoded as text? No, the largest single message with the mbox is about 100KB large.

read part of jpeg file by pure python

2007-09-13 Thread Pacino
Hi, everyone, I am wondering whether it's possible to read part (e.g. 1000*1000) of a huge jpeg file (e.g. 3*3) and save it to another jpeg file by pure python. I failed to read the whole file and split it, because it would cost 2GB memory. Can anyone help me? Any comments would be apprec

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Amer Neely wrote: > TheFlyingDutchman wrote: >> On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: >>> I'm a complete newbie with Python, but have several years experience >>> with Perl in a web environment. >>> >>> A question I have, if someone here is familiar with Perl, does Python >>> ha

Re: Possible suggestion for removing the GIL

2007-09-13 Thread Diez B. Roggisch
Prateek wrote: > Hi, > > Recently there was some talk on removing the GIL and even the BDFL has > written a blog post on it. > I was trying to come up with a scalable and backwards compatible > approach for how to do it. > > I've put my thoughts up in a blog post - and I'd really like to hear >

Re: Python 3K or Python 2.9?

2007-09-13 Thread Piet van Oostrum
> TheFlyingDutchman <[EMAIL PROTECTED]> (T) wrote: >T> The confusing way about the current Python method when you first >T> encounter it is >T> why is "self" being passed in when you write the function but not >T> when you call it. It *is* passed when you call it, but it is written before t

Re: Python 3K or Python 2.9?

2007-09-13 Thread Piet van Oostrum
> Ben Finney <[EMAIL PROTECTED]> (BF) wrote: >BF> The latter two statements are equivalent. The 'instance.method(args)' >BF> syntax is just sugar for 'Class.method(instance, args)'. It is more than just syntactic sugar because the Class is derived from the instance at runtime. -- Piet van O

Re: cannot declare global vars!

2007-09-13 Thread Peter Otten
Konstantinos Pachopoulos wrote: > i had posted earlier for not being able to declare global vars. No i Post a followup in that thread then rather than starting a new one. > followed the suggestions and created a class, but still the vars do not > seem to have a global scope. I have tried pretty

Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread half . italian
On Sep 12, 9:27 pm, gamename <[EMAIL PROTECTED]> wrote: > Hi, > > Is it still the case there is no practical Expect-like module for > win32? I know that cygwin can support pexpect, but that isn't an > option here --- I have to use a native win32 Python version. > > Are there alternatives, or is it

Re: read part of jpeg file by pure python

2007-09-13 Thread Laurent Pointal
Pacino a écrit : > Hi, everyone, > > I am wondering whether it's possible to read part (e.g. 1000*1000) of > a huge jpeg file (e.g. 3*3) and save it to another jpeg file > by pure python. I failed to read the whole file and split it, because > it would cost 2GB memory. > > Can anyone help

Re: read part of jpeg file by pure python

2007-09-13 Thread Pacino
On 9 13 , 4 43 , Laurent Pointal <[EMAIL PROTECTED]> wrote: > Pacino a écrit : > > > Hi, everyone, > > > I am wondering whether it's possible to read part (e.g. 1000*1000) of > > a huge jpeg file (e.g. 3*3) and save it to another jpeg file > > by pure python. I failed to read the whole fi

Re: Get the complete command line as-is

2007-09-13 Thread Tim Golden
wangzq wrote: > On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> wangzq a écrit : >> >>> Hello, >>> I'm passing command line parameters to my browser, I need to pass the >>> complete command line as-is, for example: >>> test.py "abc def" xyz >>> If I use ' '.join(sys.argv[1:]), the

Re: Get the complete command line as-is

2007-09-13 Thread Thomas Heller
wangzq schrieb: > On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> wangzq a écrit : >> >> > Hello, >> >> > I'm passing command line parameters to my browser, I need to pass the >> > complete command line as-is, for example: >> >> > test.py "abc def" xyz >> >> > If I use ' '.join(sy

Re: Get the complete command line as-is

2007-09-13 Thread Tim Golden
Thomas Heller wrote: > Better would be this code: > > import ctypes > ctypes.windll.kernel32.GetCommandLineA.restype = ctypes.c_char_p > print ctypes.windll.kernel32.GetCommandLineA() Or you could use pywin32: import win32api print win32api.GetCommandLine () TJG -- http://mail.python.org/m

Re: Coming from Perl

2007-09-13 Thread Ben Finney
Amer Neely <[EMAIL PROTECTED]> writes: > Well, I have checked everything I can but I'm getting '500 Internal > Server Error'. This is the HTTP response code saying that the program that should have served the response document instead exited with an error. To debug, you should first run the prog

Re: I want py2exe not to create library.zip

2007-09-13 Thread Laszlo Nagy
>> I want py2exe not to create library.zip. >> > > setup ( >[...] >options = {"py2exe": {"skip_archive":1}} > ) > Cool! Just what I needed. Where it is documented? Ah, in the source. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: I want py2exe not to create library.zip

2007-09-13 Thread Laszlo Nagy
> That is correct. People want less files to distribute not more. People > complain on py2exe list that it doesn't create a single .EXE file. Don't > try to update the program via patching "pieces". Wrap everything in a proper > installer (I use and highly recommend Inno Setup). It can hand

Can You Program?

2007-09-13 Thread hatspin
We are offering $2000 USD for the best website developed with www.hatspin.com Are you up to it?? -- http://mail.python.org/mailman/listinfo/python-list

Make money to share your videos

2007-09-13 Thread amit
Make money to share your videos Goodtolove.com is sharing their 50% adsense revenue with you to post videos of anything. Just keep up logging in and start posting now to make money... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread gamename
On Sep 13, 1:42 am, [EMAIL PROTECTED] wrote: > On Sep 12, 9:27 pm, gamename <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Is it still the case there is no practical Expect-like module for > > win32? I know that cygwin can support pexpect, but that isn't an > > option here --- I have to use a native wi

Re: Setting stdout encoding

2007-09-13 Thread Fabio Zadrozny
> > But I don't think it's a good idea. Changing the default encoding will > change it for *all* scripts, *all* users, *all* objects. And AFAIK you > have trouble ONLY with sys.std* - one should fix those objects, not mess > with a global configuration. > Makes sense... Do you think that creating

wxstyledtextctrl and xml markup

2007-09-13 Thread OpenPavilion Team
Hello community, I want to create an editor for a self defined xml markup language. I want to use wxpython with wxstyledtextctrl and I have looked around at yellowbrain site, but there are no examples. I also watched the styledtextctrl examples with wxpython 2.8.4. What I am looking for is an ex

wx.ToplevelWindow.SetIcon: Native MS Windows error dialog pops up in wxPython app, no exception raised, no stack trace

2007-09-13 Thread Laszlo Nagy
Hello, I wrote a small program that works uses wxPython. The same application works on Linux and Windows. When I start it from MS Windows, I see this error message appearing each time I open a window: --- Warehouseclient Error --- Can't load im

RE: Setting stdout encoding

2007-09-13 Thread Ryan Ginstrom
> On Behalf Of Fabio Zadrozny > Makes sense... Do you think that creating a new object, > setting it as sys.stdout and overriding its write() method to > check for a unicode string to do > original_stdout.write(unicode_str.encode(my_encoding)) would > do it? Here's an output stream encoder I h

Re: read part of jpeg file by pure python

2007-09-13 Thread michal . zaborowski
On 13 Wrz, 10:48, Pacino <[EMAIL PROTECTED]> wrote: > On 9 13 , 4 43 , Laurent Pointal <[EMAIL PROTECTED]> wrote: > > > Pacino a écrit : > > > > Hi, everyone, > > > > I am wondering whether it's possible to read part (e.g. 1000*1000) of > > > a huge jpeg file (e.g. 3*3) and save it to ano

Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread Philem
On Sep 13, 12:27 am, gamename <[EMAIL PROTECTED]> wrote: > Hi, > > Is it still the case there is no practical Expect-like module for > win32? I know that cygwin can support pexpect, but that isn't an > option here --- I have to use a native win32 Python version. > > Are there alternatives, or is it

Re: struct is saving 4 bytes instead of 2

2007-09-13 Thread Bjoern Schliessmann
TonyB wrote: > I tried > > f.write(struct.pack('=h',thevariable)) > > and it works. Great! :) Regards, Björn -- BOFH excuse #45: virus attack, luser responsible -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread [EMAIL PROTECTED]
Why not use '_' as the self variable. It is minimal and achieves close to '.var', as '_.var' isn't that different. I know its a little perl-esque, but its not a bad convention if you are aiming to up readability of your code. class test: def __init__(self): _ = self; _.a = 0;

Re: Python 3K or Python 2.9?

2007-09-13 Thread Bjoern Schliessmann
TheFlyingDutchman wrote: > I am not talking about how the implementation of a C++ or Java > compiler uses the this pointer/this reference internally. I am > talking about how an author describes in English the "this" > pointer/reference in their book on programming C++ or Java. Ah, okay. > I do

Re: customizing a logging logger

2007-09-13 Thread Vinay Sajip
On 12 Sep, 19:17, [EMAIL PROTECTED] wrote: > It seems like using something other than a literal string in the > message is the way to go, since I assume that its __repr__() won't get > called unless the logger is actually going to log a message for it. > Is that right? > > Are any of the other meth

lxml + mod_python: cannot unmarshal code objects in restricted execution mode

2007-09-13 Thread Dmitri Fedoruk
Hello everyone, I'm developing a mod_python application that is based on XML\XSLT transforming. I used 4Suite libraries for that, but as the speed was unacceptable for me, I switched to lxml. Everything became much easier and 10 times faster, but I've encountered the subject problem. In brief -

Re: wx.ToplevelWindow.SetIcon: Native MS Windows error dialog pops up in wxPython app, no exception raised, no stack trace

2007-09-13 Thread kyosohma
On Sep 13, 6:29 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > Hello, > > I wrote a small program that works uses wxPython. The same application > works on Linux and Windows. When I start it from MS Windows, I see this > error message appearing each time I open a window: > > ---

Re: File Parsing Question

2007-09-13 Thread Shankarjee Krishnamoorthi
Great. That worked for me. I had some of my routines implemented in Perl earlier. Now that I started using Python I am trying to do all my automation scripts with Python. Thanks a ton Jee On 9/13/07, Peter Otten <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > > for line in inp: > > > >

Re: wxstyledtextctrl and xml markup

2007-09-13 Thread kyosohma
On Sep 13, 6:23 am, OpenPavilion Team <[EMAIL PROTECTED]> wrote: > Hello community, > > I want to create an editor for a self defined xml markup language. I want to > use wxpython with wxstyledtextctrl and I have looked around at yellowbrain > site, but there are no examples. I also watched the sty

Re: wxstyledtextctrl and xml markup

2007-09-13 Thread stef
> I highly recommend the wxPython mailing list. Right now it is down > (see their website), its'up again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Ben Finney wrote: > Amer Neely <[EMAIL PROTECTED]> writes: > >> Well, I have checked everything I can but I'm getting '500 Internal >> Server Error'. > > This is the HTTP response code saying that the program that should > have served the response document instead exited with an error. > > To de

Re: wxstyledtextctrl and xml markup

2007-09-13 Thread kyosohma
On Sep 13, 8:27 am, stef <[EMAIL PROTECTED]> wrote: > > I highly recommend the wxPython mailing list. Right now it is down > > (see their website), > > its'up again. That's not what the website says, but I'll take your word for it. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: wxstyledtextctrl and xml markup

2007-09-13 Thread limodou
> I highly recommend the wxPython mailing list. Right now it is down > (see their website), but when it's back up (check their website for > news), that's where I'd post this question if no one else here > answers. > wxPython mail list already comes back! -- I like python! UliPad <>: http://code.

Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread Tim Golden
gamename wrote: > On Sep 13, 1:42 am, [EMAIL PROTECTED] wrote: >> On Sep 12, 9:27 pm, gamename <[EMAIL PROTECTED]> wrote: >> >>> Hi, >>> Is it still the case there is no practical Expect-like module for >>> win32? I know that cygwin can support pexpect, but that isn't an >>> option here --- I have

Re: wx.ToplevelWindow.SetIcon: Native MS Windows error dialog pops up in wxPython app, no exception raised, no stack trace

2007-09-13 Thread Laszlo Nagy
> See main.py of the Demo, line 1129. img2py is in the following default > location: > C:\Python24\Lib\site-packages\wx-2.8-msw-unicode\wxPython\tools > > Without seeing how you create the image, it's hard to troubleshoot, > but I would guess that you have an absolute path that you're using in

Re: Coming from Perl

2007-09-13 Thread Richie Hindle
[Amer] > Can you or anyone see anything in the posted code that might be the > cause? > #!/usr/bin/python > import cgitb; cgitb.enable(display=0, logdir=".") > import sys > sys.stderr = sys.stdout > print "Content-Type: text/html" > print My guess would be that you don't have cgitb in your serv

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread Ivan Voras
Amit N wrote: About 800+ 10-15MB files are generated daily that need to be processed. The processing consists of different steps that the files must go through: -Uncompress -FilterA -FilterB -Parse -Possibly compress parsed files for archival You can implement one of two easy straightforward

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Steven D'Aprano
On Thu, 13 Sep 2007 12:10:03 +, [EMAIL PROTECTED] wrote: > Why not use '_' as the self variable. It is minimal and achieves close > to '.var', as '_.var' isn't that different. I know its a little > perl-esque, but its not a bad convention if you are aiming to up > readability of your code.

recursion

2007-09-13 Thread Gigs_
Can someone explain me this >>> def f(l): if l == []: return [] else: return f(l[1:]) + l[:1] # <= cant figure this, how is all sum at the end? thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: wx.ToplevelWindow.SetIcon: Native MS Windows error dialog pops up in wxPython app, no exception raised, no stack trace

2007-09-13 Thread kyosohma
On Sep 13, 8:41 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > See main.py of the Demo, line 1129. img2py is in the following default > > location: > > C:\Python24\Lib\site-packages\wx-2.8-msw-unicode\wxPython\tools > > > Without seeing how you create the image, it's hard to troubleshoot, > > but I

Re: recursion

2007-09-13 Thread Tom Wright
Gigs_ wrote: > Can someone explain me this > def f(l): > if l == []: > return [] > else: > return f(l[1:]) + l[:1] # <= cant figure this, how is > all sum at the end? If you think about building up from the simplest case: f([]) = [] f(['a']) = f([])

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Wildemar Wildenburger
Steven D'Aprano wrote: > On Thu, 13 Sep 2007 12:10:03 +, [EMAIL PROTECTED] wrote: > >> Why not use '_' as the self variable. It is minimal and achieves close >> to '.var', as '_.var' isn't that different. I know its a little >> perl-esque, but its not a bad convention if you are aiming to up

Help to start python

2007-09-13 Thread python_lover
Hi All, I'm new to python. I installed python 2.5 and IDLE 1.2.1 . I'm able to run shell commands. But I don't know how to execute a python program using this. When I'm opeing a py program a seperate IDLE window opeing with program text. But I don't know to to execute the prg. Please help me o

Re: Help to start python

2007-09-13 Thread kyosohma
python_lover wrote: > Hi All, > > I'm new to python. I installed python 2.5 and IDLE 1.2.1 . I'm able > to run shell commands. > > But I don't know how to execute a python program using this. When I'm > opeing a py program a seperate IDLE window opeing with program text. > But I don't know to to

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread BJörn Lindqvist
On 9/12/07, Dave Hansen <[EMAIL PROTECTED]> wrote: > The name "self" is just a convention. You can give it any name you > wish. Using "s" is common. Not it's not common. And the name "self" is a convention codified in PEP8 which you shouldn't violate. And I agree with the OP that the convention

Re: Possible suggestion for removing the GIL

2007-09-13 Thread Prateek
On Sep 13, 1:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Prateek wrote: > > Hi, > > > Recently there was some talk on removing the GIL and even the BDFL has > > written a blog post on it. > > I was trying to come up with a scalable and backwards compatible > > approach for how to do it.

Re: Help to start python

2007-09-13 Thread python_lover
On Sep 13, 7:23 pm, [EMAIL PROTECTED] wrote: > python_lover wrote: > > Hi All, > > > I'm new to python. I installed python 2.5 and IDLE 1.2.1 . I'm able > > to run shell commands. > > > But I don't know how to execute a python program using this. When I'm > > opeing a py program a seperate IDLE w

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Eduardo O. Padoan
On 9/13/07, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > because I'm trained to interpret the underscore as a synonym for one > space. It's not particularly beautiful, but that is probably a matter of > habituation. And that exact word is probably the reason why I'd still > use self or s (exp

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Richie Hindle wrote: > [Amer] >> Can you or anyone see anything in the posted code that might be the >> cause? > >> #!/usr/bin/python >> import cgitb; cgitb.enable(display=0, logdir=".") >> import sys >> sys.stderr = sys.stdout >> print "Content-Type: text/html" >> print > > My guess would be th

Re: Possible suggestion for removing the GIL

2007-09-13 Thread Chris Mellon
On 9/13/07, Prateek <[EMAIL PROTECTED]> wrote: > On Sep 13, 1:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Prateek wrote: > > > Hi, > > > > > Recently there was some talk on removing the GIL and even the BDFL has > > > written a blog post on it. > > > I was trying to come up with a scal

Re: Coming from Perl

2007-09-13 Thread Richie Hindle
> [Amer] > #!/usr/bin/python > [...] On my home PC [...] > [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system > cannot find the file specified. That's because on your home PC Python is somewhere like C:\Python25\python.exe, not /usr/bin/python. Are you sure /usr/bin/python is

My first Python CGI (was: Coming from Perl)

2007-09-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Amer Neely <[EMAIL PROTECTED]> wrote: >Amer Neely wrote: >> TheFlyingDutchman wrote: >>> On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: I'm a complete newbie with Python, but have several years experience with Perl in a web environment. >>>

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread [EMAIL PROTECTED]
On Sep 12, 10:05 am, [EMAIL PROTECTED] (Alex Martelli) wrote: ... > into a function and a call to it: > > def f(): > with implicit_self(t): > print a > print b > a = 40 > b = a * 2 > f() > > ...even with different values for the argu

Re: Python 3K or Python 2.9?

2007-09-13 Thread Alex Martelli
TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > >>> Foo.bar(foo, "spam") > > >>> foo.bar("spam") > > That looks like a case of "There's more than one way to do it". ;) > The first form is definitely consistent with the > method declaration, so there's a lot to be said for using that styl

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Steven D'Aprano
On Thu, 13 Sep 2007 16:30:36 +0200, BJörn Lindqvist wrote: > And I agree with the OP that the convention is really annoying. > > self.rect.width = self.foo(self.rect.x + self.rect.y) * self.boo() > > is much less concise than > > s.rect.width = s.foo(s.rect.x + s.rect.y) * s.boo() Y do u

Re: I want py2exe not to create library.zip

2007-09-13 Thread Grant Edwards
On 2007-09-13, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > >>> I want py2exe not to create library.zip. >>> >> >> setup ( >>[...] >>options = {"py2exe": {"skip_archive":1}} >> ) > > Cool! Just what I needed. Where it is documented? Ah, in the source. :-) That's prett

Re: lxml + mod_python: cannot unmarshal code objects in restricted execution mode

2007-09-13 Thread Stefan Behnel
Dmitri Fedoruk wrote: > def extApplyXslt(xslt, data, logger ): > try: > strXslt = urllib2.urlopen(xslt).read() > # i have to read the xslt url to the python string > except urllib2.HTTPError, e: >... > except urllib2.URLError, e: >. >

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Richie Hindle wrote: >> [Amer] >> #!/usr/bin/python >> [...] On my home PC [...] >> [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system >> cannot find the file specified. > > That's because on your home PC Python is somewhere like > C:\Python25\python.exe, not /usr/bin/python. >

Re: Generating HTML

2007-09-13 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "Sebastian Bassi" <[EMAIL PROTECTED]> wrote: > Hello, > > What are people using these days to generate HTML? I still use > HTMLgen, but I want to know if there are new options. I don't > want/need a web-framework a la Zope, just want to produce valid HTML > from P

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Amer Neely wrote: > Richie Hindle wrote: >>> [Amer] >>> #!/usr/bin/python >>> [...] On my home PC [...] >>> [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system >>> cannot find the file specified. >> >> That's because on your home PC Python is somewhere like >> C:\Python25\python.e

Re: Coming from Perl

2007-09-13 Thread Tim Golden
Amer Neely wrote: > Richie Hindle wrote: >>> [Amer] >>> #!/usr/bin/python >>> [...] On my home PC [...] >>> [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system >>> cannot find the file specified. >> That's because on your home PC Python is somewhere like >> C:\Python25\python.exe,

Re: recursion

2007-09-13 Thread Neil Cerutti
On 2007-09-13, Gigs_ <[EMAIL PROTECTED]> wrote: > Can someone explain me this > > >>> def f(l): > if l == []: > return [] > else: > return f(l[1:]) + l[:1] # <= cant figure this, how is all sum > at the end? In plain English, the above program says: The s

Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Rodney Maxwell
The following are apparently legal Python syntactically: L[1:3, 8:10] L[1, ..., 5:-2] But they don't seem to work on lists: >>> l = [0,1,2,3] >>> l[0:2,3] Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers >>> l[...] Traceback (most recent call

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Charles Fox
hmm, I guess this is the difference between numerical programming and the rest -- sure, if I was writing a database server or something it would be great to have thisObject.veryLongName to know what everything is -- however when you are implementing a model from a published paper, the variables ten

Re: Coming from Perl

2007-09-13 Thread Amer Neely
Tim Golden wrote: > Amer Neely wrote: >> Richie Hindle wrote: [Amer] #!/usr/bin/python [...] On my home PC [...] [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system cannot find the file specified. >>> That's because on your home PC Python is somewhere like

Re: Error in random module, bad installation?

2007-09-13 Thread Andrew F
On Sep 13, 12:57 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > Andrew F <[EMAIL PROTECTED]> wrote: > >I'm a linux user and I just upgraded from 2.1 to 2.5 and changed the > >location of a number of libraries and tools. > > >So far I've tracked most errors, but this one has me scratching my > >head :

Re: recursion

2007-09-13 Thread Ian Clark
Neil Cerutti wrote: > On 2007-09-13, Gigs_ <[EMAIL PROTECTED]> wrote: >> Can someone explain me this >> > def f(l): >> if l == []: >> return [] >> else: >> return f(l[1:]) + l[:1] # <= cant figure this, how is all sum >> at the end? > > In plain English, t

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Robert Kern
Rodney Maxwell wrote: > The following are apparently legal Python syntactically: >L[1:3, 8:10] >L[1, ..., 5:-2] > > But they don't seem to work on lists: l = [0,1,2,3] l[0:2,3] > Traceback (most recent call last): > File "", line 1, in > TypeError: list indices must be integer

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Steven D'Aprano
On Thu, 13 Sep 2007 16:16:03 +0200, Wildemar Wildenburger wrote: > I see merit in using > >(_.foo + _.bar) * _.baz > > instead of > >(s.foo + s.bar) * s.baz > > because I'm trained to interpret the underscore as a synonym for one > space. It's not particularly beautiful, but that is pr

Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread gamename
On Sep 13, 4:18 am, Tim Golden <[EMAIL PROTECTED]> wrote: > gamename wrote: > > On Sep 13, 1:42 am, [EMAIL PROTECTED] wrote: > >> On Sep 12, 9:27 pm, gamename <[EMAIL PROTECTED]> wrote: > > >>> Hi, > >>> Is it still the case there is no practical Expect-like module for > >>> win32? I know that cygw

Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread gamename
On Sep 13, 4:51 am, Philem <[EMAIL PROTECTED]> wrote: > On Sep 13, 12:27 am, gamename <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Is it still the case there is no practical Expect-like module for > > win32? I know that cygwin can support pexpect, but that isn't an > > option here --- I have to use a

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
Well I'm with Bruce Eckel - there shouldn't be any argument for the object in the class method parameter list. But since Python 3 was "code-named" 3000 (implying but not delivering big changes... I don't think it required big changes) and since it still has an explicit object parameter it's a given

Re: lxml + mod_python: cannot unmarshal code objects in restricted execution mode

2007-09-13 Thread Dmitri Fedoruk
On Sep 13, 5:05 pm, Dmitri Fedoruk <[EMAIL PROTECTED]> wrote: > So, my configuration is the following: > Python 2.5.1 > Server version: Apache/2.2.4 (FreeBSD) > mod_python-3.3.1 update: lxml-1.3.4 libxslt-1.1.21 libxml2-2.6.29 -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Wildemar Wildenburger
Charles Fox wrote: > Maybe for now I will just fix up my emacs to display the world 'self' > in 10% gray... :-) > > Now *that* is a clever idea! (And that's no irony.) /W -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Wildemar Wildenburger
Eduardo O. Padoan wrote: > On 9/13/07, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: >> because I'm trained to interpret the underscore as a synonym for one >> space. It's not particularly beautiful, but that is probably a matter of >> habituation. And that exact word is probably the reason why

Re: Help to start python

2007-09-13 Thread Wildemar Wildenburger
python_lover wrote: > Please guide me some good sites to start web based programing on > python. > Here's a good one: Always remember: GIYF If you don't know what that means:

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > > Here is a link to a tutorial where Sun is talking about the this > > reference: > >http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html > > That's a tutorial for getting you started, no reference > documentation or in-depth course. > Here's a FAQ item where they refer to it as I

Re: Python 3K or Python 2.9?

2007-09-13 Thread Wildemar Wildenburger
TheFlyingDutchman wrote: > What I would like to have seen added to class definitions was the > forced declaration of all object variables in the class outside of > methods. I don't like the fact that they have to be, and can be > created in any method on the fly. > Isn't one of the main ideas behi

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread J. Clifford Dyer
On Thu, Sep 13, 2007 at 04:21:36PM -, Steven D'Aprano wrote regarding Re: newbie: self.member syntax seems /really/ annoying: > > It's not just a matter of taste. > > Reading comprehensibility is an objective, measurable quantity, and I > would bet that "(self.foo + self.bar) * self.baz" wo

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > Isn't one of the main ideas behind python that it doesn't force you to > do (well, declare) anything? And by "ideas" I mean "design decisions". > Thats exactly what makes python great for prototyping; you just do it > and see if it works. As soon as you need to declare things you have to > cha

Re: Python 3K or Python 2.9?

2007-09-13 Thread Stefan Bellon
On Thu, 13 Sep, TheFlyingDutchman wrote: > Bruce said that no other mainstream OO language is explicitly passing > the object as a parameter to class methods. Ada 95 does. And Ada 95 was the first standardized OO language. Now with Ada 2005 you can either pass the the object explicitly as first p

Re: recursion

2007-09-13 Thread James Stroud
Ian Clark wrote: > Neil Cerutti wrote: >> On 2007-09-13, Gigs_ <[EMAIL PROTECTED]> wrote: >>> Can someone explain me this >>> >> def f(l): >>> if l == []: >>> return [] >>> else: >>> return f(l[1:]) + l[:1] # <= cant figure this, how is all >>> sum at the end? >> >> In

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread OKB (not okblacke)
Steven D'Aprano wrote: >> And I agree with the OP that the convention is really annoying. >> >> self.rect.width = self.foo(self.rect.x + self.rect.y) * self.boo() >> >> is much less concise than >> >> s.rect.width = s.foo(s.rect.x + s.rect.y) * s.boo() > > > Y do u thnk bng cncis is lwys

Re: An ordered dictionary for the Python library?

2007-09-13 Thread [EMAIL PROTECTED]
On Sep 13, 1:27 am, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 13 Sep, 00:03, Paul Rubin wrote: > > > Mark Summerfield <[EMAIL PROTECTED]> writes: > > > I feel that Python lacks one useful data structure: an ordered > > > dictionary. > > > Do other Python programmer

Re: recursion

2007-09-13 Thread Neil Cerutti
On 2007-09-13, Ian Clark <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> On 2007-09-13, Gigs_ <[EMAIL PROTECTED]> wrote: >>> Can someone explain me this >>> >> def f(l): >>> if l == []: >>> return [] >>> else: >>> return f(l[1:]) + l[:1] # <= cant figure thi

Re: Python 3K or Python 2.9?

2007-09-13 Thread Marc 'BlackJack' Rintsch
On Thu, 13 Sep 2007 10:10:57 -0700, TheFlyingDutchman wrote: >> Isn't one of the main ideas behind python that it doesn't force you to >> do (well, declare) anything? And by "ideas" I mean "design decisions". >> Thats exactly what makes python great for prototyping; you just do it >> and see if it

Re: Help to start python

2007-09-13 Thread kyosohma
On Sep 13, 9:39 am, python_lover <[EMAIL PROTECTED]> wrote: > On Sep 13, 7:23 pm, [EMAIL PROTECTED] wrote: > > > > > python_lover wrote: > > > Hi All, > > > > I'm new to python. I installed python 2.5 and IDLE 1.2.1 . I'm able > > > to run shell commands. > > > > But I don't know how to execute a

  1   2   >