newbie question: if var1 == var2:

2008-11-29 Thread joemacbusiness
Hi All, I dont understand why the following code never finds tree. I could not find the answer in the Python tutorials. Here is the code, test43.in, and runtime: #!/usr/bin/python fname = open(test43.in) var = 'tree' for item in fname: print item: , item, if item == var: print

Dec 1st - Python Users Group Meeting

2008-11-29 Thread Mike Driscoll
Hi, The 3rd meeting of the Iowa Python Users Group (Pyowa) is getting together next Monday, December 1st, 7-9 p.m. Be sure to mark your calendars! We currently have one presentation scheduled and a workshop where we hope to have teams work on easy to intermediate problems in an effort to

Re: Confused about class relationships

2008-11-29 Thread Carl Banks
On Nov 26, 11:20 pm, John O'Hagan [EMAIL PROTECTED] wrote: Apologies if this is a D.Q., I'm still learning to use classes, and this little problem has proved too specific to find in the tutorials. I have two classes with a relationship that I find confusing. One is called Engine, and it has

Python docs and enumeration of sections

2008-11-29 Thread Kay Schluehr
Is there a reason why enumeration of sections and subsections has been dropped after the switch to the Sphinx documentation tool? It doesn't really make quoting library sections easier or do you know what I mean when I refer to How It Works? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to dynamically get an attribute from a module from within the same module

2008-11-29 Thread Gabriel Genellina
En Mon, 24 Nov 2008 02:11:49 -0200, Rafe [EMAIL PROTECTED] escribió: What are the pros and cons of these two patterns (and are there any other)? Which is the best way to dynamically get an attribute from a module from within the same module? 1) Using the name of the module this_module =

Re: python.org coming back as unreachable in Dillo (IPv6 routing error?)

2008-11-29 Thread Martin v. Löwis
Have any network changes taken place at python.org (particularly IPv6 or DNS related) recently? Yes, python.org has IPv6 connectivity now, and many systems (except for mail) have IPv6 DNS entries (). Some of the configuration details from my machine: [EMAIL PROTECTED]:~$ ip -f inet6

Re: Python docs and enumeration of sections

2008-11-29 Thread Robert Kern
Kay Schluehr wrote: Is there a reason why enumeration of sections and subsections has been dropped after the switch to the Sphinx documentation tool? It doesn't really make quoting library sections easier or do you know what I mean when I refer to How It Works? If you hover the mouse over the

Debugging in Python

2008-11-29 Thread Vicent Giner
Hello again. Thank you for the answers I got to my previous question. All of them were very useful to me. I want to know if I have understood well the way I can work with Python. As far as I've understood, [the free version of] ActivePython is just a [good, ready-to-work] Python distribution.

Re: Python docs and enumeration of sections

2008-11-29 Thread Kay Schluehr
On 29 Nov., 09:47, Robert Kern [EMAIL PROTECTED] wrote: Kay Schluehr wrote: Is there a reason why enumeration of sections and subsections has been dropped after the switch to the Sphinx documentation tool? It doesn't really make quoting library sections easier or do you know what I mean

Re: Unicode regex and Hindi language

2008-11-29 Thread John Machin
On Nov 29, 10:51 am, MRAB [EMAIL PROTECTED] wrote: John Machin wrote: On Nov 29, 2:47 am, Shiao [EMAIL PROTECTED] wrote: The regex below identifies words in all languages I tested, but not in Hindi: pat = re.compile('^(\w+)$', re.U) ...    m = pat.search(l.decode('utf-8')) [example

Re: HELP!...Google SketchUp needs a Python API

2008-11-29 Thread Aaron Brady
On Nov 28, 10:42 pm, r [EMAIL PROTECTED] wrote: Arron, i give you an A++ just for writing a longer post than me =D Hey wow, lucky me. Maybe someone will read it too. -- http://mail.python.org/mailman/listinfo/python-list

Re: Exhaustive Unit Testing

2008-11-29 Thread Roel Schroeven
Fuzzyman schreef: By the way, to reduce the number of independent code paths you need to test you can use mocking. You only need to test the logic inside the methods you create (testing behaviour), and not every possible combination of paths. I don't understand that. This is part of something

Re: Unicode regex and Hindi language

2008-11-29 Thread Martin v. Löwis
Huh? I thought it was settled. Read Terry Ready's latest message. Read the bug report it points to (http://bugs.python.org/issue1693050), especially the contribution from MvL. To paraphrase a remark by the timbot, Martin reads Unicode tech reports so that we don't have to. However if you are

Re: Using thread in an asyncronous application

2008-11-29 Thread Giampaolo Rodola'
On 29 Nov, 02:24, Aaron Brady [EMAIL PROTECTED] wrote: On Nov 27, 9:03 am, Giampaolo Rodola' [EMAIL PROTECTED] wrote: Hi, I'm the maintainer of an asynchronous FTP server implementation based on asyncore. Some days ago I thought it would be interesting to add a class offering the

Making directories with python

2008-11-29 Thread Robert Singer
I've been looking in the archives, but can't find anything similar. I'm trying to write a script which would make directories (winxp platform, py2.5) - actually, just one - a new directory with a date name. That is it would be called, for example: 20081129 (today's date). Are there any modules

Re: HELP!...Google SketchUp needs a Python API

2008-11-29 Thread Дамјан Георгиевски
Fight with me for Glory not riches. Fight with me and you shall be free. FREDOM! SketchUp is not free -- дамјан ( http://softver.org.mk/damjan/ ) war is peace freedom is slavery restrictions are enablement -- http://mail.python.org/mailman/listinfo/python-list

Re: Making directories with python

2008-11-29 Thread Stef Mientki
Robert Singer wrote: I've been looking in the archives, but can't find anything similar. I'm trying to write a script which would make directories (winxp platform, py2.5) - actually, just one - a new directory with a date name. That is it would be called, for example: 20081129 (today's date

Re: Exhaustive Unit Testing

2008-11-29 Thread Steven D'Aprano
On Sat, 29 Nov 2008 11:36:56 +0100, Roel Schroeven wrote: Fuzzyman schreef: By the way, to reduce the number of independent code paths you need to test you can use mocking. You only need to test the logic inside the methods you create (testing behaviour), and not every possible combination

double import protection - how to ?

2008-11-29 Thread Helmut Jarausch
Hi, sorry if this is a FAQ (I couldn't find an answer) I have a module which gets imported at several different places not all of which are under my control. How can I achieve that all/some statements within that module get executed only at the very first import? (the statement which must be

Re: double import protection - how to ?

2008-11-29 Thread Steven D'Aprano
On Sat, 29 Nov 2008 13:43:45 +0100, Helmut Jarausch wrote: How can I achieve that all/some statements within that module get executed only at the very first import? (the statement which must be executed only once, initializes another OS-thread (java in my case)) Python already enforces that.

Re: Debugging in Python

2008-11-29 Thread Colin J. Williams
Vicent Giner wrote: Hello again. Thank you for the answers I got to my previous question. All of them were very useful to me. I want to know if I have understood well the way I can work with Python. As far as I've understood, [the free version of] ActivePython is just a [good, ready-to-work]

Re: double import protection - how to ?

2008-11-29 Thread Peter Otten
Helmut Jarausch wrote: I have a module which gets imported at several different places not all of which are under my control. How can I achieve that  all/some statements within that module get executed only at the very first import? What you describe is Python's default behaviour. A module

Re: python.org coming back as unreachable in Dillo (IPv6 routing error?)

2008-11-29 Thread Tim Chase
You shouldn't need to do anything. It should be no problem that you can't reach www.python.org through IPv6, since all your applications will immediately fall back to using IPv4 on their own. It may be that some application misbehaves, i.e. it tries to get an IPv6 connection, which it can't, and

Re: Python docs and enumeration of sections

2008-11-29 Thread Aahz
In article [EMAIL PROTECTED], Kay Schluehr [EMAIL PROTECTED] wrote: Is there a reason why enumeration of sections and subsections has been dropped after the switch to the Sphinx documentation tool? It doesn't really make quoting library sections easier or do you know what I mean when I refer to

Re: newbie question: if var1 == var2:

2008-11-29 Thread filtered
Any reason for posting such an issue to the account list? Pillock! On Sat, Nov 29, 2008 at 4:47 AM, [EMAIL PROTECTED] wrote: Hi All, I dont understand why the following code never finds tree. I could not find the answer in the Python tutorials. Here is the code, test43.in, and runtime:

Re: unicode and hashlib

2008-11-29 Thread Jeff H
On Nov 28, 1:24 pm, Scott David Daniels [EMAIL PROTECTED] wrote: Jeff H wrote: hashlib.md5 does not appear to like unicode,   UnicodeEncodeError: 'ascii' codec can't encode character u'\xa6' in position 1650: ordinal not in range(128) After googling, I've found BDFL and others on Py3K

Re: unicode and hashlib

2008-11-29 Thread Jeff H
On Nov 28, 2:03 pm, Terry Reedy [EMAIL PROTECTED] wrote: Jeff H wrote: hashlib.md5 does not appear to like unicode,   UnicodeEncodeError: 'ascii' codec can't encode character u'\xa6' in position 1650: ordinal not in range(128) It is the (default) ascii encoder that does not like non-ascii

Re: unicode and hashlib

2008-11-29 Thread Jeff H
On Nov 29, 8:27 am, Jeff H [EMAIL PROTECTED] wrote: On Nov 28, 2:03 pm, Terry Reedy [EMAIL PROTECTED] wrote: Jeff H wrote: hashlib.md5 does not appear to like unicode,   UnicodeEncodeError: 'ascii' codec can't encode character u'\xa6' in position 1650: ordinal not in range(128)

Re: HELP!...Google SketchUp needs a Python API

2008-11-29 Thread r
After careful consideration and much pondering of the subject, I will NOT retract my words. And I will give you truthful answers for my reasons. People have said that i ripped Ruby in my promotion of Python. This just IS NOT True. Lets go over the facts here, and let them speak louder than words.

Re: newbie question: if var1 == var2:

2008-11-29 Thread Mike Howard
item = tree\n != 'tree' [EMAIL PROTECTED] wrote: Hi All, I dont understand why the following code never finds tree. I could not find the answer in the Python tutorials. Here is the code, test43.in, and runtime: #!/usr/bin/python fname = open(test43.in) var = 'tree' for item in fname:

Re: newbie question: if var1 == var2:

2008-11-29 Thread kirby urner
It's the newline after each word that's messing you up. var = tree\n ... or if item.strip() == var: ... etc. Kirby On Fri, Nov 28, 2008 at 7:47 PM, [EMAIL PROTECTED] wrote: Hi All, I dont understand why the following code never finds tree. I could not find the answer in the Python

Re: double import protection - how to ?

2008-11-29 Thread Helmut Jarausch
Peter Otten wrote: Helmut Jarausch wrote: I have a module which gets imported at several different places not all of which are under my control. How can I achieve that all/some statements within that module get executed only at the very first import? What you describe is Python's default

Re: Exhaustive Unit Testing

2008-11-29 Thread Fuzzyman
On Nov 29, 3:33 am, Emanuele D'Arrigo [EMAIL PROTECTED] wrote: On Nov 29, 12:35 am, Fuzzyman [EMAIL PROTECTED] wrote: Your experiences are one of the reasons that writing the tests *first* can be so helpful. You think about the *behaviour* you want from your units and you test for that

Re: double import protection - how to ?

2008-11-29 Thread Fuzzyman
On Nov 29, 3:40 pm, Helmut Jarausch [EMAIL PROTECTED] wrote: Peter Otten wrote: Helmut Jarausch wrote: I have a module which gets imported at several different places not all of which are under my control. How can I achieve that  all/some statements within that module get executed

Re: double import protection - how to ?

2008-11-29 Thread Peter Otten
Helmut Jarausch wrote: Peter Otten wrote: Helmut Jarausch wrote: I have a module which gets imported at several different places not all of which are under my control. How can I achieve that all/some statements within that module get executed only at the very first import? What you

Re: Exhaustive Unit Testing

2008-11-29 Thread Roel Schroeven
Thanks for your answer. I still don't understand completely though. I suppose it's me, but I've been trying to understand some of this for quite some and somehow I can't seem to wrap my head around it. Steven D'Aprano schreef: On Sat, 29 Nov 2008 11:36:56 +0100, Roel Schroeven wrote: The

Re: Python surpasses Perl in popularity?

2008-11-29 Thread Tam Ha
Jorgen Grahn [EMAIL PROTECTED] wrote: (I could get away with using Bash in these cases. It has functions, local variables and so on. Writing portable Bourne shell is not as much fun.) Can you explain this? Bourne is always more portable than Bash. That's why you'll find experienced shell

Re: unicode and hashlib

2008-11-29 Thread Marc 'BlackJack' Rintsch
On Sat, 29 Nov 2008 06:51:33 -0800, Jeff H wrote: Actually, what I am surprised by, is the fact that hashlib cares at all about the encoding. A md5 hash can be produced for an .iso file which means it can handle bytes, why does it care what it is being fed, as long as there are bytes. But

'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Can someone tell me why 'new' has been deprecated in python 2.6 and provide direction for code that uses new for the future. I find new is invaluable for some forms of automation. I don't see a replacement for python 3 either. Many thanks. --

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Michael Crute
On Sat, Nov 29, 2008 at 11:52 AM, David Pratt [EMAIL PROTECTED] wrote: Can someone tell me why 'new' has been deprecated in python 2.6 and provide direction for code that uses new for the future. I find new is invaluable for some forms of automation. I don't see a replacement for python 3

Re: Python surpasses Perl in popularity?

2008-11-29 Thread Stephane CHAZELAS
2008-11-29, 16:23(+00), Tam Ha: Jorgen Grahn [EMAIL PROTECTED] wrote: (I could get away with using Bash in these cases. It has functions, local variables and so on. Writing portable Bourne shell is not as much fun.) Can you explain this? Bourne is always more portable than Bash. That's why

Re: unicode and hashlib

2008-11-29 Thread Scott David Daniels
Jeff H wrote: ... Actually, what I am surprised by, is the fact that hashlib cares at all about the encoding. A md5 hash can be produced for an .iso file which means it can handle bytes, why does it care what it is being fed, as long as there are bytes. I would have assumed that it would take

Re: newbie question: if var1 == var2:

2008-11-29 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: Hi All, I dont understand why the following code never finds tree. I could not find the answer in the Python tutorials. Here is the code, test43.in, and runtime: #!/usr/bin/python fname = open(test43.in) var = 'tree' for item in fname: print item: , item, if

Re: Unicode regex and Hindi language

2008-11-29 Thread Terry Reedy
Martin v. Löwis wrote: To be fair to Python (and SRE), SRE predates TR#18 (IIRC) - atleast annex C was added somewhere between revision 6 and 9, i.e. in early 2004. Python's current definition of \w is a straight-forward extension of the historical \w definition (of Perl, I believe), which,

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Hi Mike. Many thanks for your reply and thank you for reference. I have code that looks like the following so initially looking at what will need to be done as it doesn't appear new will survive. So first need to find way of translating this sort of thing using types. I see there is a

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Rob Williscroft
David Pratt wrote in news:mailman.4664.1227980181.3487.python- [EMAIL PROTECTED] in comp.lang.python: import new class FirstBase(object): foo = 'bar' biz = 'baz' class SecondBase(object): bla = 'blu' buz = 'brr' attr = { 'fiz': 'An attribute', 'fuz':

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Yeah, can just use types.ClassType instead of new.classobj, but still wonder what happens when we get to python 3. Regards, David On Nov 29, 2008, at 1:04 PM, Michael Crute wrote: On Sat, Nov 29, 2008 at 11:52 AM, David Pratt [EMAIL PROTECTED] wrote: Can someone tell me why 'new' has been

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Christian Heimes
David Pratt wrote: Hi Mike. Many thanks for your reply and thank you for reference. I have code that looks like the following so initially looking at what will need to be done as it doesn't appear new will survive. So first need to find way of translating this sort of thing using types. I see

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Rob. Sweet! Many thanks. Regards, David On Nov 29, 2008, at 1:46 PM, Rob Williscroft wrote: David Pratt wrote in news:mailman.4664.1227980181.3487.python- [EMAIL PROTECTED] in comp.lang.python: import new class FirstBase(object): foo = 'bar' biz = 'baz' class

Re: Debugging in Python

2008-11-29 Thread Scott David Daniels
Vicent Giner wrote: As far as I've understood, [the free version of] ActivePython is just a [good, ready-to-work] Python distribution. Also, it contains and editor, PythonWin Editor. Has that editor the ability of performing good debugging tasks? I mean, is it enough for doing debugging?

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Hey Christian. Many thanks for explanation. Clears that up :-) Regards, David On Nov 29, 2008, at 1:52 PM, Christian Heimes wrote: David Pratt wrote: Hi Mike. Many thanks for your reply and thank you for reference. I have code that looks like the following so initially looking at what

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Scott David Daniels
David Pratt wrote: ... import new class FirstBase(object): foo = 'bar' biz = 'baz' class SecondBase(object): bla = 'blu' buz = 'brr' attr = { 'fiz': 'An attribute', 'fuz': 'Another one'} Test = new.classobj( ^^^ replace with: Test = type( 'Test', (FirstBase,

Re: Unicode regex and Hindi language

2008-11-29 Thread MRAB
Terry Reedy wrote: Martin v. Löwis wrote: To be fair to Python (and SRE), SRE predates TR#18 (IIRC) - atleast annex C was added somewhere between revision 6 and 9, i.e. in early 2004. Python's current definition of \w is a straight-forward extension of the historical \w definition (of Perl, I

Re: unicode and hashlib

2008-11-29 Thread Scott David Daniels
Scott David Daniels wrote: ... If you now, and for all time, decide that the only source you will take is cp1252, perhaps you should decode to cp1252 before hashing. Of course my dyslexia sticks out here as I get encode and decode exactly backwards -- Marc 'BlackJack' Rintsch has it right.

PYTHONPATH in Windows

2008-11-29 Thread waltbrad
PYTHONPATH is a concept I've never been able to get straight. I can't see the difference between this and just setting paths in the Windows environment variables. So, for the longest time I just never worried about it. Now, I'm going through James Bennett's Practical Django Projects and the

Re: Python surpasses Perl in popularity?

2008-11-29 Thread Xah Lee
Great to see quality post from real expert once in a while. Thanks! Xah ∑ http://xahlee.org/ ☄ On Nov 29, 9:03 am, Stephane CHAZELAS [EMAIL PROTECTED] wrote: There's a common confusion in this in the nature of /bin/sh. There's no standard (neither POSIX nor Unix) that specifies that

Re: PYTHONPATH in Windows

2008-11-29 Thread Diez B. Roggisch
waltbrad schrieb: PYTHONPATH is a concept I've never been able to get straight. I can't see the difference between this and just setting paths in the Windows environment variables. So, for the longest time I just never worried about it. Now, I'm going through James Bennett's Practical Django

Re: Pycon 2009

2008-11-29 Thread Fuzzyman
On Nov 29, 4:22 am, r [EMAIL PROTECTED] wrote: Sorry friend, i could not view your link, but if you are trying to garner support for python nobody here cares. I have already been lynched by the community for tying to promote python. see the

Re: Windows Installer testing using python.

2008-11-29 Thread Fuzzyman
On Nov 28, 10:02 am, kalyan [EMAIL PROTECTED] wrote: Hi, How can we test Windows Installer using python. Is there any module available for testing? Please mail to [EMAIL PROTECTED] Thanks, Kalyan. What do you need to test? We test our msi installers by automating them from Python. We use

How to Setup SFTP Server using twisted

2008-11-29 Thread Siah
The only implementation I could find is mangled with Zope. Anyone has any resources handy on the subject? Thank you in advanced, Sia -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging in Python

2008-11-29 Thread Stef Mientki
The debugging ability of the Komodo IDE is _significantly_ better than the freely available debuggers. If you like the Komodo Editor, you'll love the debugger. hi Scott, can you tell us, why Komodo debugger is better than PyScripter or even Winpdb(rpdb2) used in most python build IDE's ?

Embedded Program Icon (wxPython)

2008-11-29 Thread Bart
Dear members, It's not (yet) easy to find my way through the bunch of info scattered over the internet to find out how to embed an icon. It could be that I’m looking at the wrong places, I'm new to Python and wxPython. Nevertheless, I would like to share this little script with the rest of the

Version upgrade blocked mentally

2008-11-29 Thread Adam E
I have read in my copy of Programming Python that all strings will be Unicode and there will be a byte type. This is mentally keeping me from upgrading to 2.6 . I'm curious, but are there still some who prefer Python 2.5? I don't mind constructive criticsm. --

Convert hexadecimal characters to ascii

2008-11-29 Thread Durand
Hi, I've got this weird problem where in some strings, parts of the string are in hexadecimal, or thats what I think they are. I'm not exactly sure...I get something like this: 's\x08 \x08Test!' from parsing a log file. From what I found on the internet, x08 is the backspace character but I'm

Re: Debugging in Python

2008-11-29 Thread Scott David Daniels
Stef Mientki wrote: The debugging ability of the Komodo IDE is _significantly_ better than the freely available debuggers. If you like the Komodo Editor, you'll love the debugger. hi Scott, can you tell us, why Komodo debugger is better than PyScripter or even Winpdb(rpdb2) used in most

Emacs vs. Eclipse vs. Vim

2008-11-29 Thread Josh
If you were a beginning programmer and willing to make an investment in steep learning curve for best returns down the road, which would you pick? I know this topic has been smashed around a bit already, but 'learning curve' always seems to be an arguement. If you feel that one is easier or

Re: Quick Newbie Question

2008-11-29 Thread Josh
alex23 wrote: On Nov 29, 5:09 pm, Josh [EMAIL PROTECTED] wrote: Can Python be used on one Linux machine to drive another Linux machine through SSH? I am currently running Putty on my XP box to run tests on a Linux box. I need to automate these tests and thought it would be fun to do so from a

Re: Emacs vs. Eclipse vs. Vim

2008-11-29 Thread Joe Riopel
On Sat, Nov 29, 2008 at 3:44 PM, Josh [EMAIL PROTECTED] wrote: Thanks in advance, There is no right, or wrong, answer to this question. Try one for a few weeks, force yourself to use it as exclusively as possible for all your text editing needs. After that, repeat that process with the other

Re: newbie question: if var1 == var2:

2008-11-29 Thread Reggie Dugard
On Fri, 2008-11-28 at 19:47 -0800, [EMAIL PROTECTED] wrote: Hi All, I dont understand why the following code never finds tree. The problem is that the lines you are reading from the file have a newline at the end so 'tree' != 'tree\n'. See below for suggested changes. I could not find the

Re: Version upgrade blocked mentally

2008-11-29 Thread Albert Hopkins
On Sat, 2008-11-29 at 12:32 -0800, Adam E wrote: I have read in my copy of Programming Python that all strings will be Unicode and there will be a byte type. This is mentally keeping me from upgrading to 2.6 . Care to explain? Actually what you describe is a change change takes place in

Re: Convert hexadecimal characters to ascii

2008-11-29 Thread Mensanator
On Nov 29, 2:39�pm, Durand [EMAIL PROTECTED] wrote: Hi, I've got this weird problem where in some strings, parts of the string are in hexadecimal, or thats what I think they are. I'm not exactly sure...I get something like this: 's\x08 \x08Test!' from parsing a log file. From what I found

Re: end of print = lower productivity ?

2008-11-29 Thread Lie
On Nov 25, 11:44 pm, Tim Chase [EMAIL PROTECTED] wrote: p = print p(f) Voila, 4 keystrokes saved :-) When I write print, it is both effortless and instantaneous : my hands do not move, a wave goes through my fingers, it all happens in a tenth of a second. Contrast this with what

Re: Embedded Program Icon (wxPython)

2008-11-29 Thread Mike Driscoll
On Nov 29, 2:30 pm, Bart [EMAIL PROTECTED] wrote: Dear members, It's not (yet) easy to find my way through the bunch of info scattered over the internet to find out how to embed an icon. It could be that I’m looking at the wrong places, I'm new to Python and wxPython. Nevertheless, I would

Re: end of print = lower productivity ?

2008-11-29 Thread Lie
On Nov 26, 3:08 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: On Nov 25, 5:05 pm, peter [EMAIL PROTECTED] wrote: BUT you now can do p = print p(f) Voila, 4 keystrokes saved :-) All right. Let's talk about that. When I write print, it is both

Re: Convert hexadecimal characters to ascii

2008-11-29 Thread Albert Hopkins
On Sat, 2008-11-29 at 20:39 +, Durand wrote: Hi, I've got this weird problem where in some strings, parts of the string are in hexadecimal, or thats what I think they are. I'm not exactly sure...I get something like this: 's\x08 \x08Test!' from parsing a log file. From what I found

how to find help/doc files ?

2008-11-29 Thread Stef Mientki
hello, For an IDE, I want to find the installed help files, either in the form of chm or html files. I'm specially interested in the files for: - python - wxpython - vpython but I fact I want link to all installed docs. Is there a general way to find (by code) these docs ? If not, are there

Re: Pyhon (with wxPython) on Windows' cygwin: can it be done fully ?

2008-11-29 Thread Lie
On Nov 26, 1:45 pm, Barak, Ron [EMAIL PROTECTED] wrote: Hi Pythonistas, I read diaz's comments with interest, but - in my current configuration, I'm unable to use pdb. I'm developing on cygwin and use wxPython. Consequently, I cannot use native cygwin Python, but my Python is actually

Re: Version upgrade blocked mentally

2008-11-29 Thread Scott David Daniels
Adam E wrote: I have read in my copy of Programming Python that all strings will be Unicode and there will be a byte type. Actually that change is scheduled for 3.0. As a tool for simplifying conversions and compatible code, the name bytes is provided in 2.6 as a synonym of str. This allows

Re: PYTHONPATH in Windows

2008-11-29 Thread waltbrad
On Nov 29, 1:39 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: waltbrad schrieb: PYTHONPATH is a concept I've never been able to get straight.  I can't see the difference between this and just setting paths in the Windows environment variables. So, for the longest time I just never

Re: Debugging in Python

2008-11-29 Thread Stef Mientki
Scott David Daniels wrote: Stef Mientki wrote: The debugging ability of the Komodo IDE is _significantly_ better than the freely available debuggers. If you like the Komodo Editor, you'll love the debugger. hi Scott, can you tell us, why Komodo debugger is better than PyScripter or even

Re: newbie question: if var1 == var2:

2008-11-29 Thread Massimo Di Pierro
because when you loop over open(...) is the same as looping over open (...).readlines() and readlines() reads everything including newlines. Try replace: if item == var: with if item.strip() == var: Massimo On Nov 28, 2008, at 9:47 PM, [EMAIL PROTECTED] wrote: Hi All, I dont

Re: Unicode regex and Hindi language

2008-11-29 Thread Terry Reedy
MRAB wrote: Terry Reedy wrote: I notice from the manual All identifiers are converted into the normal form NFC while parsing; comparison of identifiers is based on NFC. If NFC used accented letters, then the issue is finesses away for European words simply because Unicode includes includes

Re: Version upgrade blocked mentally

2008-11-29 Thread Jean-Paul Calderone
On Sat, 29 Nov 2008 13:40:00 -0800, Scott David Daniels [EMAIL PROTECTED] wrote: Adam E wrote: I have read in my copy of Programming Python that all strings will be Unicode and there will be a byte type. Actually that change is scheduled for 3.0. Yes, but it's available in 2.6 as well:

Re: Unicode regex and Hindi language

2008-11-29 Thread John Machin
On Nov 30, 4:33 am, Terry Reedy [EMAIL PROTECTED] wrote: Martin v. Löwis wrote: To be fair to Python (and SRE), I was being unfair? In the context, bug == needs to be changed; see below. SRE predates TR#18 (IIRC) - atleast annex C was added somewhere between revision 6 and 9, i.e. in early

Re: Unicode regex and Hindi language

2008-11-29 Thread Terry Reedy
John Machin wrote: John, nothing I wrote was directed at you. If you feel insulted, you have my apology. My intention was and is to get future movement on an issue that was reported 20 months ago but which has lain dead since, until re-reported (a bit more clearly) a week ago, because of a

Re: Convert hexadecimal characters to ascii

2008-11-29 Thread John Machin
On Nov 30, 7:39 am, Durand [EMAIL PROTECTED] wrote: Hi, I've got this weird problem where in some strings, parts of the string are in hexadecimal, or thats what I think they are. I'm not exactly sure...I get something like this: 's\x08 \x08Test!' from parsing a log file. From what I found

Re: PYTHONPATH in Windows

2008-11-29 Thread Martin v. Löwis
But no PYTHONPATH variable shows up in my environment settings. To answer a long question with a single sentence: just add the variable, and be done with it. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question: if var1 == var2:

2008-11-29 Thread John Machin
On Nov 29, 2:53 pm, [EMAIL PROTECTED] wrote: Hi All, I dont understand why the following code cannot find the variable tree.  It is very simple but I could not find the answer to this on the Python Tutorials.  Here is the code, input and runtime: #!/usr/bin/python fname = open(test43.in)

Re: Version upgrade blocked mentally

2008-11-29 Thread Martin v. Löwis
I have read in my copy of Programming Python that all strings will be Unicode and there will be a byte type. Actually that change is scheduled for 3.0. Yes, but it's available in 2.6 as well: from __future__ import unicode_literals type('') type 'unicode' That's different,

Re: end of print = lower productivity ?

2008-11-29 Thread Tim Chase
It's not so much ridiculous as a failure of your editor to assist you. In Vim (my editor-of-choice), I'd do something like seriously, I don't think anyone in Windows uses vim Are you just guessing, or do you have any sort of facts to back this up? It's my editor of choice when I'm stuck in

Re: end of print = lower productivity ?

2008-11-29 Thread Scott David Daniels
Tim Roberts wrote: ... I can sympathize with what you are saying. I spend virtually all of my time in a command line. As a Windows driver guy, I work a lot in the \windows\system32\drivers directory. I got used to typing that as \wi tab \syst tabtab \dr tab letting tab completion fill it

Re: Debugging in Python

2008-11-29 Thread Scott David Daniels
Stef Mientki wrote: I'm not completely satisfied with even the best debuggers, most of the good ones are too difficult, so I want to wrap rpdb2 and don't want to miss any great features ;-) I think ActiveState has a free 21-day trial, so you could check it out yourself if you are willing

Re: Embedded Program Icon (wxPython)

2008-11-29 Thread Bart
On Nov 29, 10:14 pm, Mike Driscoll [EMAIL PROTECTED] wrote: On Nov 29, 2:30 pm, Bart [EMAIL PROTECTED] wrote: Dear members, It's not (yet) easy to find my way through the bunch of info scattered over the internet to find out how to embed an icon. It could be that I’m looking at the

Re: end of print = lower productivity ?

2008-11-29 Thread Grant Edwards
On 2008-11-29, Tim Chase [EMAIL PROTECTED] wrote: [...] Python only requires a text editor. If typing a few extra parens for printing is the worst of your efficiency concerns in Notepad, you need to go out and see what productivity-enhancing features other text-editors offer. On Win32, you

Re: Convert hexadecimal characters to ascii

2008-11-29 Thread Durand
Wow, I didn't expect so many responses! Thanks! I will have to try out all those solutions when I have access to my computer.. What I meant was that when the string was printed onto a text file, it showed lots of boxes that are usually associated with unknown characters...When I tried to work out

Re: Emacs vs. Eclipse vs. Vim

2008-11-29 Thread Mario Testinori
On Sat, 29 Nov 2008 12:44:14 -0800, Josh [EMAIL PROTECTED] wrote: If you were a beginning programmer and willing to make an investment in steep learning curve for best returns down the road, which would you pick? I know this topic has been smashed around a bit already, but 'learning curve'

Re: Emacs vs. Eclipse vs. Vim

2008-11-29 Thread Stef Mientki
Mario Testinori wrote: On Sat, 29 Nov 2008 12:44:14 -0800, Josh [EMAIL PROTECTED] wrote: If you were a beginning programmer and willing to make an investment in steep learning curve for best returns down the road, which would you pick? I know this topic has been smashed around a bit

Re: Emacs vs. Eclipse vs. Vim

2008-11-29 Thread Albert Hopkins
On Sun, 2008-11-30 at 02:18 +0100, Stef Mientki wrote: First, you must understand that this is an extremelly dangerous question to ask on a public newsgroup (expecially regarding the first and the third in the series). Wars have began over this. Many people were harmed in those wars. Many

Re: end of print = lower productivity ?

2008-11-29 Thread Steven D'Aprano
On Sat, 29 Nov 2008 13:24:29 -0800, Lie wrote: I am a perfectionists But not enough of a perfectionist to tell the difference between one perfectionist and two perfectionists. *wink* -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode regex and Hindi language

2008-11-29 Thread Martin v. Löwis
John Machin wrote: On Nov 30, 4:33 am, Terry Reedy [EMAIL PROTECTED] wrote: Martin v. Löwis wrote: To be fair to Python (and SRE), I was being unfair? No - sorry if I gave that impression. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >