[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 bu

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 range

Re: Question on Python as career

2009-12-01 Thread joy99
On Dec 2, 2:11 am, Phlip 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 system; >

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 wrote: > > On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert wrote: > >> On Tue, Dec 1, 2009 at 10:05 PM, M Kumar wrote: > >> > Is there any python module for windows which is equivalent to commands > >> > module in linux?

Re: commands module for windows

2009-12-01 Thread Chris Rebert
> On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert wrote: >> On Tue, Dec 1, 2009 at 10:05 PM, M Kumar 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 `com

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("") On Wed, Dec 2, 2009 at 11:42 AM, Chris Rebert wrote: > On Tue, Dec 1, 2009 at 10:05 PM, M Kumar wrote: > > Is there any python module for windows which is equivalent to comma

Re: commands module for windows

2009-12-01 Thread Chris Rebert
On Tue, Dec 1, 2009 at 10:05 PM, M Kumar 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 more powerful facilit

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: combinatorics via __future__ generators

2009-12-01 Thread John Yeung
On Dec 1, 5:55 pm, Phlip 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 is right in th

Re: Raw strings as input from File?

2009-12-01 Thread Dave Angel
rzed wrote: utabintarbo 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 As

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 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 server level

Re: Creating a local variable scope.

2009-12-01 Thread Ben Finney
markolopa 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 ‘lower_case_words_separated_by_unders

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

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 fau

Re: NumPy installation won't import correctly

2009-12-01 Thread Ethos
On Dec 1, 6:37 pm, David Cournapeau wrote: > On Wed, Dec 2, 2009 at 11:03 AM, Ethos 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

Re: NumPy installation won't import correctly

2009-12-01 Thread David Cournapeau
On Wed, Dec 2, 2009 at 11:03 AM, Ethos 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 you using ? (t

Re: NumPy installation won't import correctly

2009-12-01 Thread Ethos
On Dec 1, 3:33 am, "Diez B. Roggisch" 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 mac. When

Re: python bijection

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

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: 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 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 to the fi

Re: Raw strings as input from File?

2009-12-01 Thread rzed
utabintarbo 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 > > As I try t

Re: python bijection

2009-12-01 Thread Aahz
In article <85100df7-a8b0-47e9-a854-ba8a8a2f3...@r31g2000vbi.googlegroups.com>, Joshua Bronson 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 relation is many-t

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 extract data which worked great, they build quick custom screen scrapers, extracting data, and data parsing

Re: how to debug extended module?

2009-12-01 Thread junyoung
On 12월1일, 오후6시14분, "Diez B. Roggisch" 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 no need

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 extract data which worked great, they build quick custom screen scrapers, extracting data, and data parsing programs -- http:/

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 muc

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

2009-12-01 Thread John Bokma
Mark Summerfield 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 want more on Python

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'

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 de

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...@hos

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"

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 don't

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") ..

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

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

2009-12-01 Thread Ben Finney
Steven D'Aprano 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 an abuse of service. Look in

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 conside

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 fun

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 cl

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 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 you forbid

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 importi

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 traceb

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 possi

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 wrote: > On Nov 30, 2:18 pm, Joachim Dahl 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* foo(PyObject *self, PyO

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 rath

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: 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: 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 5

Re: python bijection

2009-12-01 Thread Joshua Bronson
On Dec 1, 2:11 pm, Raymond Hettinger 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 chance

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 hav

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 l

Re: Feature request: String-inferred names

2009-12-01 Thread Carl Banks
On Dec 1, 10:21 am, Raymond Hettinger 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 nea

Re: Bored.

2009-12-01 Thread Stef Mientki
Floris Bruynooghe wrote: On Nov 30, 11:52 pm, Stef Mientki 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 after I started 2 year

Re: PIL build error on Snow Leopard

2009-12-01 Thread Ned Deily
In article <785f1942-6aec-4a5a-934a-8db50648b...@e22g2000vbm.googlegroups.com>, Xiao 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 fresh downlo

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.joi

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): storesTables

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 approa

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 g

Re: Can't print Chinese to HTTP

2009-12-01 Thread Ned Deily
In article , Gnarlodious 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 Nov 20 21:24 /usr/bin/python -> /Library/ > Frameworks/Python.framework/Versions

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 us

Re: python bijection

2009-12-01 Thread Joshua Bronson
On Nov 27, 1:12 pm, Francis Carr 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 original.  The result is

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 table

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

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 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 'String % operat

Re: NumPy installation won't import correctly

2009-12-01 Thread Günther Dietrich
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 m

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: 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 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 the tbird developers on crack o

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 o

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

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

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 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 for a bit. >

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: 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: How to prevent re.split() from removing part of string

2009-12-01 Thread Jeremy
On Nov 30, 5:24 pm, MRAB 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) > > > This split

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 fr

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

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

Re: os.remove() permission problem

2009-12-01 Thread Victor Subervi
On Tue, Dec 1, 2009 at 8:12 AM, Christian Heimes 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 error. I can

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 th

Re: os.remove() permission problem

2009-12-01 Thread Victor Subervi
On Mon, Nov 30, 2009 at 5:06 PM, Christian Heimes 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 from a d

Re: NumPy installation won't import correctly

2009-12-01 Thread David Cournapeau
On Tue, Dec 1, 2009 at 7:47 PM, Ethos 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: >        /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site- >

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 Pyt

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, J

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

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 > ga

Re: Bored.

2009-12-01 Thread Floris Bruynooghe
On Nov 30, 11:52 pm, Stef Mientki 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: 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.

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: 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

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

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 "", line 1, in getargspec(sys.getsizeof) File "C:\Pyth

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 module,

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   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 programm

Re: Function parameters list

2009-12-01 Thread Chris Rebert
On Tue, Dec 1, 2009 at 12:15 AM, Nadav Chernin 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 http://docs.python.org/library/inspect.h

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