Function parameters list

2009-12-01 Thread Nadav Chernin
Hello, all I need to know dynamically parameters of any function (prototype). Is there some way to get it? Thanks, Nadav -- http://mail.python.org/mailman/listinfo/python-list

Re: Function parameters list

2009-12-01 Thread Chris Rebert
On Tue, Dec 1, 2009 at 12:15 AM, Nadav Chernin nada...@qualisystems.com wrote: Hello, all I need to know dynamically parameters of any function (prototype). Is there some way to get it? The `inspect` module: http://docs.python.org/library/inspect.html#inspect.getargspec

Re: Python Programming Challenges for beginners?

2009-12-01 Thread Jon Clements
On Nov 30, 9:13 pm, f...@mauve.rahul.net (Edward A. Falk) wrote: In article 09ea817f-57a9-44a6-b815-299ae3ce7...@x5g2000prf.googlegroups.com, alex23  wuwe...@gmail.com wrote: On Nov 27, 1:24 pm, astral orange 457r0...@gmail.com wrote: I would like to test out what I know so far by solving

Re: how to debug extended module?

2009-12-01 Thread Diez B. Roggisch
junyoung schrieb: Hi, I am a newbie who want to implement a extend module to use native python language with my own shared library. If it's a C shared library, don't bother extending it. Use ctypes to wrap it. Much easier, and no need for a compiler. to test wrapper library(extend

Inspect module - getargspec raise TypeError for built-in functions

2009-12-01 Thread Nadav Chernin
Hi, all When I use getargspec(func) for user-defined function, all is working OK, but using it for built-in functions raise TypeError: import sys getargspec(sys.getsizeof) Traceback (most recent call last): File pyshell#15, line 1, in module getargspec(sys.getsizeof) File

Possibly something wrong with mailman ?

2009-12-01 Thread Jonas Geiregat
I'm getting lot's of messages to: undisclosed-recipients:; Which horribly scrambles my email, since no filters are applied to them. -- http://mail.python.org/mailman/listinfo/python-list

Re: python and vc numbers

2009-12-01 Thread Lie Ryan
On 11/30/2009 10:05 PM, Daniel Dalton wrote: On Mon, Nov 30, 2009 at 02:26:14AM -0800, Chris Rebert wrote: Also, in my quickie newbie experimentation with `screen`, each screen window seems to get a unique tty#. Admittedly I am running OS X Can you make do with the tempfile module? Or you'd

NumPy installation won't import correctly

2009-12-01 Thread Ethos
I installed NumPy for python 2.6 on my leopard macbook, using the nifty mac installer they now provide. I have the 2.6 official python distro installed on my computer, in addition to the 2.5 that is native on the mac. When I went to test out the installation, with 2.6, it gave me this: import

Re: Inspect module - getargspec raise TypeError for built-in functions

2009-12-01 Thread Christian Heimes
Nadav Chernin wrote: When I use getargspec(func) for user-defined function, all is working OK, but using it for built-in functions raise TypeError: That's just fine and to be expected. It's not possible to inspect a C function. Only functions implemented in Python have the necessary metadata.

Re: Bored.

2009-12-01 Thread Floris Bruynooghe
On Nov 30, 11:52 pm, Stef Mientki stef.mien...@gmail.com wrote: Well I thought that after 2 years you would know every detail of a language ;-) Ouch, I must be especially stupid then! ;-) Floris -- http://mail.python.org/mailman/listinfo/python-list

Re: NumPy installation won't import correctly

2009-12-01 Thread Diez B. Roggisch
Ethos wrote: I installed NumPy for python 2.6 on my leopard macbook, using the nifty mac installer they now provide. I have the 2.6 official python distro installed on my computer, in addition to the 2.5 that is native on the mac. When I went to test out the installation, with 2.6, it gave

Re: Function parameters list

2009-12-01 Thread Mohsen Pahlevanzadeh
You need to define a function same following definition: def myfunc(*arglist): yourbody calling function: myfunc(it's first argument,It's second argument,It's thr argument) On Tue, 2009-12-01 at 10:15 +0200, Nadav Chernin wrote: Hello, all I need to know dynamically parameters

Re: problem with lambda / closures

2009-12-01 Thread Jussi Piitulainen
Terry Reedy writes: definitions. Lambda expressions create functions just like def statements and are not closures and do not create closure unless nested within another function definition. Thinking otherwise is Seems quite closed in the top level environment to me: Python 2.3.4 (#1, Jul

RE: Python-list Digest, Vol 75, Issue 6

2009-12-01 Thread Nadav Chernin
Nadav Chernin wrote: When I use getargspec(func) for user-defined function, all is working OK, but using it for built-in functions raise TypeError: That's just fine and to be expected. It's not possible to inspect a C function. Only functions implemented in

Re: NumPy installation won't import correctly

2009-12-01 Thread David Cournapeau
On Tue, Dec 1, 2009 at 7:47 PM, Ethos kevint...@gmail.com wrote: ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/ lib/python2.6/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find:        

Re: os.remove() permission problem

2009-12-01 Thread Victor Subervi
On Mon, Nov 30, 2009 at 5:06 PM, Christian Heimes li...@cheimes.de wrote: Victor Subervi wrote: When I go into the python interpreter and execute that statement, it succeeds. What have I missed? You are confusing the permissions of a Unix file system. In order to create or a remove a file

Re: os.remove() permission problem

2009-12-01 Thread Christian Heimes
Victor Subervi wrote: Well, that's what I've tried. I've loaded the permissions up, 0777, and it still throws the same error. I've also tried os.chmod(file, 0777) from the script, and I get the same permissions error. I can do all of this from the python prompt. I've set the ownership of the

Re: os.remove() permission problem

2009-12-01 Thread Victor Subervi
On Tue, Dec 1, 2009 at 8:12 AM, Christian Heimes li...@cheimes.de wrote: Victor Subervi wrote: Well, that's what I've tried. I've loaded the permissions up, 0777, and it still throws the same error. I've also tried os.chmod(file, 0777) from the script, and I get the same permissions

Re: Python-list Digest, Vol 75, Issue 6

2009-12-01 Thread Lie Ryan
On 12/1/2009 11:27 PM, Nadav Chernin wrote: Nadav Chernin wrote: When I use getargspec(func) for user-defined function, all is working OK, but using it for built-in functions raise TypeError: That's just fine and to be expected. It's not possible to inspect a

Moving from Python 2 to Python 3: A 4 page cheat sheet

2009-12-01 Thread Mark Summerfield
I've produced a 4 page document that provides a very concise summary of Python 2-3 differences plus the most commonly used new Python 3 features. It is aimed at existing Python 2 programmers who want to start writing Python 3 programs and want to use Python 3 idioms rather than those from Python 2

Re: Moving from Python 2 to Python 3: A 4 page cheat sheet

2009-12-01 Thread Daniel Fetchinson
I've produced a 4 page document that provides a very concise summary of Python 2-3 differences plus the most commonly used new Python 3 features. It is aimed at existing Python 2 programmers who want to start writing Python 3 programs and want to use Python 3 idioms rather than those from

Re: How to prevent re.split() from removing part of string

2009-12-01 Thread Jeremy
On Nov 30, 5:24 pm, MRAB pyt...@mrabarnett.plus.com wrote: Jeremy wrote: I am using re.split to... well, split a string into sections.  I want to split when, following a new line, there are 4 or fewer spaces.  The pattern I use is:         sections = re.split('\n\s{,4}[^\s]', lineoftext)

Re: Feature request: String-inferred names

2009-12-01 Thread Steven D'Aprano
On Mon, 30 Nov 2009 18:55:46 -0800, The Music Guy wrote: Lie Ryan, I think I see what you're saying about using __dict__ to add members to a class, but it's not quite the same. __dict__ is only for attributes, NOT properties, methods, etc. which all come from the class of an object rather

Re: Moving from Python 2 to Python 3: A 4 page cheat sheet

2009-12-01 Thread Gnarlodious
On Dec 1, 7:03 am, Mark Summerfield wrote: Programming in Python 3 (Second Edition) ISBN-10: 0321680561. I ordered it... -- Gnarlie http://Gnarlodious.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-12-01 Thread David Robinow
On Mon, Nov 30, 2009 at 12:57 PM, Esmail ebo...@hotmail.com wrote: Hello all. I am using the PIL 1.1.6 and Python 2.6.x under XP without any problems. However, I can't display any images under Vista or Windows 7. I could understand Windows 7 as it's relatively new, but Vista has been around

Re: Can't print Chinese to HTTP

2009-12-01 Thread Lie Ryan
On 12/2/2009 12:27 AM, Gnarlodious wrote: On Nov 30, 5:53 am, Martin v. Löwis wrote: #!/usr/bin/python print(Content-type:text/plain;charset=utf-8\n\n) sys.stdout.buffer.write('晉\n'.encode(utf-8)) Does this work for anyone? Because all I get is a blank page. Nothing. If I can establish what

Re: Can't print Chinese to HTTP

2009-12-01 Thread Gnarlodious
On Dec 1, 8:36 am, Lie Ryan wrote: #!/usr/bin/python import sys print = lambda s: sys.stdout.buffer.write(s.encode('utf-8')) print(Content-type:text/plain;charset=utf-8\n\n) print('晉\n') HA! IT WORKS! Thank you thank you thank you. I don't understand the lambda functionality but will figure

Re: Feature request: String-inferred names

2009-12-01 Thread Bruno Desthuilliers
The Music Guy a écrit : (snip) Lie Ryan, I think I see what you're saying about using __dict__ to add members No members in Python - only attributes. to a class, but it's not quite the same. __dict__ is only for attributes, NOT properties, methods, etc. which all come from the class of an

Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-12-01 Thread Aahz
In article 031bc732$0$1336$c3e8...@news.astraweb.com, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Good grief, it's about six weeks away from 2010 and Thunderbird still uses mbox as it's default mail box format. Hello, the nineties called, they want their mail formats back! Are

Re: The Strong Relationship between MatLab and MatPlotLib? What One Needs to Know?

2009-12-01 Thread Robert Kern
On 2009-11-29 15:39 PM, W. eWatson wrote: Although MatPlotLib has plenty of examples, they do not seem to cover the fundamentals like figure. It seems as though in someway this is dependent upon a user's knowledge of MatLab. Is this true, or oes MatPlotLib provide some description of how forming

Re: NumPy installation won't import correctly

2009-12-01 Thread Günther Dietrich
Ethos kevint...@gmail.com wrote: I installed NumPy for python 2.6 on my leopard macbook, using the nifty mac installer they now provide. I have the 2.6 official python distro installed on my computer, in addition to the 2.5 that is native on the mac. When I went to test out the installation, with

Re: Moving from Python 2 to Python 3: A 4 page cheat sheet

2009-12-01 Thread Mark Dickinson
On Dec 1, 2:03 pm, Mark Summerfield l...@qtrac.plus.com wrote: I've produced a 4 page document that provides a very concise summary of Python 2-3 differences plus the most commonly used new Python 3 features. Very nice indeed! My only quibble is with the statement on the first page that the

Re: Feature request: String-inferred names

2009-12-01 Thread Raymond Hettinger
[Gregory Ewing] I just posted to my blog about a feature that I'd like to see added to Python. http://alphaios.blogspot.com/2009/11/python-string-inferred-names-wor... I don't think getattr and setattr are used anywhere near frequently enough to justify special syntax. Perhaps that would

getattr problem

2009-12-01 Thread Victor Subervi
Hi; I have the following code that execute without a problem: import sys,os sys.path.append(os.getcwd()) import options storesTables = [] junkStores = string.join(addStore(), ', ') for table in optionsTables(): if table not in ('particulars', junkStores): storesTables.append(table) for

Re: python bijection

2009-12-01 Thread Joshua Bronson
On Nov 27, 1:12 pm, Francis Carr coldtort...@gmail.com wrote: I was really inspired by this discussion thread! :-) After much tinkering, I think I have a simpler solution.  Just make the inverse mapping accessible via an attribute, -AND- bind the inverse of -THAT- mapping back to the

Re: Moving from Python 2 to Python 3: A 4 page cheat sheet

2009-12-01 Thread Lie Ryan
On 12/2/2009 1:03 AM, Mark Summerfield wrote: I've produced a 4 page document that provides a very concise summary of Python 2-3 differences plus the most commonly used new Python 3 features. It is aimed at existing Python 2 programmers who want to start writing Python 3 programs and want to use

Re: Can't print Chinese to HTTP

2009-12-01 Thread Ned Deily
In article bc8d4390-9f36-47c6-b6fc-585180f2d...@m26g2000yqb.googlegroups.com, Gnarlodious gnarlodi...@gmail.com wrote: I symlinked to the new Python, and no I do not want to roll it back because it is work (meaning I would have to type sudo). ls /usr/bin/python lrwxr-xr-x 1 root wheel 63

Question on Python as career

2009-12-01 Thread joy99
Dear Group, I am a researcher in India's one of the premier institutes.(Indian Institute of Science,Bangalore). I have done one MA in Linguistics, did a PhD in Natural Language Processing and doing a Post Doctoral now. Earlier I knew C/C++ and presently work on Python on WinXP. I use IDLE to as

Re: python bijection

2009-12-01 Thread Raymond Hettinger
[Joshua Bronson] Raymond, do you think there might be any future in including a built- in bidict data structure in Python? I don't think so. There are several forces working against it: * the recipe is new, so it hasn't had a chance to mature or to gain a fan club. * there are many

Re: getattr problem

2009-12-01 Thread Jean-Michel Pichavant
Victor Subervi wrote: Hi; I have the following code that execute without a problem: import sys,os sys.path.append(os.getcwd()) import options storesTables = [] junkStores = string.join(addStore(), ', ') for table in optionsTables(): if table not in ('particulars', junkStores):

Re: getattr problem

2009-12-01 Thread Victor Subervi
On Tue, Dec 1, 2009 at 3:17 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Victor Subervi wrote: Hi; I have the following code that execute without a problem: import sys,os sys.path.append(os.getcwd()) import options storesTables = [] junkStores = string.join(addStore(), ', ')

Re: PIL build error on Snow Leopard

2009-12-01 Thread Ned Deily
In article 785f1942-6aec-4a5a-934a-8db50648b...@e22g2000vbm.googlegroups.com, Xiao x...@xiao-yu.com wrote: I haven't fully understood the nuances in the difference between Apple's system Python and MacPython. But I have just installed Python 2.6.4 from python.org. Now I'm trying to install a

Re: Bored.

2009-12-01 Thread Stef Mientki
Floris Bruynooghe wrote: On Nov 30, 11:52 pm, Stef Mientki stef.mien...@gmail.com wrote: Well I thought that after 2 years you would know every detail of a language ;-) Ouch, I must be especially stupid then! ;-) Sorry if I insulted you Floris! btw, I'm too still learning Python

Re: Feature request: String-inferred names

2009-12-01 Thread Carl Banks
On Dec 1, 10:21 am, Raymond Hettinger pyt...@rcn.com wrote: [Gregory Ewing] I just posted to my blog about a feature that I'd like to see added to Python. http://alphaios.blogspot.com/2009/11/python-string-inferred-names-wor... I don't think getattr and setattr are used anywhere near

Python reflection and loading/calling external module classes

2009-12-01 Thread cmckenzie
Hi! I've been putting off playing with Python for sometime now and I recently came up with a worthwhile project for my first hack. One technical challenge I'm trying to work out is dynamically loading modules from a directory (glob'd for a specific filename format) then importing them for calling

Re: Question on Python as career

2009-12-01 Thread Phlip
joy99 wrote: I have developed the following toolkits: (i) A web based crawler; (ii) A Bayesian classifier; (iii) One NER engine; (iv) One XML parser; (v) One PoS Tagger; (vi) One Parser based on CRF; (vii) One MLE training system; (viii) One Spell Checker; (ix) One Transliteration System; I

Re: python bijection

2009-12-01 Thread Joshua Bronson
On Dec 1, 2:11 pm, Raymond Hettinger pyt...@rcn.com wrote: [Joshua Bronson] Raymond, do you think there might be any future in including a built- in bidict data structure in Python? I don't think so.  There are several forces working against it: * the recipe is new, so it hasn't had a

Re: Questions about list-creation

2009-12-01 Thread Manuel Graune
Thanks to all of you. You have been most helpful. Regards, Manuel Graune -- A hundred men did the rational thing. The sum of those rational choices was called panic. Neal Stephenson -- System of the world http://www.graune.org/GnuPG_pubkey.asc Key fingerprint = 1E44 9CBD DEE4 9E07 5E0A 5828

Re: Inspect module - getargspec raise TypeError for built-in functions

2009-12-01 Thread Terry Reedy
Christian Heimes wrote: Nadav Chernin wrote: When I use getargspec(func) for user-defined function, all is working OK, but using it for built-in functions raise TypeError: I added an issue to document this better http://bugs.python.org/issue7422 That's just fine and to be expected. It's not

Re: problem with lambda / closures

2009-12-01 Thread Terry Reedy
Jussi Piitulainen wrote: Terry Reedy writes: definitions. Lambda expressions create functions just like def statements and are not closures and do not create closure unless nested within another function definition. Thinking otherwise is Seems quite closed in the top level environment to me:

Re: Moving from Python 2 to Python 3: A 4 page cheat sheet

2009-12-01 Thread Terry Reedy
Mark Summerfield wrote: I've produced a 4 page document that provides a very concise summary of Python 2-3 differences plus the most commonly used new Python 3 features. It is aimed at existing Python 2 programmers who want to start writing Python 3 programs and want to use Python 3 idioms

Re: PyArg_ParseTupleAndKeywords in Python3.1

2009-12-01 Thread Joachim Dahl
thanks - the patch fixed my problem. Joachim On Dec 1, 5:51 am, casevh cas...@gmail.com wrote: On Nov 30, 2:18 pm, Joachim Dahl dahl.joac...@gmail.com wrote: I think that C encoding is what I need, however I run into an odd problem. If I use the following C code static PyObject*

Tracing variable scope (local vs. global)

2009-12-01 Thread Manuel Graune
Hello, consider the following piece of code: a=1 b=2 def foo(c): b=3 return a + b + c In this case, when calling foo, a will take the global value, b will take the local value and c will take the value assigned when calling the function. Since I consider this behaviour a possible

Re: Can't print Chinese to HTTP

2009-12-01 Thread Terry Reedy
Gnarlodious wrote: On Dec 1, 8:36 am, Lie Ryan wrote: #!/usr/bin/python import sys print = lambda s: sys.stdout.buffer.write(s.encode('utf-8')) This is almost exactly the same as def print(s): return sys.stdout.buffer.write(s.encode('utf-8')) except that the latter gives better error

Re: Python reflection and loading/calling external module classes

2009-12-01 Thread Dave Angel
cmckenzie wrote: Hi! I've been putting off playing with Python for sometime now and I recently came up with a worthwhile project for my first hack. One technical challenge I'm trying to work out is dynamically loading modules from a directory (glob'd for a specific filename format) then

Re: Creating a local variable scope.

2009-12-01 Thread markolopa
Hi Dave, Since you feel like discussing my weird idea of Python reform :-) lets go... On 30 Nov, 11:29, Dave Angel da...@ieee.org wrote: Somehow you seem to think there's some syntax for creating avariable.  In fact, what's happening is you're binding/rebinding a name to an object.  And if

Re: Creating a local variable scope.

2009-12-01 Thread markolopa
Hi Roger, That is what I do regularly...8- Well really dude, you need to stop doing that. It's not a language problem, it's a memory problem (human not RAM!). You guessed quite correctly!...:-) I can't recognise my code sometimes after a single week. That's why I spend a lot of time

Re: Tracing variable scope (local vs. global)

2009-12-01 Thread Lie Ryan
On 12/2/2009 9:02 AM, Manuel Graune wrote: Hello, consider the following piece of code: a=1 b=2 def foo(c): b=3 return a + b + c In this case, when calling foo, a will take the global value, b will take the local value and c will take the value assigned when calling the function.

Re: Tracing variable scope (local vs. global)

2009-12-01 Thread Diez B. Roggisch
Manuel Graune schrieb: Hello, consider the following piece of code: a=1 b=2 def foo(c): b=3 return a + b + c In this case, when calling foo, a will take the global value, b will take the local value and c will take the value assigned when calling the function. Since I consider this

Report spammers to their service provider for great justice (was: can you say it please)

2009-12-01 Thread Ben Finney
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Tue, 01 Dec 2009 00:31:51 -0800, Processor-Dev1l wrote: does it mean ... Please don't respond to religious nutters or spammers, you only encourage them. Instead, report them to the provider they used to send their message, as

Re: combinatorics via __future__ generators

2009-12-01 Thread Phlip
Awesome thanks - but: from itertools import imap,product Do we have a version for Python2.5? I have to support an older server here; can't install a newer python on it... -- http://mail.python.org/mailman/listinfo/python-list

How to set object parameters nicely?

2009-12-01 Thread allen.fowler
Hello, I've got a bunch of code that looks something like: class MyOb(object): def __init__(self, p1=None, p2=None, p3=None, ...): self.p1 = p1 self.p2 = p2 self.p3 = p3 self.pN = ... ob1 = MyOb(p1=Tom, p3=New York) ob2 = MyOb(p1=Joe, p2=j...@host, p3=New Jersey) ... and so

Reading a file that is changing and getting the new lines

2009-12-01 Thread Ouray Viney
Hi: Problem: = I want to read a ASCII text file that can have data appended to it. I have hacked some code together that handles the basics, but it falls short. My code doesn't read in the new lines that could have been added to the end of the file. Not python's fault, more that I

Re: How to set object parameters nicely?

2009-12-01 Thread MRAB
allen.fowler wrote: Hello, I've got a bunch of code that looks something like: class MyOb(object): def __init__(self, p1=None, p2=None, p3=None, ...): self.p1 = p1 self.p2 = p2 self.p3 = p3 self.pN = ... ob1 = MyOb(p1=Tom, p3=New York) ob2 = MyOb(p1=Joe, p2=j...@host,

Re: How to set object parameters nicely?

2009-12-01 Thread Diez B. Roggisch
allen.fowler schrieb: Hello, I've got a bunch of code that looks something like: class MyOb(object): def __init__(self, p1=None, p2=None, p3=None, ...): self.p1 = p1 self.p2 = p2 self.p3 = p3 self.pN = ... ob1 = MyOb(p1=Tom, p3=New York) ob2 = MyOb(p1=Joe, p2=j...@host,

Re: How to set object parameters nicely?

2009-12-01 Thread allen.fowler
Is there a better way to do this? class MyOb(object):      def __init__(self, **kwargs):          self.__dict__.update(kwargs) ob1 = MyOb(p1=Tom, p3=New York) ob2 = MyOb(p1=Joe, p2=j...@host, p3=New Jersey) I've tried this, but have found two issues: 1) I can't set default values. 2) I

Re: How to set object parameters nicely?

2009-12-01 Thread Diez B. Roggisch
allen.fowler schrieb: Is there a better way to do this? class MyOb(object): def __init__(self, **kwargs): self.__dict__.update(kwargs) ob1 = MyOb(p1=Tom, p3=New York) ob2 = MyOb(p1=Joe, p2=j...@host, p3=New Jersey) I've tried this, but have found two issues: 1) I can't set

Re: Moving from Python 2 to Python 3: A 4 page cheat sheet

2009-12-01 Thread John Bokma
Mark Summerfield l...@qtrac.plus.com writes: It is available as a free PDF download (no registration or anything) from InformIT's website. Here's the direct link: http://ptgmedia.pearsoncmg.com/imprint_downloads/informit/promotions/python/python2python3.pdf Thanks! And of course, if you

Re: [Edu-sig] teaching python using turtle module

2009-12-01 Thread kirby urner
Gregor FYI: You'll find me linking to one Gregor in Vienna in this blog post, just beneath an archival photo of work by Alexander Graham Bell.[1] http://worldgame.blogspot.com/2009/12/meeting-with-sam.html ... providing more context and spin for this rhombic triancontahedron thread, all that

Re: DOM related question and problem

2009-12-01 Thread bla bla
Nice post on extracting data, simple and too the point :), I use python for simple html extracting data, but for larger projects like the web, files, or documents i tried a href=http:// www.extractingdata.comextract data/a which worked great, they build quick custom screen scrapers, extracting

Re: how to debug extended module?

2009-12-01 Thread junyoung
On 12월1일, 오후6시14분, Diez B. Roggisch de...@nospam.web.de wrote: junyoung schrieb: Hi, I am a newbie who want to implement a extend module to use native python language with my own shared library. If it's a C shared library, don't bother extending it. Use ctypes to wrap it. Much easier, and

Re: DOM related question and problem

2009-12-01 Thread Diez B. Roggisch
bla bla schrieb: Nice post on extracting data, simple and too the point :), I use python for simple html extracting data, but for larger projects like the web, files, or documents i tried a href=http:// www.extractingdata.comextract data/a which worked great, they build quick custom screen

Re: python bijection

2009-12-01 Thread Aahz
In article 85100df7-a8b0-47e9-a854-ba8a8a2f3...@r31g2000vbi.googlegroups.com, Joshua Bronson jabron...@gmail.com wrote: I noticed the phonebook example in your ActiveState recipe and thought you might consider changing it to something like husbands to wives, since the names-to-phone-numbers

Re: Raw strings as input from File?

2009-12-01 Thread rzed
utabintarbo utabinta...@gmail.com wrote in news:adc6c455-5616-471a-8b39-d7fdad217...@m33g2000vbi.googlegroups.c om: I have a log file with full Windows paths on a line. eg: K:\A\B\C\10xx\somerandomfilename.ext-/a1/b1/c1/10xx \somerandomfilename.ext ; txx; 11/23/2009 15:00:16 ; 1259006416

Re: Reading a file that is changing and getting the new lines

2009-12-01 Thread Sean DiZazzo
On Dec 1, 3:09 pm, Ouray Viney ovi...@gmail.com wrote: Problem: = I want to read a ASCII text file that can have data appended to it. Example scenario:  As the python script is running a user/application adds new entries to the end of the test case file, example, adds the following

Re: xmlrpc idea for getting around the GIL

2009-12-01 Thread Patrick Stinson
yes, using an rpc mechanism would insert a blocking call into a thread in which I am not allowed to make a blocking call, but actual turn around times would be far better than forcing all threads to wait on the Gil. As it stands, blocking on a single thread lock *almost* works, and while we can

Re: python bijection

2009-12-01 Thread Chris Rebert
On Tue, Dec 1, 2009 at 5:17 PM, Aahz a...@pythoncraft.com wrote: In article 85100df7-a8b0-47e9-a854-ba8a8a2f3...@r31g2000vbi.googlegroups.com, Joshua Bronson  jabron...@gmail.com wrote: I noticed the phonebook example in your ActiveState recipe and thought you might consider changing it to

Re: NumPy installation won't import correctly

2009-12-01 Thread Ethos
On Dec 1, 3:33 am, Diez B. Roggisch de...@nospam.web.de wrote: Ethos wrote: I installed NumPy for python 2.6 on my leopard macbook, using the nifty mac installer they now provide. I have the 2.6 official python distro installed on my computer, in addition to the 2.5 that is native on the

Re: NumPy installation won't import correctly

2009-12-01 Thread David Cournapeau
On Wed, Dec 2, 2009 at 11:03 AM, Ethos kevint...@gmail.com wrote: I reinstalled numpy, from sourceforge, even though I had already installed the latest version. Same business. 2.5 imports fine, 2.6 doesn't. Here's the output of the commands you gave me. Which exact version of mac os x are

Re: NumPy installation won't import correctly

2009-12-01 Thread Ethos
On Dec 1, 6:37 pm, David Cournapeau courn...@gmail.com wrote: On Wed, Dec 2, 2009 at 11:03 AM, Ethos kevint...@gmail.com wrote: I reinstalled numpy, from sourceforge, even though I had already installed the latest version. Same business. 2.5 imports fine, 2.6 doesn't. Here's the output

Re: Reading a file that is changing and getting the new lines

2009-12-01 Thread Dave Angel
Ouray Viney wrote: Hi: Problem: = I want to read a ASCII text file that can have data appended to it. I have hacked some code together that handles the basics, but it falls short. My code doesn't read in the new lines that could have been added to the end of the file. Not python's

Re: Tracing variable scope (local vs. global)

2009-12-01 Thread Terry Reedy
Manuel Graune wrote: Hello, consider the following piece of code: a=1 b=2 def foo(c): b=3 return a + b + c In this case, when calling foo, a will take the global value, b will take the local value and c will take the value assigned when calling the function. Since I consider this

Re: Creating a local variable scope.

2009-12-01 Thread Ben Finney
markolopa marko.lopa...@gmail.com writes: Hi Roger, […] Long, descriptive variable names all_in_lower_case Function names all in CamelCase Global names are in ALL CAPS yes, pep8 I guess. Not quite: it deviates from PEP 8 on function names, which should rather be

Re: High-performance Python websites

2009-12-01 Thread Rami Chowdhury
On Monday 30 November 2009 10:55:55 inhahe wrote: On Wed, Nov 25, 2009 at 7:33 PM, ShoqulKutlu kursat.ku...@gmail.com wrote: Hi, Managing load of high volume of visitors is a common issue for all kind of web technologies. I mean this is not the python issue. This issue is mostly about

Re: Raw strings as input from File?

2009-12-01 Thread Dave Angel
rzed wrote: utabintarbo utabinta...@gmail.com wrote in news:adc6c455-5616-471a-8b39-d7fdad217...@m33g2000vbi.googlegroups.c om: I have a log file with full Windows paths on a line. eg: K:\A\B\C\10xx\somerandomfilename.ext-/a1/b1/c1/10xx \somerandomfilename.ext ; txx; 11/23/2009

Re: combinatorics via __future__ generators

2009-12-01 Thread John Yeung
On Dec 1, 5:55 pm, Phlip phlip2...@gmail.com wrote: Awesome thanks - but: from itertools import imap,product Do we have a version for Python2.5? I have to support an older server here; can't install a newer python on it... If you can get by with the performance of pure Python, a solution

commands module for windows

2009-12-01 Thread M Kumar
Dear all, Is there any python module for windows which is equivalent to commands module in linux? -- thanks regards, Maneesh KB -- http://mail.python.org/mailman/listinfo/python-list

Re: commands module for windows

2009-12-01 Thread Chris Rebert
On Tue, Dec 1, 2009 at 10:05 PM, M Kumar tomanis...@gmail.com wrote: Is there any python module for windows which is equivalent to commands module in linux? `subprocess` should work: http://docs.python.org/library/subprocess.html The `commands` docs even say: The subprocess module provides

Re: commands module for windows

2009-12-01 Thread M Kumar
can I use this module to store output to a python variable? I am looking for something similar to commands.getoutput(cmd) On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert c...@rebertia.com wrote: On Tue, Dec 1, 2009 at 10:05 PM, M Kumar tomanis...@gmail.com wrote: Is there any python module for

Re: commands module for windows

2009-12-01 Thread Chris Rebert
On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert c...@rebertia.com wrote: On Tue, Dec 1, 2009 at 10:05 PM, M Kumar tomanis...@gmail.com wrote: Is there any python module for windows which is equivalent to commands module in linux? `subprocess` should work:

Re: commands module for windows

2009-12-01 Thread M Kumar
thank you very much Chris :) On Wed, Dec 2, 2009 at 12:10 PM, Chris Rebert c...@rebertia.com wrote: On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert c...@rebertia.com wrote: On Tue, Dec 1, 2009 at 10:05 PM, M Kumar tomanis...@gmail.com wrote: Is there any python module for windows which is

Re: Question on Python as career

2009-12-01 Thread joy99
On Dec 2, 2:11 am, Phlip phlip2...@gmail.com wrote: joy99 wrote: I have developed the following toolkits: (i) A web based crawler; (ii) A Bayesian classifier; (iii) One NER engine; (iv) One XML parser; (v) One PoS Tagger; (vi) One Parser based on CRF; (vii) One MLE training

Recursion head scratcher

2009-12-01 Thread Joel Madigan
Hi everyone! Sorry this isn't strictly a Python question but my algorithms professor contends that given the standard recursive-backtracking maze solving algorithm: width=6 height=4 maze=[[1,0,1,1,0,1], [0,0,1,0,0,0], [1,0,1,0,1,0], [0,0,0,0,1,1]] visited = [[False for x in

[ANN] doit 0.5

2009-12-01 Thread Eduardo Schettino
doit - Automation Tool doit comes from the idea of bringing the power of build-tools to execute any kind of task. It will keep track of dependencies between tasks and execute them only when necessary. It was designed to be easy to use and get out of your way. doit can be used as: * a build

[issue691291] codecs.open(filename, 'U', 'UTF-16') corrupts text

2009-12-01 Thread flox
flox la...@yahoo.fr added the comment: Proposed patch following suggestion of And Clover. Compliant with documentation: «Files are always opened in binary mode, even if no binary mode was specified. This is done to avoid data loss due to encodings using 8-bit values. This means that no

[issue691291] codecs.open(filename, 'U', 'UTF-16') corrupts text

2009-12-01 Thread flox
Changes by flox la...@yahoo.fr: Added file: http://bugs.python.org/file15423/issue691291_py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue691291 ___

[issue7413] datetime.datetime.isoformat truncation problem

2009-12-01 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Here is a test + fix. -- assignee: - amaury.forgeotdarc keywords: +patch nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file15424/isoformat.patch ___ Python tracker

[issue7416] select module compile errors breaks OS X multi-architecture builds

2009-12-01 Thread Ned Deily
New submission from Ned Deily n...@acm.org: Release blocker The changes for Issue7211 to support 64-bit kevent ident fields in 64-bit builds cause compile errors on those OS X multi-arch builds which include both 32-bit and 64-bit variants. Problem is reproducible by this simplified build

[issue7380] uuid.UUID.bytes gives a bytearray() instead of bytes

2009-12-01 Thread flox
Changes by flox la...@yahoo.fr: Added file: http://bugs.python.org/file15426/issue7380_py3k.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7380 ___

[issue7380] uuid.UUID.bytes gives a bytearray() instead of bytes

2009-12-01 Thread flox
Changes by flox la...@yahoo.fr: Removed file: http://bugs.python.org/file15388/issue7380.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7380 ___ ___

  1   2   >