Re: Splitting a string

2006-02-14 Thread Fredrik Lundh
Nico Grubert wrote: > I'd like to split a string where 'and', 'or', 'and not' occurs. > > Example string: > s = 'Smith, R. OR White OR Blue, T. AND Black AND Red AND NOT Green' > > I need to split s in order to get this list: > ['Smith, R.', 'White', 'Blue, T.', 'Back', 'Red', 'Green'] > > Any ide

Re: Splitting a string

2006-02-14 Thread Dylan Moreland
Take a look at: http://docs.python.org/lib/node115.html#l2h-878 So I would try something like: pat = re.compile(r" (?:AND|OR|AND NOT) ") pat.split(string) Compile the regular expression with re.IGNORECASE if you like. Nico Grubert wrote: > Dear Python users, > > I'd like to split a string wher

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Martin P. Hellwig
Roy Smith wrote: > Erik Max Francis <[EMAIL PROTECTED]> wrote: >> (A 2-tuple is an "ordered pair" in mathematics.) If a 2-tuple is a >> pair, then it would seem to follow that a 1-tuple is a single. > > Yeah, but an *ordered* single :-) > > A more interesting question is what do you call ()? A

Re: hard disk activity

2006-02-14 Thread Terry Hancock
On 13 Feb 2006 13:13:51 -0800 Paul Rubin <"http://phr.cx"@NOSPAM.invalid> wrote: > "VSmirk" <[EMAIL PROTECTED]> writes: > > Aweseme!!! I got as far as segmenting the large file on > > my own, and I ran out of ideas. I kind of thought about > > checksum, but I never put the two together. > > > >

Re: Splitting a string

2006-02-14 Thread Xie Yanbo
On 2/14/06, Nico Grubert <[EMAIL PROTECTED]> wrote: > Dear Python users, > > I'd like to split a string where 'and', 'or', 'and not' occurs. > > Example string: > s = 'Smith, R. OR White OR Blue, T. AND Black AND Red AND NOT Green' > > I need to split s in order to get this list: > ['Smith, R.', 'W

Re: Splitting a string

2006-02-14 Thread Fredrik Lundh
Dylan Moreland wrote: > So I would try something like: > > pat = re.compile(r" (?:AND|OR|AND NOT) ") > pat.split(string) footnote: this yields: ['Smith, R.', 'White', 'Blue, T.', 'Black', 'Red', 'NOT Green'] (the | operator picks the first (leftmost) alternative that results in an overall m

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Paddy
Hmm, I've found a term for a large tuple, a muckle: http://www.google.co.uk/search?hl=en&q=define%3Amuckle&btnG=Search&meta= Definitions of muckle on the Web: * batch: (often followed by `of') a large number or amount or extent; "a batch of letters"; "a deal of trouble"; "a lot of money"; "

Re: Splitting a string

2006-02-14 Thread Dylan Moreland
Woops! Thanks for the correction. I was assuming greediness for some reason. Fredrik Lundh wrote: > Dylan Moreland wrote: > > > So I would try something like: > > > > pat = re.compile(r" (?:AND|OR|AND NOT) ") > > pat.split(string) > > footnote: this yields: > > ['Smith, R.', 'White', 'Blue, T.

Re: Splitting a string

2006-02-14 Thread Peter Otten
Fredrik Lundh wrote: re.split("(?i)\s*(?:and not|and|or)\s*", s) > ['Smith, R.', 'White', 'Blue, T.', 'Black', 'Red', 'Green'] This fails for people with nasty names: >>> s = "James White or Andy Grove and Jack Orr and not James Grand" >>> re.split("(?i)\s*(?:and not|and|or)\s*", s) ['Jame

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Paddy
(dupple, supple, zupple) = (2,1,0) # :-) -- http://mail.python.org/mailman/listinfo/python-list

RE: How to get DVD Drive Name?

2006-02-14 Thread Tim Golden
[Robot] > How to get the DVD Drive name with Python? Since you're not giving many clues with that question, I'm going to guess that you're on Windows and that you want to know which of your drives is the DVD? Or, possibly, what the physical DVD description is. Assuming that's the case, you shoul

Re: Splitting a string

2006-02-14 Thread Paul Rubin
Nico Grubert <[EMAIL PROTECTED]> writes: > I'd like to split a string where 'and', 'or', 'and not' occurs. Other people have suggested how to do this splitting. But don't you really want a parser? -- http://mail.python.org/mailman/listinfo/python-list

Python / Apache / MySQL

2006-02-14 Thread vpr
Hi All I want to build an Website using Apache / Python and MySQL. I dont want to spend to much time hacking html. I'm looking for some recommendations e.g. should I be using mod_python ? whats the best module for mysql ? any suggestings so I could get my site up in a day ? [EMAIL PROTECTED] --

Re: Loop Backwards

2006-02-14 Thread bruno at modulix
Dave wrote: > This should be simple, but I can't get it: > > How do you loop backwards through a list? > > For example, in, say, Javascript: > > for (var i = list.length - 1; i >=0; i--) { > do_stuff() > } > > I mean, I could reverse the list, but I don't want to. I want it to > stay exact

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Alan Kennedy
[Terry Hancock] > So what's a 1-element tuple, anyway? A "mople"? "monople"? > It does seem like this lopsided pythonic creature (1,) ought > to have a name to reflect its ugly, newbie-unfriendly > nature. It's a "trip-you-uple", which you can pronounce anyway you like ;-) -- alan kennedy --

Re: Jedit

2006-02-14 Thread Doug Bromley
I've often wondered this. I was thinking more along the lines of a scriptable Python editor like Emacs. The only thing I've noticed is: CUTE - *nix only. - (http://cute.sourceforge.net/) PyEditor - (http://www.rexx.com/~dkuhlman/pyeditor_howto.html) ViImproved - (http://wiki.python.org/moin/ViImp

Re: Python / Apache / MySQL

2006-02-14 Thread bruno at modulix
vpr wrote: > Hi All > > I want to build an Website using Apache / Python and MySQL. Good choice, good choice, bad choice... Why not using PostgresSQL (if you need a *real* RDBMS) or SQLite (if you don't...) > I dont want to spend to much time hacking html. I'm looking for some > recommendations

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Erik Max Francis
Alan Kennedy wrote: > [Terry Hancock] >> So what's a 1-element tuple, anyway? A "mople"? "monople"? >> It does seem like this lopsided pythonic creature (1,) ought >> to have a name to reflect its ugly, newbie-unfriendly >> nature. > > It's a "trip-you-uple", which you can pronounce anyway you l

Xah's Edu Corner: accountability & lying thru the teeth

2006-02-14 Thread Xah Lee
here's a site: http://www.longbets.org/bets that takes socially important predictions. I might have to enter one or two. i longed for such a accountable predictions for a long time. Usually, some fucking fart will do predictions, but the problem is that it's not accountable. So, lots fuckhead moro

Re: Pythonic gui format?

2006-02-14 Thread bruno at modulix
DH wrote: > Bruno Desthuilliers wrote: > >>> I am currently seeking for pythonic alternative for XML. >> >> >> A pretty obvious one is dicts and lists. What about (Q&D): > > > That's like JSON: http://www.json.org/example.html No, it's pure Python. It happens that JSON looks pretty close to Py

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-14 Thread Ulrich Hobelmann
Xah Lee wrote: > here's a site: http://www.longbets.org/bets that takes socially > important predictions. I might have to enter one or two. > > i longed for such a accountable predictions for a long time. Usually, > some fucking fart will do predictions, but the problem is that it's not [...] OMG

Re: Python / Apache / MySQL

2006-02-14 Thread Kalle Anke
On Tue, 14 Feb 2006 10:32:34 +0100, Sybren Stuvel wrote (in article <[EMAIL PROTECTED]>): > I second Bruno: swap MySQL in favour of PostgreSQL. And the reason is ?? (apart from PostgreSQL being larger and more complete, what are the differences for "simple" usage?) jem -- http://

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-14 Thread Anno Siegel
Xah Lee <[EMAIL PROTECTED]> wrote in comp.lang.perl.misc: > ...a mechanism, so that any fuckhead tech geekers with their > loud cries will hurt badly when they open their mouths in public... Yeah, good idea! Anno -- If you want to post a followup via groups.google.com, don't use the broken "Rep

Re: Issues installing MySQL-python-0.3.5

2006-02-14 Thread Gerhard Häring
Sorry for the duplicate email, Keith. [EMAIL PROTECTED] wrote: > Hi, > > I am trying to use the Python MySQL APIs and have been attempting to > install the above software. > > I am using MySQL 5.0.18-standard with Python 2.4.1 > > I get errors on the build. Some searching showed that one of the

Re: 88k regex = RuntimeError

2006-02-14 Thread Diez B. Roggisch
> I assume it's hitting some limit, but don't know where the limit is to > remove it. I tried stepping into it repeatedly with Komodo, but didn't > see the problem. That's because it is buried in the C-library that is the actual implementation. There has been a discussion about this a few weeks ag

Re: Python / Apache / MySQL

2006-02-14 Thread bruno at modulix
Kalle Anke wrote: > On Tue, 14 Feb 2006 10:32:34 +0100, Sybren Stuvel wrote > (in article <[EMAIL PROTECTED]>): > > >>I second Bruno: swap MySQL in favour of PostgreSQL. > > > And the reason is ?? (apart from PostgreSQL being larger and more complete, > what are the differences for "simple" us

is socket thread safe?

2006-02-14 Thread e2wugui
thread1: while 1: buf = s.read() process(buf) thread2: while 1: buf = getdata() s.write(buf) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python / Apache / MySQL

2006-02-14 Thread Sybren Stuvel
vpr enlightened us with: > I want to build an Website using Apache / Python and MySQL. I second Bruno: swap MySQL in favour of PostgreSQL. > e.g. should I be using mod_python ? You could use my framework based on mod_python and Cheetah. I find it really easy to use. Check out http://www.unrealto

Re: get output of cmd-line command under MS windows

2006-02-14 Thread Fredrik Lundh
"calmar" wrote: > that was good, but on python2.4 > > subprocess is GREAT! e.g.: > > pipe = subprocess.Popen(tot, stdout=subprocess.PIPE,\ > stderr=subprocess.PIPE, shell=False) > message = pipe.stdout.read() > error = pipe.stderr.read() footnote: subprocess is available f

Re: cyclic data structures

2006-02-14 Thread Ewald R. de Wit
John Salerno wrote: > I'm having some slight trouble understanding exactly why this creates an > infinite loop: > > L = [1, 2] > L.append(L) I tried this with Python 2.3.5 and it handles this tailbiter in a very pleasantly surprising way: >>> l = [ 0, 1 ] >>> l.append( l ) >>> l [0, 1, [...]] >>

Re: 88k regex = RuntimeError

2006-02-14 Thread Tim N. van der Leeuw
Why don't you create a regex that finds for you all C function declarations (and which returns you the function-names); apply re.findall() to all files with that regex; and then check those funtion-names against the set of allSupported? You might even be able to find a regex for C funtion declarat

Re: Newbie

2006-02-14 Thread Magnus Lycka
LittlePython wrote: > Is this a good place to post python questions from newbie's, or would you > suggest another board? The best place to ask newbie questions is the Tutor mailing list. Go to http://mail.python.org/mailman/listinfo/tutor to subscribe. Check out the archives and you'll see how gre

Re: Python / Apache / MySQL

2006-02-14 Thread Peter Hansen
Kalle Anke wrote: > I always thought that a SQLlite database "belonged" to a single process, can > a database be used by several processes? Depending on what you mean by "belong", that's either true or false. Certainly multiple processes can access a SQLite database, although as the documentati

Re: Loop Backwards

2006-02-14 Thread Felipe Almeida Lessa
Em Ter, 2006-02-14 às 10:08 +0100, bruno at modulix escreveu: > for item in reversed(alist): > do_something_with(item) > > or (more perlish at first sight): > > for item in alist[::-1]: > do_something_with(item) No "or" here. The [::-1] version creates a whole new list in memory, it's silly

Re: listing attributes

2006-02-14 Thread Steven D'Aprano
On Mon, 13 Feb 2006 22:18:56 -0500, Peter Hansen wrote: > Thomas Girod wrote: >> I'm trying to get a list of attributes from a class. The dir() function >> seems to be convenient, but unfortunately it lists to much - i don't >> need the methods, neither the built-in variables. >> >> In fact, all

Re: 88k regex = RuntimeError

2006-02-14 Thread Kent Johnson
jodawi wrote: > I need to find a bunch of C function declarations by searching > thousands of source or html files for thousands of known function > names. My initial simple approach was to do this: > > rxAllSupported = re.compile(r"\b(" + "|".join(gAllSupported) + r")\b") > # giving a regex of

Re: Python / Apache / MySQL

2006-02-14 Thread Sybren Stuvel
Kalle Anke enlightened us with: > What about speed? I've always had the impression that while > PostgreSQL is more complete than MySQL it's also slower. For simple queries, I believe (no real knowledge here) MySQL is indeed faster. One of the problems I have with MySQL is that it doesn't support f

Re: Python / Apache / MySQL

2006-02-14 Thread Kalle Anke
On Tue, 14 Feb 2006 11:19:11 +0100, bruno at modulix wrote (in article <[EMAIL PROTECTED]>): > The reason is mostly that either you need a real, full-blown, rock-solid > RDBMS - which MySQL is definitively not - or you dont - in which case > SQLite is probably a much more lightweight and agile so

Re: get output of cmd-line command under MS windows

2006-02-14 Thread calmar
On 2006-02-08, Bernard Lebel <[EMAIL PROTECTED]> wrote: Hi Bernhard, > You should give a go to os.popen( ). Article > 6.1.2 and 6.1.3 in the Python Library doc. > that was good, but on python2.4 subprocess is GREAT! e.g.: pipe = subprocess.Popen(tot, stdout=subprocess.PIPE,\ s

Re: Python / Apache / MySQL

2006-02-14 Thread Kalle Anke
On Tue, 14 Feb 2006 12:04:45 +0100, Peter Hansen wrote (in article <[EMAIL PROTECTED]>): > SQLite. (As but one option, but "just basic selects" is certainly > included in the set of suitable conditions for SQLite use.) I've considered to use SQLite for an application but for completely differen

file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Sergey
Hello. I try to open file with pathname length 282 bytes: E:\files\..\something.dat On MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp) described method to access files with path length up to 32000 bytes: just add prefix \\?\ t

Re: Logging hangs thread after detaching a StreamHandler's terminal

2006-02-14 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Hi all, > > After many hours, I think I've found a bug in the logging module! > > If you add a (stdout) StreamHandler to a logger, then detach the > terminal for that stdout, subsequent calls to log() will hang the > calling thread. > > To reproduce this, write the follo

Re: 88k regex = RuntimeError

2006-02-14 Thread Peter Otten
jodawi wrote: > I need to find a bunch of C function declarations by searching > thousands of source or html files for thousands of known function > names. My initial simple approach was to do this: > > rxAllSupported = re.compile(r"\b(" + "|".join(gAllSupported) + r")\b") > # giving a regex of

Unexpected behaviour of getattr(obj, __dict__)

2006-02-14 Thread Steven D'Aprano
I came across this unexpected behaviour of getattr for new style classes. Example: >>> class Parrot(object): ... thing = [1,2,3] ... >>> getattr(Parrot, "thing") is Parrot.thing True >>> getattr(Parrot, "__dict__") is Parrot.__dict__ False I would have expected that the object returned by get

RE: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Tim Golden
[Sergey] | I try to open file with pathname length 282 bytes: | E:\files\..\something.dat | [... MS advise ...] just add prefix \\?\ to file name. | But when I try to pass prefixed name to file(), I get the | same result as when I don't add the prefix: file not found. With a fi

Re: Splitting a string

2006-02-14 Thread Christoph Zwerschke
Nico Grubert wrote: > I'd like to split a string where 'and', 'or', 'and not' occurs. > Example string: > s = 'Smith, R. OR White OR Blue, T. AND Black AND Red AND NOT Green' Here is a solution without using the re module: s.replace(' AND NOT ', ' OR ').replace(' AND ', ' OR ').split(' OR ') --

Re: is socket thread safe?

2006-02-14 Thread Rene Pijlman
[EMAIL PROTECTED]: >[code] I certainly expect socket to be threadsafe. I use it (via urllib2/httplib) in a multithreaded program, that runs fine with Python 2.3 and 2.4 on both Windows XP and Linux. -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Sergey
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Sergey] >But note that r prefix to the string. Is it possible >that your string didn't include it? If not, then the >backslash character which Windows uses as a separator >can be stolen by Python which sees it as an escapin

Re: Cygwin IDLE has no menu bar

2006-02-14 Thread Jason Tishler
Steve, On Mon, Feb 13, 2006 at 11:14:03PM -0500, Steve Holden wrote: > I just wondered whether anyone has seen this problem: Yes, this is a known problem: http://sf.net/tracker/?func=detail&atid=105470&aid=786827&group_id=5470 > and fixed it. Unfortunately, no. Jason -- PGP/GPG Key: htt

RE: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Tim Golden
[Sergey] | "Tim Golden" <[EMAIL PROTECTED]> wrote in | message news:[EMAIL PROTECTED] | [Sergey] | | >But note that r prefix to the string. Is it possible | >that your string didn't include it? If not, then the | >backslash character which Windows uses as a separator | >can be stolen by Python w

Re: Unexpected behaviour of getattr(obj, __dict__)

2006-02-14 Thread bruno at modulix
Steven D'Aprano wrote: > I came across this unexpected behaviour of getattr for new style classes. > Example: > > class Parrot(object): > > ... thing = [1,2,3] > ... > getattr(Parrot, "thing") is Parrot.thing > > True > getattr(Parrot, "__dict__") is Parrot.__dict__ > > False

Re: listing attributes

2006-02-14 Thread Christoph Zwerschke
Steven D'Aprano wrote: > However it is easy to use introspection to get what you need. So just for completeness sake, what Thomas probably wants is the following: from types import MethodType def attributes(obj): return [attr for attr in dir(obj) if not attr.startswith('__') and n

Re: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Steven D'Aprano
On Tue, 14 Feb 2006 22:43:50 +1100, Steven D'Aprano wrote: > On Tue, 14 Feb 2006 14:29:44 +0300, Sergey wrote: > >> Hello. >> >> I try to open file with pathname length 282 bytes: >> E:\files\..\something.dat >> >> On MSDN >> (http://msdn.microsoft.com/library/default.asp?url=/

Re: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Sergey
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Sergey] >Not to state the obvious, but can you cut-and-paste that long >string (the one starting with \\?\e:\...) from the Python >interpreter into the [S]tart [R]un [O]pen field to see what >comes up? I'm just trying to ma

Re: Unexpected behaviour of getattr(obj, __dict__)

2006-02-14 Thread Raymond Hettinger
Steven D'Aprano wrote: > I came across this unexpected behaviour of getattr for new style classes. > Example: > > >>> class Parrot(object): > ... thing = [1,2,3] > ... > >>> getattr(Parrot, "thing") is Parrot.thing > True > >>> getattr(Parrot, "__dict__") is Parrot.__dict__ > False > > I would

Re: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Sergey
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are you passing a unicode object to the function? > > f = file(u"E:\\files\\...\\something.dat", "r") I pass variable c into functions: >>> c u'.\\e:\\files\\\u041f\u0420\u041e\u0414\u041e \u041c\u0435\u043d\u043

Re: Pythonic gui format?

2006-02-14 Thread Christoph Zwerschke
Bruno Desthuilliers schrieb: > Gregory Petrosyan a écrit : >> I am currently seeking for pythonic alternative for XML. > > A pretty obvious one is dicts and lists. What about (Q&D): > > window = { > 'title' : 'Hello World!' > 'image' : {'text' :"nice picture here", > ... I think this is pret

Re: [OT] Pythonic gui format?

2006-02-14 Thread bruno at modulix
Christoph Zwerschke wrote: > Bruno Desthuilliers schrieb: > >> Gregory Petrosyan a écrit : >> >>> I am currently seeking for pythonic alternative for XML. >> >> (snip) > Bruno, before writing another simple GUI, Sorry, Christoph, wrong attribution !-) -- bruno desthuilliers python -c "pr

Re: Splitting a string

2006-02-14 Thread Nico Grubert
> re.split("(?i)\s*(and not|and|or)\s*", s) Thanks, Frederik for the step by step howto! And also thanks to you, Dylan. re.split("(?i)\s*(and not|and|or)\s*", s) is almost right. I changed it to: words = re.split("(?i)\s*( and not | and | or )\s*", s) in order to handle words containing "or"

Re: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Steven D'Aprano
On Tue, 14 Feb 2006 14:29:44 +0300, Sergey wrote: > Hello. > > I try to open file with pathname length 282 bytes: > E:\files\..\something.dat > > On MSDN > (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp) > described method to acces

Re: Unexpected behaviour of getattr(obj, __dict__)

2006-02-14 Thread Steven D'Aprano
On Tue, 14 Feb 2006 04:11:52 -0800, Raymond Hettinger wrote: > Steven D'Aprano wrote: >> I came across this unexpected behaviour of getattr for new style classes. >> Example: >> >> >>> class Parrot(object): >> ... thing = [1,2,3] >> ... >> >>> getattr(Parrot, "thing") is Parrot.thing >> True >

Re: Unexpected behaviour of getattr(obj, __dict__)

2006-02-14 Thread Carl Banks
Raymond Hettinger wrote: > Steven D'Aprano wrote: > > I came across this unexpected behaviour of getattr for new style classes. > > Example: > > > > >>> class Parrot(object): > > ... thing = [1,2,3] > > ... > > >>> getattr(Parrot, "thing") is Parrot.thing > > True > > >>> getattr(Parrot, "__dic

Re: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Sergey
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Sergey] >Not to state the obvious, but can you cut-and-paste that long >string (the one starting with \\?\e:\...) from the Python >interpreter into the [S]tart [R]un [O]pen field to see what >comes up? I'm just trying to ma

Re: Unexpected behaviour of getattr(obj, __dict__)

2006-02-14 Thread Fredrik Lundh
Steven D'Aprano wrote: > >class Parrot(object): > >> > >> ... thing = [1,2,3] > >> ... > >> > >getattr(Parrot, "thing") is Parrot.thing > >> > >> True > >> > >getattr(Parrot, "__dict__") is Parrot.__dict__ > >> > >> False > > > > > > hint: > getattr(object, '__dict__') > > >

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Christoph Zwerschke
[EMAIL PROTECTED] schrieb: > Then we went to hear Guido speak about Python 2.2 at a ZPUG meeting in > Washington, DC. When he said toople I almost fell out of my chair > laughing, particularly because the people who taught me to say it the > "right" way were with me. When I looked over, they just

Re: Unexpected behaviour of getattr(obj, __dict__)

2006-02-14 Thread Steven D'Aprano
On Tue, 14 Feb 2006 13:03:17 +0100, bruno at modulix wrote: > Steven D'Aprano wrote: >> I came across this unexpected behaviour of getattr for new style classes. >> Example: >> >> >class Parrot(object): >> >> ... thing = [1,2,3] >> ... >> >getattr(Parrot, "thing") is Parrot.thing >

Re: Pythonic gui format?

2006-02-14 Thread Gregory Petrosyan
> > Isn't it ugly a bit? >I'd even say 'ugly 16-bits' !-) You are right of course. Those "examples" are really bad, and, most of all, really un-pythonic. Thanks for JSON. It's more clean&simple than XML, but my main idea is to remove any extra layer between Python and GUI. I want all GUI elemen

Re: python-ldap

2006-02-14 Thread Christos Georgiou
On 13 Feb 2006 11:11:05 -0800, rumours say that "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> might have written: >hy... >if you dont know how to help people here... dont say "google it". I never said "google it". I presume you mean this post as a reply to all other posters in this thread, right? An

Re: Cygwin IDLE has no menu bar

2006-02-14 Thread Thorsten Kampe
* Steve Holden (2006-02-14 04:14 +0100) > I just wondered whether anyone has seen this problem and fixed it. An > IDLE with no menu bar isn't much use ... It's not fixed but the workaround is "idle -n" -- http://mail.python.org/mailman/listinfo/python-list

RE: file names longer than MAX_PATH under Windows 2003

2006-02-14 Thread Tim Golden
[Sergey] | "Tim Golden" <[EMAIL PROTECTED]> wrote in | message news:[EMAIL PROTECTED] | [Sergey] | | >Not to state the obvious, but can you cut-and-paste that long | >string (the one starting with \\?\e:\...) from the Python | >interpreter into the [S]tart [R]un [O]pen field to see what | >comes

Helpful replies (was Re: python-ldap)

2006-02-14 Thread Christos Georgiou
On Tue, 07 Feb 2006 12:36:11 -0500, rumours say that Steve Holden <[EMAIL PROTECTED]> might have written: >[EMAIL PROTECTED] wrote: >> y0! >> >> >> >> tks! >gOOgl3, man > >PS: We tend to speak English here :-) Actually, we tend to speak whatever language the OP's experience suggests. I reme

Re: listing attributes

2006-02-14 Thread Thomas Girod
Thanks a lot for all your answers ! Thanks to you I resolved this problem. Here is what i've done : [...] for (_,v) in getmembers(self): if isinstance(v,Property): st += "\t%s\n" % str(v) [...] as all the attributes I want to get are instances of Property or a subclass of Property,

Re: Pythonic gui format?

2006-02-14 Thread DH
bruno at modulix wrote: > DH wrote: >> Bruno Desthuilliers wrote: >> I am currently seeking for pythonic alternative for XML. >>> >>> A pretty obvious one is dicts and lists. What about (Q&D): >> >> That's like JSON: http://www.json.org/example.html > > No, it's pure Python. It happens that

Re: Pythonic gui format?

2006-02-14 Thread DH
Gregory Petrosyan wrote: > Thanks for JSON. It's more clean&simple than XML, but my main idea is > to remove any extra layer between Python and GUI. I want all GUI > elements/data to be directly accessible from Python (without extra > libraries). Since JSON is just python dicts and lists, you don'

Re: Pythonic gui format?

2006-02-14 Thread bruno at modulix
DH wrote: > bruno at modulix wrote: > >> DH wrote: >> >>> Bruno Desthuilliers wrote: >>> > I am currently seeking for pythonic alternative for XML. A pretty obvious one is dicts and lists. What about (Q&D): >>> >>> >>> That's like JSON: http://www.json.org/example.html >> >> >>

Re: hard disk activity

2006-02-14 Thread VSmirk
Terry, Yeah, I was sketching out a scenario much like that. It does break things down pretty well, and that gets my file sync scenario up to much larger files. Even if many changes are made to a file, if you keep track of the number of bytes and checksum over from 1 to the number of bytes differ

Re: Pythonic gui format?

2006-02-14 Thread bruno at modulix
DH wrote: > Gregory Petrosyan wrote: > >> Thanks for JSON. It's more clean&simple than XML, but my main idea is >> to remove any extra layer between Python and GUI. I want all GUI >> elements/data to be directly accessible from Python (without extra >> libraries). > > Since JSON is just python d

Re: 88k regex = RuntimeError

2006-02-14 Thread Tim N. van der Leeuw
This is basically the same idea as what I tried to describe in my previous post but without any samples. I wonder if it's more efficient to create a new list using a list-comprehension, and checking each entry against the 'wanted' set, or to create a new set which is the intersection of set 'wanted

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-14 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Hi, > Is it true that that "Python 3000" is dead ? > Honestly I think that e.g. changing 5/2 to be 2.5 (instead of 2) would > just break to much code :-( > On the otherhand I'm using Python as "Matlab replacement" and would > generally like 5/2 ==2.5 > >... It's Comp. S

Re: Python / Apache / MySQL

2006-02-14 Thread Luis M. González
Just a few comments... Database: As with anything else, try to keep it simple until you need to make it complex. Sqlite is the simplier alternative, and it's also the fastest for the intended use (small number of users, simple selects, etc). MySQL is also a very good alternative and much more powe

Re: Pythonic gui format?

2006-02-14 Thread bruno at modulix
Gregory Petrosyan wrote: >>>Isn't it ugly a bit? >> >>I'd even say 'ugly 16-bits' !-) > > > You are right of course. Those "examples" are really bad, and, most > of all, really un-pythonic. > > Thanks for JSON. It's more clean&simple than XML, but my main idea is > to remove any extra layer be

Re: listing attributes

2006-02-14 Thread Peter Hansen
Steven D'Aprano wrote: > On Mon, 13 Feb 2006 22:18:56 -0500, Peter Hansen wrote: >>Thomas Girod wrote: >>>I'm trying to get a list of attributes from a class. The dir() function >>>seems to be convenient, but unfortunately it lists to much - i don't >>>need the methods, neither the built-in variabl

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-14 Thread John Thingstad
On Tue, 14 Feb 2006 10:33:49 +0100, Xah Lee <[EMAIL PROTECTED]> wrote: > i longed for such a accountable predictions for a long time. Usually, > some fucking fart will do predictions, but the problem is that it's not > accountable. So, lots fuckhead morons in the IT industry will shout > ... Fin

Re: Python / Apache / MySQL

2006-02-14 Thread Peter Hansen
Kalle Anke wrote: > On Tue, 14 Feb 2006 12:04:45 +0100, Peter Hansen wrote: >>Don't optimize prematurely? If you use something like SQLObject, or any >>other means of abstracting yourself away from the details of a specific >>datbase, you won't be particularly tied to it if you decide you need

Re: Is python very slow compared to C

2006-02-14 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: . . . >Javascript has leveraged its early advantage in the Netscape browser to >become the only "universally available" language for client-side "in the >

Embedding an Application in a Web browser

2006-02-14 Thread rodmc
Is it possible to embed a Python application within Internet explorer? If so how do people recommend going about it. As for the application it has to be able display simple animated graphics such as circles, lines and squares. However if someone clicks on a shape it should open up another applicat

Re: 88k regex = RuntimeError

2006-02-14 Thread Peter Otten
Tim N. van der Leeuw wrote: > This is basically the same idea as what I tried to describe in my > previous post but without any samples. > I wonder if it's more efficient to create a new list using a > list-comprehension, and checking each entry against the 'wanted' set, > or to create a new set w

Embedding an Application in a Web browser

2006-02-14 Thread Daniel Nogradi
> Is it possible to embed a Python application within Internet explorer? > If so how do people recommend going about it. > > As for the application it has to be able display simple animated > graphics such as circles, lines and squares. However if someone clicks > on a shape it should open up anoth

Re: Rethinking the Python tutorial

2006-02-14 Thread Magnus Lycka
A.M. Kuchling wrote: > On Mon, 13 Feb 2006 11:03:55 -0500, > Steve Holden <[EMAIL PROTECTED]> wrote: >>What we are talking about here is a Python Language Users' Guide. > > I actually started on such a document over the holidays, but have only > described about 3 or 4 statements at this poi

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Tim Peters
[EMAIL PROTECTED] > ... > I work with Guido now and I'm conflicted. I'm still conditioned to say > tuhple. Whenever he says toople, I just get a smile on my face. I > think most of the PythonLabs guys pronounce it toople. "tuhple" is a girly-man affectation. That's why Guido and I both say the

Re: Embedding an Application in a Web browser

2006-02-14 Thread SamFeltus
Didn't ActiveState or somebody have a Python plugin to run Python on IE? -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Rocco Moretti
Erik Max Francis wrote: > If a 4-tuple is a quadruple, a 3-tuple is a triple, a > 2-tuple is an pair, then I guess a 1-tuple would be a single. Granted > that's not nearly as gruesome enough a name to go with the special > lopsided Pythonic creature mentioned above. I suggest we name it a > h

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Roy Smith
Tim Peters <[EMAIL PROTECTED]> wrote: > the-acid-test-is-whether-you-say-"xor"-with-one-syllable-or-three-ly y'rs I pronounce it with two. -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding an Application in a Web browser

2006-02-14 Thread Tim N. van der Leeuw
'A' Web Browser? Meaning: any random web-browser? Or specifically and *only* Internet Explorer? If you want it to work only and ever only in Internet Explorer, then you can create a Python ActiveX object and embed that in your page; using the pythonwin extensions. Cheers, --Tim -- http://mail.

Re: Embedding an Application in a Web browser

2006-02-14 Thread SamFeltus
Perhaps IronPython could be hacked in somehow also? Seems like it might could. -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding an Application in a Web browser

2006-02-14 Thread SamFeltus
Perhaps IronPython could be hacked in somehow also? Seems like it might could. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-14 Thread Gregory Piñero
On 14 Feb 2006 06:44:02 -0800, [EMAIL PROTECTED] > 5./2.=2.5 is floating point math, with all the round off errors that > incorporates. Thanks Curtis, I never knew that trick. I guess for variables do have true division you have to make them floats? e.g. float(var1)/float(var2)? Or do you know

Re: Embedding an Application in a Web browser

2006-02-14 Thread bruno at modulix
rodmc wrote: > Is it possible to embed a Python application within Internet explorer? No. Nor in any other browser (except from Grail, but I think this doesn't count). > If so how do people recommend going about it. Either write a rich client app or a real web application. > As for the applicat

Re: how do you pronounce 'tuple'?

2006-02-14 Thread John Salerno
Tim Peters wrote: > "tuhple" is a girly-man affectation. That's why Guido and I both say > the manly "toople". Heh heh. Actually, 'toople' sounds like a noun to me, and 'tuple' sounds like a verb, so I prefer 'toople' anyway. -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you pronounce 'tuple'?

2006-02-14 Thread John Salerno
::snip a thousand responses:: Well, I'm certainly glad I brought it up. :) -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >