why __repr__ affected after __getattr__ overloaded?

2007-06-21 Thread Roc Zhou
Now I have to design a class that overload __getattr__, but after that, I found the __repr__ have been affected. This is a simple example model: #!/usr/bin/env python class test: def __init__(self): self.x = 1 def __getattr__(self, attr_name): try: return

why __repr__ affected after __getattr__ overloaded?

2007-06-21 Thread Roc Zhou
Now I have to design a class that overload __getattr__, but after that, I found the __repr__ have been affected. This is a simple example model: #!/usr/bin/env python class test: def __init__(self): self.x = 1 def __getattr__(self, attr_name): try: return

Re: comparing two lists and returning position

2007-06-21 Thread Neil Cerutti
On 2007-06-22, hiro [EMAIL PROTECTED] wrote: Hi there, I have a 2 lists.. for simplicities sake lets say the are: l1 = [ 'abc' 'ghi' 'mno' ] l2 = [ 'abc' 'def' 'ghi' 'jkl 'mno' 'pqr'] what I need to do is compare l1 against l2 and return the position of where each object in l1 is in l2

gettext and __doc__ for class methods?

2007-06-21 Thread Roc Zhou
from gettext import gettext as _ __doc__ = _(module docstrings) class test: __doc__ = _(class docstrings) def __setattr__(self, attr_name, value): _(class method docstrings) But I found when the module and class docstrings take effect(must use __doc__ to specify it), the

Type of __builtins__ changes from module import to execution?

2007-06-21 Thread Adam Hupp
I've noticed some unexpected behavior with __builtins__ during module import. It seems that during module import __builtins__ is a dict but at all other times it is a module. For example, if the file testmod.py has these contents: print type(__builtins__) print has str attr,

Re: Issues with nonfunctioning VTK under python 2.5

2007-06-21 Thread Robert Kern
Eric Carlson wrote: Any suggestions would be greatly appreciated. Please bring these bug reports to [EMAIL PROTECTED] and possibly make a ticket on our Trac. https://mail.enthought.com/mailman/listinfo/enthought-dev https://svn.enthought.com/enthought Thanks. -- Robert Kern I have come

Re: subprocess.popen question

2007-06-21 Thread [EMAIL PROTECTED]
On Jun 21, 1:22 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 22:28:06 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 7:50 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 20:02:52 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED]

Re: Changing the names of python keywords and functions

2007-06-21 Thread Martin v. Löwis
koristiti OS- (THIS IS MY IMAGINARY EXAMPLE OF KEYWORD), my program must write this code in some user file, but my program must read this command like: import os.How can I do something like that?? The keywords are listed in Grammar/Grammar. You need to edit this file, then recompile. To

Re: comparing two lists and returning position

2007-06-21 Thread Paul Rubin
hiro [EMAIL PROTECTED] writes: what I need to do is compare l1 against l2 and return the position of where each object in l1 is in l2 ie: pos = 0, 2, 4 Is it September already? from itertools import izip pos = map(dict(izip(l2, count())).__getitem__, l1) Heh heh heh. --

Re: How to Encode Parameters into an HTML Parsing Script

2007-06-21 Thread Gabriel Genellina
En Thu, 21 Jun 2007 23:37:07 -0300, [EMAIL PROTECTED] escribió: So for example if I wanted to navigate to an encoded url http://online.investools.com/landing.iedu?signedin=true rather than just http://online.investools.com/landing.iedu How would I do this? How can I modify the script to

Re: why __repr__ affected after __getattr__ overloaded?

2007-06-21 Thread Gabriel Genellina
En Fri, 22 Jun 2007 00:30:43 -0300, Roc Zhou [EMAIL PROTECTED] escribió: Now I have to design a class that overload __getattr__, but after that, I found the __repr__ have been affected. This is a simple example model: You are creating many attributes with value inexistent, even special

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Robert Brown
Stephen R Laniel [EMAIL PROTECTED] writes: Granted, in a dynamic language we won't always (maybe won't often) have a situation where the types are known this well at compile time. But sometimes we will. And it would be nice to catch these before the program even runs. So my question is:

Re: Google breaks international charset messages

2007-06-21 Thread Ben Finney
Evan Klitzke [EMAIL PROTECTED] writes: Ironically, you're sending out us-ascii encoded emails as well. Yes, because I was (a) replying to a message already in that encoding, and (b) that encoding was sufficient to encode all the characters in my message. Where the original poster's message

Re: subprocess.popen question

2007-06-21 Thread Gabriel Genellina
En Fri, 22 Jun 2007 01:05:36 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: cmd = [gawk, -f, altertime.awk, -v, time_offset=4, -v, outfile=testdat.sco, i1.sco] output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] lines = output.splitlines() for line in

Re: Python's only one way to do it philosophy isn't good?

2007-06-21 Thread Robert Brown
Neil Cerutti [EMAIL PROTECTED] writes: On 2007-06-21, Douglas Alan [EMAIL PROTECTED] wrote: A prime example of this is how CLOS, the Common Lisp Object System was implemented completely as a loadable library (with the help of many macros) into Common Lisp, which was not an OO language prior to

Re: Internationalised email subjects

2007-06-21 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: That's really strange. The chinese characters I am inputing into the post are not being displayed. Basically, what I am doing is this: h = Header('(Some Chinese characters inserted here', 'GB2312') What encoding do Some Chinese characters have at that point? 1.

assert annoyance

2007-06-21 Thread Paul Rubin
So I have some assert statements in my code to verify the absence of some impossible conditions. They were useful in debugging and of course I left them in place for real runs of the program. Umpteen hours into a run, an assertion failed, and of course since failure was impossible, I didn't

Re: Python's only one way to do it philosophy isn't good?

2007-06-21 Thread Douglas Alan
Terry Reedy [EMAIL PROTECTED] writes: | It allows the community to develop language features in a modular way | without having to sully the code base for the language itself. [etc] Some of the strongest opposition to adding macros to Python comes from people like Alex Martelli who have had

Re: comparing two lists and returning position

2007-06-21 Thread Charles Sanders
Paul Rubin wrote: from itertools import izip pos = map(dict(izip(l2, count())).__getitem__, l1) or probably less efficiently ... l1 = [ 'abc', 'ghi', 'mno' ] l2 = [ 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqr'] pos = [ l2.index(i) for i in l1 ] print pos [0, 2, 4] Charles --

Re: why __repr__ affected after __getattr__ overloaded?

2007-06-21 Thread Roc Zhou
I know what's wrong. Thank you. And I think try: return self.__dict__[attr_name] is unnecessary, because python will do it itself for us. So now I have to overload __str__, but how can I make self.__str__ print as builtin str(): at here, I want get the result like: test instance at 0xb7bbb90c

Re: Problem with using ConfigParser.py

2007-06-21 Thread David Wahler
On 6/22/07, shridhar kurhade [EMAIL PROTECTED] wrote: Hi, Thanks for your reply. I tried changing the ownership and it looks as below: # ls -l /home/ast/ast-linux.conf -rw-r--r-- 1 ast ast 7936 Jun 21 11:11 /home/ast/ast-linux.conf But when I try to read through browser, it gives permission

Re: Python live environment on web-site?

2007-06-21 Thread [EMAIL PROTECTED]
On Jun 21, 1:18 am, [EMAIL PROTECTED] (Thomas Lenarz) wrote: Hi all, I was wondering if there was a python-live-environment available on a public web-site similar to the ruby-live-tutorial on http://tryruby.hobix.com/ I would prefer something which allows to paste small scripts into a

Re: python website

2007-06-21 Thread [EMAIL PROTECTED]
On Jun 21, 12:53 am, Martin Skou [EMAIL PROTECTED] wrote: The Daily Python-URLhttp://www.pythonware.com/daily/ pythonpapers.org :) -T -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.popen question

2007-06-21 Thread Gabriel Genellina
En Wed, 20 Jun 2007 22:28:06 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 7:50 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 20:02:52 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 1:46 pm, Gabriel Genellina [EMAIL PROTECTED]

Split file into several and reformat

2007-06-21 Thread bomber71
Hi, I want to take read an input file (sels.txt) that looks like: Begin sels sel1 = {1001, 1002, 1003, ... ... 1099} sel2 = {1001, 1008, 1009 ... ... 1299} End sels And turn it into an output file for each of the sels in the input file, i.e

Re: Python live environment on web-site?

2007-06-21 Thread Daniel Nogradi
I was wondering if there was a python-live-environment available on a public web-site similar to the ruby-live-tutorial on http://tryruby.hobix.com/ I would prefer something which allows to paste small scripts into a text-field, to run them on the server, and to be able to read the

Re: string formatter %x and a class instance with __int__ or __long__ cannot handle long

2007-06-21 Thread Gabriel Genellina
En Thu, 21 Jun 2007 00:24:28 -0300, Kenji Noguchi [EMAIL PROTECTED] escribió: Example2 -- pass an instance of a class with __int__() class X: ... def __init__(self, v): ... self.v = v ... def __int__(self): ... return self.v ... y = X(0x8000) %08x % y

Re: The Modernization of Emacs

2007-06-21 Thread David Kastrup
Twisted [EMAIL PROTECTED] writes: On Jun 20, 12:39 pm, [EMAIL PROTECTED] (Joel J. Adamson) wrote: The point is that the responsibility to customize is on the user. Given that in its out-of-the-box configuration it's well-nigh unusable without a printed-out cheat sheet of some kind, of the

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-21 Thread David Kastrup
Twisted [EMAIL PROTECTED] writes: On Jun 20, 5:37 pm, David Kastrup [EMAIL PROTECTED] wrote: ...spewing...babbling... I won't dignify your insulting twaddle and random ad-hominem verbiage with any more responses after this one. Something with actual logical argumentation to rebut may be

Emacs topic

2007-06-21 Thread Gabor Urban
Hi guys, I kindly ask you to stop this topic. Though I see the importance to have a good editor for programming, this is outside of the focus of a Python mailing list. The open source world offers a lot of very good tools to edit source files, even for cross-platform development. Emacs is one

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Bruno Desthuilliers
Stephen R Laniel a écrit : On Wed, Jun 20, 2007 at 12:59:28PM -0700, [EMAIL PROTECTED] wrote: Then you should use another language. This is what I meant about knowing how Internet discussions go. Please let not forget the context. You said: I'm new to Python, and then : if I *want*

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Diez B. Roggisch
kaens schrieb: On 6/20/07, Diez B. Roggisch [EMAIL PROTECTED] wrote: That is exactly the problem - there is no some more static typing. There is static typing - or not. You can't have it just a bit. Couldn't a language be made so that if you declared a variable like, say: string foo =

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Bruno Desthuilliers
Stephen R Laniel a écrit : On Wed, Jun 20, 2007 at 09:41:09PM +0100, Michael Hoffman wrote: If you asked Java programmers why you couldn't turn *off* Java's static type checking if you wanted to, you'd probably get a similar response. Perhaps it would help for me to explain what I'd like.

Re: Split file into several and reformat

2007-06-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hi, I want to take read an input file (sels.txt) that looks like: (snip) And turn it into an output file for each of the sels in the input file, i.e sel1.txt: (snip) and sel2.txt: (snip) And so on. Yes, fine. All this is documented here:

Re: visual gui ides for python/jythpn

2007-06-21 Thread kromakey
Thanks, I'll take a look at these. Kromakey On 20 Jun, 22:10, Peter Decker [EMAIL PROTECTED] wrote: On 6/20/07, kromakey [EMAIL PROTECTED] wrote: Hi, Are there any free visual GUI IDE's available for python/jython, which have a drag and drop form designer similar to Visual Studio or

Re: Help With Better Design

2007-06-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) I would like to be able to get a good hold of the concept state machines ? Well both state machines and classes (objects). That may be a bit of a tall order to take on all at once but the concepts seem to be quite related. They are, since OO was born

Making decimal default datatype for floats during runtime

2007-06-21 Thread Stefan Sonnenberg-Carstens
Hi, I was wondering if there are any tricks around to do some sort of changing types, float in particular. I do many operations like summing etc on lots of floats and always have to do some extra checks where results are heading 0.0, like round(n,10) for example. My idea was to tell python in some

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread M�ta-MCI
Hi! Given that one can add/replace/remove methods and attributes dynamically either on a per-class or per-instance basis, and even dynamically change the class of an object, I fail to see how static typechecking could be meaningfull. Et toc ! --

Re: Invisible processes in Win2K

2007-06-21 Thread M�ta-MCI
Hi! When you lock (the cpu), interactive mode is off. You can try to use services, who run independently of sessions. But... -- http://mail.python.org/mailman/listinfo/python-list

Re: DFW Pythoneers Meeting THIS Saturday

2007-06-21 Thread peter
OK. Not my intention to start a flame war, but as DFW did not mean a thing to me (other than being my late father in law's initials) I was a bit peeved about the assumption that everybody would understand it. I think posts which are essentially local should make this clear to all in the title. I

Re: The Modernization of Emacs

2007-06-21 Thread Sascha Bohnenkamp
E M A C S i e n o w g g d n a h a t p t b i p y n i t o n e u g s s l o y f m e m o r y -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs

2007-06-21 Thread Sascha Bohnenkamp
Windows text editors are not normal: most are devoid of all but the most primitive functions and are further hampered by having an interface that required frequent time wasting hand transfers from keyboard to mouse because, if they provide keyboard equivalents at all, these are remarkably

For Python programmers in Egypt

2007-06-21 Thread Mohammad Tayseer
Dear Pythonistas My company, Silverkey, is going to hold a demo day on 07/07/2007. We are going to make a comparison between static languages and dynamic languages. I'm going to represent the dynamic languages side. If you are in Egypt, we will be happy to meet you. http://www.demoday.us/

Looking to embed python into html like mason

2007-06-21 Thread Steven W. Orr
Does something like that exist? TIA -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 individuals! What

Re: Invisible processes in Win2K

2007-06-21 Thread Tim Golden
[EMAIL PROTECTED] wrote: I'm running a Python program on M$ Windows 2000 as a test monitor. The program should close various processes, mostly Application error-windows, as they are created. This works fine until the screensaver gets active or until I press Ctrl-Alt-Del and choose Lock

Error while installing Python2.5.1

2007-06-21 Thread zaperaj
I use red hat 9 which comes with python2.2 installed in it. Wanting to use the latest version, i downloaded python 2.5.1 from the official python website. After downloading, i performed the following steps, but there is some error during the configuration process and hence i'm not able to run the

Re: Python and (n)curses

2007-06-21 Thread peter
You could write your own little console interface, tailored to your needs, which is implemented using curses on Unix, and the effbot's 'console' on Windows. Indeed, that's basically what I have done. Just can't help thinking how much simpler (and so less error prone) it would have been had

Re: Looking to embed python into html like mason

2007-06-21 Thread Stefan Behnel
Steven W. Orr wrote: Does something like that exist? Many of them, as usual :) http://wiki.python.org/moin/WebProgramming Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Error while installing Python2.5.1

2007-06-21 Thread Pavel
On Thu, 21 Jun 2007 10:03:43 +0200, [EMAIL PROTECTED] wrote: checking for --without-gcc... no checking for gcc... no checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. It appears you

Re: string formatter %x and a class instance with __int__ cannot handle long

2007-06-21 Thread Kenji Noguchi
2007/6/20, [EMAIL PROTECTED] [EMAIL PROTECTED]: In your second example y is an instance of class X...not an int. y.v is an int. Are you hoping it will cast it to an int as needed using your method? If so, I think you need to do so explicitly...ie %08x % int(y) ~Sean I confirmed that %08x

Indenting in Emacs

2007-06-21 Thread [EMAIL PROTECTED]
Hello, Does anyone know how to make python-mode correctly indent nested lists and dictionaries. I hate indenting Django url patterns and Zope Archetypes schemas by hand, because python-mode indents them in incorrect and ugly way. Here's how it should be: StringField('reference',

Re: SimplePrograms challenge

2007-06-21 Thread Pete Forman
Steve Howell [EMAIL PROTECTED] writes: The BankAccount example is about as small of a complete class example that I could come up with, even though it's complete only a basic level. It would be good to have a larger class example that fleshes out the concept a bit more, even if it's just

Re: SimplePrograms challenge

2007-06-21 Thread pelon
*** New Thread #5 has been bothering me. def greet(name): print 'hello', name greet('Jack') greet('Jill') greet('Bob') Using greet() three times is cheating and doesn't teach much and doesn't have any real world use that #1 can't fulfill. I offer this replacement: def greet(name):

Can python access windows clipboard

2007-06-21 Thread MaHL
Can I use python to copy something(like a string) to the clipboard, so that I can paste it somewhere else. Is there a way to do this? Thanks very much! -- http://mail.python.org/mailman/listinfo/python-list

Re: Indenting in Emacs

2007-06-21 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: Hello, Does anyone know how to make python-mode correctly indent nested lists and dictionaries. I hate indenting Django url patterns and Zope Archetypes schemas by hand, because python-mode indents them in incorrect and ugly way. Here's how it should be:

Re: Internationalised email subjects

2007-06-21 Thread bugmagnet
Seems some characters are missing from my last post. The line that says: h = Header(' ', 'GB2312') should say: h = Header(' ', 'GB2312') -- http://mail.python.org/mailman/listinfo/python-list

Re: SimplePrograms challenge

2007-06-21 Thread pelon
And while I'm at it... Although Guido's tutorial was a great place to start when I first came to python I would have learned more and faster had SimplePrograms existed. My only complaint with the python documentation is the dearth of examples. The PHP documentation is chock full. Steve, You

Re: Can python access windows clipboard

2007-06-21 Thread Ant
On Jun 21, 9:59 am, MaHL [EMAIL PROTECTED] wrote: Can I use python to copy something(like a string) to the clipboard, so that I can paste it somewhere else. Is there a way to do this? The following requires Mark Hammond's win32all package (http:// sourceforge.net/projects/pywin32/): import

Re: Internationalised email subjects

2007-06-21 Thread bugmagnet
That's really strange. The chinese characters I am inputing into the post are not being displayed. Basically, what I am doing is this: h = Header('(Some Chinese characters inserted here', 'GB2312') And when I run this code, I receive the following error message: UnicodeDecodeError: 'gb2312'

Re: metaclasses and performance

2007-06-21 Thread Mirko Dziadzka
Lenard Lindstrom [EMAIL PROTECTED] wrote: I don't know if C asserts are active in release Python, but for new-style classes one thing that happens during attribute lookup is that an object's class is asserted to be an instance of type. Thank's for the explanation. My Linux distribution

Re: Can python access windows clipboard

2007-06-21 Thread Gabriel Genellina
En Thu, 21 Jun 2007 05:59:06 -0300, MaHL [EMAIL PROTECTED] escribió: Can I use python to copy something(like a string) to the clipboard, so that I can paste it somewhere else. Is there a way to do this? Yes, using the pywin32 extensions that you can download from Sourceforge py from

Re: Can python access windows clipboard

2007-06-21 Thread Michael Hoffman
MaHL wrote: Can I use python to copy something(like a string) to the clipboard, so that I can paste it somewhere else. Is there a way to do this? If you're using Cygwin Python you can just open /dev/clipboard and work on that. -- Michael Hoffman --

Re: The Modernization of Emacs

2007-06-21 Thread anno4000
Dave Hansen [EMAIL PROTECTED] wrote in comp.lang.perl.misc: Speaking of which, vi is a piece of wombat do. ;-) You can have Emacs when you pry it from my cold hypertrophied escape-pressing pinky! Anno -- http://mail.python.org/mailman/listinfo/python-list

Re: Can python access windows clipboard

2007-06-21 Thread MaHL
thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: Split file into several and reformat

2007-06-21 Thread half . italian
On Jun 20, 10:45 pm, [EMAIL PROTECTED] wrote: Hi, I want to take read an input file (sels.txt) that looks like: Begin sels sel1 = {1001, 1002, 1003, ... ... 1099} sel2 = {1001, 1008, 1009 ... ... 1299} End sels And turn it into an

install paramiko on AIX (ActiveState)

2007-06-21 Thread loial
I need help installing paramiko on ActiveState python on AIX 5 I am new to python so need info on how to download and install paramiko AIX box does not have internet connection so presume cannot use ez_setup.py? Can anyone help? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's only one way to do it philosophy isn't good?

2007-06-21 Thread Steven D'Aprano
On Wed, 20 Jun 2007 17:23:42 -0400, Douglas Alan wrote: But Scheme has macros isn't a justification for why Python should have them. No one ever gave that justification. The justification is that they are *good*. Macros are a way to abstract syntax the way that objects are used to

Re: Python live environment on web-site?

2007-06-21 Thread André
On Jun 21, 3:00 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Jun 21, 1:18 am, [EMAIL PROTECTED] (Thomas Lenarz) wrote: Hi all, I was wondering if there was a python-live-environment available on a public web-site similar to the ruby-live-tutorial on http://tryruby.hobix.com/ I

Re: Internationalised email subjects

2007-06-21 Thread Gabriel Genellina
En Thu, 21 Jun 2007 06:23:43 -0300, [EMAIL PROTECTED] escribió: That's really strange. The chinese characters I am inputing into the post are not being displayed. Basically, what I am doing is this: h = Header('(Some Chinese characters inserted here', 'GB2312') And when I run this code, I

Re: something similar to shutil.copytree that can overwrite?

2007-06-21 Thread Ben Sizer
On 20 Jun, 11:40, Justin Ezequiel [EMAIL PROTECTED] wrote: On Jun 20, 5:30 pm, Ben Sizer [EMAIL PROTECTED] wrote: I need to copy directories from one place to another, but it needs to overwrite individual files and directories rather than just exiting if a destination file already exists.

Globals in nested functions

2007-06-21 Thread [EMAIL PROTECTED]
def f(): a = 12 def g(): global a if a 14: a=13 g() return a print f() This function raises an error. Is there any way to access the a in f() from inside g(). I could find few past discussions on this subject, I could not find the simple answer

Re: How to hide a program?

2007-06-21 Thread jvdb
Hi all, thanks very much! it was indeed how i compiled to .exe After using the windows= , my issue was solved. Thanks to all who took the time on helping me. Jeroen -- http://mail.python.org/mailman/listinfo/python-list

Re: fetching text from the screen

2007-06-21 Thread Juergen Kareta
Gabriel Genellina schrieb: En Mon, 18 Jun 2007 09:13:16 -0300, Juergen Kareta [EMAIL PROTECTED] escribió: I'm thinking about a python script which fetch some text from the screen independent of what application provides the text on the screen. In this regard it should be similar to the

Re: The Modernization of Emacs

2007-06-21 Thread Karsten Wutzke
On 17 Jun., 17:13, Xah Lee [EMAIL PROTECTED] wrote: Yaawn! Xah [EMAIL PROTECTED] ∑http://xahlee.org/ Hmm I just had to think about the C64/Amiga etc. game California Games... The game displayed a comment when the player broke his neck the 13th time when BMXing: Geek of the week!

Re: visual gui ides for python/jythpn

2007-06-21 Thread Kelvie Wong
If Qt/PyQt is an option, I'd recommend the Qt designer. There is the odd dual license that they have, though. On 6/21/07, kromakey [EMAIL PROTECTED] wrote: Thanks, I'll take a look at these. Kromakey On 20 Jun, 22:10, Peter Decker [EMAIL PROTECTED] wrote: On 6/20/07, kromakey [EMAIL

Re: Globals in nested functions

2007-06-21 Thread Duncan Booth
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: def f(): a = 12 def g(): global a if a 14: a=13 g() return a print f() This function raises an error. Is there any way to access the a in f() from inside g(). I could find few past

Re: Split file into several and reformat

2007-06-21 Thread Neil Cerutti
On 2007-06-21, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I want to take read an input file (sels.txt) that looks like: Begin sels sel1 = {1001, 1002, 1003, ... ... 1099} sel2 = {1001, 1008, 1009 ... ... 1299} End sels And turn

Re: Indenting in Emacs

2007-06-21 Thread Steven W. Orr
On Thursday, Jun 21st 2007 at 10:11 +0100, quoth Michael Hoffman: =[EMAIL PROTECTED] wrote: = Hello, = Does anyone know how to make python-mode correctly indent nested lists = and dictionaries. I hate indenting Django url patterns and Zope = Archetypes schemas by hand, because python-mode indents

Re: Downloading from a clean url

2007-06-21 Thread D.Hering
Evan Klitzke wrote: On 6/20/07, D.Hering [EMAIL PROTECTED] wrote: General: How do I download a page's data from a clean url. Specific: I'm using PyQt's QHttp and QUrl classes for requests and acquiring the response, but I can't figure out how to access a page's data without knowing

Re: The Modernization of Emacs

2007-06-21 Thread notbob
On 2007-06-21, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You can have Emacs when you pry it from my cold hypertrophied escape-pressing pinky! LOL! nb -- http://mail.python.org/mailman/listinfo/python-list

Re: Split file into several and reformat

2007-06-21 Thread Amit Khemka
On 6/21/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I want to take read an input file (sels.txt) that looks like: Begin sels sel1 = {1001, 1002, 1003, ... ... 1099} sel2 = {1001, 1008, 1009 ... ... 1299} End sels And turn it

Re: Reading multiline values using ConfigParser

2007-06-21 Thread Carsten Haese
On Thu, 2007-06-21 at 02:51 +, Phoe6 wrote: On Jun 20, 10:35 pm, John Krukoff [EMAIL PROTECTED] wrote: Is there anyway, I can include multi-line value in the configfile? I Following the link to RFC 822 (http://www.faqs.org/rfcs/rfc822.html) indicates that you can spread values

Re: The Modernization of Emacs

2007-06-21 Thread Martin Gregorie
Sascha Bohnenkamp wrote: Windows text editors are not normal: most are devoid of all but the most primitive functions and are further hampered by having an interface that required frequent time wasting hand transfers from keyboard to mouse because, if they provide keyboard equivalents at all,

Re: Making decimal default datatype for floats during runtime

2007-06-21 Thread Carsten Haese
On Thu, 2007-06-21 at 09:34 +0200, Stefan Sonnenberg-Carstens wrote: Hi, I was wondering if there are any tricks around to do some sort of changing types, float in particular. I do many operations like summing etc on lots of floats and always have to do some extra checks where results are

strip() 2.4.4

2007-06-21 Thread Nick
strip() isn't working as i expect, am i doing something wrong - Sample data in file in.txt: 'AF':'AFG':'004':'AFGHANISTAN':'Afghanistan' 'AL':'ALB':'008':'ALBANIA':'Albania' 'DZ':'DZA':'012':'ALGERIA':'Algeria' 'AS':'ASM':'016':'AMERICAN SAMOA':'American Samoa' Code: f1 = open('in.txt', 'r')

Re: strip() 2.4.4

2007-06-21 Thread Stephen R Laniel
On Thu, Jun 21, 2007 at 06:23:01AM -0700, Nick wrote: Why is there a apostrophe still at the end? Is it possible that you actually have whitespace at the end of the line? So then strip() is looking for an apostrophe at the end of the line, not finding it, and therefore not stripping it? --

Re: strip() 2.4.4

2007-06-21 Thread linuxprog
Stephen R Laniel a écrit : On Thu, Jun 21, 2007 at 06:23:01AM -0700, Nick wrote: Why is there a apostrophe still at the end? Is it possible that you actually have whitespace at the end of the line? So then strip() is looking for an apostrophe at the end of the line, not finding it,

Re: strip() 2.4.4

2007-06-21 Thread Roy Smith
In article [EMAIL PROTECTED], Nick [EMAIL PROTECTED] wrote: strip() isn't working as i expect, am i doing something wrong - Sample data in file in.txt: 'AF':'AFG':'004':'AFGHANISTAN':'Afghanistan' 'AL':'ALB':'008':'ALBANIA':'Albania' 'DZ':'DZA':'012':'ALGERIA':'Algeria'

Re: strip() 2.4.4

2007-06-21 Thread Stephen R Laniel
On Thu, Jun 21, 2007 at 01:42:03PM +, linuxprog wrote: that should work for you ? I reproduced the original poster's problem by adding one extra space after the final ' on each line. I'd vote that that's the problem. -- Stephen R. Laniel [EMAIL PROTECTED] Cell: +(617) 308-5571

Re: Globals in nested functions

2007-06-21 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: def f(): a = 12 def g(): global a if a 14: a=13 g() return a print f() This function raises an error. Is there any way to access the a in f() from inside g(). Yes. Pass it to g when calling the latter and let g

newbie question: parsing street name from address

2007-06-21 Thread cjl
P: I am working on a project that requires geocoding, and have written a very simple geocoder that uses the Google service. I would like to be able to extract the name of the street from the addresses in my data, however they vary significantly. Here a some examples: 25 Main St 2500 14th St 12

Re: The Modernization of Emacs

2007-06-21 Thread Roy Smith
In article [EMAIL PROTECTED], David Kastrup [EMAIL PROTECTED] wrote: Kaldrenon [EMAIL PROTECTED] writes: I'm very, very new to emacs. I used it a little this past year in college, but I didn't try at all to delve into its features. I'm starting that process now, and frankly, the thought

Conceptualizing Threading

2007-06-21 Thread JonathanB
I have a multi-access problem that I'm pretty sure needs to be solved with threading, but I'm not sure how to do it. This will be my first foray into threading, so I'm a little confused by all of the new landscape. So, I'm going to lay out the problem I'm facing and if someone could point me

Re: strip() 2.4.4

2007-06-21 Thread Neil Cerutti
On 2007-06-21, Nick [EMAIL PROTECTED] wrote: strip() isn't working as i expect, am i doing something wrong - Sample data in file in.txt: 'AF':'AFG':'004':'AFGHANISTAN':'Afghanistan' 'AL':'ALB':'008':'ALBANIA':'Albania' 'DZ':'DZA':'012':'ALGERIA':'Algeria' 'AS':'ASM':'016':'AMERICAN

Re: The Modernization of Emacs

2007-06-21 Thread David Kastrup
Roy Smith [EMAIL PROTECTED] writes: In article [EMAIL PROTECTED], David Kastrup [EMAIL PROTECTED] wrote: Kaldrenon [EMAIL PROTECTED] writes: I'm very, very new to emacs. I used it a little this past year in college, but I didn't try at all to delve into its features. I'm starting

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Bjoern Schliessmann
Stephen R Laniel wrote: On Wed, Jun 20, 2007 at 12:59:28PM -0700, [EMAIL PROTECTED] wrote: Then you should use another language. This is what I meant about knowing how Internet discussions go. I agree. I also notice that (rather newbie-) OPs with not-so-simple questions are easily

Re: strip() 2.4.4

2007-06-21 Thread Peter Otten
Nick wrote: strip() isn't working as i expect, am i doing something wrong - Sample data in file in.txt: 'AF':'AFG':'004':'AFGHANISTAN':'Afghanistan' 'AL':'ALB':'008':'ALBANIA':'Albania' 'DZ':'DZA':'012':'ALGERIA':'Algeria' 'AS':'ASM':'016':'AMERICAN SAMOA':'American Samoa' Code:

Re: strip() 2.4.4

2007-06-21 Thread Nick
On 21 Jun, 14:53, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-06-21, Nick [EMAIL PROTECTED] wrote: strip() isn't working as i expect, am i doing something wrong - Sample data in file in.txt: 'AF':'AFG':'004':'AFGHANISTAN':'Afghanistan' 'AL':'ALB':'008':'ALBANIA':'Albania'

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Stephen R Laniel
On Thu, Jun 21, 2007 at 03:55:48PM +0200, Bjoern Schliessmann wrote: I agree. I also notice that (rather newbie-) OPs with not-so-simple questions are easily offended by technical answers. I'd love to know why. One doesn't like to get meta on such things, as so often happens, so I'll be brief.

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Peter Decker
On 6/21/07, Bjoern Schliessmann [EMAIL PROTECTED] wrote: Stephen R Laniel wrote: On Wed, Jun 20, 2007 at 12:59:28PM -0700, [EMAIL PROTECTED] wrote: Then you should use another language. This is what I meant about knowing how Internet discussions go. I agree. I also notice that

  1   2   3   >