Re: variable & scoping question.

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 08:46:17 -0700, Cornelius Keller wrote: > On 10 Aug., 17:12, "Diez B. Roggisch" wrote: >> Cornelius Keller wrote: > [snip] >> >> http://effbot.org/zone/default-values.htm >> >> Diez > > Ok thank you. > I' understand now why. > I still think this is very confusing, because def

Re: Python docs disappointing - group effort to hire writers?

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 20:05:00 -0400, David Lyon wrote: > So, what you're advocating is let things stay how they are... If it's not broken, don't fix it. > Ignore feedback... tell people to freak off... Only useless feedback. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

How to pickle a lambda function?

2009-08-10 Thread Terry
Hi, I'm trying to implement something like: remote_map(fun, list) to execute the function on a remove machine. But the problem is I cannot pickle a lambda function and send it to the remote machine. Is there any possible way to pickle (or other method) any functions including lambda? br, Terry

ElementTree - Howto access text within XML tag element...

2009-08-10 Thread cmalmqui
Hi, I am writing on a small XML parser and are currently stuck as I am not able to get the whole element name in ElementTree. Please see the below example where "print root[0][0]" returns "" Is there a way to get hold of the "Running" string in the tag using elementTree? 2009-07-10T

Nltk with python

2009-08-10 Thread ArshaKrishna
How can I resolve scope ambiguity using nltk toolkit with python -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem when fetching page using urllib2.urlopen

2009-08-10 Thread jitu
Yes Piet you were right this works. But seems does not work on google app engine, since it appends it own agent info as seen below 'User-Agent': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.13) Gecko/2009073021 Firefox/3.0.13 AppEngine-Google; (+http://code.google.com/appengi

Re: numpy array merge

2009-08-10 Thread Robert Kern
On 2009-08-10 17:38, Nathan wrote: Is there an easy way to merge two numpy arrays with different rank sizes (terminology?). You will want to ask numpy questions on the numpy mailing list. http://www.scipy.org/Mailing_Lists I believe that "shape" is the term you are looking for. I want to

ANN: M2Crypto 0.20

2009-08-10 Thread Heikki Toivonen
I am please to announce the M2Crypto 0.20 release, which was in development for over nine months. Over 30 bugs fixed by more than ten people. Download links and bug filing instructions on the homepage at http://chandlerproject.org/Projects/MeTooCrypto. M2Crypto is the most complete Python wrapper

Re: With or without leading underscore...

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 16:37:25 +0200, Ulrich Eckhardt wrote: > ...that is the question! > > I have a module which exports a type. It also exports a function that > returns instances of that type. Now, the reason for my question is that > while users will directly use instances of the type, they wil

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 08:21:03 -0700, Douglas Alan wrote: > But you're right, it's too late to change this now. Not really. There is a procedure for making non-backwards compatible changes. If you care deeply enough about this, you could agitate for Python 3.2 to raise a PendingDepreciation warni

Re: dictionary help

2009-08-10 Thread J. Cliff Dyer
On Mon, 2009-08-10 at 22:11 -0400, Krishna Pacifici wrote: > Hi, > kind of a newbie here, but I have two questions that are probably > pretty simple. > > 1. I need to get rid of duplicate values that are associated with > different keys in a dictionary. For example I have the following > code. >

dictionary help

2009-08-10 Thread Krishna Pacifici
Hi, kind of a newbie here, but I have two questions that are probably pretty simple. 1. I need to get rid of duplicate values that are associated with different keys in a dictionary. For example I have the following code. s={} s[0]=[10,2,3] s[10]=[22,23,24] s[20]=[45,5] s[30]=[2,4] s[40]=[6,7

Re: Python configuration question when python scripts are executed using Appweb as web server.

2009-08-10 Thread Gabriel Genellina
En Mon, 10 Aug 2009 11:48:31 -0300, IronyOfLife escribió: Why different results in IIS and appweb? [...] This is fairly easy to explain. When I configured IIS to execute python scripts, as per the documentation I pass two command line arguments. Appweb works this way. It opens up a new command

Re: Python docs disappointing - group effort to hire writers?

2009-08-10 Thread Paul Rubin
r writes: > Whilst writing any tutorial on any subject matter please remember, you > may be an expert, but mostly *non-experts* will be reading your > material... pssft, this may come as a surprise, but tutorials are > meant for *NON-EXPERTS*! I think the Python tutorial is aimed at users who are

Re: Python docs disappointing - group effort to hire writers?

2009-08-10 Thread David Lyon
On Mon, 10 Aug 2009 09:13:34 -0700, Ethan Furman wrote: > As someone who relies heavily on the docs I will also say that the idea > of giving the ability to modify the official documentation to somebody > who is /learning/ the language is, quite frankly, terrifying. What is more terrifying is

Re: wxpython question

2009-08-10 Thread David Lyon
is there a method/property called Show/Shown ? On Mon, 10 Aug 2009 07:55:42 -0700 (PDT), azrael wrote: > Is there maybe a method bounded to the class SpinCtrl() that could > hide the widget. One that is maybe also implemented in any other > control. > > self.spcKvadDo = wx.SpinCtrl(id=-1, initi

Re: illegal geld machen , schnell geld verdienen in , schnell geld im internet , geld 2.0 geld verdienen im web 2.0 , novoline american poker online spielen , sofort geld im internet , mehr geld ver

2009-08-10 Thread bernd
On 25 Jul., 00:50, entr...@web.de wrote: > On 7 Jun., 19:48, swirler...@googlemail.com wrote: > , schnell geld verdienenwww.novocasinos.de > http://www.novocasinos.de > http://casino-pirat.de > www.casino-pirat.de > www.novocasinos.de > http://www.novocasinos.de > > *www.novocasinos.de > > *http://

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Douglas Alan
From: Steven D'Aprano wrote: > On Mon, 10 Aug 2009 00:32:30 -0700, Douglas Alan wrote: > > In C++, if I know that the code I'm looking at compiles, > > then I never need worry that I've misinterpreted what a > > string literal means. > If you don't know what your string literals are, you don't

fastPATX (a new and simple web browser)

2009-08-10 Thread patx
There was a new release of fastPATX today. However the code and the program itself will not be available to the public untill Tuesday the 11th. This is due to me not having the proper tools I need to publish it (I am not at my "main comp."). This is a bit of an over statement it will probably be pu

Re: help with threads

2009-08-10 Thread Aahz
In article <5a744bd6-6b9a-4f46-97c1-bb7fd65b8...@l5g2000pra.googlegroups.com>, Michael Mossey wrote: > >I have a simple application that needs one thread to manage networking >in addition to the main "thread" that does the main job. It's not >working right. I know hardly anything about threads, s

Re: How to find out in which module an instance of a class is created?

2009-08-10 Thread Johannes Janssen
Christian Heimes schrieb: Johannes Janssen wrote: > class A(object): > def __init__(self, mod=__name__): > self.mod = mod won't work. In this case mod would always be "foo". You have to inspect the stack in order to get the module of the caller. The implementation of warn

numpy array merge

2009-08-10 Thread Nathan
Is there an easy way to merge two numpy arrays with different rank sizes (terminology?). I want to make a single array by concatenating two arrays along a given direction and filling the excess cells with a dummy variable. numpy concatenate works well as long as the two arrays have the same dimen

Re: how to use "exec" stmt to get input from user

2009-08-10 Thread Rick King
Thanks for your comment. The purpose of the application is to automate the manipulation of large numbers of files. For automation I want to be able to have scripts that I can use for various purposes. On input, cmd.py handles calling "do_" methods for known commands; for the rest I want

Re: pybotwar-0.5

2009-08-10 Thread Mensanator
On Aug 10, 1:35 pm, r wrote: > > Sure, there is no documentation http://www.mensanator.com/mensanator/PythonTurtle/paper.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Python docs disappointing - group effort to hire writers?

2009-08-10 Thread r
On Aug 10, 11:13 am, Ethan Furman wrote: (snip) > As someone who relies heavily on the docs I will also say that the idea > of giving the ability to modify the official documentation to somebody > who is /learning/ the language is, quite frankly, terrifying. (snip) Ethan, I think what you and a f

Re: Python docs disappointing - group effort to hire writers?

2009-08-10 Thread Ethan Furman
Kee Nethery wrote: As someone trying to learn the language I want to say that the tone on this list towards people who are trying to learn Python feels like it has become anti-newbies. Learning a new language is difficult enough without seeing other newbies getting shamed for not knowing

Re: www.python.org website is down?

2009-08-10 Thread Piet van Oostrum
> MRAB (M) wrote: >M> r wrote: >>> On Aug 8, 8:48 am, MRAB wrote: >>> ...(snip) Bothwww.python.organd svn.python.org are down. They're hosted on the same machine, and it seems to have run into disk problems and hasn't rebooted even after power-cycling. Thomas Wouters will be

Re: Problem when fetching page using urllib2.urlopen

2009-08-10 Thread Piet van Oostrum
> jitu (j) wrote: >j> Hi, >j> A html page contains 'anchor' elements with 'href' attribute having >j> a semicolon in the url , while fetching the page using >j> urllib2.urlopen, all such href's containing 'semicolons' are >j> truncated. >j> For example the href >http://travel.yahoo.co

Re: Python documentation servers

2009-08-10 Thread r
On Aug 10, 12:53 pm, Roy Hyunjin Han wrote: > Are there issues with the python documentation servers?http://docs.python.org/ > The site has been really slow to respond all weekend. try this thread http://groups.google.com/group/comp.lang.python/browse_thread/thread/052368a71f2a8ad2/929bd74bd203c6

Re: pybotwar-0.5

2009-08-10 Thread Mark Lawrence
[snip] r "slayer of the galactic-ly stupid!" Can I assume from this that you intend killing yourself, on the grounds that some 10 days ago you couldn't successfully use a windows compiled help file? -- Kindest regards. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: variable & scoping question.

2009-08-10 Thread J. Cliff Dyer
On Mon, 2009-08-10 at 08:46 -0700, Cornelius Keller wrote: > On 10 Aug., 17:12, "Diez B. Roggisch" wrote: > > Cornelius Keller wrote: > [snip] > > > > http://effbot.org/zone/default-values.htm > > > > Diez > > Ok thank you. > I' understand now why. > I still think this is very confusing, because

Re: pybotwar-0.5

2009-08-10 Thread r
On Aug 9, 9:46 pm, Mensanator wrote: > On Aug 9, 3:26 pm, Lee Harr wrote: > > > pybotwar is a fun and educational game where players > > create computer programs to control simulated robots > > to compete in a battle arena. > > >http://pybotwar.googlecode.com/ > > Why is the doc folder empty? > >

Re: how to use "exec" stmt to get input from user

2009-08-10 Thread David C Ullrich
What you're trying to do and what's not working isn't entirely clear to me. But if I had a wxPython application and I wanted to execute user input (note the _if_) I'd just pop up a window (I forget how "ShowModal" is spelled in wx right now) with a text box and an Execute button and a Cancel butt

Re: wxpython question

2009-08-10 Thread David
Il Mon, 10 Aug 2009 07:55:42 -0700 (PDT), azrael ha scritto: > Is there maybe a method bounded to the class SpinCtrl() that could > hide the widget. One that is maybe also implemented in any other > control. AFAIK, any widget can be made invisibile calling the .Show(False) method of the container

Python documentation servers

2009-08-10 Thread Roy Hyunjin Han
Are there issues with the python documentation servers? http://docs.python.org/ The site has been really slow to respond all weekend. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Carl Banks
On Aug 10, 1:37 am, Steven D'Aprano wrote: > On Mon, 10 Aug 2009 00:37:33 -0700, Carl Banks wrote: > > On Aug 9, 11:10 pm, Steven D'Aprano > > wrote: > >> On Sun, 09 Aug 2009 18:34:14 -0700, Carl Banks wrote: > >> >> Why should a backslash in a string literal be an error? > > >> > Because the beh

how to use "exec" stmt to get input from user

2009-08-10 Thread Rick King
I have a cmd.py-derived program (with a wxPython GUI) and want to execute python statements for lines that are not my own special commands. So basically it's either: def do_somecommand(self,arg): ... or def default(self,arg): exec arg in globals(),self.cmdlocals (where cm

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Carl Banks
On Aug 10, 4:41 am, MRAB wrote: > Steven D'Aprano wrote: > > On Sun, 09 Aug 2009 17:56:55 -0700, Douglas Alan wrote: > > [snip] > >> My point of view is that > >> every language has *some* warts; Python just has a bit fewer than most. > >> It would have been nice, I should think, if this wart had

Re: With or without leading underscore...

2009-08-10 Thread Carl Banks
On Aug 10, 7:37 am, Ulrich Eckhardt wrote: > ...that is the question! > > I have a module which exports a type. It also exports a function that > returns instances of that type. Now, the reason for my question is that > while users will directly use instances of the type, they will not create > in

Re: reloading the module imported as 'from ... import ...'

2009-08-10 Thread William
What about using the reimport library? http://code.google.com/p/reimport/ Cheers, William From: AlF To: python-list@python.org Sent: Monday, August 10, 2009 1:48:31 AM Subject: Re: reloading the module imported as 'from ... import ...' Steven D'Aprano wrote:

Re: variable & scoping question.

2009-08-10 Thread Ethan Furman
Cornelius Keller wrote: [snip] I still think this is very confusing, because default values don't behave like most people would expect without reading the docs. - Cornelius Why would you expect to become a good programmer of _any_ language without reading its docs? ~Ethan~ -- http://mail.p

Re: resume upload wsgi script

2009-08-10 Thread gert
On Aug 10, 10:39 am, "Diez B. Roggisch" wrote: > > 250KB :) > > So why do you bother? > > > Its just HTTP1.1 has everything for making ftp like file transfers > > possible. > > When I write it to a file then I am back at square one because I still > > need to load it completely to get it into a bl

Re: variable & scoping question.

2009-08-10 Thread MRAB
Francesco Bochicchio wrote: On Aug 10, 5:12 pm, "Diez B. Roggisch" wrote: Cornelius Keller wrote: Hi, I'm a quite fresh python programmer, (6 Month python experience). Today I found something I absolotly don'nt understand: given the following function: def test_effect(class_id=None,class_ids=[

Re: Problem when fetching page using urllib2.urlopen

2009-08-10 Thread dorzey
"geturl - this returns the real URL of the page fetched. This is useful because urlopen (or the opener object used) may have followed a redirect. The URL of the page fetched may not be the same as the URL requested." from http://www.voidspace.org.uk/python/articles/urllib2.shtml#info-and-geturl I

Re: M2Crypto: How to generate subjectKeyIdentifier / authorityKeyIdentifier

2009-08-10 Thread Matthias Güntert
Hello once again Now I have the extension-patch [0] applied to the M2Crypto SVN branch (revision 704). Creating a root and an subRoot CA certificate now works great including the SKID/AKID extensions. I am also able to verify those created certificates using: $ openssl verify -CAfile rootCA.crt

Re: www.python.org website is down?

2009-08-10 Thread r
On Aug 10, 9:13 am, MRAB wrote: > r wrote: > > On Aug 8, 8:48 am, MRAB wrote: > > ...(snip) > >> Bothwww.python.organdsvn.python.org are down.  They're hosted on > >> the same machine, and it seems to have run into disk problems and > >> hasn't rebooted even after power-cycling.  Thomas Wouters w

Re: Client/Server based on SocketServer and Windows

2009-08-10 Thread Dave Angel
Kiki wrote: Thank you Dennis I'm using 2 differents editor, which may be the cause of such a mess in the indentation. I must admitt that I lazily rely on those (not so bad indeed) editors. "If indentation whas bad they would have tell me" Too bad am i Won't post misindeted code anymore.

Re: Problem Regarding Handling of Unicode string

2009-08-10 Thread Piet van Oostrum
> joy99 (j) wrote: >j> Dear Group, >j> I am using Python26 on WindowsXP with service pack2. My GUI is IDLE. >j> I am using Hindi resources and get nice output like: >j> एक >j> where I can use all the re functions and other functions without doing >j> any transliteration,etc. >j> I was trying

Re: M2Crypto: How to generate subjectKeyIdentifier / authorityKeyIdentifier

2009-08-10 Thread Matthias Güntert
Now I have this patch applied to the M2Crypto SVN branch -- http://mail.python.org/mailman/listinfo/python-list

Re: variable & scoping question.

2009-08-10 Thread Cornelius Keller
On 10 Aug., 17:12, "Diez B. Roggisch" wrote: > Cornelius Keller wrote: [snip] > > http://effbot.org/zone/default-values.htm > > Diez Ok thank you. I' understand now why. I still think this is very confusing, because default values don't behave like most people would expect without reading the doc

Re: variable & scoping question.

2009-08-10 Thread Francesco Bochicchio
On Aug 10, 5:12 pm, "Diez B. Roggisch" wrote: > Cornelius Keller wrote: > > Hi, > > > I'm a quite fresh python programmer, (6 Month python experience). > > Today I found something I absolotly don'nt understand: > > > given the following function: > > > def test_effect(class_id=None,class_ids=[]):

Re: Processes not exiting

2009-08-10 Thread MRAB
ma3mju wrote: On 7 Aug, 16:02, MRAB wrote: ma3mju wrote: On 3 Aug, 09:36, ma3mju wrote: On 2 Aug, 21:49, Piet van Oostrum wrote: MRAB (M) wrote: M> I wonder whether one of the workers is raising an exception, perhaps due M> to lack of memory, when there are large number of jobs to proces

Re: setting Referer for urllib.urlretrieve

2009-08-10 Thread samwyse
On Aug 9, 9:41 am, Steven D'Aprano wrote: > On Sun, 09 Aug 2009 06:13:38 -0700,samwysewrote: > > Here's what I have so far: > > > import urllib > > > class AppURLopener(urllib.FancyURLopener): > >     version = "App/1.7" > >     referrer = None > >     def __init__(self, *args): > >         urllib

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Douglas Alan
On Aug 10, 10:58 am, Scott David Daniels wrote: > The string rules reflect C's rules, and I see little > excuse for trying to change them now. No they don't. Or at least not C++'s rules. C++ behaves exactly as I should like. (Or at least g++ does. Or rather *almost* as I would like, as by defau

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-10 Thread r
On Aug 9, 11:02 pm, David Lyon wrote: > Since you're talking about documentation, which is a part of python, > don't you think you should be discussing it on python-dev ? Yea, them's be a friendly bunch to noob ideas ;). Hey i got a better idea, lets go to the IRS and see if we can persuade them

Re: variable & scoping question.

2009-08-10 Thread Diez B. Roggisch
Cornelius Keller wrote: > Hi, > > I'm a quite fresh python programmer, (6 Month python experience). > Today I found something I absolotly don'nt understand: > > given the following function: > > def test_effect(class_id=None,class_ids=[]): >     if class_id is not None: >         if class_id no

variable & scoping question.

2009-08-10 Thread Cornelius Keller
Hi, I'm a quite fresh python programmer, (6 Month python experience). Today I found something I absolotly don'nt understand: given the following function: def test_effect(class_id=None,class_ids=[]): if class_id is not None: if class_id not in class_ids: class_ids.append(

Re: reloading the module imported as 'from ... import ...'

2009-08-10 Thread Piet van Oostrum
> Steven D'Aprano (SD) wrote: >SD> On Sun, 09 Aug 2009 22:48:31 -0700, AlF wrote: >>> Steven D'Aprano wrote: On Sun, 09 Aug 2009 20:43:41 -0700, AlF wrote: > Hi, > > what is the best way to reload the module imported using 'from ... > import ...' H

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Hi Lars, Lars Gustäbel wrote: How much smaller is it? I did a test with a recent Linux kernel source tree which made an archive of 337MB. Command-line gzip was ahead of Python's GzipFile() by just 20200 bytes(!) with an archive of about 74MB. Is the only way to accomplish the higher rate to c

Florida Python training in October

2009-08-10 Thread Mark Lutz
We're pleased to announce a new venue for our Python classes. Python author and trainer Mark Lutz will be teaching a 3-day Python class on October 20-22, in Sarasota, Florida. Come spend 3 days mastering Python, and enjoy all that Florida and its Gulf Coast have to offer while you're here. This i

wxpython question

2009-08-10 Thread azrael
Is there maybe a method bounded to the class SpinCtrl() that could hide the widget. One that is maybe also implemented in any other control. self.spcKvadDo = wx.SpinCtrl(id=-1, initial=0, max=100, min=0, name='spcKvadDo', parent=self.pnlFilteri, pos=wx.Point(10, 10), size=wx.Size(118, 21), sty

Re: Processes not exiting

2009-08-10 Thread ma3mju
On 7 Aug, 16:02, MRAB wrote: > ma3mju wrote: > > On 3 Aug, 09:36, ma3mju wrote: > >> On 2 Aug, 21:49, Piet van Oostrum wrote: > > MRAB (M) wrote: > M> I wonder whether one of the workers is raising an exception, perhaps > due > M> to lack of memory, when there are large

Re: With or without leading underscore...

2009-08-10 Thread Jan Kaliszewski
10-08-2009 Ulrich Eckhardt wrote: So, the type is a part of the public API, but its constructor is not. Should I mark the type as private (with a leading underscore) or not? IMHO you shouldn't (i.e. name should be marked "public") because of possible usage of e.g. "isinstance(foo, YourType)

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Scott David Daniels
Douglas Alan wrote: So, what's the one obvious right way to express "foo\zbar"? Is it "foo\zbar" or "foo\\zbar" And if it's the latter, what possible benefit is there in allowing the former? And if it's the former, why does Python echo the latter? Actually, if we were designing from fres

Re: Need help in configuration for TimedRotatingFileHandler

2009-08-10 Thread Dave Angel
Lokesh Maremalla wrote: Code: mlogger = logging.getLogger("simpleExample") def a_view(request): mlogger.debug("a_view called") if request.method== "POST" : mlogger.debug("post function") else: mlogger.debug("serve function") Execution: step1: Executed the code and go

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Benjamin Kaplan wrote: I can't find tarfile.gzopen in the tarfile docs, I'm looking here: http://docs.python.org/library/tarfile.html Am I looking at the wrong page? My mistake. It isn't a function of the tarfile module, it's a class method of tarfile.TarFile. I was looking at the help

Re: Python configuration question when python scripts are executed using Appweb as web server.

2009-08-10 Thread IronyOfLife
Hi Gabriel Thanks for the detailed and useful reply. On Aug 7, 1:37 am, "Gabriel Genellina" wrote: > En Thu, 06 Aug 2009 12:49:30 -0300, IronyOfLife   > escribió: > > > > > > > On Aug 5, 4:18 pm, "Gabriel Genellina" wrote: > >> En Tue, 04 Aug 2009 10:15:24 -0300, IronyOfLife > >> escribió: >

With or without leading underscore...

2009-08-10 Thread Ulrich Eckhardt
...that is the question! I have a module which exports a type. It also exports a function that returns instances of that type. Now, the reason for my question is that while users will directly use instances of the type, they will not create instances of the type themselves. So, the type is a part

Re: syntax checker in python

2009-08-10 Thread nn
On Aug 7, 4:39 pm, horos11 wrote: > ps - I just realized that it isn't enough to do: > > python -c 'import /path/to/script' > > since that actually executes any statement inside of the script > (wheras all I want to do is check syntax) > > So - let me reprhase that - exactly how can you do a synta

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Douglas Alan
On Aug 10, 4:37 am, Steven D'Aprano > There is at least one good reason for preferring an error, namely that it > allows Python to introduce new escape codes without going through a long, > slow process. But the rest of these complaints are terribly unconvincing. What about: o Beautiful is b

Re: www.python.org website is down?

2009-08-10 Thread MRAB
r wrote: On Aug 8, 8:48 am, MRAB wrote: ...(snip) Bothwww.python.organd svn.python.org are down. They're hosted on the same machine, and it seems to have run into disk problems and hasn't rebooted even after power-cycling. Thomas Wouters will be visiting the machine physically tomorrow to try

Re: Social problems of Python doc [was Re: Python docs disappointing]

2009-08-10 Thread rurpy
On Aug 9, 10:02 pm, David Lyon wrote: ... > Before you do that, you should clearly work out in your own mind > how you think things need to improve. It's not good enough just > saying this or that is bad without having specific ideas on what > needs to change. ''' He did. Did you read, for examp

Re: www.python.org website is down?

2009-08-10 Thread r
On Aug 8, 8:48 am, MRAB wrote: ...(snip) > Bothwww.python.organd svn.python.org are down.  They're hosted on > the same machine, and it seems to have run into disk problems and > hasn't rebooted even after power-cycling.  Thomas Wouters will be > visiting the machine physically tomorrow to try to

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Lars Gustäbel
On Mon, Aug 10, 2009 at 08:50:21AM -0400, Esmail wrote: > I was wondering if it possible to specify a compression level when I > tar/gzip a file in Python using the tarfile module. I would like to > specify the highest (9) compression level for gzip. tarfile uses gzip.GzipFile() internally, GzipFi

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Benjamin Kaplan
On Mon, Aug 10, 2009 at 9:37 AM, Esmail wrote: > Benjamin Kaplan wrote: >> >> On Mon, Aug 10, 2009 at 8:50 AM, Esmail wrote: >>> >>> I was wondering if it possible to specify a compression level when I >>> tar/gzip a file in Python using the tarfile module. I would like to >>> specify the highest (

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Benjamin Kaplan wrote: On Mon, Aug 10, 2009 at 8:50 AM, Esmail wrote: I was wondering if it possible to specify a compression level when I tar/gzip a file in Python using the tarfile module. I would like to specify the highest (9) compression level for gzip. Ideally: t = tarfile.open(tar_fi

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Benjamin Kaplan
On Mon, Aug 10, 2009 at 8:50 AM, Esmail wrote: > Hello, > > I was wondering if it possible to specify a compression level when I > tar/gzip a file in Python using the tarfile module. I would like to > specify the highest (9) compression level for gzip. > > Ideally: > >   t = tarfile.open(tar_file_n

Re: www.python.org website is down?

2009-08-10 Thread Xavier Ho
On Mon, Aug 10, 2009 at 10:41 PM, Christopher wrote: > > Actually, it appears to be down again. > Nope, works for me, just a little slow. -Xav -- http://mail.python.org/mailman/listinfo/python-list

compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Hello, I was wondering if it possible to specify a compression level when I tar/gzip a file in Python using the tarfile module. I would like to specify the highest (9) compression level for gzip. Ideally: t = tarfile.open(tar_file_name+'.tar.gz', mode='w:gz:9') When I create a simple tar an

Re: Changing Remote Registry

2009-08-10 Thread Kevin Holleran
On Fri, Aug 7, 2009 at 2:08 PM, Tim Golden wrote: > Kevin Holleran wrote: > >> Long story short, I am using _winreg to do this. >> >> hKey = _winreg.OpenKey (keyPath, path, 0, _winreg.KEY_SET_VALUE) >> value,type = _winreg.QueryValueEx(hKey, item) >> if (value == wrongValue): >> _winreg.Set

Re: www.python.org website is down?

2009-08-10 Thread Christopher
On Aug 8, 5:50 pm, Pouya Khankhanian wrote: > On Aug 8, 11:49 am, Sharath wrote: > > > > > On Aug 8, 11:33 am, Pouya Khankhanian wrote: > > > > On Aug 8, 11:17 am, "Martin v. Löwis" wrote: > > > > > > This is probably a stupid question, but Is there going to be any data > > > > > loss if it tur

[Errno 9] Bad file descriptor

2009-08-10 Thread Mehndi, Sibtey
Hi I am trying to create a COM object of picalo functionalities so that I can use it into my VB application but I am getting the following error "[Errno 9] bad file descriptor". Can you please suggest me what is supposed to do to avoid this problem? This is my code class Test(object): _reg_

Re: Problem when fetching page using urllib2.urlopen

2009-08-10 Thread jitu
On Aug 10, 4:39 pm, jitu wrote: > Hi, > > A html page  contains 'anchor' elements with 'href' attribute  having > a semicolon  in the url , while fetching the page using > urllib2.urlopen, all such href's  containing  'semicolons' are > truncated. > > For example the > hrefhttp://travel.yahoo.com

Re: Problem Regarding Handling of Unicode string

2009-08-10 Thread Ulrich Eckhardt
joy99 wrote: > [...] it is giving me output like: > '\xef\xbb\xbf\xe0\xa6\x85\xe0\xa6\xa8\xe0\xa7\x87\xe0\xa6\x95' These three bytes encode the byte-order marker (BOM, Unicode uFEFF) as UTF-8, followed by codepoint u09a8 (look it up on unicode.org what that is). In any case, if th

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread MRAB
Steven D'Aprano wrote: On Sun, 09 Aug 2009 17:56:55 -0700, Douglas Alan wrote: [snip] My point of view is that every language has *some* warts; Python just has a bit fewer than most. It would have been nice, I should think, if this wart had been "fixed" in Python 3, as I do consider it to be a

Problem when fetching page using urllib2.urlopen

2009-08-10 Thread jitu
Hi, A html page contains 'anchor' elements with 'href' attribute having a semicolon in the url , while fetching the page using urllib2.urlopen, all such href's containing 'semicolons' are truncated. For example the href http://travel.yahoo.com/p-travelguide-6901959-pune_restaurants-i;_ylt=

Problem Regarding Handling of Unicode string

2009-08-10 Thread joy99
Dear Group, I am using Python26 on WindowsXP with service pack2. My GUI is IDLE. I am using Hindi resources and get nice output like: एक where I can use all the re functions and other functions without doing any transliteration,etc. I was trying to use Bengali but it is giving me output like: '\xe

Re: Cython + setuptools not working with .pyx,only with .c-files

2009-08-10 Thread Diez B. Roggisch
Stefan Behnel wrote: > Diez B. Roggisch wrote: >> I'm trying to build a Cython-extension as Egg. >> >> However, this doesn't work - I can either use distutils to build the >> extension, creating a myextension.c-file on the way. >> >> If that's there, I can use setuptools to build the egg. >> >>

Re: exec("dir()",d)

2009-08-10 Thread Emanuele D'Arrigo
Thank you both for the explanation. As a matter of fact RTFM doesn't -always- help. Sometimes I'm just thick and I can read the manual 10 times and still not understand, as it happened on this particular matter. Your contribution focused my attention on the right bit of the manual which I somehow

Re: Problem in installing PyGreSQL

2009-08-10 Thread Thangappan.M
Here I attached the setup.py and setup.cfg file.This is for your reference. I have changed the exception line. Even though I got the following error while running the python setup.py build running build running build_py running build_ext error: No such file or directory ===

Re: install tarball package Python on Debian, necessary modules not found

2009-08-10 Thread garabik-news-2005-05
Frédéric Léger wrote: > I use Debian Lenny and I tried to install the tarball packaging of the > lastest python realease (http://www.python.org/download/, release > 3.1). After read README file I launch standard Makefile commands. But > at the end of "make" command, I have got this message: > M

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Duncan Booth
Steven D'Aprano wrote: > Or perhaps they should follow bash's lead, and map \C to C for every > character. If there were no special escapes at all, Windows > programmers wouldn't keep getting burnt when they write > "C:\\Documents\today\foo" and end up with something completely > unexpected. >

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 00:32:30 -0700, Douglas Alan wrote: > In C++, if I know that the code I'm looking at compiles, then I never > need worry that I've misinterpreted what a string literal means. If you don't know what your string literals are, you don't know what your program does. You can't exp

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Duncan Booth
Douglas Alan wrote: > "\xba" isn't an escape sequence in any other language that I've used, > which is one reason I made this error... Oh, wait a minute -- it *is* > an escape sequence in JavaScript. But in JavaScript, while "\xba" is a > special character, "\xb" is synonymous with "xb". > "\xb

Re: Problem with join in__str__() in class (newbie)

2009-08-10 Thread Fencer
Piet van Oostrum wrote: [snip] Thanks for your detailed reply! - Fencer -- http://mail.python.org/mailman/listinfo/python-list

Re: resume upload wsgi script

2009-08-10 Thread Diez B. Roggisch
250KB :) So why do you bother? Its just HTTP1.1 has everything for making ftp like file transfers possible. When I write it to a file then I am back at square one because I still need to load it completely to get it into a blob. Well, the blob is nothing but datat in the file-system. If you

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 00:57:18 -0700, Douglas Alan wrote: > On Aug 10, 2:10 am, Steven D'Aprano > >> I've never had any errors caused by this. > > But you've seen an error caused by this, in this very discussion. I.e., > "foo\xbar". Your complaint is that "invalid" escapes like \y resolve to a l

install tarball package Python on Debian, necessary modules not found

2009-08-10 Thread Frédéric Léger
I use Debian Lenny and I tried to install the tarball packaging of the lastest python realease (http://www.python.org/download/, release 3.1). After read README file I launch standard Makefile commands. But at the end of "make" command, I have got this message: "... Python build finished, but t

Re: Unrecognized escape sequences in string literals

2009-08-10 Thread Steven D'Aprano
On Mon, 10 Aug 2009 00:37:33 -0700, Carl Banks wrote: > On Aug 9, 11:10 pm, Steven D'Aprano > wrote: >> On Sun, 09 Aug 2009 18:34:14 -0700, Carl Banks wrote: >> >> Why should a backslash in a string literal be an error? >> >> > Because the behavior of \ in a string is context-dependent, which >>

Re: Monkeypatching an object to become callable

2009-08-10 Thread Bruno Desthuilliers
7stud a écrit : (snip) class Wrapper(object): def __init__(self, obj, func): self.obj = obj self.func = func def __call__(self, *args): return self.func(*args) def __getattr__(self, name): return object.__getattribute__(self.obj, name) This should b

  1   2   >