Re: PEP 359: The "make" Statement

2006-04-13 Thread OKB (not okblacke)
Nicolas Fleury wrote: > I have no idea of the > implementation implications, but it would be nice to have the > capability to override the namespace type to use something else > than dict, so that it can be filled with symbols one statement at a > time. I agree. I have sometimes wante

A problem with exec statement

2006-04-13 Thread TPJ
I have the following code: --- def f(): def g(): a = 'a' # marked line 1 exec 'a = "b"' in globals(), locals() print "g: a =", a a = 'A' # marked line 2 exec 'a = "B"' in globals(), locals() print "f: a =", a g() f(

Re: Remove Whitespace

2006-04-13 Thread John Machin
On 14/04/2006 12:51 PM, Felipe Almeida Lessa wrote: > Em Sex, 2006-04-14 às 12:46 +1000, Steven D'Aprano escreveu: >> Why would you want to call in the heavy sledgehammer of regular >> expressions for cracking this peanut? > > And put heavy on that! > > $ python2.4 -mtimeit -s "str = 'D c a V e r

wx.DC problem

2006-04-13 Thread python
I’m trying to create a way to pass the wx.dc object between multiple object, and its mostly working… I can get two different panels to draw to the same DC but when I scale the window out… it looks like the 2nd panel is getting blocked by something, im not sure if its a OnPaint problem or Maybe some

Re: reading files in small chunks?

2006-04-13 Thread Felipe Almeida Lessa
Em Sex, 2006-04-14 às 13:45 +0800, Rajesh Sathyamoorthy escreveu: > I wanted to know why it is more efficient to read a file in smaller > chunks ( using file() or open() )? It's more efficient in some cases, and worse on others. It also depends on how you implement the read loop. I won't elaborate

reading files in small chunks?

2006-04-13 Thread Rajesh Sathyamoorthy
Hi,I wanted to know why it is more efficient to read a file in smaller chunks ( using file() or open() )? If this is not done, will this lead to errors in the data read or just results in slower performance? Thank You. -- http://mail.python.org/mailman/listinfo/python-list

Re: list.clear() missing?!?

2006-04-13 Thread Felipe Almeida Lessa
Em Sex, 2006-04-14 às 09:17 +0400, Sergei Organov escreveu: > I, as a newcomer, don't have much trouble understanding the binding vs > the assignment by themselves. What does somewhat confuse is dual role of > the "=" operator, -- sometimes it means "bind" and other times it means > "assign", right

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread BartlebyScrivener
Yes, but for some reason, I get more and better help here with Python than on xemacs. Or maybe I've just had bad luck. Something like the following just leaves me scratching my head. I'm on Windows XP and never compiled anything that I know of. I'd rather pay $30 and have the editor work. "Bart

Re: list.clear() missing?!?

2006-04-13 Thread Sergei Organov
Peter Hansen <[EMAIL PROTECTED]> writes: [...] > Then it's a good reason we had this thread, so you could learn something > *crucial* to understanding Python and writing non-buggy code: name > binding versus variables which occupy fixed memory locations like in > some other languages. This has

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread Sergei Organov
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: >>> When all I started looking for was a more robust editor for Python ;-) > > Both WingIDE and Komodo Dragon allow for customization of keyboard > bindings. They aren't free, but they cost only $30.00 or so. Cheap for > what you get, especially in th

Re: How to create a single executable console application?

2006-04-13 Thread Podi
Alright, pythoneers, here is what I have found from http://wiki.wxpython.org/index.cgi/CreatingStandaloneExecutables. This is much easier than the py2exe + nullsoft combo :) Cheers! The mcillian installer development is discontinued. mirror: http://davidf.sjsoft.com/mirrors/mcmillan-inc/installe

Re: Kross - Start of a Unified Scripting Approach

2006-04-13 Thread Jerry
So, this would be like .Net or Mono, but for KOffice? Kind of like AppleScript then? Sorry, just starting to learn about some of this stuff (CLI, CLR, CIL, etc...) and am interested in understanding better. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 359: The "make" Statement

2006-04-13 Thread Felipe Almeida Lessa
Em Qui, 2006-04-13 às 23:17 -0400, Nicolas Fleury escreveu: > The callable could have something like a __namespacetype__ that could be > use instead of dict. That type would have to implement __setitem__. Or the namespace variable could be a list of tuples. -- Felipe. -- http://mail.python.o

Re: PEP 359: The "make" Statement

2006-04-13 Thread Nicolas Fleury
Steven Bethard wrote: > Ok, I finally have a PEP number. Here's the most updated version of the > "make" statement PEP. I'll be posting it shortly to python-dev. > > Thanks again for the previous discussion and suggestions! I find it very interesting. My only complaint is that it is limited t

Re: namespace issue

2006-04-13 Thread Steven D'Aprano
On Thu, 13 Apr 2006 22:59:52 +0200, Daniel Nogradi wrote: > I would like to give the same name to a keyword argument of a class > method as the name of a function, with the function and the class > living in the same namespace and the class method using the > aforementioned function. That's a pr

Re: Remove Whitespace

2006-04-13 Thread Martin Blais
On 13 Apr 2006 12:32:56 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > re.sub() doesn't do the substitution in place: it returns the resulting > string. Try this: In-place substitution is impossible in Python, strings are immutable. -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove Whitespace

2006-04-13 Thread Felipe Almeida Lessa
Em Sex, 2006-04-14 às 12:46 +1000, Steven D'Aprano escreveu: > Why would you want to call in the heavy sledgehammer of regular > expressions for cracking this peanut? And put heavy on that! $ python2.4 -mtimeit -s "str = 'D c a V e r \" = d w o r d : 0 0 0 0 0 6 4 0'" 'str.replace(" ", "")' 1

Re: How to create a single executable console application?

2006-04-13 Thread Podi
Alright, pythoneers, here is what I have found from http://wiki.wxpython.org/index.cgi/CreatingStandaloneExecutables. This is much easier than the py2exe + nullsoft combo :) Cheers! The mcillian installer development is discontinued. mirror: http://davidf.sjsoft.com/mirrors/mcmillan-inc/installe

Re: PEP 359: The "make" Statement

2006-04-13 Thread Steven D'Aprano
On Thu, 13 Apr 2006 13:39:14 -0700, gangesmaster wrote: > "make type" is uber leet So you're against it then? -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2006-04-13 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 383 open ( -8) / 3156 closed (+14) / 3539 total ( +6) Bugs: 886 open (-12) / 5759 closed (+28) / 6645 total (+16) RFE : 210 open ( -5) / 212 closed ( +5) / 422 total ( +0) New / Reopened Patches __ socket.py

Re: Remove Whitespace

2006-04-13 Thread Steven D'Aprano
On Thu, 13 Apr 2006 12:09:32 -0700, Kelvie Wong wrote: > try this: > > string = 'D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0' > import re > re.sub("\s", "", string) Why would you want to call in the heavy sledgehammer of regular expressions for cracking this peanut? old_s = 'D c a V e r " = d w

setup.py on unix/linux and converting to windows

2006-04-13 Thread AIM
Hi all, I have a general question and some advice is needed. Over time, I am running into python modules with setups that are just made for linux/unix. I have python installed on windows. To get these modules into windows, should I do the following? (1) Install cygwin. (2) compile/setup the p

Re: Kross - Start of a Unified Scripting Approach

2006-04-13 Thread Alex Martelli
RM <[EMAIL PROTECTED]> wrote: > This is from the new KOffice Announcement. > > http://www.koffice.org/announcements/announce-1.5.php > > '''This version of KOffice features a start of a unified scripting > solution called Kross. Kross provides cross-language support for > scripting (thus its nam

Re: print without newline "halts" program execution

2006-04-13 Thread Jay Parlar
On Apr 13, 2006, at 5:57 PM, Karlo Lozovina wrote: > Consider this short script: > > --- > from time import time, sleep > > st = time() > print 'Start: %f, ' % st, > sleep(10) > sp = time() > print 'Stop: %f, Duration: %f' % (sp, (st - sp)) > --- > > On my environment (Linux, py24), when run, Pyt

print without newline "halts" program execution

2006-04-13 Thread Karlo Lozovina
Consider this short script: --- from time import time, sleep st = time() print 'Start: %f, ' % st, sleep(10) sp = time() print 'Stop: %f, Duration: %f' % (sp, (st - sp)) --- On my environment (Linux, py24), when run, Python first waits 10s, and then produces the entire output. How, can I make i

Re: Forms with multiple submit buttons vs 'form' objects with single 'submit' methods

2006-04-13 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Here's my question: Suppose a form has more than one submit button. > Now the COM 'form' object has a 'submit' method that doesn't take any > arguments, so how do I tell it which button I want to press? What difference does it make? Don't they all do the same thing?

Re: namespace issue

2006-04-13 Thread Steven Bethard
Daniel Nogradi wrote: > I would like to give the same name to a keyword argument of a class > method as the name of a function, with the function and the class > living in the same namespace and the class method using the > aforementioned function. So far I've been unsuccesfully trying to go > alon

Socket Error: Connection Refused

2006-04-13 Thread niceyama
Dear c.l.p, I have recently been doing the tutorial of Python and everything is well, i'm upto the pass section. Anyway, when I try to launch idle now I get the error message: Socket Error: Connection Refused. I do not have a firewall, so I don't know what is going on. Also, this comes up afte

telnet read_sb_data

2006-04-13 Thread Arne
Hello! Task: Connecting to a unix server and getting the directory list . OS: XP Connecting to the server via telnet is no problem. I also want to get the directory list. I know by using read_all I can get all the output (starting from the login up to the end). 1. What I look for is the option t

BSTR

2006-04-13 Thread Aleksandar Cikota
Hi all, I'm beginner in Python and need help. I'm writing software for a robotic telescope. For CCD camera control we use MaxIm DL (Diffraction Limited). I have a problem with CCDCamera.SaveImage. Error message: >File "S:MaxImmaxim.py", line 19, in ? > CCDCamera.SaveImage('C:/1.fit') >

Buffer.so,oci.so compilation for DCoracle

2006-04-13 Thread tksri2000
I am trying to compile Buffer.so for oracle 10g. This is as part of DCoracle installation. I am following the instructions under src/README.txt. ORACLE_PATH=.:/opt/oracle/product/10.2.0/bin Python 2.4.3 (#2, Apr 10 2006, 13:02:28) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-53)] on linux2 I get t

Re: List comp bug?

2006-04-13 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [f() for f in [lambda: t for t in ((1, 2), (3, 4))]] > is giving me > [(3, 4), (3, 4)] > > The equivalent using a generator expression: List comps were originally designed to be equivalent to for loops with nested for loops and i

Building Python with the free MS Toolkit compiler

2006-04-13 Thread Paul Moore
I've just added some instructions on how to build Python on Windows with the free MS Toolkit C++ compiler. They are at http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit. Most of the credit for this goes to David Murmann, whose posting on the subject to python-list pointed out

Re: namespace issue

2006-04-13 Thread Daniel Nogradi
Ooops, there was a typo in my previous mail: > in the hope of the del statement only removing the local variable util ^ the above line should be: in the hope of the del statement only removing the lo

Re: Forms with multiple submit buttons vs 'form' objects with single 'submit' methods

2006-04-13 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I'm using pywin to write a script that will commandeer internet > explorer to go to a certain website, where it will navigate menus, post > forms, and eventually retrieve certain data. > > Here's my question: Suppose a f

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread Carl Banks
Thomas Bartkus wrote: > I do notice that I can invoke wordstar-mode *after* loading the .py file and > get the whole enchilada. The Wordstar key bindings with the syntax > highlighting. > It just strikes me as odd that key bindings should be reasserted by invoking > python-mode. Ah--you're only t

Re: Forms with multiple submit buttons vs 'form' objects with single 'submit' methods

2006-04-13 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I'm using pywin to write a script that will commandeer internet > explorer to go to a certain website, where it will navigate menus, post > forms, and eventually retrieve certain data. > > Here's my question: Suppose a f

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Erik Max Francis
Ben Sizer wrote: > Why is Wikipedia being abused for software promotion and documentation? > Articles on Wikipedia are supposed to be from a neutral point of view > and purely informative, not biased or instructive. Because it's Wikipedia? This kind of garbage is the inevitable result of an "en

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread John J. Lee
"Carl Banks" <[EMAIL PROTECTED]> writes: [...] > >1) When I load a .py file, emacs automatically overrides my wordstar-mode > > with python-mode, forcing all the keybindings back to emacs native keys. > > Why? [...] > Python and wordstar are both major modes. When python-mode is loaded, > it r

namespace issue

2006-04-13 Thread Daniel Nogradi
I would like to give the same name to a keyword argument of a class method as the name of a function, with the function and the class living in the same namespace and the class method using the aforementioned function. So far I've been unsuccesfully trying to go along these lines: def great_name(

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread BartlebyScrivener
Pretty tough to beat Alan Gauld, but the more examples the merrier for me, and the infogami has plenty of those. Thanks. http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 359: The "make" Statement

2006-04-13 Thread gangesmaster
"make type" is uber leet -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python cgkit v2.0.0alpha6 & Maya Python package

2006-04-13 Thread Matthias Baas
The sixth alpha release of version 2 of the Python Computer Graphics Kit is available at http://cgkit.sourceforge.net This release also comes with a "preview" version of a Maya Python package that integrates Python into the 3D tool Maya. What is it? --- The Python Computer Graphics Kit

Re: Forms with multiple submit buttons vs 'form' objects with single 'submit' methods

2006-04-13 Thread Tim Williams (gmail)
On 13 Apr 2006 12:26:52 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:Hi all,  I'm using pywin to write a script that will commandeer internet explorer to go to a certain website, where it will navigate menus, postforms, and eventually retrieve certain data.  Here's my question:  Suppose a fo

Announce: Construct's wiki!

2006-04-13 Thread gangesmaster
finally, i opened a wiki for Construct, the "parsing made fun" library. the project's page: http://pyconstruct.sourceforge.net/ the project's wiki: http://pyconstruct.wikispaces.com/ (anyone can edit) so now we have one place where people can share inventory constructs, questions-and-answers, pat

Re: function prototyping?

2006-04-13 Thread Burton Samograd
bruno at modulix <[EMAIL PROTECTED]> writes: > Burton Samograd wrote: > > "infidel" <[EMAIL PROTECTED]> writes: > > I'm a C programmer, so I'm doing it in a bit of a C like way; > > prototype the function, initalize the array using the prototypes, have > > the functions defined somewhere else and

Re: Remove Whitespace

2006-04-13 Thread Jay Parlar
On Apr 13, 2006, at 12:09 PM, Kelvie Wong wrote: > try this: > > string = 'D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0' > import re > re.sub("\s", "", string) > > On 4/13/06, david brochu jr <[EMAIL PROTECTED]> wrote: > Even easier (if you only want to replace blank spaces, and not all whitespa

Re: Remove Whitespace

2006-04-13 Thread [EMAIL PROTECTED]
re.sub() doesn't do the substitution in place: it returns the resulting string. Try this: myString = 'D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0' import re newString = re.sub("\s", "", myString) print newString -- http://mail.python.org/mailman/listinfo/python-list

Forms with multiple submit buttons vs 'form' objects with single 'submit' methods

2006-04-13 Thread neil . fitzgerald
Hi all, I'm using pywin to write a script that will commandeer internet explorer to go to a certain website, where it will navigate menus, post forms, and eventually retrieve certain data. Here's my question: Suppose a form has more than one submit button. Now the COM 'form' object has a 'su

Re: function prototyping?

2006-04-13 Thread Peter Otten
Burton Samograd wrote: > Duncan Booth <[EMAIL PROTECTED]> writes: > >> Burton Samograd wrote: >> > Is there any way to 'prototype' functions in python, as you would in >> > C? Would that be what the 'global' keyword is for, or is there a more >> > elegant or 'pythonic' way of doing forward refer

Re: Looking for thoughts on PyMPI

2006-04-13 Thread M�ta-MCI
Hi! And a small glance on Candygram (http://candygram.sourceforge.net/) can be funny... @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove Whitespace

2006-04-13 Thread Kelvie Wong
try this: string = 'D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0' import re re.sub("\s", "", string) On 4/13/06, david brochu jr <[EMAIL PROTECTED]> wrote: > > Hi again, > > Trying to remove whitespace from a string in a text file. > > the string is: > D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0 >

Re: just one more question about the python challenge

2006-04-13 Thread Jerry
John, If you are really frustrated with this one (like I was on 14), email me off-list to get further hints. I'm willing to help you out. I wish that someone was around to help me work through some of these. I really think they are more fun/helpful when you work on them with another person so if

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread Kent Johnson
John Salerno wrote: > Couldn't we also say that this issue of namespace scope is a little more > specific to Python than OOP in general? I could very easily be wrong, > but I wouldn't want the poster to think that this is how OOP works always. No, the confusion in the OP was between class attrib

Remove Whitespace

2006-04-13 Thread david brochu jr
Hi again,   Trying to remove whitespace from a string in a text file.   the string is: D c a V e r " = d w o r d : 0 0 0 0 0 6 4 0   how would i go about doing this? -- http://mail.python.org/mailman/listinfo/python-list

Re: function prototyping?

2006-04-13 Thread bruno at modulix
Burton Samograd wrote: > "infidel" <[EMAIL PROTECTED]> writes: > > >>If you want the user to be able to (re)define them in config.py, why >>not just define them there in the first place? I may be wrong, but I >>think "global" means "module level" rather than "interpreter level". > > > That's w

BSTR

2006-04-13 Thread Aleksandar Cikota
 Hi all,   I'm beginner in Python and need help. I'm writing software for a robotic telescope. For CCD camera control we use MaxIm DL (Diffraction Limited). I have a problem with CCDCamera.SaveImage.   Error message: >    File "S:MaxImmaxim.py", line 19, in ?>  CCDCamera.SaveImage('C:/1.f

Re: function prototyping?

2006-04-13 Thread bruno at modulix
Burton Samograd wrote: > bruno at modulix <[EMAIL PROTECTED]> writes: (snip) >>*But* is it necessary to have the main() in the same file that defines >>a_fun and b_fun ? It's quite common (and not only in Python) to use a >>distinct file for the main(). So you can easily solve your problem by >>s

Re: function prototyping?

2006-04-13 Thread Burton Samograd
bruno at modulix <[EMAIL PROTECTED]> writes: > Burton Samograd wrote: > > Duncan Booth <[EMAIL PROTECTED]> writes: > > dont use 'dict' as an identifier, it shadows the builtin dict type. just an example i jotted down, not real code. > > 'a': a_fun, > > 'b': b_fun > > } > > -

Re: function prototyping?

2006-04-13 Thread Burton Samograd
"infidel" <[EMAIL PROTECTED]> writes: > If you want the user to be able to (re)define them in config.py, why > not just define them there in the first place? I may be wrong, but I > think "global" means "module level" rather than "interpreter level". That's what I'm trying to do but I'm running

Re: function prototyping?

2006-04-13 Thread infidel
If you want the user to be able to (re)define them in config.py, why not just define them there in the first place? I may be wrong, but I think "global" means "module level" rather than "interpreter level". -- http://mail.python.org/mailman/listinfo/python-list

Re: function prototyping?

2006-04-13 Thread bruno at modulix
Burton Samograd wrote: > Duncan Booth <[EMAIL PROTECTED]> writes: > > >>Burton Samograd wrote: >> >>>Is there any way to 'prototype' functions in python, as you would in >>>C? Would that be what the 'global' keyword is for, or is there a more >>>elegant or 'pythonic' way of doing forward referen

Re: Can't see the forest for the trees - when reading file, only processing first line

2006-04-13 Thread bruno at modulix
News wrote: > Hi Everyone, > > > The attached code creates client connections to websphere queue managers > and then processes an inquiry against them. > > The program functions when it gets options from the command line. > > It also works when pulling the options from a file. > > My issue is

Re: function prototyping?

2006-04-13 Thread Burton Samograd
Duncan Booth <[EMAIL PROTECTED]> writes: > Burton Samograd wrote: > > Is there any way to 'prototype' functions in python, as you would in > > C? Would that be what the 'global' keyword is for, or is there a more > > elegant or 'pythonic' way of doing forward references? > > > There isn't really

Re: list.clear() missing?!?

2006-04-13 Thread Raymond Hettinger
[Dan Christensen] > It's true that this runs at the same speed as the del variants on my > machine. That's not too surprising to me, but I still don't > understand why the del variants are more than 5% faster than the first > version. Understanding it involves looking at implementation specific d

Re: Can't see the forest for the trees - when reading file, only processing first line

2006-04-13 Thread News
[EMAIL PROTECTED] wrote: > Suggest keeping it simple: > > def use_file(): > return open(options.filename).readlines() > > m > Very cool.. Didn't know you could do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: function prototyping?

2006-04-13 Thread Duncan Booth
Burton Samograd wrote: > Is there any way to 'prototype' functions in python, as you would in > C? Would that be what the 'global' keyword is for, or is there a more > elegant or 'pythonic' way of doing forward references? > There isn't really such a thing as a forward reference in Python. Always

function prototyping?

2006-04-13 Thread Burton Samograd
Hi, Is there any way to 'prototype' functions in python, as you would in C? Would that be what the 'global' keyword is for, or is there a more elegant or 'pythonic' way of doing forward references? -- burton samograd kruhft .at. gmail kruhft.blogspot.com www.

Re: Tkinter vs PyGTK

2006-04-13 Thread mwt
I've had a good experience with Pygtk. I made a small app called "Protein Think" that monitors a [EMAIL PROTECTED] client. The front end is extremely simple - basically a notebook with five small pages. It runs well and was a breeze to create. Looks much better than Tkinter, if that matters at all

Re: Can't see the forest for the trees - when reading file, only processing first line

2006-04-13 Thread matt
Suggest keeping it simple: def use_file(): return open(options.filename).readlines() m News wrote: > Hi Everyone, > > > The attached code creates client connections to websphere queue managers > and then processes an inquiry against them. > > The program functions when it gets options from the

Re: Python editing with emacs/wordstar key bindings.

2006-04-13 Thread BartlebyScrivener
>> When all I started looking for was a more robust editor for Python ;-) Both WingIDE and Komodo Dragon allow for customization of keyboard bindings. They aren't free, but they cost only $30.00 or so. Cheap for what you get, especially in the case of Komodo because it makes a nice editor for many

Re: list.clear() missing?!?

2006-04-13 Thread Sion Arrowsmith
Fredrik Lundh <[EMAIL PROTECTED]> wrote: >except that arguments along the line of "if the syntax is not obj.method(), >it's not OO enough" are likely to be mostly ignored. > >(nobody's going to be impressed by yet another "len(obj) isn't OO" variant) Does that suggest that what's needed is clear(o

Re: Can't see the forest for the trees - when reading file, only processing first line

2006-04-13 Thread Heiko Wundram
Am Donnerstag 13 April 2006 19:12 schrieb News: > The use_file() function should be returning each file line. How do you think it should do that? There's a return line statement in the function which breaks function execution right after having read the first line. Rethink your logic... --- He

Can't see the forest for the trees - when reading file, only processing first line

2006-04-13 Thread News
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command line. It also works when pulling the options from a file. My issue is that it only processes the first l

Re: Tkinter vs PyGTK

2006-04-13 Thread Lunpa
makes me wonder how useable pygui is now... I made the mistake of using wxpython a while back... having something that runs perfectly in windows, and *sorta* works in other platforms hardly counts as cross platform, imho. And they wonder why tkinter is shipped with python while wxpython is not...

Re: list.clear() missing?!?

2006-04-13 Thread Fredrik Lundh
Raymond Hettinger wrote: > Also, in the python-dev world, making something "more OO" is neither a > virtue nor a vice. except that arguments along the line of "if the syntax is not obj.method(), it's not OO enough" are likely to be mostly ignored. (nobody's going to be impressed by yet another

Re: list.clear() missing?!?

2006-04-13 Thread Raymond Hettinger
> > * the request is inane, the underlying problem is trivial, and the > > relevant idiom is fundamental (api expansions should be saved for rich > > new functionality and not become cluttered with infrequently used > > redundant entries) > > Is this sort of editorialising fair, or just a way of no

Re: Initializing defaults to module variables

2006-04-13 Thread Burton Samograd
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > since you know the name of the config file you're looking for, you can > simplify (and unweirdify) your code a bit by changing your config file to > look like this: > > # File: config.py > > # > # configuration defaults > > some_param

Re: Looking for thoughts on PyMPI

2006-04-13 Thread Konrad Hinsen
On Apr 13, 2006, at 17:37, Carl J. Van Arsdall wrote: > Hey, anyone use the PyMPI suite: http://sourceforge.net/projects/ > pympi/ ?? > > I am an engineer doing research with MPI and thought I'd do some > digging > to see if any scripting languages had adopted it yet. I was just > looking for

Re: Initializing defaults to module variables

2006-04-13 Thread Fredrik Lundh
Burton Samograd wrote: > A reply to my own question, but I thought I would share the answer. I > got it to work with the following code: > > import config > import sys > from posix import environ > sys.path.insert(0, environ["HOME"]+"/.program") > reload(config) > > I have a file in my working di

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
Roel Schroeven <[EMAIL PROTECTED]> writes: > /var/www/karrigell1 > /var/www/karrigell2 > > How do I configure everything so that they are accessible via > > http://hostname/karrigell1 > http://hostname/karrigell2 You mean you want your apache server to proxy the Karrigell pages? I usually do th

Re: new-style classes and len method

2006-04-13 Thread bruno at modulix
Thomas Girod wrote: > It's alright I found where my mistake came from. I was misunderstanding > the meaning of "classmethod", thinking of it as an instance method. Given that 'instance methods' being most of the time attributes of the class object, such a confusion is not so surprising !-) -- br

Re: Initializing defaults to module variables

2006-04-13 Thread Burton Samograd
Burton Samograd <[EMAIL PROTECTED]> writes: > Is there a way to create a module namespace and populate it > before sourcing the file? A reply to my own question, but I thought I would share the answer. I got it to work with the following code: import config import sys from posix

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Roel Schroeven
Tim Williams (gmail) schreef: > > > On 13/04/06, *Tim Williams (gmail)* <[EMAIL PROTECTED] > > wrote: > > In Karrigell you could write the host mappings into a karrigell > script (.ks) application, so you wouldn't even need to use > virtual-hosts in the co

Re: new-style classes and len method

2006-04-13 Thread bruno at modulix
Thomas Girod wrote: > Or maybe I'm mixing up what we call a "classmethod" with what we could > call an "instance method" ? > That's what I was about to point out !-) > class Data(list): > __slots__ = ["width", "height", "label"] > > def __init__(self,width,height,label=None): > l

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Roel Schroeven
Pierre Quentel schreef: > No, in the document root you create a folder "app1" and put all the > files for the first application in it, and a folder "app2" for the > second application > > For http://foo.example.com/app1 the server will search for an index > file in this directory and serve it. You

PEP 359: The "make" Statement

2006-04-13 Thread Steven Bethard
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions! PEP: 359 Title: The "make" Statement Version: $Revision: 45366 $ Last-Modified: $Date: 2006-04-13 0

Re: just one more question about the python challenge

2006-04-13 Thread John Salerno
JW wrote: > There are SEVEN pages of clues for level 12. The most recent post (to > challenge 1) was on April 11, so the forums are most certainly not > dead. I read those seven pages at least twice and they still don't make much sense to me (not to mention that many of the posts are just co

Re: new-style classes and len method

2006-04-13 Thread Thomas Girod
It's alright I found where my mistake came from. I was misunderstanding the meaning of "classmethod", thinking of it as an instance method. -- http://mail.python.org/mailman/listinfo/python-list

Re: list.clear() missing?!?

2006-04-13 Thread Fredrik Lundh
Mel Wilson wrote: > > for item in seq: > > L.append(item) > > Both extend and append have one-line slice equivalents, > except that the equivalents have to keep referring to > the length of the list.. (have to keep finding the > len function.) fwiw, the *tutorial* defines append and extend in

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread John Salerno
[EMAIL PROTECTED] wrote: > Thanks guys, > > It is starting to make much more sense. Most documentation I find about > OO is very academic Couldn't we also say that this issue of namespace scope is a little more specific to Python than OOP in general? I could very easily be wrong, but I wouldn't

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Luis M. González" <[EMAIL PROTECTED]> writes: > I appreciate all the observations regarding Wikipedia's nature, but I > confess that I'm surprised to see you, "python folks", so annoyed by > this article. I think it's more "wikipedia folks" (I'm one) who found the original version of the article

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Paul Rubin
"Pierre Quentel" <[EMAIL PROTECTED]> writes: > For http://foo.example.com/app1 the server will search for an index > file in this directory and serve it. You can also specify the script > you want : http://foo.example.com/app1/default.py. Same thing for app2 > of course. Absolutely no need to start

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: In Karrigell you could write the host mappings into a karrigell script (.ks) application, so you wouldn't  even need to use virtual-hosts in the config file.  and of course, you could just write a single ..ks  that contains (at least the

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > It is starting to make much more sense. Most documentation I find about > OO is very academic you may find Jay Parlar's new python class tutorial helpful: http://parlar.infogami.com/pytut_classes_copy (this is a proposed addition/replacement for the class chapter

Re: list.clear() missing?!?

2006-04-13 Thread Steven Bethard
Raymond Hettinger wrote: > [Steven Bethard] >> I think these are all good reasons for adding a clear method, but being >> that it has been so hotly contended in the past, I don't think it will >> get added without a PEP. Anyone out there willing to take out the best >> examples from this thread an

Looking for thoughts on PyMPI

2006-04-13 Thread Carl J. Van Arsdall
Hey, anyone use the PyMPI suite: http://sourceforge.net/projects/pympi/ ?? I am an engineer doing research with MPI and thought I'd do some digging to see if any scripting languages had adopted it yet. I was just looking for general comments and reviews from the community on this project, tha

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Pierre Quentel
No, in the document root you create a folder "app1" and put all the files for the first application in it, and a folder "app2" for the second application For http://foo.example.com/app1 the server will search for an index file in this directory and serve it. You can also specify the script you wan

quick surface plots

2006-04-13 Thread buchstaebchen
Hi folks, I need advice in finding an appropriate python module for 3D surface plots, such as for the visualization of wave-dynamics...I'd prefer something capable of being embedded in wxpython frames, as matplotlib is doing pretty well for 2D, however, I couldn't get a hold of functions like the

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Roel Schroeven <[EMAIL PROTECTED]> wrote: Tim Williams (gmail) schreef:> Karrigell will happily run multiple karrigell "applications" on a single> server .  In your example simply by having different applications at > http://foo.example.com/app1 and http://foo.example.com/app2 will d

  1   2   >