Re: IDLE - Customizing output format

2006-09-24 Thread Robert Kern
Ilias Lazaridis wrote: > Steve Holden wrote: >> And I am wondering at your continual surprise when the rest of the world >> fails to share your perceptions. Doesn't this carry *any* information? > > not the rest of the world, but the rest of the python community. Remember back when you first cam

Re: Daemonizing python

2006-09-24 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > There is a good daemonization recipe on activstate: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012 That is worth reading, including the long comment thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse a String?

2006-09-24 Thread p . lavarre
> http://pyfaq.infogami.com/ Tell me more? Clueless newbie me, thru this door I'm at three deaths and counting. Does that Py Faq Wiki have a sandbox a la alt.test, and/or a tutorial? // Death One: http://pyfaq.infogami.com/_account/in?path=/ requires me to create a persisting ID "between 3 and

ruby %w equivalent

2006-09-24 Thread Antoine De Groote
Hi everybody, is there a python equivalent for the ruby %w operator? %w{a b c} creates an array with strings "a", "b", and "c" in ruby... Thanks a lot Regards, antoine -- http://mail.python.org/mailman/listinfo/python-list

Re: ruby %w equivalent

2006-09-24 Thread Robert Kern
Antoine De Groote wrote: > Hi everybody, > > is there a python equivalent for the ruby %w operator? > %w{a b c} creates an array with strings "a", "b", and "c" in ruby... I assume that ['a', 'b', 'c'] isn't what you are looking for. How does 'a b c'.split() strike you? -- Robert Kern

Re: ruby %w equivalent

2006-09-24 Thread John Machin
Antoine De Groote wrote: > > is there a python equivalent for the ruby %w operator? > %w{a b c} creates an array with strings "a", "b", and "c" in ruby... > | >>> "a b c".split() | ['a', 'b', 'c'] ... appears to match your single example. HTH, John -- http://mail.python.org/mailman/listinfo/p

Re: ruby %w equivalent

2006-09-24 Thread p . lavarre
> is there a python equivalent for the ruby %w operator? > %w{a b c} creates an array with strings "a", "b", and "c" in ruby... The expression 'a b c'.split() creates the ['a', 'b', 'c'] list of str, if that helps. Also dir('a b c') briefly lists much of what http://docs.python.org/lib/string-met

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread dtlog
On Sun, 24 Sep 2006 23:59:34 +0300, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > I don't know what you heard but IronPython generates IL code which > happens to be the bytecode of the CLR (the runtime of .NET). So you are > not generating "native" stuff but a PE executable wrapping the .NET > st

Re: ruby %w equivalent

2006-09-24 Thread John Machin
[EMAIL PROTECTED] wrote: > > Also Google was curiously resistant to telling me where Ruby's %w is > documented. > You would need to dig into your Google toolbar config and un-tick "YAGNI filter". -- http://mail.python.org/mailman/listinfo/python-list

Re: ruby %w equivalent

2006-09-24 Thread Tim Chase
>> is there a python equivalent for the ruby %w operator? >> %w{a b c} creates an array with strings "a", "b", and "c" in ruby... >> > > | >>> "a b c".split() > | ['a', 'b', 'c'] > > ... appears to match your single example. bah, far to easy to understand...add a little line-noise, man, and it

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread dtlog
> Learning to use Psyco is very easy, for a basic usage you just have to > put in your code: > import psyco > psyco.full() > > For a better usage you can do: > psyco.bind(functioname) > for just the functions that you have seen can enjoy the compilation. > > For a smart usage you can learn few tric

Re: Automatic import PEP

2006-09-24 Thread Saizan
I think this is obviously great in interactive mode and would also be very good in the early stages of developing if you have several sources files. A little error prone maybe, and should be avoided in "production" code I suppose. (I would like to track each name exactly, on each installation of py

Talking to marketing people about Python

2006-09-24 Thread Roy Smith
I'm working on a product which for a long time has had a Perl binding for our remote access API. A while ago, I wrote a Python binding on my own, chatted it up a bit internally, and recently had a (large) customer enquire about getting access to it. I asked for permission to distribute the Pyt

Re: Automatic import PEP

2006-09-24 Thread Robert Kern
Saizan wrote: > BTW what would the benefit of the form "lazily import A, B"? If you > name the modules why not import them directly? Maybe you are not sure > you would need them, but I don't think that the overhead of importing > them should matter.. It's primarily useful for large packages. scipy

Unexpected behaviour of csv module

2006-09-24 Thread Andrew McLean
I have a bunch of csv files that have the following characteristics: - field delimiter is a comma - all fields quoted with double quotes - lines terminated by a *space* followed by a newline What surprised me was that the csv reader included the trailing space in the final field value returned,

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Georg Brandl wrote: >> Attributes can be quoted with either single or double quotes. That's what >> the HTML spec says. cgi.escape doesn't correctly allow for that. Ergo, >> cgi.escape is broken. QED. > > A function is broken if its implementation doesn't match the

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> Making cgi.escape always escape the '"' character would not break >> anything, and would probably fix a few bugs in existing code. Yes, >> those bugs are not cgi.escape's fault, but that's no reason not to >> be helpful. It's a minor improveme

Re: Unexpected behaviour of csv module

2006-09-24 Thread John Machin
Andrew McLean wrote: > I have a bunch of csv files that have the following characteristics: > > - field delimiter is a comma > - all fields quoted with double quotes > - lines terminated by a *space* followed by a newline > > What surprised me was that the csv reader included the trailing space in

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread Ravi Teja
In most cases, carefully examine why you need native code at all. Since a good number of performance sensitive CPython modules are in fact written in C to begin with, the improvements may not always be significant. I don't know about your application but here are some general observations. Beginer

Re: String Pattern Matching: regex and Python regex documentation

2006-09-24 Thread Xah Lee
Xah Lee wrote: « the Python regex documentation is available at: http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...» Jürgen Exner wrote: «Yeah, sure, and the Perl regex documentation is available at 'perldoc perlre'. So what? Is that anything new or surprising?» It is of inter

Re: ruby %w equivalent

2006-09-24 Thread MonkeeSage
Tim Chase wrote: > to give it that perl/ruby-ish feel of terseness and obscurity. Don't feel bad, you always have things like r'%s\%s' % (u'blah', u'blah') and so on. But of course, it's only the other guys who are evil / ugly / stupid. As the human torch says, "Flame On". :) [Full disclosure: I

Re: SQL reports like in MS Access

2006-09-24 Thread Luis M. González
This isn't probably the answer you are looking for, but a good solution that worked for me is Cheetah. Cheetah is a template engine, which is mainly used for web applications, but that can be used for generating all kinds of text documents. For example, I use it for creating invoices in html form

Re: One program in different GUI Toolkits

2006-09-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Actually due to lack of documentation and feedback from the mailing > list, I am fallen out of love with Pythoncard and in love with > Kiwi/Pygtk. Given the large groundswell support for pygtk, i dont think > I will be disappointed. > > PyQT looks ultra-slick, but the co

Re: String Pattern Matching: regex and Python regex documentation

2006-09-24 Thread Steve Holden
Xah Lee wrote: > Xah Lee wrote: > « the Python regex documentation is available at: > http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...» > > Jürgen Exner wrote: > «Yeah, sure, and the Perl regex documentation is available at 'perldoc > perlre'. So what? Is that anything new or

Re: Talking to marketing people about Python

2006-09-24 Thread Steve Holden
Roy Smith wrote: > I'm working on a product which for a long time has had a Perl binding for > our remote access API. A while ago, I wrote a Python binding on my own, > chatted it up a bit internally, and recently had a (large) customer enquire > about getting access to it. > > I asked for per

Re: Daemonizing python

2006-09-24 Thread Andi Clemens
Hi, what is the main difference of running a python program as a daemon or as a cronjob? I have written a program at work that checks all internet connections of our failover sites and saves the results in a MySQL-database. The whole program is made with django (a webframework) so I had to be

unicode, bytes redux

2006-09-24 Thread willie
(beating a dead horse) Is it too ridiculous to suggest that it'd be nice if the unicode object were to remember the encoding of the string it was decoded from? So that it's feasible to calculate the number of bytes that make up the unicode code points. # U+270C # 11100010 10011100 10001100 buf =

Re: gtk.Entry Colors

2006-09-24 Thread Tuomas
MonkeeSage wrote: > Tuomas wrote: > >>I would like to manipulate PyGTK Entry widget's background and >>foreground colors. Is it possible? How? > > > Yes, it is possible: > > # widget color > entry.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("#FF")) > # frame color > entry.modify_bg(gt

Re: unicode, bytes redux

2006-09-24 Thread Robert Kern
willie wrote: > (beating a dead horse) > > Is it too ridiculous to suggest that it'd be nice > if the unicode object were to remember the > encoding of the string it was decoded from? Yes. The unicode object itself is precisely the wrong place for that kind of information. Many (most?) unicode o

<    1   2