Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-28 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: Wouldn't it have been better to define tuples with <>'s or {}'s or something else to avoid this confusion?? The way I see it, tuples are just a way of having a function return multiple values at once. When you think of them that way, you don't even need parenthesis: def

Re: Problem in threading

2004-12-29 Thread Binu K S
You haven't split the task between the threads here. loops should be set to [2500,2500] for a correct comparison. On a single processor system, a tight loop like the one you are testing will at best show the same time as the non-threaded case. Most likely the threaded version will take more time o

Re: Wikipedia - conversion of in SQL database stored data to HTML

2005-03-21 Thread Leif K-Brooks
Claudio Grondi wrote: Is there an already available script/tool able to extract records and generate proper HTML code out of the data stored in the Wikipedia SQL data base? They're not in Python, but there are a couple of tools available here: . By the way: has someone suc

Re: Python docs [was: function with a state]

2005-03-24 Thread Leif K-Brooks
Xah Lee wrote: The word âobjectâ has generic English meaning as well might have very technical meaning in a language. In Python, it does not have very pronounced technical meaning. For example, there's a chapter in Python Library Ref titled â2. Built-In Objectsâ, and under it a section â2.1 Built-i

Re: Specifying __slots__ in a dynamically generated type

2005-03-27 Thread Leif K-Brooks
Ron Garret wrote: I need to dynamically generate new types at run time. I can do this in two ways. I can use the "type" constructor, or I can generate a "class" statement as a string and feed that to the exec function. The former technique is much cleaner all else being equal, but I want to b

Re: __init__ method and raising exceptions

2005-03-31 Thread Leif K-Brooks
NavyJay wrote: I have a simple for-loop, which instantiates a class object each iteration. As part of my class constructor, __init__(), I check for valid input settings. If there is a problem with this iteration, I want to abort the loop, but equivalently 'continue' on in the for-loop. I can't us

Re: Simple thread-safe counter?

2005-04-02 Thread Leif K-Brooks
Artie Gold wrote: Skip Montanaro wrote: counter = Queue.Queue() def f(): i = counter.get() I think you need: i = counter.get(True) The default value for the "block" argument to Queue.get is True. -- http://mail.python.org/mailman/listinfo/python-list

Re: Use string in URLs

2005-04-07 Thread Leif K-Brooks
Markus Franz wrote: I want to use the string "rüffer" in a get-request, so I tried to encode it. My problem: But with urllib.quote I always get "r%FCffer", but I want to get "r%C3%BCffer" (with is correct in my opinion). urllib.quote(u'rüffer'.encode('utf8')) -- http://mail.python.org/mailman/li

Re: How to name Exceptions that aren't Errors

2005-04-08 Thread Leif K-Brooks
Steve Holden wrote: I've even used an exception called Continue to overcome an irksome restriction in the language (you used not to be able to continue a loop from an except clause). Out of curiosity, how could you use an exception to do that? I would think you would need to catch it and then use

Re: unknown encoding problem

2005-04-08 Thread Leif K-Brooks
Uwe Mayer wrote: Hi, I need to read in a text file which seems to be stored in some unknown encoding. Opening and reading the files content returns: f.read() '\x00 \x00 \x00<\x00l\x00o\x00g\x00E\x00n\x00t\x00r\x00y\x00... Each character has a \x00 prepended to it. I suspect its some kind of unicod

Re: text processing problem

2005-04-08 Thread Leif K-Brooks
Maurice LING wrote: I'm looking for a way to do this: I need to scan a text (paragraph or so) and look for occurrences of " ()". That is, if the text just before the open bracket is the same as the text in the brackets, then I have to delete the brackets, with the text in it. How's this? import

Why does StringIO discard its initial value?

2005-04-10 Thread Leif K-Brooks
When StringIO gets an initial value passed to its constructor, it seems to discard it after the first call to .write(). For instance: >>> from StringIO import StringIO >>> buffer = StringIO('foo') >>> buffer.getvalue() 'foo' >>> buffer.write('bar') >>> buffer.getvalue() 'bar' >>> buffer.write('ba

Re: pre-PEP: Simple Thunks

2005-04-15 Thread Leif K-Brooks
Brian Sabbey wrote: Thunk statements contain a new keyword, 'do', as in the example below. The body of the thunk is the suite in the 'do' statement; it gets passed to the function appearing next to 'do'. The thunk gets inserted as the first argument to the function, reminiscent of the way 'self'

Re: pre-PEP: Suite-Based Keywords

2005-04-15 Thread Leif K-Brooks
Brian Sabbey wrote: class C(object): x = property(): doc = "I'm the 'x' property." def fget(self): return self.__x def fset(self, value): self.__x = value def fdel(self): del self.__x After seeing this example, I think I'll go on a killing spree

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
Lad wrote: Is anyone capable of providing Python advantages over PHP if there are any? Python is a programming language in more ways than simple Turing completeness. PHP isn't. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
Mage wrote: However one of the worst cases is the sql injection attack. And sql injections must be handled neither by php nor by python but by the programmer. But Python's DB-API (the standard way to connect to an SQL database from Python) makes escaping SQL strings automatic. You can do this: cu

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
John Bokma wrote: Not. Perl and Java use similar methods where one can specify place holders, and pass on the data unescaped. But still injection is possible. How? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
John Bokma wrote: my $sort = $cgi->param( "sort" ); my $query = "SELECT * FROM table WHERE id=? ORDER BY $sort"; And the equivalent Python code: cursor.execute('SELECT * FROM table WHERE id=%%s ORDER BY %s' % sort, [some_id]) You're right, of course, about being *able* to write code with SQL inj

Re: Python or PHP?

2005-04-23 Thread Leif K-Brooks
Peter Ammon wrote: I'm bewildered why you haven't mentioned magic quotes. A one line change to the configuration file can render your PHP site almost entirely immune to SQL injection attacks. PHP's magic quotes is one of the most poorly-designed features I can think of. Instead of magically esc

Re: HTML cleaner?

2005-04-25 Thread Leif K-Brooks
Ivan Voras wrote: Is there a HTML clean/tidy library or module written in pure python? I found mxTidy, but it's a interface to command-line tool. What I'm searching is something that will accept a list of allowed tags and/or attributes and strip the rest from HTML string. Here's a module I wrote

Re: Order of elements in a dict

2005-04-26 Thread Leif K-Brooks
Marcio Rosa da Silva wrote: So, my question is: if I use keys() and values() it will give me the keys and values in the same order? It should work fine with the current implementation of dictionaries, but (AFAIK) it's not guaranteed to work by the mapping protocol. So theoretically, it could bre

Re: Reusing object methods?

2005-04-29 Thread Leif K-Brooks
Ivan Voras wrote: I want to 'reuse' the same method from class A in class B, and without introducing a common ancestor for both of them - is this possible in an elegant, straightforward way? >>> import new >>> >>> class A: ... def foo(self): ... print "Hello, %s!" % self.__class__.__n

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-30 Thread Leif K-Brooks
pythonchallenge wrote: For the riddles' lovers among you, you are most invited to take part in the Python Challenge, the first python programming riddle on the net. You are invited to take part in it at: http://www.pythonchallenge.com Very neat, I love things like this. Level 5 is maddening. Keep u

Re: Explaining names vs variables in Python

2016-03-02 Thread Jesper K Brogaard
understand it, when you use 'is', you are comparing addresses to objects, not the values contained in the objects. Use '==' instead. Take a look here as well: https://docs.python.org/3.5/reference/datamodel.html -- Venlig hilsen / Best regards Jesper K. Brogaard (remove upper

Re: Export

2016-03-13 Thread Jesper K Brogaard
Den 13-03-2016 kl. 00:07 skrev Herbert Müller: Hello, how can I export my .py files to .exe files? Thanks for your support Your Robert Look at pyinstaller or py2exe. I have no experience with either of them. -- Venlig hilsen / Best regards Jesper K. Brogaard (remove upper case letters in my

Re: pdf version of python tutorial

2016-03-14 Thread Jesper K Brogaard
://docs.python.org/3.5/download.html. I found the tutorial in the zip-file "PDF(A4 paper size)", which contains a lot of PDFs, amongst these many of howto-documents. -- Venlig hilsen / Best regards Jesper K. Brogaard (remove upper case letters in my e-mail address) -- https://mail.python.o

property confusion

2014-02-21 Thread K Richard Pixley
Could someone please explain to me why the two values at the bottom of this example are different? Python-3.3 if it makes any difference. Is this a difference in evaluation between a class attribute and an instance attribute? --rich class C: def __init__(self): self._x = None

Teaching python to non-programmers

2014-04-10 Thread Lalitha Prasad K
Dear List Recently I was requested to teach python to a group of students of GIS (Geographic Information Systems). Their knowledge of programming is zero. The objective is to enable them to write plug-ins for GIS software like QGIS and ArcGIS. It would require them to learn, besides core python, P

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Steven K Knight
June 8 2015 3:11 PM, "Skip Montanaro" wrote: I have so far ignored the new string formatting (you know, the stuff with all the braces, dots and brackets that make Python strings look like Perl code ). I am still only using Python 2.7, but have recently started forcing myself to use the

Why are Sphinx docs incompatible with Safari Reader?

2011-12-02 Thread K . -Michael Aye
Anybody knows? Have a nice weekend! Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: I love the decorator in Python!!!

2011-12-08 Thread K . -Michael Aye
On 2011-12-08 08:59:26 +, Thomas Rachel said: Am 08.12.2011 08:18 schrieb 8 Dihedral: I use the @ decorator to behave exactly like a c macro that does have fewer side effects. I am wondering is there other interesting methods to do the jobs in Python? In combination with a generator,

Re: I love the decorator in Python!!!

2011-12-08 Thread K . -Michael Aye
On 2011-12-08 11:43:12 +, Chris Angelico said: On Thu, Dec 8, 2011 at 10:22 PM, K.-Michael Aye wrote: I am still perplexed about decorators though, am happily using Python for many years without them, but maybe i am missing something? For example in the above case, if I want the names

confused about __new__

2011-12-26 Thread K. Richard Pixley
I'm confused about the following. The idea here is that the set of instances of some class are small and finite, so I'd like to create them at class creation time, then hijack __new__ to simply return one of the preexisting classes instead of creating a new one each call. This seems to work i

Re: confused about __new__

2011-12-26 Thread K Richard Pixley
On 12/26/11 20:53 , Steven D'Aprano wrote: On Mon, 26 Dec 2011 20:28:26 -0800, K. Richard Pixley wrote: I'm confused about the following. The idea here is that the set of instances of some class are small and finite, so I'd like to create them at class creation time, then hi

Re: confused about __new__

2011-12-27 Thread K Richard Pixley
On 12/26/11 21:48 , Fredrik Tolf wrote: On Mon, 26 Dec 2011, K. Richard Pixley wrote: I don't understand. Can anyone explain? I'm also a bit confused about __new__. I'd very much appreciate it if someone could explain the following aspects of it: * The manual (<http

Re: Python education survey

2011-12-27 Thread K Richard Pixley
On 12/19/11 19:51 , Raymond Hettinger wrote: Do you use IDLE when teaching Python? If not, what is the tool of choice? If your goal is to quickly get new users up and running in Python, what IDE or editor do you recommend? I would: a) let the students pick their own editor. b) encourage ema

Re: confused about __new__

2011-12-27 Thread K Richard Pixley
On 12/27/11 10:28 , Ian Kelly wrote: On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixley wrote: The conceptual leap for me was in recognizing that a class is just an object. The best way, (imo, so far), to create a singleton in python is to use the class itself as the singleton rather than

Re: Python education survey

2011-12-27 Thread K Richard Pixley
On 12/27/11 10:21 , Rick Johnson wrote: On Dec 27, 11:59 am, K Richard Pixley wrote: The problem is that IDLE is hard to set up. (I've never managed it and I'm a well seasoned veteran). Can you qualify that statement? Do you mean "difficult to set up on certain OS's&q

Re: Python education survey

2011-12-27 Thread K Richard Pixley
On 12/27/11 10:26 , Andrew Berg wrote: On 12/27/2011 11:59 AM, K Richard Pixley wrote: You'd do better to encourage eclipse, but setting that up isn't trivial either. IIRC, all I had to do to set up PyDev was copy a URL to Eclipse's "Install New Software" wizard, and

Re: confused about __new__

2011-12-27 Thread K Richard Pixley
On 12/27/11 12:34 , Ian Kelly wrote: On Tue, Dec 27, 2011 at 1:31 PM, K Richard Pixley wrote: On 12/27/11 10:28 , Ian Kelly wrote: On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixleywrote: The conceptual leap for me was in recognizing that a class is just an object. The best way, (imo

Re: Which library for audio playback ?

2011-12-30 Thread K Richard Pixley
On 12/29/11 05:55 , Jérôme wrote: I'm writing a small application that plays sound through the speakers. The sounds are juste sine waves of arbitrary frequency I create in the code, not sample .wav files. I didn't expect the choice for an audio library to be that complicated. There are several l

Re: Generating sin/square waves sound

2011-12-30 Thread K Richard Pixley
On 12/29/11 23:17 , Paulo da Silva wrote: Hi, Sorry if this is a FAQ, but I have googled and didn't find any satisfatory answer. Is there a simple way, preferably multiplataform (or linux), of generating sinusoidal/square waves sound in python? Thanks for any answers/suggestions. I just poste

readline for mac python? (really, reproducing mac python packages)

2012-01-01 Thread K Richard Pixley
I'm having trouble finding a reasonable python environment on mac. The supplied binaries, (2.7.2, 3.2.2), are built with old versions of macosx and are not capable of building any third party packages that require gcc. The source builds easily enough out of the box, (./configure --enable-fra

Re: readline for mac python? (really, reproducing mac python packages)

2012-01-01 Thread K Richard Pixley
On 1/1/12 16:49 , K Richard Pixley wrote: I'm having trouble finding a reasonable python environment on mac. The supplied binaries, (2.7.2, 3.2.2), are built with old versions of macosx and are not capable of building any third party packages that require gcc. The source builds easily e

Re: readline for mac python? (really, reproducing mac python packages)

2012-01-02 Thread K Richard Pixley
On 1/1/12 19:04 , K Richard Pixley wrote: On 1/1/12 16:49 , K Richard Pixley wrote: I'm having trouble finding a reasonable python environment on mac. The supplied binaries, (2.7.2, 3.2.2), are built with old versions of macosx and are not capable of building any third party packages

Python3 on MacOsX Lion?

2012-01-02 Thread K Richard Pixley
Where would I look to find the current expected status of python3 on MacOsX Lion? The distributed binaries aren't capable of allowing extensions that use gcc. I can build the source naked, but then it lacks some libraries, notably, readline. Attempting to build the full Mac packages fails, e

Re: Python3 on MacOsX Lion?

2012-01-02 Thread K Richard Pixley
On 1/2/12 13:03 , Benjamin Kaplan wrote: On Mon, Jan 2, 2012 at 2:32 PM, K Richard Pixley wrote: Where would I look to find the current expected status of python3 on MacOsX Lion? The distributed binaries aren't capable of allowing extensions that use gcc. I can build the source naked

Re: help me get excited about python 3

2012-01-05 Thread K Richard Pixley
You get some of the good stuff by importing future, unicode literals which essentially means you're working in unicode by default most of the time, and print function, (a small fix but long overdue). I try to write python3 whenever I can. It's rare that dependencies keep me back. More often

socketserver question

2012-01-05 Thread K Richard Pixley
Once I've instantiated my server class, along with a handler class, called server.serve_forever(), handler.handle() has been called, I've done my work, and I'm ready to shut the whole thing down... How do I do that? The doc says server.shutdown(), but if I call self.server.shutdown() from wit

Re: codecs in a chroot / without fs access

2012-01-10 Thread K Richard Pixley
On 1/9/12 16:41 , Philipp Hagemeister wrote: I want to forbid my application to access the filesystem. The easiest way seems to be chrooting and droping privileges. However, surprisingly, python loads the codecs from the filesystem on-demand, which makes my program crash: import os os.getuid()

Re: Two questions about logging

2012-01-12 Thread K Richard Pixley
On 1/11/12 18:19 , Matthew Pounsett wrote: Second, I'm trying to get a handle on how libraries are meant to integrate with the applications that use them. The naming advice in the advanced tutorial is to use __name__ to name loggers, and to allow log messages to pass back up to the using applica

Re: stable object serialization to text file

2012-01-12 Thread K Richard Pixley
On 1/11/12 12:16 , Máté Koch wrote: Hello All, I'm developing an app which stores the data in file system database. The data in my case consists of large python objects, mostly dicts, containing texts and numbers. The easiest way to dump and load them would be pickle, but I have a problem wit

Re: OO in Python? ^^

2005-12-10 Thread Leif K-Brooks
Heiko Wundram wrote: > Fredrik Lundh wrote: >>Matthias Kaeppler wrote: >>>polymorphism seems to be missing in Python >> >>QOTW! > > Let's have some UQOTW: the un-quote of the week! ;-) +1 -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Leif K-Brooks
Chris Song wrote: > Here's my solution > > _unicodeRe = re.compile("(\\\u[\da-f]{4})") > def unisub(mo): > return unichr(int(mo.group(1)[2:],16)) > > unicodeStrFromNetwork = '\u5927' > unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) > > But I think there must be a more straigh

ANN: Leo 4.4a5 released

2006-01-06 Thread Edward K. Ream
ge.net/project/showfiles.php?group_id=3458 CVS: http://sourceforge.net/cvs/?group_id=3458 Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream January 6, 2006 ---- Edward K. Ream email: [EMAIL PROTEC

ANN: Leo 4.4b1 released

2006-01-17 Thread Edward K. Ream
mleo/front.html Home: http://sourceforge.net/projects/leo/ Download: http://sourceforge.net/project/showfiles.php?group_id=3458 CVS: http://sourceforge.net/cvs/?group_id=3458 Quotes: http://webpages.charter.net/edreamleo/testimonials.html Edward K. Ream January 17,

Python shell interpreting delete key as tilde?

2006-01-20 Thread Leif K-Brooks
I'm running Python 2.3.5 and 2.4.1 under Debian Sarge. Instead of deleting the character after the cursor, pressing my "delete" key in an interactive Python window causes a system beep and inserts a tilde character. This behavior occurs across all of the terminals I've tried (xterm, Konsole, real L

Re: range() is not the best way to check range?

2006-07-17 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > or is there an alternative use of range() or something similar that can > be as fast? You could use xrange: [EMAIL PROTECTED]:~$ python -m timeit -n1 "1 in range(1)" 1 loops, best of 3: 260 usec per loop [EMAIL PROTECTED]:~$ python -m timeit -n1 "1 in xr

Re: function v. method

2006-07-18 Thread Leif K-Brooks
danielx wrote: > This is still a little bit of magic, which gets me thinking again about > the stuff I self-censored. Since the dot syntax does something special > and unexpected in my case, why not use some more dot-magic to implement > privates? Privates don't have to be entirely absent from Klas

Re: range() is not the best way to check range?

2006-07-18 Thread Leif K-Brooks
Grant Edwards wrote: > Using xrange as somebody else suggested is also insane. Sorry about that, I somehow got the misguided notion that xrange defines its own __contains__, so that it would be about the same speed as using comparison operators directly. I figured the OP might have a better rea

Re: sax barfs on unicode filenames: workaround

2006-10-04 Thread Edward K. Ream
parser does not support parseString... Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
put in the first xml line. I'm going to have to parse this line myself. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
> are you expecting your users to write XML by hand? Of course not. Leo has the following option: @string new_leo_file_encoding = utf-8 Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
o some users. They have a right, I think, to expect that the original encoding gets preserved when the file is rewritten. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/e

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
> Try this: [snip] Parser.XmlDeclHandler = self.XmlDecl [snip] Excellent! Thanks so much. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.h

Tkinter: populating Mac Help menu?

2006-10-10 Thread Edward K. Ream
Help menu. Naturally, I could be wrong :-) Thanks for any help you can provide. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html ---

ANN: Leo 4.4.2 beta 2 released

2006-10-10 Thread Edward K. Ream
net/edreamleo/testimonials.html Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: operator overloading + - / * = etc...

2006-10-10 Thread Leif K-Brooks
Paul Rubin wrote: > The symbols on the left side of = signs are called variables even in > Haskell, where they don't "vary" (you can't change the value of a > variable once you have set it). FWIW, that's the original, mathematical meaning of the word 'variable'. They _do_ vary, but only when you

Re: Tkinter: populating Mac Help menu?

2006-10-11 Thread Edward K. Ream
Thanks for these replies. I'll try these ideas soon and report back on my experiences. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front

Re: Tkinter: populating Mac Help menu?

2006-10-15 Thread Edward K. Ream
> hm = Menu(mb, name='help') Yes, that worked. Many thanks for your help with Help. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreaml

ANN: Leo 4.4.2 beta 3 released

2006-10-21 Thread Edward K. Ream
urceforge.net/projects/leo/ Download: http://sourceforge.net/project/showfiles.php?group_id=3458 CVS:http://leo.tigris.org/source/browse/leo/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K

ANN: $500 prize for best Leo slideshows

2006-10-23 Thread Edward K. Ream
amleo/leo_TOC.html FAQ: http://webpages.charter.net/edreamleo/FAQ.html Wiki: http://leo.zwiki.org/FrontPage 1. Prize fund The total prize fund is $500. Prizes will be awarded solely at the discretion of Edward K. Ream. The prize fund may be split among contestants, and the total prize fund wi

Re: pretty basic instantiation question

2006-10-23 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > let's say i have a class, and i need to create a different number of > instances (changes every time - and i can't know the number in advance) in > a loop. > a function receives the number of instances that are needed, and creates > them like, > a=Myclass() > b=Myclass()

Re: How to get each pixel value from a picture file!

2006-10-23 Thread Leif K-Brooks
Lucas wrote: > 1)I just copy the tutorial to run "print pix[44,55]". I really dont > know why they wrote that?! What tutorial? Where does it say that? -- http://mail.python.org/mailman/listinfo/python-list

Re: The format of filename

2006-10-24 Thread Leif K-Brooks
Neil Cerutti wrote: > Where can I find documentation of what Python accepts as the > filename argument to the builtin function file? Python will accept whatever the OS accepts. > As an example, I'm aware (through osmosis?) that I can use '/' as > a directory separator in filenames on both Unix an

Re: The format of filename

2006-10-24 Thread Leif K-Brooks
Neil Cerutti wrote: > Is translation of '/' to '\\' a feature of Windows or Python? It's a feature of Windows, but it isn't a translation. Both slashes are valid path separators on Windows; backslashes are just the canonical form. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending Dictionary via Network

2006-10-25 Thread Leif K-Brooks
Frithiof Andreas Jensen wrote: >> "mumebuhi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> The simplejson module is really cool and simple to use. This is great! > > JUST what I need for some configuration files!! > Thanks for the link (die, configparse, dieee). I would person

ANN: Leo 4.4.2 final released

2006-10-28 Thread Edward K. Ream
age Wikipedia: http://en.wikipedia.org/wiki/Leo_%28text_editor%29 Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://we

Re: Leo 4.4.2 final released: config bug

2006-10-28 Thread Edward K. Ream
xt in Leo's config directory 'by hand': it can start life as an empty text file. My apologies for this error. It will be fixed in Leo 4.4.2.1 in a few days. Edward ---- Edward K. Ream email: [EMAIL

Re: what is "@param" in docstrings?

2006-10-28 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > What does the "@param" mean? It looks like something meant to be > machine readable. Alas, googling on "@param" doesn't work... It looks > at first like a decorator, but that doesn't make much sense. It's Epydoc's Epytext markup: . --

ANN: Leo 4.4.2.1 final released

2006-10-29 Thread Edward K. Ream
ttp://leo.tigris.org/source/browse/leo/ Leo's Wiki: http://leo.zwiki.org/FrontPage Wikipedia: http://en.wikipedia.org/wiki/Leo_%28text_editor%29 Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Rea

Re: ANN: Leo 4.4.2.1 final released

2006-10-30 Thread Edward K. Ream
sole-window Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Random image text generation?

2006-11-12 Thread Leif K-Brooks
Steven D'Aprano wrote: > For a text only solution, consider putting up a natural language question > such as: > > What is the third letter of 'national'? > What is four plus two? > How many eggs in a dozen? > Fill in the blank: Mary had a little its fleece was white as snow. > Cat, Dog, Apple

Re: Random image text generation?

2006-11-12 Thread Leif K-Brooks
Ben Finney wrote: > Leif K-Brooks <[EMAIL PROTECTED]> writes: > >> Steven D'Aprano wrote: >>> For a text only solution, consider putting up a natural language >>> question >> That wouldn't work as a true CAPTCHA (Completely Automated *Publi

Re: Question about unreasonable slowness

2006-11-16 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > i = 0 > while (i < 20): > i = i + 1 for i in xrange(20): > (shellIn, shellOut) = os.popen4("/bin/sh -c ':'") # for testing, the > spawned shell does nothing > print 'next' > # for line in shellOut: > # print line > > On my system (AIX 5.1 if it matters, w

Re: TSV to HTML

2006-05-31 Thread Leif K-Brooks
Brian wrote: > I was wondering if anyone here on the group could point me in a > direction that would expllaing how to use python to convert a tsv file > to html. I have been searching for a resource but have only seen > information on dealing with converting csv to tsv. Specifically I want > to

Re: Best Python Editor

2006-06-02 Thread Edward K. Ream
dward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Leo 4.4.1 beta 1 released

2006-06-03 Thread Edward K. Ream
edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Simple script to make .png thumbnails from .zip archive...

2006-06-18 Thread K P S
Hi. I'm looking for a small script that will take a .zip archive and pull the first .jpg from the archive and convert it to a .png. The reason for this is I want to have tuhmbnails for these archives in nautilus under gnome. I would like something similar to the following code, which will pull

Re: Simple script to make .png thumbnails from .zip archive...

2006-06-19 Thread K P S
.ANTIALIAS) > image.save (file + '.thumb.png') > except: > print 'Skipping file', file > > Links: > http://docs.python.org/lib/lib.html - Python Library Reference > http://www.pythonware.com/library/pil/handbook/image.htm - The Image > Mod

Re: Simple script to make .png thumbnails from .zip archive...

2006-06-19 Thread K P S
Thanks everyone. One last thing (I hope). How can I get the name of just the first file in a zipfile? I see routines to list all the files in a zip archive, but I don't see any to list only the first, or only the second, etc. It doesn't look like zipfile is storing info in a useful array that I

Re: Simple script to make .png thumbnails from .zip archive...

2006-06-20 Thread K P S
Thanks a lot! This is what I ended up with. (I would like to get rar archive support, but browsing the web it looks like rar support isn't in any python library (yet)) :-( Anyway, I was able to use the below code unchanged to create thumbnails in nautilus based on the first .jpg file in a .zip ar

Leo 4.4.1 beta 2 released

2006-06-23 Thread Edward K. Ream
oad: http://sourceforge.net/project/showfiles.php?group_id=3458 CVS: http://leo.tigris.org/source/browse/leo/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED]

Leo 4.4.1 beta 3 released

2006-06-29 Thread Edward K. Ream
ials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Leo 4.4.1 beta 4 released

2006-08-24 Thread Edward K. Ream
?group_id=3458 CVS: http://leo.tigris.org/source/browse/leo/ Quotes: http://webpages.charter.net/edreamleo/testimonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edream

regex matching rst code block?

2006-09-03 Thread Edward K. Ream
nyone prove me wrong :-) Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

Re: regex matching rst code block?

2006-09-03 Thread Edward K. Ream
> Why not convert the reStructuredText to XML and parse that? Because the problem arises for the jEdit syntax colorer whose most powerful pattern matcher is a regex. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: h

Re: regex matching rst code block?

2006-09-03 Thread Edward K. Ream
> r"(::\s*\n(\s*\n)*((\s+).*?\n)(((\4).*?\n)|(\s*\n))*)" Thanks for this. I'll try it out. Edward ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/ed

ANN: Leo 4.4.1.1 final released

2006-09-08 Thread Edward K. Ream
timonials.html ---- Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   >