Re: sizers in wxpanels/notebooks

2007-12-07 Thread chaelon
On Dec 7, 9:52 pm, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a wxNoteBook with a bunch of wxPanels attached to it as pages. > Every page has its own GUI items. > What Im trying to do is on a certain page, a certain GUI (wxTextCtrl) to > be resized every time the notebook or panel is resi

Re: How does python build its AST

2007-12-07 Thread MonkeeSage
On Dec 8, 12:20 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "MonkeeSage" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | 1.) What is the benefit of doing a two phase compilation (parsing/ > | compiling), rather than a single, joint parse + compile phase (as in > | interactive

Re: How does python build its AST

2007-12-07 Thread Terry Reedy
"MonkeeSage" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | 1.) What is the benefit of doing a two phase compilation (parsing/ | compiling), rather than a single, joint parse + compile phase (as in | interactive mode)? As far as I know (without looking at the code), there is no di

a Python person's experience with Ruby

2007-12-07 Thread Steve Howell
Python is my favorite programming language. I've used it as my primary language for about six years now, including four years of using it full-time in my day job. Three months ago I decided to take a position with a team that does a lot of things very well, but they don't use Python. We use Ruby

Re: How does python build its AST

2007-12-07 Thread MonkeeSage
On Dec 7, 4:29 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "MonkeeSage" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > |A quick question about how python parses a file into compiled > | bytecode. Does it parse the whole file into AST first and then compile > | the AST, or does

Re: changing fonts?

2007-12-07 Thread Doug Morse
Hi Jay, I'm not *that* familiar with the Terminal program on OS/X, but regardless perhaps I can point out a possibly useful path to explore... With terminal programs generally -- especially more in the past, as then they were much more about emulating "real" terminals -- a lot of the terminal pro

RE: I'm missing something here with range vs. xrange

2007-12-07 Thread Joe Goldthwaite
>90+ seconds?? What hardware, OS, and Python version? What else was >running in the background? >With this kit: >OS Name: Microsoft Windows XP Professional >Version: 5.1.2600 Service Pack 2 Build 2600 >Processor: x86 Family 15 Model 36 Stepping 2 AuthenticAMD ~1995 Mhz >Python: Pyt

Re: File to dict

2007-12-07 Thread J. Clifford Dyer
On Fri, 2007-12-07 at 03:31 -0800, [EMAIL PROTECTED] wrote: > Hello everyone, > > I have written this small utility function for transforming legacy > file to Python dict: > > > def lookupdmo(domain): > lines = open('/etc/virtual/domainowners','r').readlines() > lines = [ [y.ls

sizers in wxpanels/notebooks

2007-12-07 Thread Astan Chee
Hi, I have a wxNoteBook with a bunch of wxPanels attached to it as pages. Every page has its own GUI items. What Im trying to do is on a certain page, a certain GUI (wxTextCtrl) to be resized every time the notebook or panel is resized. But everything else stays the same. Now I know I can use si

changing fonts?

2007-12-07 Thread jyoung79
Hi Greg, Thanks for your fast reply. I apologize for my ignorance with unicode, but would you mind sharing an example of your experiment? Again, thanks for your help with this! Jay > I don't think you can control the font, but you can print > out the Greek text as utf8-encoded unicode. I jus

Re: changing fonts?

2007-12-07 Thread greg
[EMAIL PROTECTED] wrote: > Is it possible for the next answer that Python returns in the > Terminal Window to be displayed in the 'Symbols' font so that the > Greek text is displayed correctly? I don't think you can control the font, but you can print out the Greek text as utf8-encoded unicode.

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-12-07 Thread Jeffrey Froman
Jeffrey Froman wrote: > While recently > considering whether to re-write a standalone mod_python application as CGI > or WSGI, I was scared off by this paragraph from PEP333: As a followup, I did go ahead and convert my CGI handler to WSGI, and doing so was not difficult at all. The steps were b

Re: Problem with generator expression and class definition

2007-12-07 Thread Michael Spencer
Terry Reedy wrote: > "Maric Michaud" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > |I faced a strange behavior with generator expression, which seems like a > bug, for both > | python 2.4 and 2.5 : > > Including the latest release (2.5.2)? > > | >>> class A : > | ... a = 1

Re: I'm missing something here with range vs. xrange

2007-12-07 Thread John Machin
On Dec 8, 8:08 am, "Joe Goldthwaite" <[EMAIL PROTECTED]> wrote: > Here's the simple benchmark; > > start = time.time() > for x in xrange(3): > for y in xrange(1000): > pass > print 'xRange %s' % (time.time() - start) > > start = time.time() > for x in range(3): >

Re: I'm missing something here with range vs. xrange

2007-12-07 Thread [EMAIL PROTECTED]
On Dec 7, 3:08 pm, "Joe Goldthwaite" <[EMAIL PROTECTED]> wrote: > Here's the simple benchmark; > > start = time.time() > for x in xrange(3): > for y in xrange(1000): > pass > print 'xRange %s' % (time.time() - start) > > start = time.time() > for x in range(3): >

Re: "finding hostid with python"

2007-12-07 Thread kdwyer
On Dec 7, 9:10 pm, farsheed <[EMAIL PROTECTED]> wrote: > I,m searching for a way to obtain hostid in windows. > Any ideas? IIRC, MArk Hammond's extensions for windows have a method for obtaining the fully qualified hostname of a machine. Kev -- http://mail.python.org/mailman/listinfo/python-li

Re: I'm missing something here with range vs. xrange

2007-12-07 Thread Chris Mellon
On Dec 7, 2007 3:08 PM, Joe Goldthwaite <[EMAIL PROTECTED]> wrote: > Here's the simple benchmark; > > start = time.time() > for x in xrange(3): > for y in xrange(1000): > pass > print 'xRange %s' % (time.time() - start) > > start = time.time() > for x in range(3): >

Re: pipeline encoding

2007-12-07 Thread Tomasz Toczyski
"Martin v. Löwis": > Not a command line option. However, you can wrap sys.stdout with a > stream that automatically performs an encoding. If all your print > statements output Unicode strings, you can do > > sys.stdout = codecs.getwriter("utf-8")(sys.stdout) It is the best solution for me. Thanks.

Re: [NEWB] Dictionary instantiation?

2007-12-07 Thread Shane Geiger
#!/usr/bin/python """ EXAMPLE USAGE OF PYTHON'S CSV.DICTREADER FOR PEOPLE NEW TO PYTHON Python - Batteries Included(tm) This file will demonstrate that when you use the python CSV module, you don't have to remove the newline characters, as between "acorp_ Ac" and "orp Foundation" and other parts

Re: Converting Excel time-format (hours since 1.1.1901)

2007-12-07 Thread [EMAIL PROTECTED]
On Dec 7, 9:59 am, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > On 7 Dez., 16:50, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > > > > > > > On 7 Dez., 16:21, Tim Golden <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > > On Dec 7, 7:20�am, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > > > >

Re: Problem with generator expression and class definition

2007-12-07 Thread Terry Reedy
"Maric Michaud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I faced a strange behavior with generator expression, which seems like a bug, for both | python 2.4 and 2.5 : Including the latest release (2.5.2)? | >>> class A : | ... a = 1, 2, 3 | ... b = 1, 2, 3 | ...

Re: logging.py: mutiple system users writing to same file getting permission errors.

2007-12-07 Thread Vinay Sajip
On Dec 6, 6:35 pm, evenrik <[EMAIL PROTECTED]> wrote: > An a redhat box I have root, apache and other normal users run code > that uses theloggingmodule to write to the same log file. Since > umasks are set to 2 or 022 this gets permission errors. > > I have fixed my issue by patching theloggingco

Re: Fill In a Form Automatically

2007-12-07 Thread Ismail Dönmez
Friday 07 December 2007 22:06:23 tarihinde Victor Subervi şunları yazmıştı: > Hi; > I'm trying to fill in a Zope form automatically. I have this script, which > works great for creating the page...but how do I write to it? Use Mechanize [0]. [0] http://wwwsearch.sourceforge.net/mechanize/ -- Ne

Python tickets summary - renewed

2007-12-07 Thread Facundo Batista
People: Well, after my hosting allowing CGI, I now improved *a lot* the interface of this page. Now you have more columns: - Id - Summary - Priority - Severity - Components - Versions - Keywords - Opened by (when) - Temporal location - Last update by (when) And, the biggest enhancement, you can

Equivalent of perl's Pod::Usage?

2007-12-07 Thread Adam Funk
I'm using to using Pod::Usage in my Perl programs (a snipped example is shown below, if you're interested) to generate a little man page when they are called with the -h option. Is there an equivalent in Python? Thanks, Adam ## use Pod::Usage; getopts("ha:b:c", \%option) ; if ($optio

Leo 4.4.5 beta 2 released

2007-12-07 Thread Edward K Ream
Leo 4.4.5 beta 2 is available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 This beta 2 release fixes several recently reported bugs. A final release is due in about a week. Leo is a text editor, data organizer, project manager and much more. See: http://webpage

Re: Converting Excel time-format (hours since 1.1.1901)

2007-12-07 Thread Max Erickson
Dirk Hagemann <[EMAIL PROTECTED]> wrote: >> Dirk > Additional to my last posting: if you want to try this out in > Excel you should replace the command "REST" by the english > command what should be something like "remainder". The equivalent in my (U.S. English, 2000) version of excel is called

Distinguishing attributes and methods

2007-12-07 Thread tjhnson
Hi, With properties, attributes and methods seem very similar. I was wondering what techniques people use to give clues to end users as to which 'things' are methods and which are attributes. With ipython, I use tab completion all the time, but I can rarely tell from the names alone whether it i

Problem with generator expression and class definition

2007-12-07 Thread Maric Michaud
I faced a strange behavior with generator expression, which seems like a bug, for both python 2.4 and 2.5 : >>> class A : ... a = 1, 2, 3 ... b = 1, 2, 3 ... C = list((e,f) for e in a for f in b) ... Traceback (most recent call last): File "", line 1, in File "", line 4, in A

Re: Erros when compiling a CPP program which uses CPython API functions

2007-12-07 Thread grbgooglefan
On Dec 7, 5:15 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > grbgooglefan wrote: > > I am compiling CPP program which uses CPython API functions from > > Python 2.5.1 source code > > > First I compiled with this commanline, that time I got "pyconfig.h" > > not found. > > On Unix you have to run

Re: Dictionary instantiation?

2007-12-07 Thread Matt_D
On Dec 7, 12:27 pm, Matt_D <[EMAIL PROTECTED]> wrote: > On Dec 7, 11:42 am, Virgil Dupras <[EMAIL PROTECTED]> > wrote: > > > > > On Dec 7, 9:05 am, Matt_D <[EMAIL PROTECTED]> wrote: > > > > Hello there, this is my first post to the list. Only been working with > > > Python for a few days. Basically

Re: An Object's Type

2007-12-07 Thread Chris Mellon
On Dec 7, 2007 10:39 AM, paul <[EMAIL PROTECTED]> wrote: > Chris Mellon schrieb: > > On Dec 6, 2007 5:52 AM, paul <[EMAIL PROTECTED]> wrote: > > >> function or method. I hope type annotations in py3k will allow for > >> something like constraints in C# where you can tell the caller right > >> away

Re: I'm missing something here with range vs. xrange

2007-12-07 Thread Carl Banks
On Dec 7, 4:08 pm, "Joe Goldthwaite" <[EMAIL PROTECTED]> wrote: > Here's the simple benchmark; > > start = time.time() > for x in xrange(3): > for y in xrange(1000): > pass > print 'xRange %s' % (time.time() - start) > > start = time.time() > for x in range(3): >

Re: Securely distributing python source code as an application?

2007-12-07 Thread Tim Churches
xkenneth wrote: > Message should have read: > Hi All, > > I'll shortly be distributing a number of python applications that > use proprietary source code. The software is part of a much larger > system and it > will need to be distributed securely. How can i achieve this? You need to define

Re: Securely distributing python source code as an application?

2007-12-07 Thread sturlamolden
On 7 Des, 23:37, xkenneth <[EMAIL PROTECTED]> wrote: > I'll shortly be distributing a number of python applications that > use proprietary. The software is part of a much larger system and it > will need to be distributed securely. How can i achieve this? If you provide the application as a

Re: [pygtk] Rectangular Selection in gtk.TextView

2007-12-07 Thread Wildemar Wildenburger
John Ehresman wrote: > I may be wrong here, but I suspect TextView does not support > rectangular selections. I haven't seen mention of rectangular > selections when I've worked with it and a quick google search seems to > confirm this. > That is my experience too; I was hoping that there might

Re: Securely distributing python source code as an application?

2007-12-07 Thread xkenneth
Message should have read: Hi All, I'll shortly be distributing a number of python applications that use proprietary source code. The software is part of a much larger system and it will need to be distributed securely. How can i achieve this? Regards, Ken -- http://mail.python.org/mailman/l

Securely distributing python source code as an application?

2007-12-07 Thread xkenneth
Hi All, I'll shortly be distributing a number of python applications that use proprietary. The software is part of a much larger system and it will need to be distributed securely. How can i achieve this? Regards, Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: Any simpler way to do this

2007-12-07 Thread Steven D'Aprano
On Fri, 07 Dec 2007 09:37:22 +0100, Lars Johansen wrote: > I have a function that looks like this: > > def Chooser(color): > > if color == "RED": > x = term.RED [snip] > Wouldn there been easier if I could just skip all the "*if's" and just > "return term.color", however

Re: How does python build its AST

2007-12-07 Thread Terry Reedy
"MonkeeSage" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |A quick question about how python parses a file into compiled | bytecode. Does it parse the whole file into AST first and then compile | the AST, or does it build and compile the AST on the fly as it reads | expressions? (I

Re: Dictionary instantiation?

2007-12-07 Thread Steven D'Aprano
On Fri, 07 Dec 2007 11:56:14 +0100, Bruno Desthuilliers wrote: > Also, modifying a sequence in place while iterating over it is a *very* > bad idea. That's somewhat of an exaggeration, surely. Some sorts of modifications are more error-prone than others, and deserves your warning e.g. inserting

Re: Securely distributing python source code as an application?

2007-12-07 Thread sturlamolden
So for example one could: 1. Put all the compiled Python bytecode in an encrypted binary file. 2. Build a small binary executable (.exe file) that: 2a. Reads the binary file. 2b. Decrypts it to conventional Python byte code. 2c. Embeds a Python interpreter. 2d. Executes the byte

Re: a Python person's experience with Ruby

2007-12-07 Thread MonkeeSage
On Dec 7, 11:08 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > Python is my favorite programming language. I've used > it as my primary language for about six years now, > including four years of using it full-time in my day > job. Three months ago I decided to take a position > with a team that d

Re: I'm missing something here with range vs. xrange

2007-12-07 Thread Tim Chase
>> Here's what I get; >> >> xRange 92.552733 >> Range 95.266599 > > Try tracking your memory usage during the benchmark and > it will become very clear why xrange exists. Or, when memory-constrained and this extra memory usage pushes your machine to pound on your swap...not a pretty sight

Re: Converting Excel time-format (hours since 1.1.1901)

2007-12-07 Thread John Machin
On Dec 8, 12:20 am, Dirk Hagemann <[EMAIL PROTECTED]> wrote: > Hello, > > From a zone-file of a Microsoft Active Directory integrated DNS server > I get the date/time of the dynamic update entries in a format, which > is as far as I know the hours since january 1st 1901. As Tim Golden has guessed,

RE: I'm missing something here with range vs. xrange

2007-12-07 Thread Joe Goldthwaite
Here's the simple benchmark; start = time.time() for x in xrange(3): for y in xrange(1000): pass print 'xRange %s' % (time.time() - start) start = time.time() for x in range(3): for y in range(1000): pass print 'Range %s' % (time.time() - st

"finding hostid with python"

2007-12-07 Thread farsheed
I,m searching for a way to obtain hostid in windows. Any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: How does python build its AST

2007-12-07 Thread Michael Spencer
MonkeeSage wrote: > A quick question about how python parses a file into compiled > bytecode. Does it parse the whole file into AST first and then compile > the AST, or does it build and compile the AST on the fly as it reads > expressions? (If the former case, why can't functions be called before

RE: File to dict

2007-12-07 Thread Joe Goldthwaite
Duncan Booth wrote: >for item in list: >if item == 'searched.domain': >return item... [EMAIL PROTECTED] wrote: >Sure, but I have two options here, none of them nice: either "write C >in Python" or do it inefficient and still elaborate way. I don't understand your point at all. How

Re: File to dict

2007-12-07 Thread Matt Nordhoff
Duncan Booth wrote: > Just some minor points without changing the basis of what you have done > here: > > Don't bother with 'readlines', file objects are directly iterable. > Why are you calling both lstrip and rstrip? The strip method strips > whitespace from both ends for you. > > It is usual

Re: File to dict

2007-12-07 Thread Matt Nordhoff
Chris wrote: > For the first one you are parsing the entire file everytime you want > to lookup just one domain. If it is something reused several times > during your code execute you could think of rather storing it so it's > just a simple lookup away, for eg. > > _domain_dict = dict() > def gen

Re: File to dict

2007-12-07 Thread Glauco
david ha scritto: > On Fri, 07 Dec 2007 16:46:56 +0100, Glauco wrote: > >> [EMAIL PROTECTED] ha scritto: >>> Hello everyone, >>> >>> I have written this small utility function for transforming legacy file >>> to Python dict: >>> >>> >>> def lookupdmo(domain): >>> lines = open('/etc/virtual

Re: Best way to merge/sort two sorted lists?...

2007-12-07 Thread Aaron Watters
On Dec 6, 9:51 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Aaron Watters" <[EMAIL PROTECTED]> wrote in message > The current version of list.sort (timsort) was designed to take advantage > of pre-existing order. It should discover the 2 sorted sublists and merge > them together. It will not r

Re: Class destructor -- strange behaviour

2007-12-07 Thread Jason
On Dec 6, 2:51 pm, Spes <[EMAIL PROTECTED]> wrote: > Hi, > > I have this simple code: > | #!/usr/bin/python > | import codecs > | import re > | from copy import deepcopy > | > | class MyClass(object): > | def __del__(self): > | deepcopy(1) > | > | x=MyClass() > > but I get an error: > | Excep

Re: How does python build its AST

2007-12-07 Thread Jason
On Dec 7, 9:03 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > On Dec 7, 9:50 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > > > On Dec 7, 3:23 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > > > > A quick question about how python parses a file into compiled > > > bytecode. Does it parse the whole file

Re: sqlite or xml

2007-12-07 Thread oj
On Dec 6, 8:21 pm, Kelie <[EMAIL PROTECTED]> wrote: > Hello group, > > If I need store and use a couple thousand of people's contact info: > first name, last name, phone, fax, email, address, etc. I'm thinking > of using either sqlite or xml. Which one is better? My understanding > is if there is l

Re: An Object's Type

2007-12-07 Thread paul
Chris Mellon schrieb: > On Dec 6, 2007 5:52 AM, paul <[EMAIL PROTECTED]> wrote: >> function or method. I hope type annotations in py3k will allow for >> something like constraints in C# where you can tell the caller right >> away she's doing something wrong. >> [language rant snipped] > On a more

Re: Some python syntax that I'm not getting

2007-12-07 Thread Chris Mellon
On Dec 7, 2007 6:31 AM, waltbrad <[EMAIL PROTECTED]> wrote: > Hello. Been studying Python for about a week now. I did a quick read > of the tutorial in the manual and I'm reading Programming Python by > Mark Lutz. I'm still getting used to the Python syntax, but I'm able > to pretty much follow w

Fill In a Form Automatically

2007-12-07 Thread Victor Subervi
Hi; I'm trying to fill in a Zope form automatically. I have this script, which works great for creating the page...but how do I write to it? import urllib2 theurl = 'example.com' protocol = 'http://' my_id = "test" text = "Hello, world!" realm_dir = '/a_dir/' realm1 = 'manage_addProduct/PageTempl

Re: How does python build its AST

2007-12-07 Thread Kay Schluehr
On Dec 7, 5:03 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > On Dec 7, 9:50 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > > > On Dec 7, 3:23 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > > > > A quick question about how python parses a file into compiled > > > bytecode. Does it parse the whole file

download complete webpage with python

2007-12-07 Thread yi zhang
Dear all, The urllib.urlretrieve() can only download the text part of a webpage, not the image associated. How can I download the whole, complete webpage with python? Thanks! Yi Looking for last m

Re: [pygtk] Rectangular Selection in gtk.TextView

2007-12-07 Thread Wildemar Wildenburger
Oops! This was meant to go to the pygtk list. Mixup on my part, sorry. Not that I would lament comments from the general python crowd, though. ;) /W Wildemar Wildenburger wrote: > John Ehresman wrote: >> I may be wrong here, but I suspect TextView does not support >> rectangular selections. I

<    1   2