Re: who to call a list of method inside the class itself

2008-08-20 Thread Gabriel Genellina
En Tue, 19 Aug 2008 11:18:00 -0300, [EMAIL PROTECTED] escribi�: Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Ok, so you already know it works - and you want to know why! class CustomMethod: def

Re: searching through a string and pulling characters

2008-08-20 Thread Sean DiZazzo
On Aug 19, 6:11 am, Wojtek Walczak [EMAIL PROTECTED] wrote: On Mon, 18 Aug 2008 15:34:12 -0700 (PDT), Alexnb wrote: Also, on a side-note, does anyone know a very simple dictionary site, that isn't dictionary.com or yourdictionary.com. This one is my favourite:http://www.lingro.com/ --

Re: how to add property dynamically?

2008-08-20 Thread Gabriel Genellina
En Tue, 19 Aug 2008 15:02:29 -0300, Rafe [EMAIL PROTECTED] escribió: On Aug 17, 5:09 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: akonsu a écrit : hello, i need to add properties to instances dynamically during run time. Properties must be class attributes. The only way (the only way I

Re: Newbie question about sending and receiving data to the command prompt.

2008-08-20 Thread Gabriel Genellina
En Tue, 19 Aug 2008 16:48:26 -0300, aditya shukla [EMAIL PROTECTED] escribi�: I am using windows vista and i am trying to send data to the command prompt ,this is what is done. import subprocess proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE) proc.communicate('abc') when i run this

Re: Factory for Struct-like classes

2008-08-20 Thread Dan Lenski
On Mon, 18 Aug 2008 08:28:53 -0700, Dan Lenski wrote: So is there a bug in the Python docs? Does __slots__ in fact work with subclasses of tuple? Dan Anybody think that this may actually be a mistake in the Python docs? Who would I contact about getting them corrected? Dan --

Re: urllib getting SSL certificate info

2008-08-20 Thread Heikki Toivonen
Ghirai wrote: Would you mind sharing some code? The module is pretty ugly and on top has no docs whatsoever; got tired of reading the source... Did you find out the right homepage at http://chandlerproject.org/Projects/MeTooCrypto? The original author, ngps, hasn't been involved in the project

os.system()- cannot add parameter

2008-08-20 Thread aditya shukla
Hello folks, I have a program which is in the form of a client-server. i wanna send the parameters from my python script such that the client passes it to the server.this is what i have done Server is running in vmplayer.This is what i have done b=c:\progs os.system('start

Python is not stupid the man is it

2008-08-20 Thread [EMAIL PROTECTED]
I see on this link # Python is Stupid http://schlake.livejournal.com/809567.html Code is #!/usr/bin/env python for flour in range( 50, 1000 + 1, 5): # Python is Stupid print '%.2f %.2f %.2f' % ( (flour), (flour * 0.6), (flour * 0.02) ) Output is corect :D --

Re: ??????: How to use win32com to convert a MS WORD doc to HTML ?

2008-08-20 Thread Grzegorz Staniak
On 2008-08-20, Lave [EMAIL PROTECTED] wroted: It's solved. Thank you all! You saved my life! Thank you very much. I love you! I love Python! ... I love the whole world, and all its languages, Boom-de-yada, boom-de-yada, boom-de-yada, boom-de-yada... Very sorry, but I just couldn't

Re: Grandchildren of TestCase don't work

2008-08-20 Thread Gabriel Genellina
En Tue, 19 Aug 2008 18:35:57 -0300, Gustavo Narea [EMAIL PROTECTED] escribi�: Hello, everyone. Why do unitest.TestCase grand-grandchildren not work? I've created a unittest.TestCase descendant, which contains the setUp() and tearDown() for testing some components of a web framework.

Question re ConfigParser

2008-08-20 Thread loial
Given a section like [Data] value1 value2 value3 Can ConfigParser be easily used to put the values in a dictionary? If so, how? -- http://mail.python.org/mailman/listinfo/python-list

Re: exception handling in complex Python programs

2008-08-20 Thread Marc 'BlackJack' Rintsch
On Tue, 19 Aug 2008 22:24:45 -0700, eliben wrote: You want to look up Easier to Ask Forgivness than Permission (EAFP) which is touted as the canonical error-handling paradigm for Python. Any (semi)complete guides on this canonical paradigm online ? I've only found some references in

Re: Subprocess module question.

2008-08-20 Thread Gabriel Genellina
En Tue, 19 Aug 2008 22:06:13 -0300, aditya shukla [EMAIL PROTECTED] escribi�: I am using windows vista and i am trying to communicate with various processes. so when i do import subprocess proc=subprocess.Popen('cmd.exe') --This opens the command prompt But when i do

IDLE issue

2008-08-20 Thread aditya shukla
I found something interesting while working in idle.I have windows vista and python2.5 if i do import subprocess proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE,stdout=subprocess.PIPE) output = proc.communicate('dir\n')[0] print repr(output) This dosen't work in idle while if it put it up

Re: Python is not stupid the man is it

2008-08-20 Thread eliben
On Aug 20, 9:22 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I see on this link # Python is Stupidhttp://schlake.livejournal.com/809567.html Code is #!/usr/bin/env python for flour in range( 50, 1000 + 1, 5): # Python is Stupid   print '%.2f %.2f %.2f' % ( (flour), (flour * 0.6), (flour

getattr() on nested functions?

2008-08-20 Thread Gabriel Rossetti
Hello, I can't get getattr() to return nested functions, I tried this : def toto(): ... def titi(): ... pass ... f = getattr(toto, titi) ... print str(f) ... toto() Traceback (most recent call last): File stdin, line 1, in module File stdin, line 4, in toto

Re: Factory for Struct-like classes

2008-08-20 Thread Gabriel Genellina
En Wed, 20 Aug 2008 04:00:08 -0300, Dan Lenski [EMAIL PROTECTED] escribi�: On Mon, 18 Aug 2008 08:28:53 -0700, Dan Lenski wrote: So is there a bug in the Python docs? Does __slots__ in fact work with subclasses of tuple? Anybody think that this may actually be a mistake in the Python

Re: os.system()- cannot add parameter

2008-08-20 Thread Gabriel Genellina
En Wed, 20 Aug 2008 04:20:15 -0300, aditya shukla [EMAIL PROTECTED] escribi�: I have a program which is in the form of a client-server. i wanna send the parameters from my python script such that the client passes it to the server.this is what i have done Server is running in vmplayer.This

Re: IDLE issue

2008-08-20 Thread Gabriel Genellina
En Wed, 20 Aug 2008 04:56:32 -0300, aditya shukla [EMAIL PROTECTED] escribi�: I found something interesting while working in idle.I have windows vista and python2.5 if i do import subprocess proc =subprocess.Popen('cmd.exe',stdin=subprocess.PIPE,stdout=subprocess.PIPE) output =

[tarfile] Difficultis catching an exception

2008-08-20 Thread [EMAIL PROTECTED]
Hello, I'm trying to catch an EOFError exception that occurs when reading truncated tarfile. Here's my routine, and below that the callback trace. Note that although I'm trying to catch all TarFile exceptions, the tarfile.EOFError ecxeption, and the global EOFError exception, the program still

Re: getattr() on nested functions?

2008-08-20 Thread Hrvoje Niksic
Gabriel Rossetti [EMAIL PROTECTED] writes: I can't get getattr() to return nested functions, I tried this : def toto(): ... def titi(): ... pass ... f = getattr(toto, titi) ... print str(f) ... toto() Traceback (most recent call last): File stdin, line 1, in

Re: adding properties dynamically (how to?)

2008-08-20 Thread Bruno Desthuilliers
Rafe a écrit : (snip) You can dynamically add properties to a class The OP was asking for *per instance* properties... just before returning the instance using __new__(): class AClass(object): def __new__(cls): setattr(cls,propName, property(fget = ...,

Re: getattr() on nested functions?

2008-08-20 Thread Gabriel Genellina
En Wed, 20 Aug 2008 05:34:38 -0300, Gabriel Rossetti [EMAIL PROTECTED] escribi�: I can't get getattr() to return nested functions, I tried this : def toto(): ... def titi(): ... pass ... f = getattr(toto, titi) ... print str(f) ... toto() Traceback (most recent

Re: how to add property dynamically?

2008-08-20 Thread Bruno Desthuilliers
Rafe a écrit : (snip) I posted this to another thread, but... And I answered there, explaining why it's not a proper solution. http://groups.google.com/group/comp.lang.python/browse_frm/thread/7ed51a8614a58082# (snip about using __new__ to add class attributes, cf above link for more) --

Re: getattr() on nested functions?

2008-08-20 Thread Bruno Desthuilliers
Gabriel Rossetti a écrit : Hello, I can't get getattr() to return nested functions, Of course. Nested functions are not attributes of their container function. I tried this : def toto(): ... def titi(): ... pass ... f = getattr(toto, titi) ... print str(f) ...

Re: [tarfile] Difficultis catching an exception

2008-08-20 Thread Wojtek Walczak
On Wed, 20 Aug 2008 02:07:33 -0700 (PDT), [EMAIL PROTECTED] wrote: I'm trying to catch an EOFError exception that occurs when reading truncated tarfile. Here's my routine, and below that the callback trace. Note that although I'm trying to catch all TarFile exceptions, the tarfile.EOFError

Re: How to stop iteration with __iter__() ?

2008-08-20 Thread MRAB
On Aug 20, 12:11 am, John Machin [EMAIL PROTECTED] wrote: On Aug 20, 5:06 am, Terry Reedy [EMAIL PROTECTED] wrote: In your case, the standard Python idiom, as Jon said, is it = iter(iterable) next(it) # 2.6, 3.0 for for item in iterable:    f(item) or, perhaps, for

Basic importing question

2008-08-20 Thread Hussein B
Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the sys module will be compiled and executed? Only once (the first time the PVM locates, compiles and executes the sys module)?

Re: How to stop iteration with __iter__() ?

2008-08-20 Thread John Machin
On Aug 20, 7:56 pm, MRAB [EMAIL PROTECTED] wrote: On Aug 20, 12:11 am, John Machin [EMAIL PROTECTED] wrote: or, perhaps, for completeness/paranoia/whatever: it = iter(iterable) try:    headings = it.next() # 2.5 except StopIteration:    # code to handle empty iterable for item

Re: Basic importing question

2008-08-20 Thread Bruno Desthuilliers
Hussein B a écrit : Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the sys module will be compiled and executed? Only once (the first time the PVM locates, compiles and

Re: Basic importing question

2008-08-20 Thread John Machin
On Aug 20, 8:08 pm, Hussein B [EMAIL PROTECTED] wrote: Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the sys module will be compiled and executed? Only once (the first

Re: Basic importing question

2008-08-20 Thread Hussein B
On Aug 20, 5:43 am, John Machin [EMAIL PROTECTED] wrote: On Aug 20, 8:08 pm, Hussein B [EMAIL PROTECTED] wrote: Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the

Re: Storing Passwords

2008-08-20 Thread Wojtek Walczak
On Tue, 19 Aug 2008 21:44:04 -0400, Eric Wertman wrote: I've a number of scripts set up that require a username/password combination to log in elsewhere. It's gotten to the point where I need to keep them in a more secure location, instead of just in the scripts themselves. I did a bit of

Re: Logging library unicode problem

2008-08-20 Thread Vinay Sajip
On 13 Aug, 11:08, Victor Lin [EMAIL PROTECTED] wrote: Hi, I'm writting a application using python standardloggingsystem. I encounter some problem with unicode message passed tologginglibrary. I found that unicode message will be messed up bylogginghandler. piese of StreamHandler:

Re: Python Substitute for PHP GD, Resizing an image on the client side

2008-08-20 Thread brahmaforces
Hi Diez: The file browse button will get me a filename on the client machine. You are saying post will transfer the file itself? I am using straight cherrypy no turbo gears etc, so ill have to do manually. I have not been able to find the javascript on google despite a lot of searching. Would

Re: Python Substitute for PHP GD, Resizing an image on the client side

2008-08-20 Thread Diez B. Roggisch
brahmaforces wrote: Hi Diez: The file browse button will get me a filename on the client machine. You are saying post will transfer the file itself? I am using straight cherrypy no turbo gears etc, so ill have to do manually. You need to use POST, and some enctype-this-or-that-stuff. There

Re: Basic importing question

2008-08-20 Thread Hussein B
On Aug 20, 5:43 am, John Machin [EMAIL PROTECTED] wrote: On Aug 20, 8:08 pm, Hussein B [EMAIL PROTECTED] wrote: Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the

bopla geschirr siemens geschirr geschirr boerse breker geschirr vileroy und boch geschirr fuerstenberg geschirr geschirr billig geschirr koeln

2008-08-20 Thread james7047276
bopla geschirr siemens geschirr geschirr boerse breker geschirr vileroy und boch geschirr fuerstenberg geschirr geschirr billig geschirr koeln + + + + +++ BILLIGES GESCHIRR ONLINE KAUFEN +++ BILLIGES GESCHIRR ONLINE BESTELLEN +++ + + http://WWW.GESCHIRR-ONLINE.INFO http://WWW.GESCHIRR-ONLINE.INFO

Re: Basic importing question

2008-08-20 Thread Bruno Desthuilliers
Hussein B a écrit : (snip) One more question: If I have this structure: orig/com/domain/project/Klass1.py Klass2.py __init__.py Why com, domain, project should have __init__.py also? Yes, why should they ? Unless you want to mimic Java's package

Re: Basic importing question

2008-08-20 Thread Christian Heimes
Hussein B wrote: Thank you both for your kind help and patience :) Built-in modules are compiled but even if they are so, when importing them (sys for example), Python will run their code in order to create bindings and objects, right? I'm learning Python and I want to learn it well, so that I'm

Re: Basic importing question

2008-08-20 Thread Hussein B
On Aug 20, 6:39 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Hussein B a écrit : (snip) One more question: If I have this structure: orig/com/domain/project/Klass1.py Klass2.py __init__.py Why com, domain, project should

Re: Basic importing question

2008-08-20 Thread Bruno Desthuilliers
Hussein B a écrit : (snip) Thank you both for your kind help and patience :) Built-in modules are compiled For which definition of compiled ? but even if they are so, when importing them (sys for example), Python will run their code in order to create bindings and objects, right? As the

damenkleidung kaufen uebergroessen mango damenbekleidung bestellen damen mantel bestellen bekleidung fuer damen bestellen only damenbekleidung bestellen

2008-08-20 Thread manfredpssnd6
damenkleidung kaufen uebergroessen mango damenbekleidung bestellen damen mantel bestellen bekleidung fuer damen bestellen only damenbekleidung bestellen damenbekleidung bestellen in uebergroessen damenbekleidung bestellen muenchen basler damenbekleidung bestellen triathlon

Re: Basic importing question

2008-08-20 Thread Scott David Daniels
Hussein B wrote: On Aug 20, 6:39 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Hussein B a écrit : One more question: If I have this structure: orig/com/domain/project/Klass1.py Klass2.py __init__.py Why com, domain, project should have

TRying to read sercah results from googles web page

2008-08-20 Thread [EMAIL PROTECTED]
Hi, I am trying to write a BOT to read the search results from Google. When I read from the www.google.com, the code works fine, loads in the web page. When I try to load in a url with the search results, http://www.google.com/search?hl=enq=ted', I get a web page that says I do not have

Re: who to call a list of method inside the class itself

2008-08-20 Thread maduma
On Aug 20, 8:14 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Tue, 19 Aug 2008 11:18:00 -0300, [EMAIL PROTECTED] escribi : Is the following code is ok. who to call all method. It is working but the call to m() without a reference to self seems strange Ok, so you already know it works

Re: Question re ConfigParser

2008-08-20 Thread alex23
On Aug 20, 5:34 pm, loial [EMAIL PROTECTED] wrote: Given a section like [Data] value1 value2 value3 Can ConfigParser be easily used to put the values in a dictionary? If so, how? Dictionaries are key/value pairs. Do you expect 'value1' to be a key or a value? If the data is literally as

Re: Basic importing question

2008-08-20 Thread Christian Heimes
Bruno Desthuilliers wrote: As the name imply, built-in modules are built in the interpreter - IOW, they are part of the interpreter *exposed* as modules[1]. Unless you have a taste for gory implementation details, just don't worry about this. Other ordinary modules need of course to be

We have over 700 companies that will pay you

2008-08-20 Thread hello_mox_10
We have over 700 companies that will pay you We have over 700 companies that will pay you to: Take online surveys - Get paid from $5 to $125 Each Survey! Get paid to drive your car $1000 to $3000 per month! Participate in Focus Groups - Get Paid up to $150 per hour Try new products and paid $10

subprocess seems to detach / ignore wait()

2008-08-20 Thread Mathieu Prevot
Hi there, it seems that child.wait() is ignored when print Server running [PID %s]%(child.pid) fpid.write(child.pid) are between the process creation child = Popen(cmd.split(), stderr=flog) and child.wait(). It seems to be a bug, doesn't it ? Mathieu (I'm running x11vnv with args in the

Re: How to stop iteration with __iter__() ?

2008-08-20 Thread MRAB
On Aug 20, 11:27 am, John Machin [EMAIL PROTECTED] wrote: On Aug 20, 7:56 pm, MRAB [EMAIL PROTECTED] wrote: On Aug 20, 12:11 am, John Machin [EMAIL PROTECTED] wrote: or, perhaps, for completeness/paranoia/whatever: it = iter(iterable) try:    headings = it.next() # 2.5

Re: exception handling in complex Python programs

2008-08-20 Thread Steven D'Aprano
On Tue, 19 Aug 2008 22:24:45 -0700, eliben wrote: between file() and open() in Python 2 and 3, a NameError is thrown with open() in Python 3 and an IOError is thrown in the other three cases bashes head against keyboard. I'm curious about the claim that open() will raise NameError in

Re: How to stop iteration with __iter__() ?

2008-08-20 Thread Peter Otten
MRAB wrote: So it's defined behaviour that an exhausted iterable will always raise StopIteration no matter how many times it's asked for the next value? That is not enforced. However, quoting http://www.python.org/dev/peps/pep-0234/ Iterator implementations (in C or in Python) should

Re: How to stop iteration with __iter__() ?

2008-08-20 Thread Steven D'Aprano
On Wed, 20 Aug 2008 06:16:17 -0700, MRAB wrote: So it's defined behaviour that an exhausted iterable will always raise StopIteration no matter how many times it's asked for the next value? Be careful -- an iterable is not the same as an iterator. Iterables are anything that you can iterate

SDF Approved Achieving Higher Performance Customer Service 8 9

2008-08-20 Thread Professional Customer Service
Sept Sender: Professional Customer Service [EMAIL PROTECTED] Mime-Version: 1.0 Content-Type: multipart/related; type=multipart/alternative; boundary==_NextPart_000_22D9BBBE_0.3E24F6BA Date: Wed, 20 Aug 2008 19:31:34 +0800 Message-ID: [EMAIL PROTECTED] Reply-To: Professional Customer Service

Re: TRying to read sercah results from googles web page

2008-08-20 Thread Wojtek Walczak
On Wed, 20 Aug 2008 05:42:34 -0700 (PDT), [EMAIL PROTECTED] wrote: the web page. When I try to load in a url with the search results, http://www.google.com/search?hl=enq=ted', I get a web page that says I do not have permissions. Is theree a way around this, or is Google just to smart

de.rec.tanz microsoft.public.de.exchange

2008-08-20 Thread somenewguy61
de.rec.tanz microsoft.public.de.exchange -- http://mail.python.org/mailman/listinfo/python-list

simple Question about using BeautifulSoup

2008-08-20 Thread Alexnb
Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you open a local html file? Usually I do something like this for a url soup = BeautifulSoup(urllib.urlopen('http://www.website.com') but the file extension doesn't work. So how do I open one? -- View this message in

Home Business for less than $300

2008-08-20 Thread harpo
Do you like to travel? If so please feel free to check out the following link. http://talkingcommunities.com:80/wm/archives/rse56639c62348/Traverusbp/ Email if interested at [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: simple Question about using BeautifulSoup

2008-08-20 Thread Grzegorz Staniak
On 2008-08-20, Alexnb [EMAIL PROTECTED] wroted: Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you open a local html file? Usually I do something like this for a url soup = BeautifulSoup(urllib.urlopen('http://www.website.com') but the file extension doesn't

Re: simple Question about using BeautifulSoup

2008-08-20 Thread Diez B. Roggisch
Alexnb wrote: Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you open a local html file? Usually I do something like this for a url soup = BeautifulSoup(urllib.urlopen('http://www.website.com') but the file extension doesn't work. So how do I open one? The

Required help on python-time module

2008-08-20 Thread Pradeep Kumar
I am a newbie to python even mobile side also. I am using openmoko device, there I installed stripped down python from feed path's and I need tzset() of time module for my application but when running my application.  time.tzset() at above line getting no  attribute tzset()  for module . So 

Re: simple Question about using BeautifulSoup

2008-08-20 Thread Jean-Paul Calderone
On Wed, 20 Aug 2008 07:33:32 -0700 (PDT), Alexnb [EMAIL PROTECTED] wrote: Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you open a local html file? Usually I do something like this for a url soup = BeautifulSoup(urllib.urlopen('http://www.website.com')

Microsoft Office Live Free

2008-08-20 Thread hello_mox_10
Microsoft Office Live Free Users get: Free Domain Name Free Web Hosting Free Business Email Accounts join now http://easylnk.com/?6896 -- http://mail.python.org/mailman/listinfo/python-list

Re: getattr() on nested functions?

2008-08-20 Thread Gabriel Rossetti
Gabriel Genellina wrote: En Wed, 20 Aug 2008 05:34:38 -0300, Gabriel Rossetti [EMAIL PROTECTED] escribi�: I can't get getattr() to return nested functions, I tried this : def toto(): ... def titi(): ... pass ... f = getattr(toto, titi) ... print str(f) ... toto()

Re: getattr() on nested functions?

2008-08-20 Thread Gabriel Rossetti
Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : Hello, I can't get getattr() to return nested functions, Of course. Nested functions are not attributes of their container function. Ok I tried this : def toto(): ... def titi(): ... pass ... f = getattr(toto,

Re: subprocess seems to detach / ignore wait()

2008-08-20 Thread Wojtek Walczak
On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wrote: flog = open(logfile, 'w') fpid = open(pidfile, 'w') try: child = Popen(cmd.split(), stderr=flog) print Server running [PID %s]%(child.pid) fpid.write(child.pid) What happens if you change: fpid.write(child.pid) into:

FREE MONEY LINKS

2008-08-20 Thread [EMAIL PROTECTED]
LINK LINK LINK LINK $ FREE MONEY RIGISTERED $ FREE Registered On Site http://rex.boobslove.info/voyngojchngogua/vegas/girl/sex/videos/ http://www.unregisteredlookup.com/refunded_domains/2007/march/17/com/com_march_17_2007_598.php

Re: exception handling in complex Python programs

2008-08-20 Thread [EMAIL PROTECTED]
On Aug 19, 4:12 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Tue, 19 Aug 2008 11:07:39 -0700, [EMAIL PROTECTED] wrote:   def do_something(filename):     if not os.access(filename,os.R_OK):       return err(...)     f = open(filename)     ... You're running on a

Re: exception handling in complex Python programs

2008-08-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Aug 19, 10:19 am, eliben [EMAIL PROTECTED] wrote: P.S. There's a common case where a method is passed a filename, to do something with a file (say, read data). Should the method catch the errors possibly thrown by open(), or leave it to the caller ? You want to

Re: exception handling in complex Python programs

2008-08-20 Thread Bruno Desthuilliers
eliben a écrit : This is *exactly* my concern with Python exceptions. You just never know what can be thrown at you. This rarely happen to be a problem in real life. At least not in mine. Exception that can be expected (ie : IOError when dealing with files) are usually obvious and more or

Re: exception handling in complex Python programs

2008-08-20 Thread Rafe
On Aug 20, 12:47 am, Fredrik Lundh [EMAIL PROTECTED] wrote: Rafe wrote: Again, this is probably too simple to help, but the only way to ignore certain types of exceptions, as far as I know, is to catch them and pass. e.g. this ignores type errors... try: somethingBad() except

Python Wiimote

2008-08-20 Thread xkenneth
All, I've just recently started fiddling with my Wiimote using python and PyBluez. I'm interested particular in getting the position IR sensor data out of the Wiimote, but I'd like to develop a library that let's you access all of it easily in an OO manner. If anyone has any interest in

urllib fails to connect

2008-08-20 Thread jlist
I'm running ActiveState Python 2.5 on Windows XP. It used to work fine. Today however I get (10061, 'Connection refused') for any site I try with urllib.urlopen(). -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre method keyword-arg bug.

2008-08-20 Thread Robert Brown
Fredrik Lundh [EMAIL PROTECTED] writes: Robert Brown wrote: You may find the above surprising, but Common Lisp users expect the default argument expression to be evaluated anew when needed by a function call: well, I'd say an argument based on Common Lisp users is a lot more dubious ;-)

Re: urllib fails to connect

2008-08-20 Thread jlist
I found out why. I set a proxy in IE and I didn't know ActiveState Python use IE proxy! I'm running ActiveState Python 2.5 on Windows XP. It used to work fine. Today however I get (10061, 'Connection refused') for any site I try with urllib.urlopen(). --

Re: getattr() on nested functions?

2008-08-20 Thread Terry Reedy
Gabriel Rossetti wrote: Bruno Desthuilliers wrote: Gabriel Rossetti a écrit : I thought that since functions are objects, that I could obtain it's nested functions. Well, there's probably a very hackish way, but it's not worth the pain. What Bruno meant here, I believe, is that there

Re: urllib fails to connect

2008-08-20 Thread raashid bhatt
On Aug 20, 10:06 am, jlist [EMAIL PROTECTED] wrote: I'm running ActiveState Python 2.5 on Windows XP. It used to work fine. Today however I get (10061, 'Connection refused') for any site I try with urllib.urlopen(). May be the host is Listening on the port you are connecting to or the host

Re: urllib fails to connect

2008-08-20 Thread Trent Mick
jlist wrote: I found out why. I set a proxy in IE and I didn't know ActiveState Python use IE proxy! I'm running ActiveState Python 2.5 on Windows XP. It used to work fine. Today however I get (10061, 'Connection refused') for any site I try with urllib.urlopen(). Perhaps IE's proxy settings

Re: Python Wiimote

2008-08-20 Thread nntpman68
Hi Ken, Yes, I'm interested in using the Wiimote with Python. However so far I did not use ('use' means 'just try') the Wiimote with anything except Glovepie. There's three setups I'm interested in (less Python, than a general setup issues so far): - Wiimote with Windows XP: Problem is,

Boost Python DLL from Boost Pro is built incorrectly?

2008-08-20 Thread Stodge
I'm having issues with Boost Python, downloaded via http://www.boostpro.com. I *think* it's related to WinXP side by side assemblies. My application that uses Boost Python fails to start. I ran dependancy walker on the Boost Python DLL and I get the following: Error: The Side-by-Side

Re: exception handling in complex Python programs

2008-08-20 Thread Steven D'Aprano
On Wed, 20 Aug 2008 09:23:22 -0700, [EMAIL PROTECTED] wrote: On Aug 19, 4:12 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Tue, 19 Aug 2008 11:07:39 -0700, [EMAIL PROTECTED] wrote:   def do_something(filename):     if not os.access(filename,os.R_OK):       return

Re: Bizarre method keyword-arg bug.

2008-08-20 Thread Steven D'Aprano
On Wed, 20 Aug 2008 13:09:21 -0400, Robert Brown wrote: In any case, chances are high that Lisp's way of handling default arguments would have been changed had it been shown to cause performance problems. But nobody is suggesting that it would cause performance problems in *Lisp*. It might,

Re: urllib fails to connect

2008-08-20 Thread jlist
My guess is urllib.urlopen() wraps the wininet calls, which share IE proxy settings. Perhaps IE's proxy settings are effectively setting the Windows system networking proxy settings? -- http://mail.python.org/mailman/listinfo/python-list

evaluating code lines above breakpoints ?

2008-08-20 Thread Stef Mientki
hello, I'm trying to create a high level debugger, based on rpd2. So when the debugger enters a breakpoint, I want to display the values of all variables in the, let's say, 5 lines above the breakpoint (if possible). Any hints on how I get a list of all vars in those lines ? My rough idea is to

Re: exception handling in complex Python programs

2008-08-20 Thread Marc 'BlackJack' Rintsch
On Wed, 20 Aug 2008 18:37:02 +0200, Bruno Desthuilliers wrote: I personally think this is sloppy because you have to couple the exception type with the function --- between file() and open() in Python 2 and 3, a NameError is thrown with open() in Python 3 ??? I suspect this has nothing to

Sorting an array on the nth element in a list

2008-08-20 Thread Ron Brennan
Hello, I am trying to parse a log file. I want to sort based on the second element the list that is in the file. What is the best way to do this? The sort is just on the line itself where I want to re-organize the lines based on the second element of the csv file Thanks, Ron --

python custom command interpreter?

2008-08-20 Thread joey boggs
I've got a hopefully simple question, maybe I'm just not searching for the right information. I'm working on a project that is using kickstarts to build Fedora/CentOS variant machines. Within the kickstart in the post section we will be performing disk space reductions by removing any unnecessary

os.readlink() doco snafu?

2008-08-20 Thread JBW
English is my first language, but I doesn't be very good at it. I was trying to endow my symlinked python module with the ability to divine where it actually resides when I came across os.readlink(), documented at http://docs.python.org/lib/os-file-dir.html I'm not sure readlink() lives up

Re: Sorting an array on the nth element in a list

2008-08-20 Thread Vlastimil Brom
2008/8/20 Ron Brennan [EMAIL PROTECTED] Hello, I am trying to parse a log file. I want to sort based on the second element the list that is in the file. What is the best way to do this? The sort is just on the line itself where I want to re-organize the lines based on the second

Re: os.readlink() doco snafu?

2008-08-20 Thread Fredrik Lundh
JBW wrote: I'm not sure readlink() lives up to its documentation. To wit: $ touch bar # Create an empty file $ ln -s bar foo # And a symlink to it. $ python Python 2.5.1 ... Herald the snitch Redacted ... Type help, copyright, credits or license for more information.

Re: urllib fails to connect

2008-08-20 Thread Fredrik Lundh
jlist wrote: My guess is urllib.urlopen() wraps the wininet calls, which share IE proxy settings. urllib doesn't use wininet, but it does fetch the proxy settings from the Windows registry. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: python custom command interpreter?

2008-08-20 Thread Fredrik Lundh
joey boggs wrote: In the end I'd like to be able to run a custom interpreter and just feed it one command and a directory. The end result in the kickstart something like this: %post --interpreter #!/usr/bin/myinterpreter DROP /tmp/directory DROP /tmp/directory2 How would I setup the

Re: Bizarre method keyword-arg bug.

2008-08-20 Thread Robert Brown
Steven D'Aprano [EMAIL PROTECTED] writes: On Wed, 20 Aug 2008 13:09:21 -0400, Robert Brown wrote: In any case, chances are high that Lisp's way of handling default arguments would have been changed had it been shown to cause performance problems. But nobody is suggesting that it would cause

Find file in a given search path

2008-08-20 Thread aditya shukla
Hello folks, i am trying to find a particular file in a given search path.I found code for this on internet. Code from os.path import exists, join from os import pathsep from string import split def search_file(filename, search_path): Given a search path, find file file_found = 0

Re: subprocess seems to detach / ignore wait()

2008-08-20 Thread Gabriel Genellina
En Wed, 20 Aug 2008 12:22:16 -0300, Wojtek Walczak [EMAIL PROTECTED] escribió: On Wed, 20 Aug 2008 15:09:11 +0200, Mathieu Prevot wrote: child = Popen(cmd.split(), stderr=flog) print Server running [PID %s]%(child.pid) fpid.write(child.pid) I think that the problem here is that

Re: urllib fails to connect

2008-08-20 Thread Edwin . Madari
jlist wrote: I found out why. I set a proxy in IE and I didn't know ActiveState Python use IE proxy! I'm running ActiveState Python 2.5 on Windows XP. It used to work fine. Today however I get (10061, 'Connection refused') for any site I try with urllib.urlopen(). switching to

Re: os.readlink() doco snafu?

2008-08-20 Thread Miles
Fredrik Lundh wrote: JBW wrote: I'm not sure readlink() lives up to its documentation. ... The result makes sense, but it belies the documentation. Should I report this? Or is there another plausible interpretation? the part about joining with dirname(path) assumes that you pass in an

py2exe importing a package not in library.zip

2008-08-20 Thread mypetslug
Hi, I'm sorry if this has been asked before, but I can't seem to find an answer to this anywhere and so far, trial and error hasn't gotten me far either. Using python 2.4, I've created a testing application. When the app starts up, I do a [code]from tests import *[/code] and it looks at the

Re: python custom command interpreter?

2008-08-20 Thread joey boggs
That's kinda what I'm looking for, but it can't be interactive as there's no way to send input during the installation. It should pass the DROP statements to the interpreter and the interpreter takes the input and runs os.rmdir() or something similar. This way the backend does all the work and the

  1   2   3   >