Re: How to determine that if a folder is empty?

2005-08-08 Thread Reinhold Birkenfeld
could ildg wrote: > I want to check if a folder named "foldername" is empty. > I use os.listdir(foldername)==[] to do this, > but it will be very slow if the folder has a lot of sub-files. > Is there any efficient ways to do this? try: os.rmdir(path) empty = True except OSError: empty

Re: IronPython 0.9 Released

2005-08-08 Thread Reinhold Birkenfeld
Al Christians wrote: > EP wrote: >> >> yes, my apologies to all things Iron and or Python. >> >> "language" and "version" can be confusing if one stays up late without >> coffee, or perhaps if one has not been debugging their English code properly. >> > > Still, it's a bit of a PITB to me that

Re: Embedding a runtime graph in Qt3 designer generated UI

2005-08-08 Thread Phil Thompson
> Hi > > Two questions : > > 1. Is it possible to use an import command in a qt3 designer code ? (I > know > that it is possible to write python inside the braces -- but is it > possible > to use an import command for some rather large libraries I wrote that I > need to access ?). You can include

Re: Python's CSV reader

2005-08-08 Thread Peter Otten
Stephan wrote: > DictReader field names on the fly. Here is a rudimentary example of my > working code and the data it can parse. > > - > John|Smith > Beef|Potatos|Dinner Roll|Ice Cream > Susan|Jones > Chicken|Peas|Biscuits|Cake > Roger|Miller > Pork|Salad|Muf

Re: Python HTTP digest authentication woes...

2005-08-08 Thread Fuzzyman
john wrote: > I'm trying to access the XML version of my Tivo now playing list with > python. It uses auth digest HTTP authentication. I could really use > some help! > > I'm able to get this page using curl: > curl --dump-header tivoHeaders --insecure --anyauth --user tivo:808 > "https://192.

Re: How to determine that if a folder is empty?

2005-08-08 Thread James Dennett
Reinhold Birkenfeld wrote: > could ildg wrote: > >>I want to check if a folder named "foldername" is empty. >>I use os.listdir(foldername)==[] to do this, >>but it will be very slow if the folder has a lot of sub-files. >>Is there any efficient ways to do this? > > > try: > os.rmdir(path) >

Re: Splitting a string into groups of three characters

2005-08-08 Thread Maksim Kasimov
import re str = '123456789983qw' re.findall("(.{3})", str)+[str[-(len(str) % 3):]] [EMAIL PROTECTED] wrote: > Hi, > > Is there a function that split a string into groups, containing an "x" > amount of characters? > > Ex. > TheFunction("Hello World",3) > > Returns: > > ['Hell','o W','orl','d']

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Torsten Bronger
Hallöchen! "Terry Reedy" <[EMAIL PROTECTED]> writes: > [...] Consider > > Hypothesis 1: someone learned Python and Tkinter, felt > dissatisfied with Tkinter, went searching the universe for an > alternative, found GTK, and wrote PyGTK, perhaps learning C in the > process. > > Hypothesis 2: a C-p

Re: Python -- (just) a successful experiment?

2005-08-08 Thread EP
Robert Kern <[EMAIL PROTECTED]> wrote: > Which is exactly why I said at the beginning that people shouldn't > bother with this thread and should instead just get to work. > Robert, you are probably right, but I think how we get to work is important as well. What I posted was a little intelle

Re: PEP: Specialization Syntax

2005-08-08 Thread Nicolas Fleury
Kay Schluehr wrote: > def makeClass(cls_name, **kw): > return type(cls_name,(), kw) > MyObject = makeClass("MyObject",a=8) MyObject As said to Bengt, a place is needed to write the class definition. There's no need for metaclass in that case: def makeType(a, b, c=someDefault):

Re: Point and click GUI builder for Python

2005-08-08 Thread Adriaan Renting
Use Eric3 with QtDesigner. Works like a charm. Adriaan Renting| Email: [EMAIL PROTECTED] ASTRON | Phone: +31 521 595 217 P.O. Box 2 | GSM: +31 6 24 25 17 28 NL-7990 AA Dwingeloo | FAX: +31 521 597 332 The Netherlands| Web: http://www.astron.nl/~ren

Re: visual studio 2005

2005-08-08 Thread Martin v. Löwis
wilf wrote: > Has anyone had success compiling python with this? I personally didn't try yet. Did you? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Hypothesis 1: someone learned Python and Tkinter, felt dissatisfied with > Tkinter, went searching the universe for an alternative, found GTK, and > wrote PyGTK, perhaps learning C in the process. > > Hypothesis 2: a C-programmer who is a satisfied use

issues with doctest and threads

2005-08-08 Thread Michele Simionato
I am getting a strange error with this script: $ cat doctest-threads.py """ >>> import time, threading >>> def example(): ... thread.out = [] ... while thread.running: ... time.sleep(.01) ... thread.out.append(".") >>> thread = threading.Thread(None, example) >>> thread.run

Re: How to use DrPython plugins

2005-08-08 Thread Franz Steinhaeusler
On Sat, 06 Aug 2005 13:38:24 +0200, Laszlo Zsolt Nagy <[EMAIL PROTECTED]> wrote: > > Hi All! Hello Laszlo, > >I have DrPython installed. I see there are cool plugins but I cannot >user them. I'm glad, you like DrPython and the plugins. What Platform do you have? Python, WxPython Version, l

Re: How to use DrPython plugins

2005-08-08 Thread Franz Steinhaeusler
On 6 Aug 2005 08:03:59 -0700, "RunLevelZero" <[EMAIL PROTECTED]> wrote: >Well I think you should post in this forum and you will get your answer >more quickly. > >http://sourceforge.net/forum/?group_id=83074 > Hi RunLevelZero, I have changed the Codemarks meanwhile. For testing, one could edit:

Re: PEP: Specialization Syntax

2005-08-08 Thread Kay Schluehr
Nicolas Fleury schrieb: > Kay Schluehr wrote: > > def makeClass(cls_name, **kw): > > return type(cls_name,(), kw) > > > MyObject = makeClass("MyObject",a=8) > MyObject > > As said to Bengt, a place is needed to write the class definition. > There's no need for metaclass in that case:

Re: ANN: Kamaelia 0.2.0 released!

2005-08-08 Thread Wolfgang Keller
> The project aims to make it simple to build networked multimedia > systems (eg audio, video, interactive systems), Why limit the scope of application artificially? Axon/Kamaelia imho is perfectly applicable to any kind of application that does some kind of data processing. Think workflow appl

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-08 Thread Paolino
Bengt Richter wrote: > Nor do we have any correspondence for bare names analogous to > > setattr(obj, "name", value) <=> obj.name = value > > e.g., > > setname(, "name", value) Probably this parallelism is a better approach to what I commented before.Thanks for clarity. > There is now

Re: Oreilly CodeZoo

2005-08-08 Thread gene tani
There it is, right on homepage. Thanks, it looks quite nice, and i see you'll be an indep. gems server, and more... I did try searching on "postscript" and it didn't pull up pyscript. Also, HTML on the "Search" results page is kind of not rendered great in Firefox1.06 /WinXP SP2. BUt it's a rea

Re: How to determine that if a folder is empty?

2005-08-08 Thread Neil Hodgson
could ildg > so you mean that this is not platform-independent? Your existing code is platform-independent but I think for faster code you will need to write platform-dependent code. FindFirstFile is only available on Windows. Neil -- http://mail.python.org/mailman/listinfo/python-lis

Re: Decline and fall of scripting languages ?

2005-08-08 Thread phil
> Kay Schluehr ([EMAIL PROTECTED]) wrote: > : No good news for scripting-language fans: > > : http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html > What incredible horse dooey. The only thing that NEVER "penetrates the enterprise space" is good sense. Does anyone read history books

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Robert Kern
EP wrote: > Robert Kern <[EMAIL PROTECTED]> wrote: > >>Which is exactly why I said at the beginning that people shouldn't >>bother with this thread and should instead just get to work. > > Robert, you are probably right, but I think how we get to work is important > as well. > > What I posted w

Re: error with examples (UDP broadcast)

2005-08-08 Thread Damir Hakimov
Damir Hakimov wrote: >Hi All! > >I'm writing a small programm which must send and service UDP broadcast >packets. >As start of it I looked at >/usr/share/doc/python2.4/Examples/Demo/sockets/broadcast.py > > > > Well, this is the broken code (from examples): -

Re: ANN: Kamaelia 0.2.0 released!

2005-08-08 Thread Matt Hammond
On Mon, 08 Aug 2005 10:49:32 +0100, Wolfgang Keller <[EMAIL PROTECTED]> wrote: >> The project aims to make it simple to build networked multimedia >> systems (eg audio, video, interactive systems), > > Why limit the scope of application artificially? > > Axon/Kamaelia imho is perfectly applicabl

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Torsten Bronger
Hallöchen! Robert Kern <[EMAIL PROTECTED]> writes: > [...] > > What I'm trying to say is that posting to c.l.py is absolutely > ineffective in achieving that goal. Code attracts people that like > to code. Tedious, repetitive c.l.py threads attract people that > like to write tedious, repetitive

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Robert Kern
Torsten Bronger wrote: > Hallöchen! > > Robert Kern <[EMAIL PROTECTED]> writes: > >>[...] >> >>What I'm trying to say is that posting to c.l.py is absolutely >>ineffective in achieving that goal. Code attracts people that like >>to code. Tedious, repetitive c.l.py threads attract people that >>li

Re: zipped socket

2005-08-08 Thread jepler
As far as I know, there is not a prefabbed solution for this problem. One issue that you must solve is the issue of buffering (when must some data you've written to the compressor really go out to the other side) and the issue of what to do when a read() or recv() reads gzipped bytes but these do

Re: How to determine that if a folder is empty?

2005-08-08 Thread jepler
On standard Unix fileystems, one way to check for this is to check that the st_nlink of the directory is 2. However, even on Unix systems this isn't guaranteed for all filesystem types. Of course, finding whether a directory is empty is inherently racy: a file could be created between the time yo

Re: How to determine that if a folder is empty?

2005-08-08 Thread John Machin
Reinhold Birkenfeld wrote: > could ildg wrote: > >>I want to check if a folder named "foldername" is empty. >>I use os.listdir(foldername)==[] to do this, >>but it will be very slow if the folder has a lot of sub-files. >>Is there any efficient ways to do this? > > > try: > os.rmdir(path) >

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Peter Hansen
Paul Rubin wrote: > I dunno about PyGTK but one of the more common complaints about > wxPython is that it's not Pythonic enough. And wxPython is probably > the most popular Python GUI toolkit after Tkinter. So people don't > want C wrappers. I think what they mostly want is a wide choice of > go

Re: issues with doctest and threads

2005-08-08 Thread jepler
I don't see the problem with your doctest usage, but what makes you believe that the code you show below produces exactly 9 dots? strangely enough, re-working the code to this >>> import time, threading >>> def example(): ... thread.out = [] ... for i in range(9): thread.out.append(".") >>

Re: zipped socket

2005-08-08 Thread Peter Hansen
John wrote: > > Is there anyway open a socket so that every send/listen/recv > goes thru a zipping/unzipping process automatically? You ought to be able to do this easily by wrapping a bz2 compressor around the socket (maybe using socket.makefile() to return a file object first) and probably us

Re: How to determine that if a folder is empty?

2005-08-08 Thread Peter Hansen
could ildg wrote: > I want to check if a folder named "foldername" is empty. > I use os.listdir(foldername)==[] to do this, > but it will be very slow if the folder has a lot of sub-files. > Is there any efficient ways to do this? I'm just curious to know under what circumstances where it's import

Re: Decline and fall of scripting languages ?

2005-08-08 Thread Neil Benn
phil wrote: >>Kay Schluehr ([EMAIL PROTECTED]) wrote: >>: No good news for scripting-language fans: >> >>: http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html >> >> >> > >What incredible horse dooey. > >The only thing that NEVER "penetrates the enterprise space" >is good sense. > >D

Re: IronPython 0.9 Released

2005-08-08 Thread Luis M. Gonzalez
could ildg wrote: > Why is iron python runs so fast but jython runs so slow while C# and > java seem very much the same? I've been playing with Ironpython since its first release and, in my experience, it is not faster than Cpython, although this is what they claim. Anyway, it is in alpha stage s

Re: listing users in Plone

2005-08-08 Thread Somesh
plz let me know the proper google group -- http://mail.python.org/mailman/listinfo/python-list

PyQt: Problem finding and showing a record in a QDataBrowser

2005-08-08 Thread Jorge Godoy
[I've also posted this to pyqt-pykde list, but I haven't got any answers so far. I also thought that someone here might have solved it or have a different idea to help me :-) Sorry for those that read it twice. ] Hi. I have created an interface where I have a QDataBrowser and all of its editin

Re: How to determine that if a folder is empty?

2005-08-08 Thread Mike Meyer
James Dennett <[EMAIL PROTECTED]> writes: > Reinhold Birkenfeld wrote: > >> could ildg wrote: >> >>>I want to check if a folder named "foldername" is empty. >>>I use os.listdir(foldername)==[] to do this, >>>but it will be very slow if the folder has a lot of sub-files. >>>Is there any efficient wa

Re: gettext again

2005-08-08 Thread stasz
On Mon, 08 Aug 2005 02:56:35 +0200, cantabile wrote: > stasz a écrit : >> On Sun, 07 Aug 2005 21:33:21 +0200, cantabile wrote: >> >> >>>stasz a écrit : >>> On Sun, 07 Aug 2005 11:09:14 +0200, cantabile wrote: >Hi, >I'm failing to make it work but can't find out what's

Re: Oreilly CodeZoo

2005-08-08 Thread Jorge Godoy
richard wrote: > We (PyPI / Cheese Shop developers) are talking to the CodeZoo people about > the relationship between the two systems. Things PyPI has: > > 1. python setup.py register > 2. python setup.py (sdist|bdist|bdist_egg|bdist_wininst|...) upload > 3. http://cheeseshop.python.org/ > 4. be

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Kay Schluehr
Paul Rubin schrieb: > Having a good FFI is certainly an important feature but Python > programs should first and foremost be Python programs. Python was originally created as an extension language for C. In some sense it is an abstraction layer for C libs. > Compare the > situation with Java or

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Cliff Wells
On Sun, 2005-08-07 at 06:55 -0700, Paul Boddie wrote: > Eric Pederson wrote: > > Why is Ruby, and Ruby on Rails, getting such strong play? > > Relentless hype from blogging celebrities? This is certainly part of it, but I feel it ignores the much deeper reasons which are the root of this hype. I

Re: Embedding a runtime graph in Qt3 designer generated UI

2005-08-08 Thread Adriaan Renting
I find Eric3 very easy to work with when using Qt+Python. It will generate a Python wrapper for your Qt (Designer designed) form, that you can the sub-class and use as if it was a Python object. I'm hoping it will be available (together with PyQt, etc.) for Qt4 soon, but as I'm not paying a dime fo

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Peter Decker
On 8/8/05, Robert Kern <[EMAIL PROTECTED]> wrote: > What I'm trying to say is that posting to c.l.py is absolutely > ineffective in achieving that goal. Code attracts people that like to > code. Tedious, repetitive c.l.py threads attract people that like to > write tedious, repetitive c.l.py threa

epyDoc Questions

2005-08-08 Thread Neil Benn
Hello, I can;t find a epyDoc specific mailing list, so I'll try here - if you know of a epyDoc mailing list then please let me know (google is not my friend, I can only find an announce, devel and commit list from 'epydoc mailing list'). I'm working on marking up a class in epyDo

Re: Decline and fall of scripting languages ?

2005-08-08 Thread Dave Brueck
Paul Rubin wrote: > Ruby just doesn't interest me that much though (maybe I'm missing > something). I don't think you are. My impression is that if you've never used Python or Ruby, you'll generally end up liking whichever of the two you really discover first (since the common case is that you'r

Extending and altering httplib to handle bad servers

2005-08-08 Thread Michael Ekstrand
In the course of my current project, I've had to deal with connecting to an HTTP server that isn't fully compliant with the HTTP requirements for chunked encodings. Rather than sending the end-of-data sentinel (0-length chunk), it just closes the connection (without even sending the CRLF at the end

Re: gettext again

2005-08-08 Thread cantabile
stasz a écrit : > Your steps seems alright. > Just a thought; you do start test1.py from a [EMAIL PROTECTED] > environment do you? > I mean in a xterm do: export [EMAIL PROTECTED] > And then start test1.py from there. > > Stas Wht ! Working at last, after three days... It wasn't the LANG par

Re: How to determine that if a folder is empty?

2005-08-08 Thread Dan Sommers
On Mon, 08 Aug 2005 09:03:39 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: > Just out of curiosity, is there an OS out there where you can have the > permissions needed to delete a directory without having the > permissions needed to create it appropriately? Depending on your definition of "out th

RE: Terminate a thread that doesn't check for events

2005-08-08 Thread Liu Shuai
Thank you for the help Chris and Jp. Just wanted to let you know that I re-wrote a "stoppable" version of the function I was calling in the thread instead of forcing the thread to terminate. I think it worth the effort as the solution is now clean and portable. Thanks again for all your input. L

Is there a better/simpler logging module?

2005-08-08 Thread Alessandro Bottoni
I just tried to use the python standard logging module in a small program and I found myself lost among all those features, all those configuration options and so on. Is there any better/simpler logging module around? What do you use for logging in your programs? Thanks in advance. --

Re: gettext again

2005-08-08 Thread cantabile
BTW stasz, Maybe you'll have still some time for the following question. Trying my luck :)) Suppose I have several units (.py files), say test.py test1.py tets2.py , test.py being my main file. I've read I can import gettext and install in the main unit. Then, must I create .po files for each u

BayPIGgies: August 11, 7:30pm (Ironport)

2005-08-08 Thread Aahz
The next meeting of BayPIGgies will be Thurs, August 11 at 7:30pm at Ironport. Hasan Diwan will present RRsR, a web-based RSS reader written using feedparser and python CGI. This is expected to be a short presentation; afterward, anyone who was at OSCON is invited to summarize what they saw/heard

Python framework

2005-08-08 Thread mohammad babaei
hi ! what's the best python framework to create web applications?     -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better/simpler logging module?

2005-08-08 Thread [EMAIL PROTECTED]
If you need some simple logging why not create a logger like one of the basic examples, see http://docs.python.org/lib/minimal-example.html, these examples are not that complex. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP: Specialization Syntax

2005-08-08 Thread phil hunt
On 8 Aug 2005 02:26:40 -0700, Kay Schluehr <[EMAIL PROTECTED]> wrote: > >I have to admit that i don't actually understand what you want? Me neither. I don't see the point of this. -- Email: zen19725 at zen dot co dot uk -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI programming, embedding, real time plots, etc.

2005-08-08 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Madhusudan Singh <[EMAIL PROTECTED]> wrote: > 1. In using matplotlib (my code essentially involved creating a plot and > show()'ing it inside a loop), the color of the plot changed. Is there a way > to tell matplotlib to not treat each new invocation as a new plot,

Re: How to determine that if a folder is empty?

2005-08-08 Thread Bernhard Herzog
[EMAIL PROTECTED] writes: > On standard Unix fileystems, one way to check for this is to check that the > st_nlink of the directory is 2. In that case you only know that the directory doesn't have any subdirectories. It may still contain ordinary files and other non-directories. Bernhard -

Re: Python -- (just) a successful experiment?

2005-08-08 Thread bruno modulix
Eric Pederson wrote: > Raise your hand if you think the best technology wins! > Those who have raised hands should google for "worse is better"... -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://ma

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Bengt Richter
On Mon, 8 Aug 2005 00:51:04 -0800, "EP" <[EMAIL PROTECTED]> wrote: >Robert Kern <[EMAIL PROTECTED]> wrote: > >> Which is exactly why I said at the beginning that people shouldn't = > >> bother with this thread and should instead just get to work. >> = > > > >Robert, you are probably right, but I t

Re: How to determine that if a folder is empty?

2005-08-08 Thread David Cuthbert
Mike Meyer wrote: > Just out of curiosity, is there an OS out there where you can have the > permissions needed to delete a directory without having the > permissions needed to create it appropriately? Not an OS, but AFS has a wider set of permissions (RLIDWKA - which, if I remember correctly, ar

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Paul Rubin
"Kay Schluehr" <[EMAIL PROTECTED]> writes: > > Having a good FFI is certainly an important feature but Python > > programs should first and foremost be Python programs. > > Python was originally created as an extension language for C. In some > sense it is an abstraction layer for C libs. I'd hav

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Paul Rubin
Cliff Wells <[EMAIL PROTECTED]> writes: > The second presentation (I don't recall the speaker's name) specifically > covered metaprogramming (writing DSLs) and one of the things I found > interesting was that despite Ruby having far more syntax than Python in > general, the resulting Ruby-based DSL

Re: PEP: Specialization Syntax

2005-08-08 Thread Nicolas Fleury
Kay Schluehr wrote: > I have to admit that i don't actually understand what you want? The > problems you try to solve seem trivial to me but it's probably my fault > and i'm misreading something. You might be correct that your PEP may be > interesting only if "optional static typing" will be introd

Re: PEP: Specialization Syntax

2005-08-08 Thread Bengt Richter
On Sun, 07 Aug 2005 21:41:33 -0400, Nicolas Fleury <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: [...] >> But here the problem is not in the __getitem__ method: >> >> >>> c.__getitem__(kw='key word arg') >> (<__main__.C object at 0x02EF498C>, (), {'kw': 'key word arg'}) >> >> It's just that

Re: gettext again

2005-08-08 Thread stas
On Mon, 08 Aug 2005 17:01:21 +0200, cantabile wrote: > stasz a écrit : > Wht ! Working at last, after three days... It wasn't the LANG param [...] > Anyways, you made my day my friend ! > Many many thanks ! Your welcome :-) Stas -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better/simpler logging module?

2005-08-08 Thread Michael Hoffman
Alessandro Bottoni wrote: > I just tried to use the python standard logging module in a small program > and I found myself lost among all those features, all those configuration > options and so on. If you don't want to mess with all this stuff it's easy enough to do: import logging logging.warn

Re: Python -- (just) a successful experiment?

2005-08-08 Thread [EMAIL PROTECTED]
That's it: got to get the PEEPs involved. Acronym of the year (AOTY). -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into groups of three characters

2005-08-08 Thread [EMAIL PROTECTED]
Yes i know i made a mistake, >['Hell','o W','orl','d'] but you know what I mean lol, I'll probly use John Machin's def nsplit(s, n): return [s[k:k+n] for k in xrange(0, len(s), n)] It seems fast, and does not require any imports. But anyways, thank you for all your help, you rpck! :) --

Re: Splitting a string into groups of three characters

2005-08-08 Thread [EMAIL PROTECTED]
Yes i know i made a mistake, >['Hell','o W','orl','d'] but you know what I mean lol, I'll probly use John Machin's def nsplit(s, n): return [s[k:k+n] for k in xrange(0, len(s), n)] It seems fast, and does not require any imports. But anyways, thank you for all your help, you rock! :) --

Re: gettext again

2005-08-08 Thread stas
On Mon, 08 Aug 2005 17:39:34 +0200, cantabile wrote: > BTW stasz, > Maybe you'll have still some time for the following question. Trying my > luck :)) > > Suppose I have several units (.py files), say test.py test1.py tets2.py > , test.py being my main file. > I've read I can import gettext and

Re: OT: World's largest Python caught!:)

2005-08-08 Thread James Stroud
http://www.afghania.com/News-article-sid-4792-mode-thread.html 3rd hit in google with "world's largest python". The first two hits were your email below to the newsgroups. James On Sunday 07 August 2005 09:15 pm, Ashok Rajasingh wrote: > Hi > > > > Can I please get some information on this pyth

Re: Python framework

2005-08-08 Thread Terry Reedy
>what's the best python framework to create web applications? Let us try a different question: what is the best way to get help from a newsgroup? Step 1: do some research. Read throught the past postings still available on your newssource for threads on your topic. And/or, use Google's news

sample script to write results of html scrape to mysql db?

2005-08-08 Thread yaffa
does anyone have a sample script that writes results of html scraping to a mysql db? -- http://mail.python.org/mailman/listinfo/python-list

Re: Decline and fall of scripting languages ?

2005-08-08 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > "Donn Cave" <[EMAIL PROTECTED]> writes: > > My vote would be Haskell first, then other functional languages. > > Learning FP with Objective CAML is like learning to swim in a > > wading pool -- you won't drown, but the

Re: Decline and fall of scripting languages ?

2005-08-08 Thread Paul Rubin
Donn Cave <[EMAIL PROTECTED]> writes: > > I'm not sure what you mean by that about OCAML. That its functional > > model is not pure enough? I'd like to look at Haskell as well, but I > > have the impression that its implementation is not as serious as > > OCaml's, i.e. no native-code compiler. >

Re: Fat and happy Pythonistas (was Re: Replacement forkeyword'global' good idea? ...)

2005-08-08 Thread Bengt Richter
On Sun, 7 Aug 2005 23:52:40 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >"Bengt Richter" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> I think the relationship of abstract entities and their concrete >> representations >> is very interesting. > >ditto > >> BTW, maybe this

Re: Python -- (just) a successful experiment?

2005-08-08 Thread A.M. Kuchling
On Mon, 08 Aug 2005 16:58:40 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: > It occurs to me that we have the PEP process for core python, but no PEP > process > for the python app/lib environment. What about starting a PEEP process > (Python Environment Enhancement Proposals) modeled on

Re: Making a timebomb

2005-08-08 Thread Cantankerous Old Git
Peter Hansen wrote: > Cantankerous Old Git wrote: > >> Peter Hansen wrote: >> >>> Cantankerous Old Git wrote: >>> The dirty way, which can leave corrupt half-written files and other nasties, is something like sys.exit(). >>> >>> >>> sys.exit() won't help you if your server is running in

Re: Splitting a string into groups of three characters

2005-08-08 Thread Cyril Bazin
Another solution derived from an old discussion about the same problem? def takeBy(s, n):     import itertools     list(''.join(x) for x in itertools.izip(*[iter(s)]*n)) (Hoping len(s) % n = 0) CyrilOn 8 Aug 2005 11:04:31 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:Yes i know i made a mi

Re: PEP: Specialization Syntax

2005-08-08 Thread Nicolas Fleury
Bengt Richter wrote: > On Sun, 07 Aug 2005 21:41:33 -0400, Nicolas Fleury <[EMAIL PROTECTED]> wrote: >>I mean should angle brackets <> like in C++, or another operator, be >>used instead? > > I am getting the feeling that your PEP is about a means to do something > C++-like > in python, not nece

Re: OT: World's largest Python caught!:)

2005-08-08 Thread Ivan Van Laningham
Hi All-- James Stroud wrote: > > http://www.afghania.com/News-article-sid-4792-mode-thread.html > > 3rd hit in google with "world's largest python". The first two hits were your > email below to the newsgroups. > This hit says it's not the world's largest: http://www.reptilia.org/NEWS.htm An

Re: Splitting a string into groups of three characters

2005-08-08 Thread William Park
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a function that split a string into groups, containing an "x" > amount of characters? > > Ex. > TheFunction("Hello World",3) > > Returns: > > ['Hell','o W','orl','d'] > > > Any reply would be truly appreciated. Look into 're' mo

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Kay Schluehr
Bengt Richter wrote: > It occurs to me that we have the PEP process for core python, but no PEP > process > for the python app/lib environment. What about starting a PEEP process > (Python Environment Enhancement Proposals) modeled on PEPs, where those > motivated > to formalize their pet projec

python for microcontrollers

2005-08-08 Thread Evil Bastard
Hi all, I'm currently tackling the problem of implementing a python to assembler compiler for PIC 18Fxxx microcontrollers, and thought I'd open it up publicly for suggestions before I embed too many mistakes in the implementation. The easy part is getting the ast, via compiler.ast. Also easy is g

Re: python for microcontrollers

2005-08-08 Thread Benji York
Evil Bastard wrote: > I'm currently tackling the problem of implementing a python to assembler > compiler for PIC 18Fxxx microcontrollers Perhaps porting Pyrex would be easier. Pyrex takes a python-like syntax (plus type information, etc.) and emits C, which is then compiled. -- Benji York --

Why does __init__ not get called?

2005-08-08 Thread Rob Conner
I'm still working on my DateTime class from last week... Why does __init__ not get called? The docs at http://www.python.org/dev/doc/devel/ref/customization.html read "If __new__() returns an instance of cls, then the new instance's __init__() method will be invoked" and as far as I can tell cls i

Re: python for microcontrollers

2005-08-08 Thread Evil Bastard
Benji York wrote: > Perhaps porting Pyrex would be easier. Pyrex takes a python-like syntax > (plus type information, etc.) and emits C, which is then compiled. Pyrex totally rocks. But for the PIC targetting, no can do: - pyrex generates a **LOT** of code, which makes extensive use of the py

Re: Why does __init__ not get called?

2005-08-08 Thread Lonnie Princehouse
Uh... are you actually trying to instantiate this class? mydate = DateTime(2005, 8, 8) The reason I ask is that __init__ /is/ called when I run your code on Python 2.4, provided that the above line is added to the end. -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax error after upgrading to Python 2.4

2005-08-08 Thread Michael Hudson
[EMAIL PROTECTED] writes: > On Sat, Aug 06, 2005 at 05:15:22PM -0400, Terry Reedy wrote: >> In any case letting developers add new features is part of the price of >> getting unpaid bug fixes for free software. But note that PSF does not >> make you to upgrade. Here is the current list of poss

Re: python for microcontrollers

2005-08-08 Thread Peter Hansen
Evil Bastard wrote: > Benji York wrote: >>Perhaps porting Pyrex would be easier. > Pyrex totally rocks. But for the PIC targetting, no can do: ... > Any other suggestions? Yes, port Lua instead. Lua is pretty much designed for this sort of application, and is probably "Pythonic" enough to pro

Re: Decline and fall of scripting languages ?

2005-08-08 Thread Michael Hudson
Donn Cave <[EMAIL PROTECTED]> writes: > On the contrary, there are a couple. Ghc is probably the > leading implementation these days, and by any reasonable > measure, it is serious. > > Objective CAML is indeed not a pure functional language. *cough* unsafePerformIO *cough* Cheers, mwh -- M

Re: Decline and fall of scripting languages ?

2005-08-08 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: ... > I notice that Haskell strings are character lists, i.e. at least > conceptually, "hello" takes the equivalent of five cons cells. Do > real implementations (i.e. GHC) actually work like that? If so, that's > enoug

Re: Splitting a string into groups of three characters

2005-08-08 Thread Gregory Piñero
I guess this question has already been thouroughly answered but here is my version: def split(string,n): outlist=[] for bottom in range(0,len(string),n): top=min(bottom+n,len(string)) outlist.append(string[bottom:top]) return outlist On 8/8/05, William Park <[EMAIL

Re: python for microcontrollers

2005-08-08 Thread Paul Rubin
Evil Bastard <[EMAIL PROTECTED]> writes: > Yes, this approach sucks. But can anyone offer any suggestions which > suck less? I don't think you want to do this. Runtime type tags and the overhead of checking them on every operation will kill you all by themselves. Processors like that haven't been

Re: python for microcontrollers

2005-08-08 Thread Guy Robinson
How about just helping this project: http://pyastra.sourceforge.net/ I know he's trying to rewrite it to work across multiple uC's (AVR,msp430 etc) HTH, Guy Evil Bastard wrote: > Hi all, > > I'm currently tackling the problem of implementing a python to assembler > compiler for PIC 18Fxxx mic

Re: Splitting a string into groups of three characters

2005-08-08 Thread John Machin
William Park wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>Hi, >> >>Is there a function that split a string into groups, containing an "x" >>amount of characters? >> >>Ex. >>TheFunction("Hello World",3) >> >>Returns: >> >>['Hell','o W','orl','d'] >> >> >>Any reply would be truly apprec

Re: python for microcontrollers

2005-08-08 Thread David Cuthbert
Paul Rubin wrote: > I don't think you want to do this. Runtime type tags and the overhead > of checking them on every operation will kill you all by themselves. > Processors like that haven't been used much as Lisp targets either, > for the same reasons. Pick a different language. I was thinking

Re: issues with doctest and threads

2005-08-08 Thread Tim Peters
[Michele Simionato] > I am getting a strange error with this script: > > $ cat doctest-threads.py > """ > >>> import time, threading > >>> def example(): > ... thread.out = [] > ... while thread.running: > ... time.sleep(.01) > ... thread.out.append(".") > >>> thread = threa

  1   2   >