Re: Python-list Digest, Vol 27, Issue 123

2005-12-08 Thread Fredrik Lundh
Michael Williams wrote: > Thanks, Heiko, I'll give this a try. In the meantime, I'll try to > explain what exactly I mean. > > Basically, I want the ability to reference a variable just as I am > able to set a variable (or attribute) on the fly. For instance, say > the user has the following lis

Re: small inconsistency in ElementTree (1.2.6)

2005-12-08 Thread Fredrik Lundh
Damjan wrote: > Attached is the smallest test case, that shows that ElementTree returns > a string object if the text in the tree is only ascii, but returns a unicode > object otherwise. > > This would make sense if the sting object and unicode object were > interchangeable... but they are not - o

Re: ANN: pygene - genetic algorithms package

2005-12-08 Thread Erik Max Francis
malv wrote: > Thank you kindly, Erik. Sure thing. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis It is only the poor who are forbidden to beg. -- Anatole France -- http://mail.python.org/mailman/listinfo

Re: ANN: pygene - genetic algorithms package

2005-12-08 Thread malv
Thank you kindly, Erik. malv -- http://mail.python.org/mailman/listinfo/python-list

Re: sql escaping module - Frank Millman Followup

2005-12-08 Thread Frank Millman
David Bear wrote: > > The statement above can cause relief or pain. Letting the DBAPI handle > proper string escapes, formating, etc., is a big relief. However, I am > still wondering what happens under the covers. If I have a string '1\n' > that I've read from some source and I really intend on i

Re: subset permutations

2005-12-08 Thread Ben Finney
Jay Parlar <[EMAIL PROTECTED]> wrote: > For instance, say you have the list ['A','B',C','D'], and you want > all possible TWO letter permutations. $ dict permutation From The Collaborative International Dictionary of English v.0.48 [gcide]: Permutation \Per`mu*ta"tion\ (p[~e]r`m[-u

Re: Another newbie question

2005-12-08 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> My standard object interface is modeled after Meyer's presentation in >> OOSC: an objects state is manipulated with methods and examined with >> attributes; manipulating attributes doesn't change the internal state

Re: ANN: pygene - genetic algorithms package

2005-12-08 Thread Erik Max Francis
malv wrote: > How is your package different from a nn package? Is this an addon for > genetic programming or does it include the standard nn components as > well, such as backprop etc? > Not being very familiar with genetic programming, forgive me my naive > question, I could not immediately find

Re: Documentation suggestions

2005-12-08 Thread BartlebyScrivener
You guys are all wizards from mars. If it's easy to do I can tell you that it would very seductive to a prospective Pythoner, and you avoid the problem of making them download before they can try out a tutorial. Thanks for looking at it. rd -- http://mail.python.org/mailman/listinfo/python-list

Re: subset permutations

2005-12-08 Thread Rick Wotnaz
Jay Parlar <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > http://www.bigbold.com/snippets/posts/show/753 A string is also iterable, so whether s is the string (as shown) or list('ACDEFGHIKLMNPQRSTVWY'), as you have it above, this should generate the 16 permutations, as a list of 4-

Re: Another newbie question

2005-12-08 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > My standard object interface is modeled after Meyer's presentation in > OOSC: an objects state is manipulated with methods and examined with > attributes; manipulating attributes doesn't change the internal state > of the object. This makes it possible to ch

Re: Using printf in a C Extension

2005-12-08 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I am extending python with C and trying to debug with printf. The code > below succssfully returns the string "hello" when compiled and called, > but the "can print from in here phrase" does not reach python stdout. Is > there something screwy with my environment or

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 7)

2005-12-08 Thread David Isaac
"Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jibes against the lambda-clingers lead eventually to serious > questions of style in regard to variable namespacing, > lifespan, cleanup, and so on: > http://groups.google.com/group/comp.lang.python/browse_th

small inconsistency in ElementTree (1.2.6)

2005-12-08 Thread Damjan
Attached is the smallest test case, that shows that ElementTree returns a string object if the text in the tree is only ascii, but returns a unicode object otherwise. This would make sense if the sting object and unicode object were interchangeable... but they are not - one example, the translate

Re: subset permutations

2005-12-08 Thread Jay Parlar
On Dec 8, 2005, at 5:29 PM, [EMAIL PROTECTED] wrote: > > Hello all, >   > I'm a beginner with programming. Trying to teach myself with that > excellent rat book. Unfortunately I just can't seem to figure out a > simple problem that has come up at my work (biology lab): > let's say I have a lis

Re: Another newbie question

2005-12-08 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: Yes. Reaching through objects to do things is usually a bad idea. >>>I don't necessarily disagree, but I don't understand why you say this. Why >>>it is bad? >> The traditional OOP sp

Using printf in a C Extension

2005-12-08 Thread user
Hi, I am extending python with C and trying to debug with printf. The code below succssfully returns the string "hello" when compiled and called, but the "can print from in here phrase" does not reach python stdout. Is there something screwy with my environment or is there some trick to thi

Re: Dynamically add Class to Modules

2005-12-08 Thread Michael Spencer
[EMAIL PROTECTED] wrote: ... > exec testModule.TheTestCode %(testModule.TheTestName, testModule.TheTestName ) ... Try changing that to exec ~ in testModule.__dict__ otherwise, your class statement gets executed in the current scope Michael -- http://mail.python.org/mailman/listinfo/python-lis

Re: Documentation suggestions

2005-12-08 Thread Terry Hancock
On Thu, 08 Dec 2005 18:43:56 -0500 Mike Meyer <[EMAIL PROTECTED]> wrote: > "BartlebyScrivener" <[EMAIL PROTECTED]> writes: > > Too bad there > > isn't something like what Ruby does with the "Try Ruby > > In Your Browser" thing, which is a very effective > > marketing tool (although obviously I cho

Re: Unexpected behavior of read only attributes and super

2005-12-08 Thread Samuel M. Smith
> >> Then why wasn't __class__ added to c.__dict__ ? Looks like namespace >> searching to me. > > No, as you conclude later, __class__ is special, so you can still > assign > to __class__ even when __slots__ is defined because it's not > considered > a normal attribute. But note that __class__

Re: Dynamically add Class to Modules

2005-12-08 Thread callmebill
Oh! I see what I missed. I didn't supply the namespace into which the new class was going to be added (correct that statement, please, if it is incorrect). So by using this slight modification, thinks seemed to work: exec testModule.TheTestCode %(testModule.TheTestName, testModule.TheTestName )

installer question

2005-12-08 Thread Guy Robinson
Target audience is little or no programming experience. I have a win32 only library I need to write an installer for. As part of the installation it must: 1.. find where a program is installed 2.. copy a file to the directory 3.. add the directory to the pythonpath and change a ini file. 4.. add

Re: Documentation suggestions

2005-12-08 Thread skip
Trent> Nah, the Try Ruby thing is mostly faking it (I believe) rather Trent> than running an actually Ruby interactive session ("bastion'ed" Trent> or not). I don't think so. I tried typing some stuff at the prompt that it wasn't asking for, like "x = [1,2,3]" followed by "x * 5" whe

Re: hi i have some doubts on a volume and the file system

2005-12-08 Thread muttu2244
Hi Tim, Thanks for that help, that code is indeed working fine thanks a ton for that regards yogi Tim Golden wrote: > [EMAIL PROTECTED] > > > i want to check the position of a volume in a particular > > drive. say for example in a disk i have 3 different drives: > > C:\ , D:\ and E:\. > > Now

Re: Dynamically add Class to Modules

2005-12-08 Thread callmebill
Hi Michael... It didn't seem to take. Here is some of the actual code: [[ from the runner ] print "+++" print "::Dir before exec:",dir(testModule) import CodeGenBase

Re: Documentation suggestions

2005-12-08 Thread skip
Mike> The question is how do you keep the system that the Python code is Mike> actually running on safe? Ruby may have a real bastion mode, but Mike> Python doesn't. User Mode Linux? chroot? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation suggestions

2005-12-08 Thread Trent Mick
[Mike Meyer wrote] > "BartlebyScrivener" <[EMAIL PROTECTED]> writes: > > Too bad there > > isn't something like what Ruby does with the "Try Ruby In Your Browser" > > thing, which is a very effective marketing tool (although obviously I > > chose Python). > > > > http://tryruby.hobix.com/ > > I've

subset permutations

2005-12-08 Thread me you
Hello all,   I'm a beginner with programming. Trying to teach myself with that excellent rat book. Unfortunately I just can't seem to figure out a simple problem that has come up at my work (biology lab): let's say I have a list ['A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','

Re: Another newbie question

2005-12-08 Thread Steven D'Aprano
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >>>Yes. Reaching through objects to do things is usually a bad idea. >> >>I don't necessarily disagree, but I don't understand why you say this. Why >>it is bad? > > > The traditional OOP spirit is to encapsulate the object's en

Re: Another newbie question

2005-12-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > > I'm off to study the code. (Hmm.. how does python parse ("green", > "red")[(i * 8 + j) % 2] command ... ("green", "red")[0] == "green" ("green", "red")[1] == "red" (i * 8 + j) is somewhat trivial (just take care of precedence order), and will return an integer

Re: Documentation suggestions

2005-12-08 Thread Aahz
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: >"BartlebyScrivener" <[EMAIL PROTECTED]> writes: >> >> Too bad there >> isn't something like what Ruby does with the "Try Ruby In Your Browser" >> thing, which is a very effective marketing tool (although obviously I >> chose Py

Re: Python-list Digest, Vol 27, Issue 123

2005-12-08 Thread Michael Williams
Thanks, Heiko, I'll give this a try.  In the meantime, I'll try to explain what exactly I mean.Basically, I want the ability to reference a variable just as I am able to set a variable (or attribute) on the fly.  For instance, say the user has the following list in a text file: [butter, cream, eggs

Re: Documentation suggestions

2005-12-08 Thread Mike Meyer
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > Too bad there > isn't something like what Ruby does with the "Try Ruby In Your Browser" > thing, which is a very effective marketing tool (although obviously I > chose Python). > > http://tryruby.hobix.com/ I've seen things like this for other lang

hp-ux crash: threading within a c++ module.

2005-12-08 Thread [EMAIL PROTECTED]
[also sent to [EMAIL PROTECTED] Hi Python Experts, I am developing a Python interface to an existing (multithreaded) c++ api. I have it working on several platforms (linux, solaris, irix, windoze) but I am having a few problems with threading on hp-ux and aix platforms. Here is one of the prob

Re: Another newbie question

2005-12-08 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Yes. Reaching through objects to do things is usually a bad idea. > I don't necessarily disagree, but I don't understand why you say this. Why > it is bad? The traditional OOP spirit is to encapsulate the object's entire behavior in the class defini

Re: Another newbie question

2005-12-08 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote: >> "solaris_1234" <[EMAIL PROTECTED]> writes: >>> 1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems >>> awkward. Is there another way (cleaner, more intuitive) to get the >>> same th

Re: Dynamically add Class to Modules

2005-12-08 Thread Mike Meyer
[EMAIL PROTECTED] writes: > So: Does anyone know how dynamically generate a class, and add it to a > "module" that is already in memory? How about adding a step: generate your class to a file import the file as a module. bind a name in "module" to the class in the imported module.

Re: Another newbie question

2005-12-08 Thread Kent Johnson
Steven D'Aprano wrote: > On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote: >>>1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems >>>awkward. Is there another way (cleaner, more intuitive) to get the >>>same thing done? >> >>Yes. Reaching through objects to do things is usually a

Re: Encoding of file names

2005-12-08 Thread Martin v. Löwis
utabintarbo wrote: > Fredrik, you are a God! Thank You^3. I am unworthy > > I believe that may do the trick. Here is the results of running your > code: For all those who followed this thread, here is some more explanation: Apparently, utabintarbo managed to get U+2592 (MEDIUM SHADE, a filled 5

Re: Unexpected behavior of read only attributes and super

2005-12-08 Thread Steven Bethard
Samuel M. Smith wrote: > If you would care to elaborate on the how the lookup differs with > method descriptor it would be most appreciated. For the more authoritative guide, see: http://users.rcn.com/python/download/Descriptor.htm The basic idea is that a descriptor is an object that sits

Moving a package in cygwin

2005-12-08 Thread 63q2o4i02
Hi, I'm using python 2.4 and windows XP. I have two packages in the windows version of python in site-packages. They are PyVisa and ctypes, and both live in c:\python24\lib\site-packages I'd like to move these to the cygwin version of python on the same system. I tried copying the PyVisa and ct

Re: Dynamically add Class to Modules

2005-12-08 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > I'm trying to add a class to a module at runtime. I've seen examples > of adding a method to a class, but I haven't been able to suit it to my > needs. > > As part of a testsuite, I have a main process X that searches > recursively for python test files. Those files ty

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-08 Thread Steven D'Aprano
On Thu, 08 Dec 2005 08:23:52 +, Antoon Pardon wrote: > Op 2005-12-07, Steven D'Aprano schreef <[EMAIL PROTECTED]>: >> On Wed, 07 Dec 2005 15:26:59 +, Zeljko Vrba wrote: >> >>> Braces are very convenient to match block start and end. Open a C program >>> in the VI editor, and press % in com

Re: sql escaping module - Frank Millman Followup

2005-12-08 Thread David Bear
>Steve Holden wrote: > Fredrik Lundh wrote: >> Frank Millman wrote: >> >> >>>Each of the API's includes the capability of passing commands in the >>>form of 'string + parameters' directly into the database. This means >>>that the data values are never embedded into the SQL command at all, >>>an

Re: Another newbie question

2005-12-08 Thread Steven D'Aprano
On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote: > "solaris_1234" <[EMAIL PROTECTED]> writes: > >> 1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems >> awkward. Is there another way (cleaner, more intuitive) to get the >> same thing done? > > Yes. Reaching through objects t

Dynamically add Class to Modules

2005-12-08 Thread callmebill
I'm trying to add a class to a module at runtime. I've seen examples of adding a method to a class, but I haven't been able to suit it to my needs. As part of a testsuite, I have a main process X that searches recursively for python test files. Those files typically have a global "isSupported" m

Re: Unexpected behavior of read only attributes and super

2005-12-08 Thread Samuel M. Smith
> > > P.S. Note that there is an additional complication resulting from the > fact that functions are descriptors: > class C(dict): > ... pass > ... C.__iter__ > C().__iter__ > > > Even though the C instance is accessing the __iter__ function on the > class, it gets back a diff

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-08 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > if cond: > > my x = 7# make a new scope for x, goes out of scope at end of if > > > If this genuinely troubles you then you can always isolate the scope > with a function, though of course you also no longer have the code > inline then. > >>I d

Re: Bitching about the documentation...

2005-12-08 Thread BartlebyScrivener
The actress Margaret Anglin left this note in the dressing froom of another actress: 'Margaret Anglin says Mrs. Fiske is the best actress in America.' Mrs. Fiske added two commas and returned the note: 'Margaret Anglin, says Mrs. Fiske, is the best actress in America.' Or this, from a George Wil

Re: Post-modernism, Academia, and the Tech Geeking fuckheads

2005-12-08 Thread bradb
I don't know about anyone else, but you'd impress me much more if you didn't swear in your posts. I am personally not offended, but it does lower your credibility in my eyes. Just a tip. Brad -- http://mail.python.org/mailman/listinfo/python-list

Re: how to put form and display its result(data from database) on the same window?

2005-12-08 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Could you give me detailed information about your idea. I believe I just did. Really, as I said, this is "non-trivial". I can't give you a three minute tutorial that will help you at all, especially if you haven't read the information I pointed you to. (The page I p

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-08 Thread Scott David Daniels
Steve Holden wrote: > Paul Rubin wrote: >> I think it's a Python weakness that you can't declare a local var like >> in other languages, to go out of scope at the end of the current block, e.g.: >> >> if cond: >> my x = 7# make a new scope for x, goes out of scope at end of if >>

Re: unittest and non-.py files

2005-12-08 Thread Michael Hoffman
[Michael Hoffman] >>Hi. I am trying to use unittest to run a test suite on some >>scripts that do not have a .py extension. [Sybren Stuvel] > I'd move the functionality of the script into a separate file that > does end in .py, and only put the invocation into the .py-less > script. That's what I

Re: newby question: Splitting a string - separator

2005-12-08 Thread Jim
Hi Tom, > a regex for "more than one whitespace". RegEx for whitespace is \s, but > what would i use for "more than one"? \s+? For more than one, I'd use \s\s+ -Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: newby question: Splitting a string - separator

2005-12-08 Thread Noah
Thomas Liesner wrote: > ... > The only thing i can rely on, ist that the > recordseparator is always more than a single whitespace. > > I thought of something like defining the separator for split() by using > a regex for "more than one whitespace". RegEx for whitespace is \s, but > what would i

Re: newby question: Splitting a string - separator

2005-12-08 Thread Michael Spencer
Thomas Liesner wrote: > Hi all, > > i am having a textfile which contains a single string with names. > I want to split this string into its records an put them into a list. > In "normal" cases i would do something like: > >> #!/usr/bin/python >> inp = open("file") >> data = inp.read() >> names =

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Jean-Paul Calderone
On Fri, 09 Dec 2005 02:17:10 +0800, Maurice LING <[EMAIL PROTECTED]> wrote: > >> Since copy_reg lets you specify arbitrary code to serialize arbitrary >> objects, you shouldn't run into any single object that you cannot >> serialize to a pickle. > > [snip - example of pickling code objects] > > >I

Re: sql escaping module

2005-12-08 Thread David Bear
Fredrik Lundh wrote: > David Bear wrote: > >> Being new to pgdb, I'm finding there are lot of things I don't understand >> when I read the PEP and the sparse documentation on pgdb. >> >> I was hoping there would be a module that would properly escape longer >> text strings to prevent sql injectio

Images & Connected Component labeling

2005-12-08 Thread Jim
Does anyone know where I can find a 'connected component' image processing function? I don't see it in numarray or scipy core... In matlab the function is called bwlabel(bw,4); and step 8 on this page is an example of what I'm trying to do: http://www.mathworks.com/access/helpdesk_r13/help/tool

Re: How to ping in Python?

2005-12-08 Thread Chris Miles
You could also try the ping module that the Eddie monitoring tool has been using successfully, cross-platform, for many years. http://dev.eddie-tool.net/trac/browser/eddie/trunk/lib/common/Directives/pinger.py Cheers, Chris Nico Grubert wrote: > I could not find any "ping" Class or Handler in p

Re: ElementTree - Why not part of the core?

2005-12-08 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > I think the key here is ElementTree's Pythoninc API. While it's clearly > possible to install it as a third-party package, I think there's a clear > best-of-breed aspect here that suggests it belongs in the standard > distribution simply to discourage continued use of DO

Re: efficient 'tail' implementation

2005-12-08 Thread Neal Becker
[EMAIL PROTECTED] wrote: > hi > > I have a file which is very large eg over 200Mb , and i am going to use > python to code a "tail" > command to get the last few lines of the file. What is a good algorithm > for this type of task in python for very big files? > Initially, i thought of reading ev

newby question: Splitting a string - separator

2005-12-08 Thread Thomas Liesner
Hi all, i am having a textfile which contains a single string with names. I want to split this string into its records an put them into a list. In "normal" cases i would do something like: > #!/usr/bin/python > inp = open("file") > data = inp.read() > names = data.split() > inp.close() The probl

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Maurice LING
> Since copy_reg lets you specify arbitrary code to serialize arbitrary > objects, you shouldn't run into any single object that you cannot > serialize to a pickle. In http://www.effbot.org/librarybook/pickle.htm, it specifically mentions that code objects cannot be pickled and require the use

Re: Bitching about the documentation...

2005-12-08 Thread Neil Schemenauer
François Pinard <[EMAIL PROTECTED]> wrote: >[AMK] >> You may suggest that I should process my e-mail more promptly. > > No, I'm not suggesting you how to work, no more that I would accept that > you force me into working your way. If any of us wants to force the > other to speak through robots,

Re: Bitching about the documentation...

2005-12-08 Thread Sion Arrowsmith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>> "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo." > >S >P >O >I >L >E >R > >S >P >A >C >E > (Good grief, I've not done that in *years*.) >Buffalo from the city of Buffalo, which are intimidated by buffalo >from Buffalo, also inti

Re: Encoding of file names

2005-12-08 Thread utabintarbo
Fredrik, you are a God! Thank You^3. I am unworthy I believe that may do the trick. Here is the results of running your code: >>> DIR = os.getcwd() >>> files = os.listdir(DIR) >>> file = files[-1] >>> file 'L07JS41C.04389525AA.QTR\xa6INR.E\xa6C-P.D11.081305.P2.KPF.model' >>> print file L07JS41C.

Re: spawnle & umask

2005-12-08 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Yves Glodt <[EMAIL PROTECTED]> wrote: > David Wahler wrote: > > Yves Glodt wrote: > >> It does, I did like this: > >> > >> os.umask(0113) > >> newpid = > >> os.spawnl(os.P_NOWAIT,'/usr/local/bin/wine','/usr/local/bin/wine',executabl > >> e) > >> > >> But I wanted t

Re: Documentation suggestions

2005-12-08 Thread skip
amk> I wonder if the Internet chapter should be split into "HTTP/Web amk> Tools" (webbrowser, cgi, cgitb, httplib, urllib) and "Non-Web amk> Protocols" (ftplib, gopherlib, smtp, all the rest). Note that cgitb works just fine in a non-web environment. I would actually prefer it be ren

Re: Documentation suggestions

2005-12-08 Thread Fredrik Lundh
A.M. Kuchling wrote: > > of the seealso environment. I'll talk to Fred about it and begin > > assembling a patch. > > Patch #1376361: http://www.python.org/sf/1376361 . I still need to talk > to Fred about this. cool. can you post a sample page somewhere? -- http://mail.python.org/mailma

Re: how to put form and display its result(data from database) on the same window?

2005-12-08 Thread lli
Hi Peter, Could you give me detailed information about your idea. Thanks, Laya -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutability of function arguments?

2005-12-08 Thread Fredrik Lundh
Mike Meyer wrote: > Your description of "passes references by value" is a description of > call by reference. C passes all arguments by value, to pass a > reference, the C programmer creates the reference to the value "by > hand", then dereferences it by hand at the other end. So C's > "call-by-re

Re: Encoding of file names

2005-12-08 Thread Fredrik Lundh
"utabintarbo" wrote: > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant directory, I get filenames

Re: Documentation suggestions

2005-12-08 Thread A.M. Kuchling
On Wed, 07 Dec 2005 10:36:52 -0600, A.M. Kuchling <[EMAIL PROTECTED]> wrote: > of the seealso environment. I'll talk to Fred about it and begin > assembling a patch. Patch #1376361: http://www.python.org/sf/1376361 . I still need to talk to Fred about this. --amk -- http://mail.python

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Jean-Paul Calderone
On Thu, 08 Dec 2005 22:42:32 +0800, Maurice LING <[EMAIL PROTECTED]> wrote: >Hi, > >I need to look into serialization for python objects, including codes, >recursive types etc etc. Currently, I have no idea exactly what needs to >be serialized, so my scope is to be as wide as possible. > >I underst

Re: How to get the extension of a filename from the path

2005-12-08 Thread gene tani
Lad wrote: > Thank you ALL for help > Regards, > L. addendum: ASPN Python cookbook often has something relevant / modifiable for your needs: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81931 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52661 (in this case code from 2001 /

Re: Documentation suggestions

2005-12-08 Thread Kent Johnson
A.M. Kuchling wrote: > On Wed, 07 Dec 2005 12:10:18 -0500, > Kent Johnson <[EMAIL PROTECTED]> wrote: > >>OK I'll bite. That Beginners Guide page has bugged me for a long time. >>It's a wiki page but it is marked as immutable so I can't change it. >>Here are some immediate suggestions: >

Re: Documentation suggestions

2005-12-08 Thread BartlebyScrivener
Andrew, The site changes for the new-to-Python person are a big improvement in terms of the sequence of exposures, but from a marketing perspective, the first thing they read about Python is still aimed at a programmer. The bulleted points in BeginnersGuide/Overview are, again, things that are imp

Re: Bitching about the documentation...

2005-12-08 Thread Dave Hansen
On Wed, 07 Dec 2005 12:33:07 -0600 in comp.lang.python, Rocco Moretti <[EMAIL PROTECTED]> wrote: [...] >fred where guido had had had had had had had had had had had a better >effect on the reader I've seen this before as bill had had had but will had had had had had had or had had been correct

Re: Documentation suggestions

2005-12-08 Thread A.M. Kuchling
On Wed, 07 Dec 2005 12:58:36 -0800, Michael Spencer <[EMAIL PROTECTED]> wrote: > I experimented with some more re-organization, but I don't see away > to attach the resulting file in the SF comments, so I'll post it > here instead. I've attached your file to the patch. Some comments: >

Re: JPEG decoder not available in PIL

2005-12-08 Thread Paul Dickson
On 6 Dec 2005 14:02:37 -0800, Peter wrote: > I have a problem which seems to come up from time to time but I can't > find anything relevant in the archives. I have used PIL v1.1.5 with no > problem on Windows for some time but now wish to put it on Linux (Suse > Linux v10.0). I obtained and built

Re: Encoding of file names

2005-12-08 Thread Kent Johnson
utabintarbo wrote: > Here is my situation: > > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant d

Post-modernism, Academia, and the Tech Geeking fuckheads

2005-12-08 Thread Xah Lee
Post-modernism, Academia, and the Tech Geeking fuckheads • the Sokal Affair http://en.wikipedia.org/wiki/Sokal_Affair • SCIGen and World Multi-Conference on Systemics, Cybernetics and Informatics   http://pdos.csail.mit.edu/scigen/ • What are OOP's Jargons and Complexities, Xah Lee http://xahl

Re: efficient 'tail' implementation

2005-12-08 Thread Nick Craig-Wood
Gerald Klix <[EMAIL PROTECTED]> wrote: > As long as memory mapped files are available, the fastest > method is to map the whole file into memory and use the > mappings rfind method to search for an end of line. Actually mmap doesn't appear to have an rfind method :-( Here is a tested solution

Re: Encoding of file names

2005-12-08 Thread Peter Otten
utabintarbo wrote: > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant directory, I get filenames

Re: Bitching about the documentation...

2005-12-08 Thread Rocco Moretti
Fredrik Lundh wrote: > Rocco Moretti wrote: > > >>Insert punctuation & capitalization to make the following a correct and >>coherent (if not a little tourtured). >> >>fred where guido had had had had had had had had had had had a better >>effect on the reader > > > punctuation, including quote

Re: How to get the extension of a filename from the path

2005-12-08 Thread Lad
Thank you ALL for help Regards, L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutability of function arguments?

2005-12-08 Thread Mike Meyer
Kent Johnson <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: >> >>>I'm trying to create a function that can take arguments, say, foo and >>>bar, and modify the original copies of foo and bar as well as its local >>>versions -- the equivalent of C++ funct

Re: ElementTree - Why not part of the core?

2005-12-08 Thread Jeremy Hylton
> I still hope that the standard distribution will, in a not too distant future, > bundle more external libraries. as things are today, "including something > in the core" means that you have to transfer code and rights to the PSF. Your description of how to include something in the core isn't en

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-08 Thread Dave Hansen
On 8 Dec 2005 08:17:14 GMT in comp.lang.python, Antoon Pardon <[EMAIL PROTECTED]> wrote: [...] >I just think braces are the worst solution for it, as python is >concerned. Agreed. A model like Modula-2's would be much preferable, and in fact is supported (but not enforced) today (as long as you

Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Maurice LING
Hi, I need to look into serialization for python objects, including codes, recursive types etc etc. Currently, I have no idea exactly what needs to be serialized, so my scope is to be as wide as possible. I understand that marshal is extended by pickle to serialize class instances, shared elem

Re: Documentation suggestions

2005-12-08 Thread A.M. Kuchling
On Wed, 07 Dec 2005 12:10:18 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: > OK I'll bite. That Beginners Guide page has bugged me for a long time. > It's a wiki page but it is marked as immutable so I can't change it. > Here are some immediate suggestions: Good suggestions; thanks! I

Re: efficient 'tail' implementation

2005-12-08 Thread Nick Craig-Wood
Gerald Klix <[EMAIL PROTECTED]> wrote: > As long as memory mapped files are available, the fastest > method is to map the whole file into memory and use the > mappings rfind method to search for an end of line. Excellent idea. It'll blow up for large >2GB files on a 32bit OS though. -- Nick C

Re: Encoding of file names

2005-12-08 Thread Peter Hansen
utabintarbo wrote: > I am trying to programatically access files created on an IBM AIX > system, stored on a Sun OS 5.8 fileserver, through a samba-mapped drive > on a Win32 system. Not confused? OK, let's move on... ;-) > > When I ask for an os.listdir() of a relevant directory, I get filenames >

Re: How to get the extension of a filename from the path

2005-12-08 Thread Peter Hansen
Fredrik Lundh wrote: > on the other hand, for maximum portability, you can use > > f, e = os.path.splitext(filename) > if e.startswith(os.extsep): > e = e[len(os.extsep):] > if e == "txt": > ... Is there ever a time when the original `e` could evaluate True, yet not s

Re: How do you create a custom QCursor in Python Qt?

2005-12-08 Thread Steegg
Thanks Phil, Good idea, I had failed to notice these code examples and been struggling the "qt3" examples from pyqtsrc.tgz for months. So, I found my mistake, I was using a 8*8 bitmap, I have now corrected it and use a 16*16 bitmap (which is the standard size on Mac OS X) read in from a "PNG" fil

Re: newbie Q on sdtin word completion

2005-12-08 Thread Fischer
Thanks, exactly what I was looking for. I should go and buy you book ;-) Bernd Fredrik Lundh wrote: > "Bernd" wrote: > > >>I'm on a Linux env and try to get >>word completion form sdtin done, >>like Perl's >> $stdin = Complete( "\t: ", @choices ); >> >>What I have so far shows me the directory

Re: spawnle & umask

2005-12-08 Thread Yves Glodt
David Wahler wrote: > Yves Glodt wrote: >> It does, I did like this: >> >> os.umask(0113) >> newpid = >> os.spawnl(os.P_NOWAIT,'/usr/local/bin/wine','/usr/local/bin/wine',executable) >> >> But I wanted to use spawnle and it's env argument, to avoid setting >> umask manually... > > The umask is not

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 7)

2005-12-08 Thread Cameron Laird
QOTW: "... and to my utter surprise it worked." - Andrew Nagel on his move from wxPython to programming Tkinter in desperation "Python has more web application frameworks than keywords." - Skip Montanaro (but probably others going back years) Frithiof Andreas Jensen writes frankly on use o

Re: Python web publishing framework like Cocoon?

2005-12-08 Thread Paul Boddie
Dan M wrote: > Dennis Benzinger wrote: > > Is there a Python web publishing framework like Cocoon? > > How about: [List of the usual suspects] > just to name a few of my favorites. Take a look at > http://wiki.python.org/moin/WebProgramming for a more complete list. Although it is good advice to

  1   2   >