ANN: eGenix mxODBC Connect - Python Database Interface 2.0.0

2012-08-20 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 2.0.0 mxODBC Connect is our commercially supported client-server product for

Re: How do I display unicode value stored in a string variable using ord()

2012-08-20 Thread Steven D'Aprano
On Mon, 20 Aug 2012 00:44:22 -0400, Roy Smith wrote: In article 5031bb2f$0$29972$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: So it may be with utf-8 someday. Only if you believe that people's ability to generate data will remain lower

Re: New internal string format in 3.3

2012-08-20 Thread Michael Torrie
On 08/19/2012 11:51 AM, wxjmfa...@gmail.com wrote: Five minutes after a closed my interactive interpreters windows, the day I tested this stuff. I though: Too bad I did not noted the extremely bad cases I found, I'm pretty sure, this problem will arrive on the table. Reading through this

Re: How do I display unicode value stored in a string variable using ord()

2012-08-20 Thread rusi
On Aug 19, 11:11 pm, wxjmfa...@gmail.com wrote: Le dimanche 19 août 2012 19:48:06 UTC+2, Paul Rubin a écrit : But they are not ascii pages, they are (as stated) MOSTLY ascii. E.g. the characters are 99% ascii but 1% non-ascii, so 393 chooses a much more memory-expensive encoding than

Re: How do I display unicode value stored in a string variable using ord()

2012-08-20 Thread Paul Rubin
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Paul Rubin already told you about his experience using OCR to generate multiple terrabytes of text, and how he would not be happy if that was stored in UCS-4. That particular text was stored on disk as compressed XML that had UTF-8

Re: ONLINE SERVER TO STORE AND RUN PYTHON SCRIPTS

2012-08-20 Thread coldfire
On Monday, 20 August 2012 07:05:27 UTC+5:30, Jerry Hill wrote: On Sun, Aug 19, 2012 at 6:27 PM, coldfire amangill.coldf...@gmail.com wrote: Also I have no idea how to deploy a python script online. I have done that on my local PC using Apache server and cgi but it Works fine.

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Mark Lawrence
On 20/08/2012 02:57, kj wrote: In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com writes: In article k0rj38$2gc$1...@reader1.panix.com, kj no.em...@please.post wrote: As far as I've been able to determine, Python does not remember (immutably, that is) the working directory

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Mark Lawrence
On 20/08/2012 04:04, alex23 wrote: My apologies for any double-ups and bad formatting. The new Google Groups interface seems to have effectively shat away decades of UX for something that I can only guess was generated randomly. It's very useful for reporting spam. Otherwise Thunderbird is

Re: ONLINE SERVER TO STORE AND RUN PYTHON SCRIPTS

2012-08-20 Thread Mark Lawrence
On 20/08/2012 08:03, coldfire wrote: Thanks a ton I will look into these and Get back to u Could we have plain English please and not text speech, thanks. If nothing else that should help the people whose English is a second or higher numbered language. -- Cheers. Mark Lawrence. --

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-20 Thread rusi
On Aug 19, 12:15 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: is probably a really great person and kind to small animals and furry children, but... ROFL! The first we're all familiar with. Furry children? Something to do with heads the size of a planet? --

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-20 Thread Chris Angelico
On Mon, Aug 20, 2012 at 5:31 PM, rusi rustompm...@gmail.com wrote: On Aug 19, 12:15 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: is probably a really great person and kind to small animals and furry children, but... ROFL! The first we're all familiar with. Furry

How to convert base 10 to base 2?

2012-08-20 Thread gianpycea
Hi, as you can argue from the subject, i'm really,really new to python. What is the best way to achieve that with python? Because the syntax int('30',2) doesn't seem to work! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert base 10 to base 2?

2012-08-20 Thread Benjamin Kaplan
On Mon, Aug 20, 2012 at 12:50 AM, gianpy...@gmail.com wrote: Hi, as you can argue from the subject, i'm really,really new to python. What is the best way to achieve that with python? Because the syntax int('30',2) doesn't seem to work! That syntax goes the other way- from a string

Re: How to convert base 10 to base 2?

2012-08-20 Thread Mark Lawrence
On 20/08/2012 08:50, gianpy...@gmail.com wrote: Hi, as you can argue from the subject, i'm really,really new to python. What is the best way to achieve that with python? Because the syntax int('30',2) doesn't seem to work! When you have a problem please cut and paste the exact thing that you

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-20 Thread Mark Lawrence
On 20/08/2012 08:46, Chris Angelico wrote: On Mon, Aug 20, 2012 at 5:31 PM, rusi rustompm...@gmail.com wrote: On Aug 19, 12:15 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: is probably a really great person and kind to small animals and furry children, but... ROFL! The

Re: How to convert base 10 to base 2?

2012-08-20 Thread lipska the kat
On 20/08/12 08:50, gianpy...@gmail.com wrote: Hi, as you can argue from the subject, i'm really,really new to python. What is the best way to achieve that with python? Because the syntax int('30',2) doesn't seem to work x = bin(30)[2:] x '0' int(x, 2) 30 lipska -- Lipska the Kat©:

Re: Abuse of Big Oh notation

2012-08-20 Thread Oscar Benjamin
On Sun, 19 Aug 2012 16:42:03 -0700, Paul Rubin no.email@nospam.invalid wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: Of course *if* k is constant, O(k) is constant too, but k is not constant. In context we are talking about string indexing and slicing. There is no

Re: How to convert base 10 to base 2?

2012-08-20 Thread gianpycea
On Monday, August 20, 2012 9:50:53 AM UTC+2, (unknown) wrote: Hi, as you can argue from the subject, i'm really,really new to python. What is the best way to achieve that with python? Because the syntax int('30',2) doesn't seem to work! Thank you all for the big help! @Mark Lawrence Yes,

How to set the socket type and the protocol of a socket using create_connection?

2012-08-20 Thread Guillaume Comte
Hello everyone, I want to use socket.create_connection(...) to set a source address in a ping implementation in python. But how can I then set the type and the protocol? Because, before, I did: icmp = socket.getprotobyname(icmp) my_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp)

[CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
Hello Apache fails running this basic CGI script that I found on the Net: www.acme.com/cgi-bin/test.py?name=myname === #!/usr/bin/env python # Import modules for CGI handling import cgi, cgitb cgitb.enable() # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread andrea crotti
2012/8/20 kj no.em...@please.post: In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com writes This means that no library code can ever count on, for example, being able to reliably find the path to the file that contains the definition of __main__. That's a weakness, IMO.

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
Found it: The script MUST return something to the browser. I was missing this: print Content-Type: text/html;charset=utf-8 print # print a document print Name is %s % ( cgi.escape(name), ) Sorry about that. -- http://mail.python.org/mailman/listinfo/python-list

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Rod Person
On Mon, 20 Aug 2012 13:41:20 +0200 Gilles nos...@nospam.com wrote: Hello Apache fails running this basic CGI script that I found on the Net: www.acme.com/cgi-bin/test.py?name=myname === #!/usr/bin/env python # Import modules for CGI handling import cgi, cgitb

ANN: eGenix mxODBC Connect - Python Database Interface 2.0.0

2012-08-20 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 2.0.0 mxODBC Connect is our commercially supported client-server product for

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-20 Thread Guillaume Comte
In fact, socket.create_connection is for TCP only so I cannot use it for a ping implementation. Does anyone have an idea about how to be able to set a source address for ICMP messages? -- http://mail.python.org/mailman/listinfo/python-list

Re: How does .rjust() work and why it places characters relative to previous one, not to first character - placed most to left - or to left side of screen?

2012-08-20 Thread Peter Otten
crispy wrote: Thanks, i've finally came to solution. Here it is - http://codepad.org/Q70eGkO8 def pairwiseScore(seqA, seqB): score = 0 bars = [str(' ') for x in seqA] # ... length = len(seqA) similarity = [] for x in xrange(length): if seqA[x] ==

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Steven D'Aprano
On Mon, 20 Aug 2012 12:56:42 +0100, andrea crotti wrote: In the specific case there is absolutely no use of os.chdir, since you can: - use absolute paths - things like subprocess.Popen accept a cwd argument - at worst you can chdir back to the previous position right after the broken thing

Re: New internal string format in 3.3

2012-08-20 Thread Roy Smith
In article mailman.3538.1345442498.4697.python-l...@python.org, Michael Torrie torr...@gmail.com wrote: Python generally tries to follow unicode encoding rules to the letter. Thus if a piece of text cannot be represented in the character set of the terminal, then Python will properly err

python 6 compilation failure on RHEL

2012-08-20 Thread Ganesh Reddy K
Hi All, We are trying python 2.6 installation on an RHEL PC , whose 'uname -a' is (Linux 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux ) But, python compilation is not successfully done and showing a failure log. Below is the capture of the same. Please

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-20 Thread Hans Mulder
On 20/08/12 14:36:58, Guillaume Comte wrote: In fact, socket.create_connection is for TCP only so I cannot use it for a ping implementation. Why are you trying to reimplement ping? All OS'es I am aware of come with a working ping implementation. Does anyone have an idea about how to be

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 6:31 AM Ganesh Reddy K said... But, python compilation is not successfully done and showing a failure log. Below is the capture of the same. Please see failure log shown in the bottom of this mail. How to solve the failure modules mentioned in the log ( bsddb185, dl , imageop,

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Walter Hurry
On Mon, 20 Aug 2012 13:14:02 +, Steven D'Aprano wrote: On Mon, 20 Aug 2012 12:56:42 +0100, andrea crotti wrote: In the specific case there is absolutely no use of os.chdir, since you can: - use absolute paths - things like subprocess.Popen accept a cwd argument - at worst you can chdir

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
On Mon, 20 Aug 2012 07:59:39 -0400, Rod Person rodper...@rodperson.com wrote: Check the Apache error log, there should be more information there. It's a shared account, so I only have access to what's in cPanel, which didn't display anything. Problem solved. Thank you. --

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Roy Smith
In article k0tf8g$adc$1...@news.albasani.net, Walter Hurry walterhu...@lavabit.com wrote: It is difficult to think of a sensible use for os.chdir, IMHO. It is true that you can mostly avoid chdir() by building absolute pathnames, but it's often more convenient to just cd somewhere and use

Does Polymorphism mean python can create object?

2012-08-20 Thread Levi Nie
Does Polymorphism mean python can create object? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread andrea crotti
2012/8/20 Roy Smith r...@panix.com: In article k0tf8g$adc$1...@news.albasani.net, Walter Hurry walterhu...@lavabit.com wrote: It is difficult to think of a sensible use for os.chdir, IMHO. It is true that you can mostly avoid chdir() by building absolute pathnames, but it's often more

Re: Does Polymorphism mean python can create object?

2012-08-20 Thread Chris Angelico
On Tue, Aug 21, 2012 at 12:01 AM, Levi Nie levinie...@gmail.com wrote: Does Polymorphism mean python can create object? I'm not sure what your question means. Could you rephrase, please? Also, this document may be useful to you: http://www.catb.org/~esr/faqs/smart-questions.html Chris Angelico

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Jean-Michel Pichavant
kj wrote: 99.99% of Python programmers will find that there's nothing wrong with behavior [snip] Pardon my cynicism, but the general vibe from the replies I've gotten to my post (i.e. if Python ain't got it, it means you don't need it) [snip] Don't you find there's something wrong in

Re: How to convert base 10 to base 2?

2012-08-20 Thread Jean-Michel Pichavant
gianpy...@gmail.com wrote: On Monday, August 20, 2012 9:50:53 AM UTC+2, (unknown) wrote: Hi, as you can argue from the subject, i'm really,really new to python. What is the best way to achieve that with python? Because the syntax int('30',2) doesn't seem to work! Thank you all for

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Hans Mulder
On 20/08/12 15:50:43, Gilles wrote: On Mon, 20 Aug 2012 07:59:39 -0400, Rod Person rodper...@rodperson.com wrote: Check the Apache error log, there should be more information there. It's a shared account, so I only have access to what's in cPanel, which didn't display anything. Most such

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-20 Thread Jean-Michel Pichavant
Zero Piraeus wrote: : On 17 August 2012 21:43, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: There are cultures that marry five year old girls to sixty year old men, cultures that treat throwing acid in the faces of women as acceptable behaviour, cultures that allow war heroes

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-20 Thread Guillaume Comte
Le lundi 20 août 2012 15:38:14 UTC+2, Hans Mulder a écrit : On 20/08/12 14:36:58, Guillaume Comte wrote: In fact, socket.create_connection is for TCP only so I cannot use it for a ping implementation. Why are you trying to reimplement ping? Because I work on a network emulator and

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-20 Thread Chris Angelico
On Mon, Aug 20, 2012 at 11:38 PM, Hans Mulder han...@xs4all.nl wrote: Why are you trying to reimplement ping? All OS'es I am aware of come with a working ping implementation. For some definition of working, at least. I've never managed to get MS Windows to ping broadcast, for instance. A

Re: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Gilles
On Mon, 20 Aug 2012 16:56:14 +0200, Hans Mulder han...@xs4all.nl wrote: Most such panels have a button to show the error log for your own site. If you can't find it, ask the help desk of the web hosting company. If there really is no way for you to see the error log, ask the help desk to mail

Re: Abuse of Big Oh notation

2012-08-20 Thread Paul Rubin
Oscar Benjamin oscar.j.benja...@gmail.com writes: No it doen't. It is still O(k). The point of big O notation is to understand the asymptotic behaviour of one variable as it becomes large because of changes in other variables. Actually, two separate problems got mixed together late at night.

Re: Abuse of Big Oh notation

2012-08-20 Thread Chris Angelico
On Tue, Aug 21, 2012 at 2:01 AM, Paul Rubin no.email@nospam.invalid wrote: Analogy: how big a box is required to hold a pair of shoes? In a purely theoretical sense we might say O(S) where S is the shoe size, treating shoe size as an arbitrary independent variable. But in the real world,

woman in islam

2012-08-20 Thread BV BV
woman in islam http://www.youtube.com/watch?v=ZXEScVFANvAfeature=related Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Grant Edwards
On 2012-08-20, kj no.em...@please.post wrote: In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com writes: In article k0rj38$2gc$1...@reader1.panix.com, kj no.em...@please.post wrote: As far as I've been able to determine, Python does not remember (immutably, that is) the

Re: Abuse of Big Oh notation

2012-08-20 Thread Oscar Benjamin
On 20 August 2012 17:01, Paul Rubin no.email@nospam.invalid wrote: Oscar Benjamin oscar.j.benja...@gmail.com writes: No it doen't. It is still O(k). The point of big O notation is to understand the asymptotic behaviour of one variable as it becomes large because of changes in other

Re: Abuse of Big Oh notation

2012-08-20 Thread Ian Kelly
On Mon, Aug 20, 2012 at 10:09 AM, Chris Angelico ros...@gmail.com wrote: On Tue, Aug 21, 2012 at 2:01 AM, Paul Rubin no.email@nospam.invalid wrote: Analogy: how big a box is required to hold a pair of shoes? In a purely theoretical sense we might say O(S) where S is the shoe size, treating

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Kwpolska
On Mon, Aug 20, 2012 at 3:31 PM, Ganesh Reddy K ganeshred...@gmail.com wrote: Hi All, We are trying python 2.6 installation on an RHEL PC , whose 'uname -a' is (Linux 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux ) But, python compilation is not

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Walter Hurry
On Mon, 20 Aug 2012 19:12:05 +0200, Kwpolska wrote: On Mon, Aug 20, 2012 at 3:31 PM, Ganesh Reddy K ganeshred...@gmail.com wrote: Hi All, We are trying python 2.6 installation on an RHEL PC , whose 'uname -a' is (Linux 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-20 Thread Dave Angel
On 08/20/2012 11:04 AM, Guillaume Comte wrote: SNIP Because I work on a network emulator and I want to check biterros patterns so I need to access the data of the packets. An dsince my test program is written in Python, it's easier to do it in Python. You should look up scapy.

Re: New image and color management library for Python 2+3

2012-08-20 Thread Christian Heimes
Am 19.08.2012 19:35, schrieb Jan Riechers: I'm sorry for getting out of your initial question/request, but did you try out ImageMagick before making use of FreeImage - do you even perhaps can deliver a comparison between your project and ImageMagick (if regular Python is used)? I ask cause:

Re: How to convert base 10 to base 2?

2012-08-20 Thread Joel Goldstick
On Mon, Aug 20, 2012 at 1:29 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Mon, 20 Aug 2012 16:52:42 +0200, Jean-Michel Pichavant jeanmic...@sequans.com declaimed the following in gmane.comp.python.general: note that the builtin bin function is not available with python ver 2.6 def

Re: How to convert base 10 to base 2?

2012-08-20 Thread Ian Kelly
On Mon, Aug 20, 2012 at 11:29 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: I think I typically have done this by going through a hex representation. H2B_Lookup = { 0 : , 1 : 0001, 2 : 0010, 3 : 0011,

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 10:20 AM Walter Hurry said... On Mon, 20 Aug 2012 19:12:05 +0200, Kwpolska wrote: snip 300+ lines of non-referred to content replicated by you both Do you really need to compile python2.6? RHEL has packages for python, and it's better s/better/sometimes easier to use

Class.__class__ magic trick help

2012-08-20 Thread Massimo Di Pierro
I discovered I can do this: class A(object): pass class B(object): __class__ = A # magic b = B() isinstance(b,A) # returns True (as if B derived from A) isinstance(b,B) # also returns True I have some reasons I may want to do this (I an object with same methods as a

Re: How to convert base 10 to base 2?

2012-08-20 Thread Ian Kelly
On Mon, Aug 20, 2012 at 11:57 AM, Joel Goldstick joel.goldst...@gmail.com wrote: This may be moving off topic, but since you encode -6 as -0110 I thought I'd chime in on 'two's complement' with binary number, you can represent 0 to 255 in a byte, or you can represent numbers from 127 to -128.

Re: pycups

2012-08-20 Thread Adam Tauno Williams
On Thu, 2012-08-09 at 04:30 -0700, loial wrote: I am looking to monitor print jobs on linux via python. pycups looks a possibility, but I cannot find any useful tutorial, examples of how to use it. Can anyone help? Modern CUPs can provide event notifications via RSS; perhaps that would

Re: Class.__class__ magic trick help

2012-08-20 Thread Steven D'Aprano
On Mon, 20 Aug 2012 11:01:36 -0700, Massimo Di Pierro wrote: I discovered I can do this: class A(object): pass class B(object): __class__ = A # magic Why do you think that's magic? b = B() isinstance(b,A) # returns True (as if B derived from A) b.__class__ is

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Walter Hurry
On Mon, 20 Aug 2012 11:02:25 -0700, Emile van Sebille wrote: On 8/20/2012 10:20 AM Walter Hurry said... On Mon, 20 Aug 2012 19:12:05 +0200, Kwpolska wrote: snip 300+ lines of non-referred to content replicated by you both Do you really need to compile python2.6? RHEL has packages for

Re: Class.__class__ magic trick help

2012-08-20 Thread Ian Kelly
On Mon, Aug 20, 2012 at 12:01 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I discovered I can do this: class A(object): pass class B(object): __class__ = A # magic b = B() isinstance(b,A) # returns True (as if B derived from A) isinstance(b,B) #

Re: Abuse of Big Oh notation

2012-08-20 Thread wxjmfauth
By chance and luckily, first attempt. IDLE, Windows 7.0 Pro 32, Pentium Dual Core 2.6, RAM 2 Go Py 3.2.3 timeit.repeat(('€'*100+'€'*100).replace('€', 'œ')) [1.6939567134893707, 1.672874290786993, 1.6761219212298073] Py 3.3.0b2 timeit.repeat(('€'*100+'€'*100).replace('€', 'œ'))

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 11:37 AM Walter Hurry said... On Mon, 20 Aug 2012 11:02:25 -0700, Emile van Sebille wrote: On 8/20/2012 10:20 AM Walter Hurry said... I concur, but FYI the version of Python with RHEL5 is 2.4. Still, OP should stick with that unless there is a pressing reason. Hence, the 2.6

Re: Abuse of Big Oh notation

2012-08-20 Thread Paul Rubin
Ian Kelly ian.g.ke...@gmail.com writes: The difference between the two is that the former is bounded by a constant that is fundamental to the algorithm at hand,... S is clearly bounded by the constraints of actual shoes, so we can safely treat S as a constant and call it O(N). Thanks, that

Re: Class.__class__ magic trick help

2012-08-20 Thread Massimo Di Pierro
The fact is this works: class B(object): ...__class__ = dict b=B() but this does not class B(object): ...def __init__(self): ...self.__class__ = dict b=B() Traceback (most recent call last): File stdin, line 1, in module File stdin, line 3, in __init__ TypeError:

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Piet van Oostrum
kj no.em...@please.post writes: This means that no library code can ever count on, for example, being able to reliably find the path to the file that contains the definition of __main__. That's a weakness, IMO. On Unix based systems there is no reliable way to find out this information. So

Re: A difficulty with lists

2012-08-20 Thread Cheng
On Monday, August 6, 2012 12:50:13 PM UTC-7, Mok-Kong Shen wrote: I ran the following code: def xx(nlist): print(begin: ,nlist) nlist+=[999] print(middle:,nlist) nlist=nlist[:-1] print(final: ,nlist) u=[1,2,3,4] print(u) xx(u) print(u)

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Walter Hurry
On Mon, 20 Aug 2012 12:19:23 -0700, Emile van Sebille wrote: Package dependencies. If the OP intends to install a package that doesn't support other than 2.6, you install 2.6. It would be a pretty poor third party package which specified Python 2.6 exactly, rather than (say) Python 2.6 or

Re: How do I display unicode value stored in a string variable using ord()

2012-08-20 Thread Piet van Oostrum
Blind Anagram non...@nowhere.com writes: This is an average slowdown by a factor of close to 2.3 on 3.3 when compared with 3.2. I am not posting this to perpetuate this thread but simply to ask whether, as you suggest, I should report this as a possible problem with the beta? Being a beta

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 1:55 PM Walter Hurry said... On Mon, 20 Aug 2012 12:19:23 -0700, Emile van Sebille wrote: Package dependencies. If the OP intends to install a package that doesn't support other than 2.6, you install 2.6. It would be a pretty poor third party package which specified Python 2.6

Re: Abuse of Big Oh notation

2012-08-20 Thread 88888 Dihedral
Paul Rubin於 2012年8月21日星期二UTC+8上午3時29分12秒寫道: Ian Kelly ian.g.ke...@gmail.com writes: The difference between the two is that the former is bounded by a constant that is fundamental to the algorithm at hand,... S is clearly bounded by the constraints of actual shoes, so we can safely

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Cameron Simpson
On 20Aug2012 12:19, Emile van Sebille em...@fenx.com wrote: | On 8/20/2012 11:37 AM Walter Hurry said... | On Mon, 20 Aug 2012 11:02:25 -0700, Emile van Sebille wrote: | On 8/20/2012 10:20 AM Walter Hurry said... | I concur, but FYI the version of Python with RHEL5 is 2.4. Still, OP | should

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Dan Stromberg
On Mon, Aug 20, 2012 at 10:25 PM, Cameron Simpson c...@zip.com.au wrote: I was going to chime in with this anyway had the thread said nothing; I strongly prefer to specify --prefix explicitly with configure. My personal habit to to build with (adjust to match):

RE: Top-posting c.

2012-08-20 Thread Prasad, Ramit
I also tend to blame M$ (Outlook and variants) for this tendency to quote everything and top-post -- Outlook makes it almost impossible to do a triminterleave response style. I that Outlook Co are guilty. That and the fact that few people even think about this. Nonsense, I post only

RE: [ANNC] pybotwar-0.8

2012-08-20 Thread Prasad, Ramit
Look you are the only person complaining about top-posting. GMail uses top-posting by default. I can't help it if you feel irritated by it. He is most certainly not the only person to feel irritated nor even the only person who has requested you not to top post. He does happen to be the most

Re: Abuse of Big Oh notation

2012-08-20 Thread 88888 Dihedral
Paul Rubin於 2012年8月21日星期二UTC+8上午3時29分12秒寫道: Ian Kelly ian.g.ke...@gmail.com writes: The difference between the two is that the former is bounded by a constant that is fundamental to the algorithm at hand,... S is clearly bounded by the constraints of actual shoes, so we can safely

RE: [ANNC] pybotwar-0.8

2012-08-20 Thread Prasad, Ramit
I'll be using Google Groups (hopefully it won't top-post by default) to post stuff. Thanks for not top-posting. Even if it is the default, it is not difficult to change. :) Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the

Re: Does Polymorphism mean python can create object?

2012-08-20 Thread alex23
On Tue, Aug 21, 2012 at 12:01 AM, Levi Nie wrote: Does Polymorphism mean python can create object? No. This isn't DD. Polymorphism has a distinct meaning in computer science, one which you would've found in less time searching Wikipedia than asking this question here. --

Re: Abuse of Big Oh notation

2012-08-20 Thread Ned Deily
In article f0878bc4-539b-4570-a138-ea413e6d9...@googlegroups.com, wxjmfa...@gmail.com wrote: Note The used characters are not members of the latin-1 coding scheme (btw an *unusable* coding). They are however charaters in cp1252 and mac-roman. mac-roman is an obsolete encoding that was used

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Neil Hodgson
Nobody: Maybe. On Unix, it's possible that the current directory no longer has a pathname. Its also possible that you do not have permission to successfully call getcwd. One example of this I have experienced is the OS X sandbox where you can run Python starting in a directory where you

Re: Top-posting c.

2012-08-20 Thread Steven D'Aprano
On Mon, 20 Aug 2012 22:49:24 +, Prasad, Ramit wrote: I also tend to blame M$ (Outlook and variants) for this tendency to quote everything and top-post -- Outlook makes it almost impossible to do a triminterleave response style. I that Outlook Co are guilty. That and the fact that

Re: How to convert base 10 to base 2?

2012-08-20 Thread Paul Rubin
Ian Kelly ian.g.ke...@gmail.com writes: Everybody should know the generic algorithm, though: from itertools import chain ... For n0, assuming you just want the converted digits and not a string. String conversion and minus sign for n0 left as exercise. Note this returns a generator that you

Re: New internal string format in 3.3

2012-08-20 Thread Michael Torrie
On 08/20/2012 07:17 AM, Roy Smith wrote: In article mailman.3538.1345442498.4697.python-l...@python.org, Michael Torrie torr...@gmail.com wrote: Python generally tries to follow unicode encoding rules to the letter. Thus if a piece of text cannot be represented in the character set of the

Re: Class.__class__ magic trick help

2012-08-20 Thread Massimo Di Pierro
Consider this code: class SlowStorage(dict): def __getattr__(self,key): return self[key] def __setattr__(self,key): self[key]=value class FastStorage(dict): def __init__(self, __d__=None, **kwargs): self.update(__d__,**kwargs) def

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Paul Rubin
alex23 wuwe...@gmail.com writes: Oh my god, how DARE people with EXPERIENCE in a language challenge the PRECONCEPTIONS of an AMATEUR!!! HOW DARE THEY?!?! +1 QOTW :) -- http://mail.python.org/mailman/listinfo/python-list

Re: python 6 compilation failure on RHEL

2012-08-20 Thread John Nagle
On 8/20/2012 2:50 PM, Emile van Sebille wrote: On 8/20/2012 1:55 PM Walter Hurry said... On Mon, 20 Aug 2012 12:19:23 -0700, Emile van Sebille wrote: Package dependencies. If the OP intends to install a package that doesn't support other than 2.6, you install 2.6. It would be a pretty poor

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Peter Otten
John Nagle wrote: On 8/20/2012 2:50 PM, Emile van Sebille wrote: On 8/20/2012 1:55 PM Walter Hurry said... On Mon, 20 Aug 2012 12:19:23 -0700, Emile van Sebille wrote: Package dependencies. If the OP intends to install a package that doesn't support other than 2.6, you install 2.6. It

[issue15731] Mechanism for inheriting docstrings and signatures

2012-08-20 Thread Ben Finney
Ben Finney added the comment: Attached is a patch which is more comprehensive (covering the additional locations pointed out to me by ncoghlan), and also consolidating the details into the library documentation so they're not verbosely repeated in so many places. I agree with Nick's position

[issue15731] Mechanism for inheriting docstrings and signatures

2012-08-20 Thread Ben Finney
Ben Finney added the comment: Apologies, my previous comment and patch was sent to the wrong issue (should have gone to #8810). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15731 ___

[issue8810] TZ offset description is unclear in docs

2012-08-20 Thread Ben Finney
Ben Finney added the comment: Attached is a patch which is more comprehensive (covering the additional locations pointed out to me by ncoghlan), and also consolidating the details into the library documentation so they're not verbosely repeated in so many places. I agree with Nick's position

[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2012-08-20 Thread Kevin Chen
Kevin Chen added the comment: Hi I made the following patch for this issue. It addresses the #2051 security bug. So the .pyc and .pyo files are created using the same permission as .py The MS_WINDOWS version will chmod the permission of .pyc and .pyo files to write accessible before deleting

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-20 Thread Andrea Griffini
Andrea Griffini added the comment: I missed all the macrology present :-( ... the following is a patch that takes it into account (also defines a VISIT_QUIT macro to make more visible the exit points). The handling has been also extended to visit_stmt because the macros are shared. Of course

[issue15724] Add versionchanged to memoryview docs

2012-08-20 Thread Nick Coghlan
Nick Coghlan added the comment: Just a heads up that I'm about to check in a fairly major change to the sequence docs layout. I'm leaving the memoryview block alone, so hopefully this won't cause you any problems, but there's going to be a merge in your future :) -- nosy: +ncoghlan

[issue11631] Python 2.7.1 64bit, Win7 64bit problem to read and write with UDP.

2012-08-20 Thread Martin v . Löwis
Martin v. Löwis added the comment: I still can't reproduce it. I'm attaching client and server scripts that communicate over 127.0.0.1. This works just fine. -- Added file: http://bugs.python.org/file26914/server.py ___ Python tracker

[issue4966] Improving Lib Doc Sequence Types Section

2012-08-20 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4966 ___

[issue11631] Python 2.7.1 64bit, Win7 64bit problem to read and write with UDP.

2012-08-20 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: Added file: http://bugs.python.org/file26915/client.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11631 ___

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-20 Thread Andrea Griffini
Andrea Griffini added the comment: On Mon, Aug 20, 2012 at 12:27 AM, Antoine Pitrou rep...@bugs.python.org wrote: Indeed I don't like the introduction of COMPILER_STACK_FRAME_SCALE. Re-using the existing infrastructure would be much easier to maintain. The default recursion limit is 1000,

[issue15645] 2to3 Grammar pickles not created when upgrading to 3.3.0b2

2012-08-20 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm pretty sure this is a generic Makefile bug. I could reproduce this problem with a clean install into a new prefix, after cleaning up the source tree: 'make clean' won't remove the generated file when srcdir != builddir. This line in the Makefile seems

  1   2   3   >