Re: The Python Journal

2006-11-01 Thread [EMAIL PROTECTED]
I think I saw one of the articles twice. It is good to see a python journal again, even better with free content. It would be good to see more 'populist' content, even transcripts of python 411 maybe. I would also like to note if they could be organised as hpp (or whatever extension the help fil

Re: Style for modules with lots of constants

2006-11-01 Thread bearophileHUGS
Ron Adam: > The disadvantage is an invalid flag may pass silently unless you do some sort > of > validation which may slow things down a bit. That string validation is usually necessary. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Python images processing -recap

2006-11-01 Thread Fredrik Lundh
alf wrote: > Are all supported, which is most mature, in which I could perform for > instance 'Ken Burns effect' that's a display effect, not an image effect. you need a display (or animation) library for that. -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread Fredrik Lundh
Fredrik Lundh wrote: > if you're wrapping some cmd.exe command in an internal API, it's usually > easier to call "os.path.normpath" the last thing you do before you call > "os.system", than to get all the backslashes right in your code. > > also see: > > http://www.effbot.org/pyfaq/why-can-t-r

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread Fredrik Lundh
John Machin wrote: > Not all APIs do the right thing. If you fire up the cmd.exe shell and > feed it slashes as path separators, it barfs. Example: > C:\junk>dir c:/junk/*.bar > Invalid switch - "junk". > Hence the advice to use rawstrings with backslashes -- they work under > all circumst

Re: need to find out all modules from site-packages

2006-11-01 Thread Fredrik Lundh
alf wrote: > I need to find all modules/lib from the site-packages along with the > versions. Is there a way to determine physical path to the module? > > And is there is a way to identify all potential "importable" modules? maybe this could be a start? http://online.effbot.org/2006_10_01_arch

Re: can I import the module twice (under differnet names)

2006-11-01 Thread Thomas Nelson
alf wrote: > Hi, > > wonder if in the python I could treat modules imorts like classes > instances. It means I could import it twice or more times under > different names. > > -- > alfz1 You can always give any object as many names as you want: >>> import sys >>> s1 = sys >>> s2 = sys >>> s1.path

Re: Python tools for managing static websites?

2006-11-01 Thread Ben Finney
"Chris Pearl" <[EMAIL PROTECTED]> writes: > Thanks to everyone who have contributed to this thread. Several of the > posted suggestions definitely warrant a closer look. I'm going to > review those and publish my final choice - including the reasons for > it - if anyone's interested. Yes please.

Re: logo design

2006-11-01 Thread Lars Rune Nøstdal
On Thu, 02 Nov 2006 06:08:00 +0100, Lars Rune Nøstdal wrote: > On Wed, 01 Nov 2006 20:48:12 -0800, Geoffrey Summerhayes wrote: > >> Picture this: Hey, I'm switching to COBOL because its new >> logo looks great on t-shirts and mugs. > > Maybe the extra funding would improve "COBOL" and its librar

Re: Python tools for managing static websites?

2006-11-01 Thread Chris Pearl
Thanks to everyone who have contributed to this thread. Several of the posted suggestions definitely warrant a closer look. I'm going to review those and publish my final choice - including the reasons for it - if anyone's interested. -Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: can I import the module twice (under differnet names)

2006-11-01 Thread Ben Finney
alf <[EMAIL PROTECTED]> writes: > wonder if in the python I could treat modules imorts like classes > instances. It means I could import it twice or more times under > different names. No need to import more than once. The 'import' statement binds a module object to the specified name, and you ca

Re: Regular Expression for a string

2006-11-01 Thread Teja
John Machin wrote: > Teja wrote: > > HI all, > > > > I need to write a regular experssion for a string which satisfies the > > following a criteria : > > > > 1) it should start with an alphabet > > 2) it can contain alphabets/digits/_ from second character > > 3) it can contain "[a-z]" or "[0-9]"

Re: Hooking file open

2006-11-01 Thread Carl Banks
Dale Strickland-Clark wrote: > You might consider trapping calls to file() too, which is an alias for > open(). > > Also, I think I'd do my logging before calling the real function. It depends > how you want to deal with exceptions. OP should hook into os.open as well. Plus, I don't think the dat

need to find out all modules from site-packages

2006-11-01 Thread alf
Hi, I need to find all modules/lib from the site-packages along with the versions. Is there a way to determine physical path to the module? And is there is a way to identify all potential "importable" modules? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: compiling on AIX 5.3 with vacpp

2006-11-01 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > > indeed as you say. libintl.h is required so I hard coded it into > setup.py to no effect. At what point does setup.py get called? by make? Yes. When you do make, python itself is built. After that, with the built python setup.py gets called to build all the modules.

can I import the module twice (under differnet names)

2006-11-01 Thread alf
Hi, wonder if in the python I could treat modules imorts like classes instances. It means I could import it twice or more times under different names. -- alfz1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression for a string

2006-11-01 Thread John Machin
Teja wrote: > HI all, > > I need to write a regular experssion for a string which satisfies the > following a criteria : > > 1) it should start with an alphabet > 2) it can contain alphabets/digits/_ from second character > 3) it can contain "[a-z]" or "[0-9]" at the end. but this is optional Bas

Re: logo design

2006-11-01 Thread Lars Rune Nøstdal
On Wed, 01 Nov 2006 20:48:12 -0800, Geoffrey Summerhayes wrote: > Picture this: Hey, I'm switching to COBOL because its new > logo looks great on t-shirts and mugs. Maybe the extra funding would improve "COBOL" and its libraries faster by letting a developer work more often on it. I'm not totall

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread John Machin
On 2/11/2006 2:38 PM, [EMAIL PROTECTED] wrote: > >> ...alternatively you can just use 'unix slashes', e.g. > >> 'c:/temp/book1.csv', since those work just fine 'cause the Windows > >> APIs deal with them properly. > > John> Not all APIs do the right thing. If you fire up the cmd.ex

Python images processing -recap

2006-11-01 Thread alf
Hi, I try to summarize what is available in python for graphical images processing. So far I found: -PythonMagic -PIL -SDL_image Are all supported, which is most mature, in which I could perform for instance 'Ken Burns effect' or light filling operations. Is there anything else? -- alf --

Re: logo design

2006-11-01 Thread Geoffrey Summerhayes
Ken Tilton wrote: > alex23 wrote: > > Xah Lee wrote: > > > >>No personal offense intended, but human animal's history is what? 3000 > >>years at least in recorded history? And, all you can think of is what, > >>the view points of a fraction of your personal life span? > > > > > > Thank god evoluti

Re: Make all files extension lower by a given directory name

2006-11-01 Thread Tiefeng Wu
Fredrik Lundh wrote: > that's not how splitext works, though: > > >>> os.path.splitext("FOO.BAR") > ('FOO', '.BAR') > > can you post an example of a filename that misbehaves on your machine? > > To Fredrik Lundh and Tim Chase: My task was read all tga file names and generate a config xml file, t

The Python Journal

2006-11-01 Thread [EMAIL PROTECTED]
To whom it may concern, I have been involved in putting together a new Python journal, called (oh so originally) The Python Journal. This isn't related to a previous project also called The Python Journal although we have the approval of the group that put it together in using their name. http://

Re: Regular Expression for a string

2006-11-01 Thread Teja
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > "Teja" <[EMAIL PROTECTED]> wrote: > > > HI all, > > > > I need to write a regular experssion for a string which satisfies the > > following a criteria : > > > > 1) it should start with an alphabet > > I assume you mean, "It should start with a

Re: Regular Expression for a string

2006-11-01 Thread Teja
James Stroud wrote: > Teja wrote: > > HI all, > > > > I need to write a regular experssion for a string which satisfies the > > following a criteria : > > > > 1) it should start with an alphabet > > 2) it can contain alphabets/digits/_ from second character > > 3) it can contain "[a-z]" or "[0-9]

Re: Regular Expression for a string

2006-11-01 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Teja" <[EMAIL PROTECTED]> wrote: > HI all, > > I need to write a regular experssion for a string which satisfies the > following a criteria : > > 1) it should start with an alphabet I assume you mean, "It should start with a letter"? > 2) it can contain alphab

Re: Regular Expression for a string

2006-11-01 Thread James Stroud
Teja wrote: > HI all, > > I need to write a regular experssion for a string which satisfies the > following a criteria : > > 1) it should start with an alphabet > 2) it can contain alphabets/digits/_ from second character > 3) it can contain "[a-z]" or "[0-9]" at the end. but this is optional >

Regular Expression for a string

2006-11-01 Thread Teja
HI all, I need to write a regular experssion for a string which satisfies the following a criteria : 1) it should start with an alphabet 2) it can contain alphabets/digits/_ from second character 3) it can contain "[a-z]" or "[0-9]" at the end. but this is optional can any one please help me ou

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread Steve Holden
John Machin wrote: > Tom Plunket wrote: > >>John Machin wrote: >> >> >>>If you were to write 'c:\temp\book1.csv', it would blow up ... because >>>\t -> tab and \b -> backspace. Get into the habit of *always* using raw >>>strings r'C:\Temp\Book1.csv' for Windows file names (and re patterns). >>>You

Re: logo design

2006-11-01 Thread Ken Tilton
alex23 wrote: > Xah Lee wrote: > >>No personal offense intended, but human animal's history is what? 3000 >>years at least in recorded history? And, all you can think of is what, >>the view points of a fraction of your personal life span? > > > Thank god evolution spat you out to lead us all t

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread skip
>> ...alternatively you can just use 'unix slashes', e.g. >> 'c:/temp/book1.csv', since those work just fine 'cause the Windows >> APIs deal with them properly. John> Not all APIs do the right thing. If you fire up the cmd.exe shell John> and feed it slashes as path separators

Re: Python and SSL enabled

2006-11-01 Thread Heikki Toivonen
matey wrote: > I tried to run the following simple program > > #!/usr/local/bin/python > > import M2Crypto > > u = M2Crypto.m2urllib.URLopener() > u.open('http://www.yahoo.com') > > However I got the following errror: > > Traceback (most recent call last): > File "test.py", line 3, in ?

Re: re question

2006-11-01 Thread attn . steven . kuo
Schüle Daniel wrote: (snipped) > I am trying to construct a case where a greedy and > non greedy operation produce different result. > I dont see the difference between 'a??b' and 'a?b' > As far I understand is that ? will first try to match a > (it's greedy) and only if it fails then it step bac

Re: re question

2006-11-01 Thread Steve Holden
Schüle Daniel wrote: > Hello all, > > I didn't found more appropriate news group for > this question, please let me know if there is ng with > regular expression as its main topic > > I am trying to construct a case where a greedy and > non greedy operation produce different result. > I dont see

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread John Machin
Tom Plunket wrote: > John Machin wrote: > > > If you were to write 'c:\temp\book1.csv', it would blow up ... because > > \t -> tab and \b -> backspace. Get into the habit of *always* using raw > > strings r'C:\Temp\Book1.csv' for Windows file names (and re patterns). > > You could use double backs

Re: logo design

2006-11-01 Thread Steve Holden
alex23 wrote: > Xah Lee wrote: > >>No personal offense intended, but human animal's history is what? 3000 >>years at least in recorded history? And, all you can think of is what, >>the view points of a fraction of your personal life span? > > > Thank god evolution spat you out to lead us all to

Re: logo design

2006-11-01 Thread alex23
Xah Lee wrote: > No personal offense intended, but human animal's history is what? 3000 > years at least in recorded history? And, all you can think of is what, > the view points of a fraction of your personal life span? Thank god evolution spat you out to lead us all to the light, huh? No person

re question

2006-11-01 Thread Schüle Daniel
Hello all, I didn't found more appropriate news group for this question, please let me know if there is ng with regular expression as its main topic I am trying to construct a case where a greedy and non greedy operation produce different result. I dont see the difference between 'a??b' and 'a?b'

Re: trying to call main function with execfile with two arguments

2006-11-01 Thread [EMAIL PROTECTED]
To extend and revise my notes this is the dialog box that comes with boa constructor with very little change. [EMAIL PROTECTED] wrote: > I was trying to find out what my value for filename is but it will not > print. The file I am calling csoundgrid2.main seems to work fine when > I call it dire

trying to call main function with execfile with two arguments

2006-11-01 Thread [EMAIL PROTECTED]
I was trying to find out what my value for filename is but it will not print. The file I am calling csoundgrid2.main seems to work fine when I call it directly from spe with two values and I have used this file dialog to load other files the error I am getting is. thanks for any help in advance

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread Tom Plunket
John Machin wrote: > If you were to write 'c:\temp\book1.csv', it would blow up ... because > \t -> tab and \b -> backspace. Get into the habit of *always* using raw > strings r'C:\Temp\Book1.csv' for Windows file names (and re patterns). > You could use double backslashing 'C:\\Temp\\Book1.csv' b

Re: unescape HTML entities

2006-11-01 Thread Rares Vernica
Hi, I downloades 2.2 beta, just to be sure I have the same version as you specify. (The file names are no longer funny.) Anyway, it does not seem to do as you said: In [14]: import SE In [15]: SE.version ---> SE.version() Out[15]: 'SE 2.2 beta - SEL 2.2 beta' In [16]: HTM_Decoder = SE.SE

Win32 COM

2006-11-01 Thread Tom Plunket
I don't know anything about COM beyond the fact that I can look in the OLE/COM browser to maybe figure out the API that an object has that I need to operate on. Usually this gets me by fine; I've written mostly utilities for Developer Studio which work fine if a little slow, and a bit of junk for

Re: unescape HTML entities

2006-11-01 Thread Rares Vernica
Hi, Nice module! I downloaded 2.3 and I started to play with it. The file names have funny names, they are all caps, including extension. For example the main module file is "SE.PY". Is you try "import SE" it will not work as Python expects the file extension to be "py". Thanks, Ray Frederic

Re: Computing FFT with Python NumPy 1.0

2006-11-01 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I recently installed Python 2.5 on Windows and also installed numpy > 1.0. You will want to ask numpy questions on the numpy mailing list. http://www.scipy.org/Mailing_Lists > I'd like to compute an FFT on an array of numbers but I can't > seem to access the FFT fu

Re: Computing FFT with Python NumPy 1.0

2006-11-01 Thread Tim Leslie
On 1 Nov 2006 16:04:59 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I recently installed Python 2.5 on Windows and also installed numpy > 1.0. I'd like to compute an FFT on an array of numbers but I can't > seem to access the FFT function. I'm fairly new to Python (obviously) > and I can

Computing FFT with Python NumPy 1.0

2006-11-01 Thread mcdurr
I recently installed Python 2.5 on Windows and also installed numpy 1.0. I'd like to compute an FFT on an array of numbers but I can't seem to access the FFT function. I'm fairly new to Python (obviously) and I can't seem to find documentation to match my distribution of numpy and I can't figure

Re: 3d programming without opengl

2006-11-01 Thread Paul McGuire
"Jordan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On > the other hand, I thought that you were looking for something that > doesn't use openGL and I think that Slut is built around it. > Yes, slut *does* use OpenGL, so if that is in fact a poison pill for this app, it's a n

Re: Style for modules with lots of constants

2006-11-01 Thread Ron Adam
Neil Cerutti wrote: > On 2006-11-01, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Neil Cerutti: >>> scriptref = glk.fileref_create_by_prompt('Transcript+TextMode', >>>'WriteAppend', 0) >> That "+" sign seems useless. A space looks enough to me. The >> functions can accept case-agnostic strin

Re: Python and SSL enabled

2006-11-01 Thread matey
Firstly, thank for answering. Otherwise I wouldn't know where to turn for help... I tried to run the following simple program #!/usr/local/bin/python import M2Crypto u = M2Crypto.m2urllib.URLopener() u.open('http://www.yahoo.com') However I got the following errror: Traceback (most

Re: Style for modules with lots of constants

2006-11-01 Thread Ben Finney
Neil Cerutti <[EMAIL PROTECTED]> writes: > Calls to Glk functions are thus ugly and tedious. > > scriptref = glk.fileref_create_by_prompt( > glk.fileusage_Transcript | glk.fileusage_TextMode, > glk.filemode_WriteAppend, 0) > > Please give me some good style advice for t

Re: ANN: SPE 0.8.3.c Python IDE editor

2006-11-01 Thread Chris Seymour
Hi Stani, I got it going now. Not sure why but seems good to go now. Thanks for a great product. Cheers. Chris SPE - Stani's Python Editor wrote: > I checked the berlios site and it seems to be working. Or do you have > another problem? > Stani > > Chris Seymour schreef: > > > Hi Stani, > > Not

Re: scared about refrences...

2006-11-01 Thread Inyeol Lee
On Wed, Nov 01, 2006 at 12:20:36PM -0800, SpreadTooThin wrote: > > Bruno Desthuilliers wrote: > > Nick Vatamaniuc a �crit : > > (snip) > > > In Python all the primitives are copied and all other entities are > > > references. > > > > Plain wrong. There's no "primitives" (ie : primitive data types

Re: uninstall and Windows file associations

2006-11-01 Thread Neil Hodgson
Roger Miller: > When I installed Python 2.5 (on Windows XP) I left 2.4 in place "just > in case". Today I decided to remove it. However after doing so (from > the control panel) I found that Windows no longer knows about the > Python file types and associations. Is this behavior expected, Th

Re: jyton usage in a python program

2006-11-01 Thread Fredrik Lundh
Oğuz Yarımtepe wrote: > Hi all. I am planning to develop an application using Python. I will need to > use Zemberek libraries that are written with Java. I know i can use Java > libraries with the help of Jython. I will write my software by Python and > will use some modules inside it. But i will

jyton usage in a python program

2006-11-01 Thread Oğuz Yarımtepe
Hi all. I am planning to develop an application using Python. I will need to use Zemberek libraries that are written with Java. I know i can use Java libraries with the help of Jython. I will write my software by Python and will use some modules inside it. But i will need to use that Java librari

Re: Remote Objects via CGI?

2006-11-01 Thread kpd
Thanks Fredrik. I gave XmlRpc a shot as you implied earlier. It works like a charm. This is how I tested quickly locally without a large web-server installed: 1. Run cgiserver.py - this takes the place of the normal web server. 2. Then run test.py to make a local xmlrpc call. ./cgi-bin/xmlrpc

Re: Hooking file open

2006-11-01 Thread Farshid Lashkari
Dale Strickland-Clark wrote: > You might consider trapping calls to file() too, which is an alias for > open(). Thanks, I didn't know about that. > Also, I think I'd do my logging before calling the real function. It depends > how you want to deal with exceptions. I placed the logging after the

Re: Providing full interaction with the run time

2006-11-01 Thread Dale Strickland-Clark
Thanks for the info. I didn't know about that module. I'll take a look. Fredrik Lundh wrote: > Dale Strickland-Clark wrote: > >> We have a system we're developing which runs as a server. It has an >> xml-rpc interface which I've extended to provide some debugging >> facilities. This has already

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread John Machin
Jeff Blaine wrote: > It's been a year or so since I written Python code, so maybe > I am just doing something really dumb, but... > > Documentation > = > > class DictReader(csvfile[,fieldnames=None, > [,restkey=None[, restval=None[, dialect='excel' > [,

Re: Hooking file open

2006-11-01 Thread Dale Strickland-Clark
You might consider trapping calls to file() too, which is an alias for open(). Also, I think I'd do my logging before calling the real function. It depends how you want to deal with exceptions. Farshid Lashkari wrote: > Hi, > > My goal is to detect all (or most) file dependencies of a script (

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread Jeff Blaine
I see what's wrong. Me. Wow am I ever rusty. Jeff Blaine wrote: > It's been a year or so since I written Python code, so maybe > I am just doing something really dumb, but... > > Documentation > = > > class DictReader(csvfile[,fieldnames=None, > [,restkey=None[, re

Re: Where do nested functions live?

2006-11-01 Thread Rob Williscroft
Steve Holden wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Since we have a class that goes out of scope >> when the function returns, and we don't need more than one instance, >> why bother to make an instance? Why not use the class object itself? >> >> def whatever( new_ms ): >> >>

Re: Style for modules with lots of constants

2006-11-01 Thread Rob Williscroft
Tim Chase wrote in news:mailman.1617.1162412498.11739.python- [EMAIL PROTECTED] in comp.lang.python: >>> The reason I used instances instead of just the Constants >>> class was so that I could define a little more descriptive >>> context for the constants, >> >> Sorry I don't know what you mean h

Re: CSV module, DictReader problem (bug?)

2006-11-01 Thread Fredrik Lundh
Jeff Blaine wrote: > It's been a year or so since I written Python code, so maybe > I am just doing something really dumb, but... > > Documentation > = > > class DictReader(csvfile[,fieldnames=None, > [,restkey=None[, restval=None[, dialect='excel' >

uninstall and Windows file associations

2006-11-01 Thread Roger Miller
When I installed Python 2.5 (on Windows XP) I left 2.4 in place "just in case". Today I decided to remove it. However after doing so (from the control panel) I found that Windows no longer knows about the Python file types and associations. Is this behavior expected, or was there something wrong wi

Re: Style for modules with lots of constants

2006-11-01 Thread Paddy
Neil Cerutti wrote: > The Glk API (which I'm implementing in native Python code) > defines 120 or so constants that users must use. The constants > already have fairly long names, e.g., gestalt_Version, > evtype_Timer, keycode_PageDown. > > Calls to Glk functions are thus ugly and tedious. > >

Re: Remote Objects via CGI?

2006-11-01 Thread Fredrik Lundh
kpd wrote: > I did not have much hope, but thought there might be something. I was > thinking of going this route to get a very quick solution to a python > fat-client adding to or retrieving objects from a community repository > over http. > > XMLRpc could work if there is a CGI solution, altho

CSV module, DictReader problem (bug?)

2006-11-01 Thread Jeff Blaine
It's been a year or so since I written Python code, so maybe I am just doing something really dumb, but... Documentation = class DictReader(csvfile[,fieldnames=None, [,restkey=None[, restval=None[, dialect='excel' [, *args, **kwds]) Cr

Re: Remote Objects via CGI?

2006-11-01 Thread kpd
I did not have much hope, but thought there might be something. I was thinking of going this route to get a very quick solution to a python fat-client adding to or retrieving objects from a community repository over http. XMLRpc could work if there is a CGI solution, although the data sets do not

Re: scared about refrences...

2006-11-01 Thread Fredrik Lundh
SpreadTooThin wrote: >> Plain wrong. There's no "primitives" (ie : primitive data types) in >> Python, only objects. And they all get passed the same way. > > so.. > def fn(x): >x = x + 1 >print x > > a = 2 > fn(a) > fn(2) > > Wouldn't you say that this is being passed by value rather t

Re: scared about refrences...

2006-11-01 Thread Diez B. Roggisch
SpreadTooThin schrieb: > Bruno Desthuilliers wrote: >> Nick Vatamaniuc a écrit : >> (snip) >>> In Python all the primitives are copied and all other entities are >>> references. >> Plain wrong. There's no "primitives" (ie : primitive data types) in >> Python, only objects. And they all get passed

Re: scared about refrences...

2006-11-01 Thread SpreadTooThin
Bruno Desthuilliers wrote: > Nick Vatamaniuc a écrit : > (snip) > > In Python all the primitives are copied and all other entities are > > references. > > Plain wrong. There's no "primitives" (ie : primitive data types) in > Python, only objects. And they all get passed the same way. so.. def fn

Re: Style for modules with lots of constants

2006-11-01 Thread Tim Chase
>> The reason I used instances instead of just the Constants >> class was so that I could define a little more descriptive >> context for the constants, > > Sorry I don't know what you mean here, could I have an example It helps in the recognition if you have separation between something like

Re: Where do nested functions live?

2006-11-01 Thread Rob Williscroft
Frederic Rentsch wrote in news:mailman.1613.1162403556.11739.python- [EMAIL PROTECTED] in comp.lang.python: > Since we have a class that goes out of scope > when the function returns, and we don't need more than one instance, why > bother to make an instance? Why not use the class object itself?

Re: Why can't you assign to a list in a loop without enumerate?

2006-11-01 Thread Bjoern Schliessmann
Fredrik Lundh wrote: > "enumerate" is the obviously right thing for this, sure. K. > but it's not necessarily the right thing for the OP's "I want to > create a new list based on an existing list". modifying the > existing list is usually not the most efficient way to do that. Agreed. Regards

Re: best way to check if a file exists?

2006-11-01 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > os.path.exists() checks if a path exists, so a directory as argument > also returns True the original requirement was "to check if a file of a certain name exists before the user creates a new file of that name". if you want to check for files only, use the os.path.is

Re: Where do nested functions live?

2006-11-01 Thread Steve Holden
Frederic Rentsch wrote: > Rob Williscroft wrote: > >>Frederic Rentsch wrote in news:mailman.1556.1162316571.11739.python- >>[EMAIL PROTECTED] in comp.lang.python: >> >> >> >>>Rob Williscroft wrote: >>> >>> Frederic Rentsch wrote in news:mailman.1536.1162292996.11739.python- >>

Re: best way to check if a file exists?

2006-11-01 Thread [EMAIL PROTECTED]
On Nov 1, 3:44 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Ben Finney wrote: > > > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > > You could try to read the file, if that fails it doesn't exist: > > > > Except that there are other condit

Re: Style for modules with lots of constants

2006-11-01 Thread Rob Williscroft
Paul McGuire wrote in news:[EMAIL PROTECTED] in comp.lang.python: >>> opAssoc = Constants(object) >>> opAssoc.RIGHT = 0 >>> opAssoc.LEFT = 1 >> This is nice, but you can cut down on some of the cruft: >> Constants.LEFT = 1 > One man's cruft is another man's clarity. :-) > The reason I used

Re: 3d programming without opengl

2006-11-01 Thread Jordan
I don't thnk you should have any problems using Slut with wxpython - wx would be much less amazing if it couldn't do something like that. On the other hand, I thought that you were looking for something that doesn't use openGL and I think that Slut is built around it. Cheers, Jordan nelson - wro

Hooking file open

2006-11-01 Thread Farshid Lashkari
Hi, My goal is to detect all (or most) file dependencies of a script (i.e. modules, dlls, data files). Currently, after a script is finished executing I use sys.modules to determine all module dependencies, and I use win32process.EnumProcessModules to determine DLL dependencies. This works rea

Re: compiling on AIX 5.3 with vacpp

2006-11-01 Thread pruebauno
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > I am trying to compile Python 2.5 on AIX 5.3. I used > > > > building '_locale' extension > > ./Modules/ld_so_aix xlc_r -q64 -bI:Modules/python.exp > > build/temp.aix-5.3-2.5/home/pxadm/.test/Python-2.5/Modules/_localemodule.o > > -L/usr/local

MySQLdb windows binaries for Python 2.5??

2006-11-01 Thread Chris Seymour
HI All, Does such a beast exist? Have been looking but haven't seen any. Any insight would be appreciated. Thanks. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: report progress from C function

2006-11-01 Thread John Machin
On 2/11/2006 12:53 AM, Michael S wrote: > I downloaded Pyrex and ran it through their own > example. The code looks quite messy, and I even saw a > few "goto"s. > I think I will stick with my own code for now. > Thanks in any case. If your own code is doing the right amount of reference counting,

Re: Style for modules with lots of constants

2006-11-01 Thread bearophileHUGS
Rob Williscroft: > This is nice, but you can cut down on some of the cruft: > > class Constants( object ): > pass > > Constants.RIGHT = 0 > Constants.LEFT = 1 > > ## client code ... > print Constants.LEFT Another possibility is to define such constants as strings instead of integers: _allflags

Re: Where do nested functions live?

2006-11-01 Thread Frederic Rentsch
Rob Williscroft wrote: > Frederic Rentsch wrote in news:mailman.1556.1162316571.11739.python- > [EMAIL PROTECTED] in comp.lang.python: > > >> Rob Williscroft wrote: >> >>> Frederic Rentsch wrote in news:mailman.1536.1162292996.11739.python- >>> Rob Williscroft wrote:

Re: 3d programming without opengl

2006-11-01 Thread Kenneth Long
you might find this interesting... www.ogre3d.org/ and its python wrapper http://www.ogre3d.org/wiki/index.php/PyOgre With /without Hardware acceleration... with /without OpenGL or DirectX... hello Ge

Re: Style for modules with lots of constants

2006-11-01 Thread Paul McGuire
"Rob Williscroft" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul McGuire wrote in news:[EMAIL PROTECTED] in > comp.lang.python: > >> >> class Constants(object) >> pass >> >> (I guess value immutability could probably be implemented using clever >> implementations of __seta

Re: Style for modules with lots of constants

2006-11-01 Thread Rob Williscroft
Paul McGuire wrote in news:[EMAIL PROTECTED] in comp.lang.python: > > class Constants(object) > pass > > (I guess value immutability could probably be implemented using clever > implementations of __setattr__ and such, but is it really worth the > bother?). > > Then I defined the context

Re: Style for modules with lots of constants

2006-11-01 Thread Neil Cerutti
On 2006-11-01, Paul McGuire <[EMAIL PROTECTED]> wrote: > I recently had to add some new constants to pyparsing, > representing LEFT and RIGHT, but I didn't want to define such > generic and likely-to-collide-with-user-code variable names. > > I settled on defining my own flavor of the Bag class, wh

Re: Style for modules with lots of constants

2006-11-01 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Errata: > opAssoc = Constants(object) Urk! Should be "opAssoc = Constants()" > and so on. In the client modules they would simply enter "from glk import > fileusage, filemode". Or if they just "import glk", the refere

Re: Style for modules with lots of constants

2006-11-01 Thread Neil Cerutti
On 2006-11-01, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Neil Cerutti: >> scriptref = glk.fileref_create_by_prompt('Transcript+TextMode', >>'WriteAppend', 0) > > That "+" sign seems useless. A space looks enough to me. The > functions can accept case-agnostic strings and ignore spaces > in

Re: Style for modules with lots of constants

2006-11-01 Thread bearophileHUGS
Neil Cerutti: > scriptref = glk.fileref_create_by_prompt('Transcript+TextMode', >'WriteAppend', 0) That "+" sign seems useless. A space looks enough to me. The functions can accept case-agnostic strings and ignore spaces inside them. Example: ('transcript textmode ', 'writeappend', 0) > Pars

Re: Style for modules with lots of constants

2006-11-01 Thread Paul McGuire
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The Glk API (which I'm implementing in native Python code) > defines 120 or so constants that users must use. The constants > already have fairly long names, e.g., gestalt_Version, > evtype_Timer, keycode_PageDown. > > Ca

Re: 3d programming without opengl

2006-11-01 Thread Grant Edwards
On 2006-11-01, Will McGugan <[EMAIL PROTECTED]> wrote: > If you are worried about running your 3d app on older > machines, OpenGL will typically fall back to software > rendering if the hardware isn't available. That's true. OpenGL (which will do SW rendering) will certainly be available on most

Re: Remote Objects via CGI?

2006-11-01 Thread Diez B. Roggisch
kpd wrote: > Three are lots of good looking remote-object implementations for Python > such as Pyro, Rpyc, and PyInvoke.All of these require a deamon > running to serve the remote objects. > > Has anyone seen a method of doing this using CGI or FastCGI instead of > a deamon? I'm not worried

Re: Beginning setup problem

2006-11-01 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Before few months,I write to this mailing list with python script > install problem,but nobody give me right solution.I work on windows > XP,and Python 2.4. > Now,when I write in Python 2.4: > from distutils.core import setup setup(..) # whatever I write c

Re: ANN: SPE 0.8.3.c Python IDE editor

2006-11-01 Thread SPE - Stani's Python Editor
I checked the berlios site and it seems to be working. Or do you have another problem? Stani Chris Seymour schreef: > Hi Stani, > Not able to reach Berlios. The SourceForge page does not have the > Windows installer. Any ideas when it will be available? > > Thanks. > > Chris > Bernard wrote: >

Re: Why can't you assign to a list in a loop without enumerate?

2006-11-01 Thread Fredrik Lundh
Bjoern Schliessmann wrote: >> define "it". > > Sorry! I mean iterating over a list and having the list index > available in the loop. Like: > > for i, thing in enumerate(things): > pass "enumerate" is the obviously right thing for this, sure. but it's not necessarily the right thing for t

  1   2   >