Re: Stripping non-numbers from a file parse without nested lists?

2009-03-31 Thread daku9999
On Mar 31, 6:47 pm, "Rhodri James" wrote: > What you're doing (pace error checking) seems fine for the data > structures that you're using.  I'm not entirely clear what your usage > pattern for "dip" and "dir" is once you've got them, so I can't say > whether there's a more appropriate shape for

Re: urllib2, proxies, and pac files on OS X

2009-03-31 Thread Cameron Simpson
On 30Mar2009 11:00, Mani Ghasemlou wrote: | urllib2 correctly detects proxies as configured in my preferences pane | on OS X 10.5: [...] | However, when configuring a proxy via PAC file, this does not seem to | be the case: [...] | Is there any way to obtain (and parse using something like pacpars

Re: Python Goes Mercurial

2009-03-31 Thread Paul Rubin
Terry Reedy writes: > > So what were these "strong antipathies" towards Git, exactly? > > The relevant PEP is http://www.python.org/dev/peps/pep-0374/ Interesting. I'm on a project that switched from Mercurial to Git recently. I don't have much of a sense of the relevant differences but other

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Aaron Brady
On Mar 30, 8:40 am, jfager wrote: > I've written a short post on including support for configuration down > at the language level, including a small preliminary half-functional > example of what this might look like in Python, available > athttp://jasonfager.com/?p=440. > > The basic idea is that

Re: python for loop

2009-03-31 Thread Hrvoje Niksic
Chris Rebert writes: > Among other things, it has the nice property that: > len(some_list[n:m]) == m-n And also that it is intuitive how to represent an empty slice (foo[n:n]). When traversing over sublists, it's also a useful property that foo[a:b] + foo[b:c] == foo. -- http://mail.python.org/

Re: Beazley on Generators

2009-03-31 Thread Lawrence D'Oliveiro
In message , Michele Simionato wrote: > Excellent reading for everybody wanting to understand cooperative > concurrency! Hey, some of us were doing "cooperative concurrency" programming old MacOS for years. It was generally considered a poor alternative to "true multitasking". -- http://mail

Re: Python Goes Mercurial

2009-03-31 Thread Lawrence D'Oliveiro
In message <35d429fa-5d13-4703- a443-6a95c740c...@o6g2000yql.googlegroups.com>, John Yeung wrote: > Here's one that clearly expresses strong antipathy: > > http://mail.python.org/pipermail/python-dev/2009-March/087971.html There are lots of GUI- and Web-based front ends to Git. And look at on-

Re: Python Goes Mercurial

2009-03-31 Thread Lawrence D'Oliveiro
In message , Terry Reedy wrote: > Lawrence D'Oliveiro wrote: >> >> >> So what were these "strong antipathies" towards Git, exactly? > > The relevant PEP is http://www.python.org/dev/peps/pep

Re: Beazley on Generators

2009-03-31 Thread Michele Simionato
On Apr 1, 7:03 am, Terry Reedy wrote: > At PyCon2008, David Beazley presented an excellent talk on generators. > Generator Tricks for Systems > Programmershttp://www.dabeaz.com/generators/index.html > > At PyCon2009, he followed up with another talk on more advanced > generator usage, which Guido

Beazley on Generators

2009-03-31 Thread Terry Reedy
At PyCon2008, David Beazley presented an excellent talk on generators. Generator Tricks for Systems Programmers http://www.dabeaz.com/generators/index.html At PyCon2009, he followed up with another talk on more advanced generator usage, which Guido commended on the python-ideas list: A Curious

Re: the return of urllib.request.urlopen("http://www.example.com/", params)

2009-03-31 Thread tunpishuang
On Apr 1, 12:49 pm, Steven D'Aprano wrote: > On Tue, 31 Mar 2009 21:17:29 -0700, tunpishuang wrote: > > hey guys , i'm new in python ...here i got a little problem that get me > > confused... > > i wanna do an uthentication of an login page , here is the example from > > the python lib ref. : > >

Re: I find explicit self much easier to understand if i replace it in my mind with the word "instance"

2009-03-31 Thread alex23
On Apr 1, 12:05 am, fro...@gmail.com wrote: > Discuss please. Search for past discussion first, please. -- http://mail.python.org/mailman/listinfo/python-list

Re: the return of urllib.request.urlopen("http://www.example.com/", params)

2009-03-31 Thread Steven D'Aprano
On Tue, 31 Mar 2009 21:17:29 -0700, tunpishuang wrote: > hey guys , i'm new in python ...here i got a little problem that get me > confused... > i wanna do an uthentication of an login page , here is the example from > the python lib ref. : > import urllib.request import urllib.parse >>

Re: Python Goes Mercurial

2009-03-31 Thread Terry Reedy
Lawrence D'Oliveiro wrote: So what were these "strong antipathies" towards Git, exactly? The relevant PEP is http://www.python.org/dev/peps/pep-0374/ To some Pythonic eyes, the git command

py2exe fails to make valid exe

2009-03-31 Thread prakash jp
Hi all, i am trying to make an exe out of my py *prg which write to a text file*. On --> python setup.py py2exe the dist folder is created but the exe creted is not working it throws an error "pythons ps.popen function" setup.py: #python setup.py py2exe from distutils.core import setup import p

the return of urllib.request.urlopen("http://www.example.com/", params)

2009-03-31 Thread tunpishuang
hey guys , i'm new in python ...here i got a little problem that get me confused... i wanna do an uthentication of an login page , here is the example from the python lib ref. : >>> import urllib.request >>> import urllib.parse >>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 10:44 pm, "Rhodri James" wrote: > On Tue, 31 Mar 2009 07:06:50 +0100, jfager wrote: > > On Mar 30, 9:31 pm, "Rhodri James" > > wrote: > >> On Mon, 30 Mar 2009 16:59:12 +0100, jfager wrote: > >> > It's the configuration problem.  Right now you would use something > >> > like ConfigPar

Re: Python Goes Mercurial

2009-03-31 Thread John Yeung
Lawrence D'Oliveiro and andrew cooke exchanged: > >>> So what were these "strong antipathies" towards Git, exactly? > > >> compared to what i've read on dev > >> "strong antipathies" sounds a bit over-hyped. > > > That was the phrase used by GvR. > > well if you find any, please do report back. A

Re: python for loop

2009-03-31 Thread Steven D'Aprano
On Wed, 01 Apr 2009 04:58:48 +0200, Lada Kugis wrote: > Why do we try to create languages that are intuitive to humans, then ? Because of the foolish hope that sufficiently easy syntax will make excellent programmers out of average people. Programming is not intuitive to humans. *Counting* isn'

Re: python for loop

2009-03-31 Thread Rhodri James
On Wed, 01 Apr 2009 03:58:48 +0100, Lada Kugis wrote: I thoughts high level languages were created primarily so we don't have to think about what happens inside a programming language, memory offsets and the like. Different programming languages were created for different purposes. FORTRAN

Re: Does Python have certificate?

2009-03-31 Thread Lawrence D'Oliveiro
In message <73bdbfcc-e32c-4df6-bdc4- afc0b95ff...@r33g2000yqn.googlegroups.com>, Muddy Coder wrote: > I wonder that does Python have certificate? You see, java, .NET, PHP, > and so on, they have certificates for developers to get. Get yourself a CS degree. Everything else is just being able to re

Re: python for loop

2009-03-31 Thread Rhodri James
On Wed, 01 Apr 2009 04:15:00 +0100, Lada Kugis wrote: On Wed, 01 Apr 2009 03:59:36 +0100, "Rhodri James" wrote: Two opportunities to forget to lie about how big your array is It is rank 3, meaning a33 is the last element. I don't see how any alternative can be simpler than that. You

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Carl Banks
On Mar 31, 6:39 pm, Kay Schluehr wrote: > On 1 Apr., 00:38, Carl Banks wrote: > > > On Mar 31, 12:08 pm, Kay Schluehr wrote: > > > > > And your proposal is? > > > > I have still more questions than answers. > > > That's obvious. > > > Perhaps you should also refrain from making sweeping negative

Re: python for loop

2009-03-31 Thread Lada Kugis
On Wed, 01 Apr 2009 03:59:36 +0100, "Rhodri James" wrote: > >Two opportunities to forget to lie about how big your array is :-) It is rank 3, meaning a33 is the last element. I don't see how any alternative can be simpler than that. > >> I wrote in my other post, 0 is weird to me, I have model o

Re: python for loop

2009-03-31 Thread Brendon Wickham
Since when should a machine (that's what a computer is after all), be forced to contort itself into something that is capable of reflecting the laws of physical matter? Better perhaps to look at it from another angle - it's counter-intuitive to think that the digital should mirror the analogue. Th

Re: python for loop

2009-03-31 Thread Lada Kugis
On Tue, 31 Mar 2009 19:30:15 -0700 (PDT), woo...@gmail.com wrote: >Counting from zero through n-1 is used because it is the memory offset >and not any kind of counter. Simplified, if you are iterating through >a list, using a for loop or anything else, the first element/number is >at memory offse

Re: python for loop

2009-03-31 Thread Rhodri James
On Wed, 01 Apr 2009 03:37:41 +0100, Lada Kugis wrote: On Tue, 31 Mar 2009 19:29:56 -0700, Chris Rebert wrote: Sort of, but it's *really* not idiomatic. You'd have to declare the arrays to be one longer than they actually are so that array[N] is a valid index. And then you'd end up not usi

Re: python for loop

2009-03-31 Thread Lada Kugis
On Tue, 31 Mar 2009 19:29:56 -0700, Chris Rebert wrote: >Sort of, but it's *really* not idiomatic. You'd have to declare the >arrays to be one longer than they actually are so that array[N] is a >valid index. And then you'd end up not using the true first element of >the array. Not to mention mo

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Rhodri James
On Tue, 31 Mar 2009 07:06:50 +0100, jfager wrote: On Mar 30, 9:31 pm, "Rhodri James" wrote: On Mon, 30 Mar 2009 16:59:12 +0100, jfager wrote: > It's the configuration problem.  Right now you would use something > like ConfigParser or optparse to populate some configuration object, > which yo

Re: python for loop

2009-03-31 Thread woooee
Counting from zero through n-1 is used because it is the memory offset and not any kind of counter. Simplified, if you are iterating through a list, using a for loop or anything else, the first element/number is at memory offset zero because it is at the beginning. And if this is a list of 4 byte

Re: python for loop

2009-03-31 Thread Lada Kugis
On 01 Apr 2009 01:26:41 GMT, Steven D'Aprano wrote: > >Why Python (and other languages) count from zero instead of one, and >why half-open intervals are better than closed intervals: > >http://www.johndcook.com/blog/2008/06/26/why-computer-scientists-count-from-zero/ >http://www.cs.utexas.edu/us

Re: python for loop

2009-03-31 Thread Chris Rebert
On Tue, Mar 31, 2009 at 7:13 PM, Lada Kugis wrote: > On Tue, 31 Mar 2009 21:13:05 -0400 (CLT), "andrew cooke" > wrote: > >>Lada Kugis wrote: >>> I'm coming from fortran and >>   *** c *** >>> background so I'm certainly biased by >>> them. But if you could explain one thing to me:

Re: python for loop

2009-03-31 Thread Lada Kugis
On Tue, 31 Mar 2009 21:13:05 -0400 (CLT), "andrew cooke" wrote: >Lada Kugis wrote: >> I'm coming from fortran and > *** c *** >> background so I'm certainly biased by >> them. But if you could explain one thing to me: > >but this is exactly the same behaviour as the standard way

Re: Thoughts on language-level configuration support?

2009-03-31 Thread David Stanek
On Tue, Mar 31, 2009 at 9:42 PM, Lawrence D'Oliveiro wrote: > In message <36148830-22c0-4f19-ab23- > d04d8755a...@s28g2000vbp.googlegroups.com>, jfager wrote: > >> I've written a short post on including support for configuration down >> at the language level ... > > If you're advocating anything r

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 9:42 pm, Lawrence D'Oliveiro wrote: > In message <36148830-22c0-4f19-ab23- > > d04d8755a...@s28g2000vbp.googlegroups.com>, jfager wrote: > > I've written a short post on including support for configuration down > > at the language level ... > > If you're advocating anything resembling p

Re: python for loop

2009-03-31 Thread Lada Kugis
On Tue, 31 Mar 2009 18:05:19 -0700, Gary Herron wrote: >This debate has been around for decades, in both mathematics and >programming. > >Should a loop through n things use indices >1, 2, ..., n >or >0, 1, ..., n-1 ? > >Fortran tends to go with the former (1-based indices) , while moder

Re: Stripping non-numbers from a file parse without nested lists?

2009-03-31 Thread andrew cooke
Rhodri James wrote: > On Tue, 31 Mar 2009 06:51:33 +0100, wrote: > >> There has got to be a better way of doing this: >> >> I'm reading in a file that has a lot of garbage, but eventually has >> something that looks similar to: >> (some lines of garbage) >> dip/dir. >> (some more lines of garbage)

Re: Python Goes Mercurial

2009-03-31 Thread andrew cooke
Lawrence D'Oliveiro wrote: > In message , andrew > cooke wrote: > >> Lawrence D'Oliveiro wrote: >>> mercurial-version-control-system.ars> >>> >>> So what were these "strong antipathies" towards Git, exactly? >> >> i haven't read

Re: Stripping non-numbers from a file parse without nested lists?

2009-03-31 Thread Rhodri James
On Tue, 31 Mar 2009 06:51:33 +0100, wrote: There has got to be a better way of doing this: I'm reading in a file that has a lot of garbage, but eventually has something that looks similar to: (some lines of garbage) dip/dir. (some more lines of garbage) 55/158 (some more lines of garbage) 33/1

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Lawrence D'Oliveiro
In message <36148830-22c0-4f19-ab23- d04d8755a...@s28g2000vbp.googlegroups.com>, jfager wrote: > I've written a short post on including support for configuration down > at the language level ... If you're advocating anything resembling php.ini, you deserve to die. -- http://mail.python.org/mailm

Re: Python Goes Mercurial

2009-03-31 Thread Lawrence D'Oliveiro
In message , andrew cooke wrote: > Lawrence D'Oliveiro wrote: >> >> >> So what were these "strong antipathies" towards Git, exactly? > > i haven't read the article you link to, but compared

Re: Creating huge data in very less time.

2009-03-31 Thread CTO
1) How random is random enough? Some PRNGs are very fast, and some are very random, but theres always a compromise. 2) How closely related can the files be? It would be easy to generate 1GB of pseudorandom numbers, then just append UUIDs to them 3) Unique filenames can be generated with tmpnam --

I find explicit self much easier to understand if i replace it in my mind with the word "instance"

2009-03-31 Thread frolib
I find explicit self much easier to understand if i replace it in my mind with the word "instance". I know that using the word "self" though is a strong convention. Discuss please. -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Carl Banks
On Mar 31, 12:08 pm, Kay Schluehr wrote: > > And your proposal is? > > I have still more questions than answers. That's obvious. Perhaps you should also refrain from making sweeping negative judgments about a system you have more questions than answers about. (Feel free to make sweeping negativ

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Kay Schluehr
On 1 Apr., 00:38, Carl Banks wrote: > On Mar 31, 12:08 pm, Kay Schluehr wrote: > > > > And your proposal is? > > > I have still more questions than answers. > > That's obvious. > > Perhaps you should also refrain from making sweeping negative > judgments about a system you have more questions tha

Re: Python Goes Mercurial

2009-03-31 Thread andrew cooke
Lawrence D'Oliveiro wrote: > > > So what were these "strong antipathies" towards Git, exactly? you're at the wrong group. there's a lot of interesting discussion in python-dev about this (see

Re: python for loop

2009-03-31 Thread Steven D'Aprano
On Wed, 01 Apr 2009 02:24:45 +0200, Lada Kugis wrote: > I'm coming from fortran and c background so I'm certainly biased by > them. But if you could explain one thing to me: > > in fortran for example: > for i=1,n > goes from 1,2,3,4,...,n > > in python for example: > for i in range(1,n) > goes

Python Goes Mercurial

2009-03-31 Thread Lawrence D'Oliveiro
So what were these "strong antipathies" towards Git, exactly? -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with urllib

2009-03-31 Thread venkat sanaka
Hello everyone I am happy that my code finally worked and got the expected result.i suppose the problem is with python 3 becoz i wrote the similar code with python 2.5 without explicitly mentioning the proxy and it worked.It has taken the system's proxy settings as given in the documentation.Thanks

Re: python for loop

2009-03-31 Thread andrew cooke
Lada Kugis wrote: > I'm coming from fortran and *** c *** > background so I'm certainly biased by > them. But if you could explain one thing to me: but this is exactly the same behaviour as the standard way of doing things in c! int a[5]; for (i = 0; i < 5; ++i) { a[i] = 0; }

Re: python for loop

2009-03-31 Thread Gary Herron
Lada Kugis wrote: I'm coming from fortran and c background so I'm certainly biased by them. But if you could explain one thing to me: in fortran for example: for i=1,n goes from 1,2,3,4,...,n in python for example: for i in range(1,n) goes from 1,2,3,4,...,n-1 (that is, it goes from 1 up to, bu

Re: I find explicit self much easier to understand if i replace it in my mind with the word "instance"

2009-03-31 Thread Steven D'Aprano
On Tue, 31 Mar 2009 07:05:13 -0700, frolib wrote: > I find explicit self much easier to understand if i replace it in my > mind with the word "instance". I know that using the word "self" though > is a strong convention. > > Discuss please. There's nothing to discuss. Call it "self", "instance",

Re: python for loop

2009-03-31 Thread Chris Rebert
On Tue, Mar 31, 2009 at 5:48 PM, Lada Kugis wrote: > On Wed, 01 Apr 2009 11:42:20 +1100, Ben Finney > wrote: > >>Lada Kugis writes: >> >>> in python for example: >>> for i in range(1,n) >>> goes from 1,2,3,4,...,n-1 >>> (that is, it goes from 1 up to, but not including n) >> >>Also, ?range(n)? c

Re: python for loop

2009-03-31 Thread Lada Kugis
On Wed, 01 Apr 2009 11:42:20 +1100, Ben Finney wrote: >Lada Kugis writes: > >> in python for example: >> for i in range(1,n) >> goes from 1,2,3,4,...,n-1 >> (that is, it goes from 1 up to, but not including n) > >Also, ?range(n)? counts from 0 to n-1. > >> Why is that so ? > >The answer is in th

Re: python for loop

2009-03-31 Thread Grant Edwards
On 2009-04-01, Lada Kugis wrote: > in python for example: > for i in range(1,n) > goes from 1,2,3,4,...,n-1 > (that is, it goes from 1 up to, but not including n) > > Why is that so? I'm surprised this isn't in the FAQ yet, but it doesn't seem to be there. > What were the reasons for that "not

Re: python for loop

2009-03-31 Thread Lada Kugis
On Wed, 01 Apr 2009 02:24:45 +0200, Lada Kugis wrote: >I'm coming from fortran and c background so I'm certainly biased by >them. But if you could explain one thing to me: > >in fortran for example: >for i=1,n >goes from 1,2,3,4,...,n And of course, lapsus calami, this is wrong and it should go

Re: python for loop

2009-03-31 Thread Ben Finney
Lada Kugis writes: > in python for example: > for i in range(1,n) > goes from 1,2,3,4,...,n-1 > (that is, it goes from 1 up to, but not including n) Also, ‘range(n)’ counts from 0 to n-1. > Why is that so ? The answer is in the documentation for ‘range’: For example, range(4) returns [0,

Re: win32com python AttributeError!

2009-03-31 Thread Mark Hammond
My guess is that you have a hidden instance of excel running (ie, without a window). Check the task manager for instances of excel.exe and kill them. Cheers, Mark On 31/03/2009 3:17 PM, Michael wrote: Hi Python-list - Has anyone figured this out from Rebecca: Hi, I am having trouble with

Re: problem with urllib

2009-03-31 Thread venkat sanaka
Thanks for ur suggestions Terry.These are really helpful for a newbie like me in python programming. Regards Venkat On Wed, Apr 1, 2009 at 5:59 AM, Terry Reedy wrote: > venkat sanaka wrote: > >> This was the code i executed. >> >> >>> proxies={'http':'10.1.2.21:9090 '} >

Re: Detecting Binary content in files

2009-03-31 Thread Steven D'Aprano
On Tue, 31 Mar 2009 09:23:05 -0700, ritu wrote: > Hi, > > I'm wondering if Python has a utility to detect binary content in files? Define binary content. > Or if anyone has any ideas on how that can be accomplished? Step one: read the file. Step two: does any of the data you have read match

Re: python for loop

2009-03-31 Thread Chris Rebert
On Tue, Mar 31, 2009 at 5:24 PM, Lada Kugis wrote: > I'm coming from fortran and c background so I'm certainly biased by > them. But if you could explain one thing to me: > > in fortran for example: > for i=1,n > goes from 1,2,3,4,...,n > > in python for example: > for i in range(1,n) > goes from

Re: problem with urllib

2009-03-31 Thread Terry Reedy
venkat sanaka wrote: This was the code i executed. >>> proxies={'http':'10.1.2.21:9090 '} >>> opener = urllib.request.FancyURLopener(proxies) >>> f = opener.open("http://www.python.org";) Exception AttributeError: AttributeError("'FancyURLopener' object has no attribu

Re: Thoughts on language-level configuration support?

2009-03-31 Thread jfager
On Mar 31, 2:16 pm, Lorenzo Gatti wrote: > On 31 Mar, 09:19, jfager wrote: > > > On Mar 31, 2:54 am, David Stanek wrote: > > > > On Mon, Mar 30, 2009 at 9:40 AM, jfager wrote: > > > >http://jasonfager.com/?p=440. > > > > > The basic idea is that a language could offer syntactic support for > >

python for loop

2009-03-31 Thread Lada Kugis
I'm coming from fortran and c background so I'm certainly biased by them. But if you could explain one thing to me: in fortran for example: for i=1,n goes from 1,2,3,4,...,n in python for example: for i in range(1,n) goes from 1,2,3,4,...,n-1 (that is, it goes from 1 up to, but not including n)

Re: problem with urllib

2009-03-31 Thread venkat sanaka
The correct one was 10.1.2.21:9090.In my code i tried with all the possible ways and end up in getting no result.sry for that. For more clarity I will give proxy settings in mozilla as: Http proxy:10.1.2.21 port:9090 Regards venkat On Wed, Apr 1, 2009 at 5:37 AM, Emile van Sebille

Re: problem with urllib

2009-03-31 Thread Emile van Sebille
venkat sanaka wrote: Yeah I did i was getting the same error as i got without using http in the url. In your first message you say you need to use proxy of format 10.1.2.21:8080 -- but in your code example you've written and the traceback shows '10.1.2.21:9090 ' Whi

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Terry Reedy
Kay Schluehr wrote: On 31 Mrz., 20:50, Terry Reedy wrote: Although the ceremony has been performed basically correct the interpreter god is not pacified and doesn't respond. But the import 'ceremony' has not been performed. There is no import ceremony. Imports are just stated in the source

Re: problem with urllib

2009-03-31 Thread venkat sanaka
Yeah I did i was getting the same error as i got without using http in the url. Regards venkat. On Wed, Apr 1, 2009 at 4:46 AM, Chris Rebert wrote: > > On Wed, Apr 1, 2009 at 4:35 AM, Chris Rebert wrote: > >> > >> 2009/3/31 venkat sanaka : > >> > hii everyone > >> > > >> > I am new to python p

Re: problem with urllib

2009-03-31 Thread Chris Rebert
> On Wed, Apr 1, 2009 at 4:35 AM, Chris Rebert wrote: >> >> 2009/3/31 venkat sanaka : >> > hii everyone >> > >> > I am new to python programming.And i started implementing a http client >> > using urllib in which >> > i was facing a problem with proxy support.i was behind a proxy server >> > and >

Re: problem with urllib

2009-03-31 Thread venkat sanaka
This was the code i executed. >>> proxies={'http':'10.1.2.21:9090'} >>> opener = urllib.request.FancyURLopener(proxies) >>> f = opener.open("http://www.python.org";) Exception AttributeError: AttributeError("'FancyURLopener' object has no attribute 'tempcache'",) in > ignored Traceback (most rece

Re: problem with urllib

2009-03-31 Thread Chris Rebert
2009/3/31 venkat sanaka : > hii everyone > > I am new to python programming.And i started implementing a http client > using urllib in which > i was facing a problem with proxy support.i was behind a proxy server and > need to use > proxy of format 10.1.2.21:8080 to connect to internet.when i used

problem with urllib

2009-03-31 Thread venkat sanaka
hii everyone I am new to python programming.And i started implementing a http client using urllib in which i was facing a problem with proxy support.i was behind a proxy server and need to use proxy of format 10.1.2.21:8080 to connect to internet.when i used this with proxyhandler of urllib i got

Re: make money!!!!

2009-03-31 Thread D'Arcy J.M. Cain
On Tue, 31 Mar 2009 16:43:31 -0500 "Grimes, George" wrote: > April fools day is not until tomorrow. Your joke is a day early. Wow! I almost missed that piece of spam. Thanks for repeating the entire thing for me. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/d

RE: make money!!!!

2009-03-31 Thread Grimes, George
April fools day is not until tomorrow. Your joke is a day early. George A. Grimes 972-995-0190 - Desk 214-205-0244 - Cell -Original Message- From: filmmaker [mailto:centrixfi...@gmail.com] Sent: Tuesday, March 31, 2009 3:47 PM To: python-list@python.org Subject: make money TH

Re: create a log level for python logging module

2009-03-31 Thread dj
On Mar 31, 4:01 pm, MRAB wrote: > dj wrote: > > On Mar 31, 12:58 pm, MRAB wrote: > >> dj wrote: > >>> On Mar 30, 4:18 pm, Vinay Sajip wrote: > On Mar 30, 4:13 pm, dj wrote: > > I am trying to create a log level called userinfo for the > > pythonlogging. I read the source code and

Re: complaints about no replies last week

2009-03-31 Thread Arnaud Delobelle
a...@pythoncraft.com (Aahz) writes: > Arnaud Delobelle wrote: >> >>There are no comments - I don't have the time to add any, sorry! > > The margin is too small to contain the proof? I wish I could come up with such a resilient conjecture! Ah but in this case, the proof is in the program, as Cu

Re: Detecting Binary content in files

2009-03-31 Thread ritu
On Mar 31, 10:19 am, Josh Dukes wrote: > There might be another way but off the top of my head: > > #!/usr/bin/env python > > def isbin(filename): >    fd=open(filename,'rb') >    for b in fd.read(): >        if ord(b) > 127: >            fd.close() >            return True >    fd.close() >    re

Re: Detecting Binary content in files

2009-03-31 Thread Christian Heimes
Josh Dukes wrote: > Of course this would detect unicode files as being binary and maybe > that's not what you want. How are you thinking about doing it in > perl exactly? There is no such thing as a unicode file. You most likely mean UTF-8 or UTF-16 coded text. Christian -- http://mail.python.o

Re: Detecting Binary content in files

2009-03-31 Thread Grant Edwards
On 2009-03-31, ritu wrote: > I'm wondering if Python has a utility to detect binary content in > files? Yes, check the file size. If it's non-zero, then it has binary content. > Or if anyone has any ideas on how that can be accomplished? I > haven't been able to find any useful information to

Re: create a log level for python logging module

2009-03-31 Thread MRAB
dj wrote: On Mar 31, 12:58 pm, MRAB wrote: dj wrote: On Mar 30, 4:18 pm, Vinay Sajip wrote: On Mar 30, 4:13 pm, dj wrote: I am trying to create a log level called userinfo for the pythonlogging. I read the source code and tried to register the level to theloggingnamespace with the follow

Re: please include python26_d.lib in the installer

2009-03-31 Thread Carl Banks
On Mar 31, 12:50 pm, Compie wrote: > On 27 mrt, 17:01, Carl Banks wrote: > > > OTOH, it's possible that SWIG and Python just happen to use the same > > macro to indicate debugging mode.  So I think you raise a valid point > > that this can be problematic.  Perhaps something like _Py_DEBUG should

Re: complaints about no replies last week

2009-03-31 Thread Aahz
In article , Arnaud Delobelle wrote: > >There are no comments - I don't have the time to add any, sorry! The margin is too small to contain the proof? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Debugging is twice as hard as writing the code in the first p

make money!!!!

2009-03-31 Thread filmmaker
THE PAYPAL $6 DOLLAR MONEY-MAKING METHOD: This is all you need: 1) An email address 2) A Pay Pal account 3) Then POST, POST, POST.. Ever since the internet became popular, the word "scam" has become a daily term. I have never once tried any moneymaking "system" outside of this because

Re: Creating huge data in very less time.

2009-03-31 Thread Grant Edwards
On 2009-03-31, Dave Angel wrote: >>> Unfortunately, although the program still ran under NT (which >>> includes Win 2000, XP, ...), the security system insists on >>> zeroing all the intervening sectors, which takes much time, >>> obviously. >> Why would it even _allocate_ intevening sectors? T

Re: please include python26_d.lib in the installer

2009-03-31 Thread Christian Heimes
> So I'm proposing: please use _PYTHON_DEBUG for this purpose. Would > this cause any problems? Python has its own debug flag: Py_DEBUG. The roles of _DEBUG and Py_DEBUG could easily be changed in PC/pyconfig.h. Any change needs a discussion on the Python ideas list. *wink* Christian -- http://m

Re: create a log level for python logging module

2009-03-31 Thread dj
On Mar 31, 12:58 pm, MRAB wrote: > dj wrote: > > On Mar 30, 4:18 pm, Vinay Sajip wrote: > >> On Mar 30, 4:13 pm, dj wrote: > > >>> I am trying to create a log level called userinfo for the pythonlogging. > >>> I read the source code and tried to register the level to > >>> theloggingnamespace

Re: complaints about no replies last week

2009-03-31 Thread Arnaud Delobelle
prueba...@latinmail.com writes: [...] > Well since I attracted a couple people's attention I will describe the > problem in more detail. Describing the problem properly is probably as > hard as solving it, so excuse me if I struggle a bit. > > The problem is for a health insurance company and invol

Re: custom handler does not write to log file

2009-03-31 Thread dj
On Mar 31, 1:13 pm, dj wrote: > It seems that you can create custom handlers and add them to the > logging.handlers namespace(http://mail.python.org/pipermail/python- > list/2008-May/493826.html.) > But for reasons beyond my understanding my log file (test.log) is not > written to. > > ###

Re: please include python26_d.lib in the installer

2009-03-31 Thread Compie
On 27 mrt, 17:01, Carl Banks wrote: > OTOH, it's possible that SWIG and Python just happen to use the same > macro to indicate debugging mode.  So I think you raise a valid point > that this can be problematic.  Perhaps something like _Py_DEBUG should > be used instead. This would be a good solut

Re: Re: Creating huge data in very less time.

2009-03-31 Thread Dave Angel
The FAT file system does not support sparse files. They were added in NTFS, in the Windows 2000 timeframe, to my recollection. Don't try to install NTFS on a floppy. Grant Edwards wrote: On 2009-03-31, Dave Angel wrote: I wrote a tiny DOS program called resize that simply did a seek out

Re: Detecting Binary content in files

2009-03-31 Thread Dave Angel
All files are binary, but probably by binary you mean non-text. There are lots of ways to decide if a file is non-text, but I don't know of any "standard" way. You can detect a file as not-ascii by simply searching for any character greater than 0x7f. But that doesn't handle a UTF-8 file, wh

Re: Detecting Binary content in files

2009-03-31 Thread Dave Angel
There are lots of ways to decide if a file is non-text, but I don't know of any "standard" way. You can detect a file as not-ascii by simply searching for any character greater than 0x7f. But that doesn't handle a UTF-8 file, which is an 8bit text file representing Unicode. The way I've see

Re: regex negative lookbehind assertion not working correctly?

2009-03-31 Thread Gabriel Rossetti
MRAB wrote: Gabriel Rossetti wrote: Hello everyone, I am trying to write a regex pattern to match an ID in a URL only if it is not a given ID. Here's an example, the ID not to match is "14522XXX98", if my URL is "/profile.php?id=14522XXX99" I want it to match and if it's "/profile.php?id=145

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Kay Schluehr
On 31 Mrz., 20:50, Terry Reedy wrote: > Nothing is added to sys.modules, except the __main__ module, unless > imported (which so are on startup). Yes. The startup process is opaque but at least user defined modules are not accidentally imported. > > > Although the ceremony has been performed >

Re: Relative Imports, why the hell is it so hard?

2009-03-31 Thread Terry Reedy
Kay Schluehr wrote: On 31 Mrz., 18:48, s4g wrote: This and similar solutions ( see Istvan Alberts ) point me to a fundamental problem of the current import architecture. Suppose you really want to run a module as a script without a prior import from a module path: ...A\B\C> python my_module.

Re: Writing to Console on mac OS X

2009-03-31 Thread RGK
Thanks for the pointer Irmen. That works fine. Also my unfamiliarity with the console app is showing - I just learned that there is a navigation pane activated by the 'logs' icon that allows me to see various system logs, including the Apache ones :p You're right, I've heard a bit about the

Re: Writing to Console on mac OS X

2009-03-31 Thread Irmen de Jong
RGK wrote: I'm on mac os x 10.4.11 running python 2.5.2, and Django 1.0, but this is a python question. When doing django/mod_python stuff, I can write to the Apache error_log file with sys.stderr.write("SOMETHING I WANT TO KNOW") which had me wondering if there's not a means for a misc

RE: Cannot register to submit a bug report

2009-03-31 Thread John Posner
Terry Ready said: >> > My ISP (AT&T/Yahoo) was blocking email from the Python bug-tracker: "The >> > sending system has been identified as a source of spam". >> >> I hope you were able to suggest to them that that >> identification must be >> an error. Frustrating given the spam sources

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Lorenzo Gatti
On 31 Mar, 09:19, jfager wrote: > On Mar 31, 2:54 am, David Stanek wrote: > > > On Mon, Mar 30, 2009 at 9:40 AM, jfager wrote: > > >http://jasonfager.com/?p=440. > > > > The basic idea is that a language could offer syntactic support for > > > declaring configurable points in the program. The l

custom handler does not write to log file

2009-03-31 Thread dj
It seems that you can create custom handlers and add them to the logging.handlers namespace(http://mail.python.org/pipermail/python- list/2008-May/493826.html.) But for reasons beyond my understanding my log file (test.log) is not written to. my handler class

  1   2   >