Re: python 6 compilation failure on RHEL

2012-08-20 Thread Emile van Sebille
On 8/20/2012 9:34 PM John Nagle said... After a thread of clueless replies, s/clueless/unread Emile -- http://mail.python.org/mailman/listinfo/python-list

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

2012-08-20 Thread Alex Strickland
On 2012/08/17 12:42 AM, Madison May wrote: As a lurker, I agree completely with Chris's sentiments. I too, but I'd prefer something top-posted than have to skip through 38 pages of quoted e-mail to get to a (generally) 1 liner at the bottom. -- Regards Alex -- http://mail.python.org/mailman

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 inst

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

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

2012-08-20 Thread Paul Rubin
alex23 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: 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 __getitem__(self,key):

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 , > Michael Torrie 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 out. Other lang

Re: How to convert base 10 to base 2?

2012-08-20 Thread Paul Rubin
Ian Kelly writes: > Everybody should know the generic algorithm, though: > from itertools import chain ... For n>0, assuming you just want the converted digits and not a string. String conversion and minus sign for n<0 left as exercise. Note this returns a generator that you can convert to a lis

python-list@python.org

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 trim&interleave response style. >> >> I that Outlook & Co are guilty. That and th

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 h

Re: Abuse of Big Oh notation

2012-08-20 Thread Ned Deily
In article , 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 in MacOS 9 and MacOS Classic systems of previous d

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 D&D. Polymorphism has a distinct meaning in computer science, one which you would've found in less time searching Wikipedia than asking this question here. -- http://mail.python.o

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 pu

Re: Abuse of Big Oh notation

2012-08-20 Thread 88888 Dihedral
Paul Rubin於 2012年8月21日星期二UTC+8上午3時29分12秒寫道: > Ian Kelly 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

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

python-list@python.org

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 trim&interleave response style. > > I that Outlook & Co are guilty. That and the fact that few people even > think about this. Nonsense, I po

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Dan Stromberg
On Mon, Aug 20, 2012 at 10:25 PM, Cameron Simpson 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): > > --prefix=/usr/local/python-2.6.4 > >

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Cameron Simpson
On 20Aug2012 12:19, Emile van Sebille 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 stick w

Re: Abuse of Big Oh notation

2012-08-20 Thread 88888 Dihedral
Paul Rubin於 2012年8月21日星期二UTC+8上午3時29分12秒寫道: > Ian Kelly 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

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 e

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

2012-08-20 Thread Piet van Oostrum
"Blind Anagram" 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 release, is

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: 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) >

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

2012-08-20 Thread Piet van Oostrum
kj 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 how could Python

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 "", line 1, in File "", line 3, in __init__ TypeError: __class_

Re: Abuse of Big Oh notation

2012-08-20 Thread Paul Rubin
Ian Kelly 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 is a good explain o

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 ins

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('€', 'œ')") [7.924

Re: Class.__class__ magic trick help

2012-08-20 Thread Ian Kelly
On Mon, Aug 20, 2012 at 12:01 PM, Massimo Di Pierro 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) # also returns True

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: > > > >>> >Do you really need to compile python2.6? RHEL has packages for >>> >python, >>> >and it's better > > s/better/sometimes e

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.__

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 w

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 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. To get the negativ

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 a

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: >Do you really need to compile python2.6? RHEL has packages for python, >and it's better s/better/sometimes easier > to use pre-compiled packages rather than compile them yourself. I concu

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 wrote: > I think I typically have done this by going through a hex > representation. > > H2B_Lookup = { "0" : "", "1" : "0001", > "2" : "0010", "3" : "0011", >

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 wrote: > On Mon, 20 Aug 2012 16:52:42 +0200, Jean-Michel Pichavant > declaimed the following in > gmane.comp.python.general: > >> note that the builtin bin function is not available with python ver < 2.6 >> >> def Denary2Binary(n): >> '''conv

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 c

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: > > 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. http://www.s

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 > 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/Li

Re: python 6 compilation failure on RHEL

2012-08-20 Thread Kwpolska
On Mon, Aug 20, 2012 at 3:31 PM, Ganesh Reddy K 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 successfully done an

Re: Abuse of Big Oh notation

2012-08-20 Thread Ian Kelly
On Mon, Aug 20, 2012 at 10:09 AM, Chris Angelico wrote: > On Tue, Aug 21, 2012 at 2:01 AM, Paul Rubin 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 independe

Re: Abuse of Big Oh notation

2012-08-20 Thread Oscar Benjamin
On 20 August 2012 17:01, Paul Rubin wrote: > Oscar Benjamin 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

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

2012-08-20 Thread Grant Edwards
On 2012-08-20, kj wrote: > In Roy Smith > writes: > >>In article , kj >>wrote: > >>> As far as I've been able to determine, Python does not remember >>> (immutably, that is) the working directory at the program's start-up, >>> or, if it does, it does not officially expose this information. >

woman in islam

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

Re: Abuse of Big Oh notation

2012-08-20 Thread Chris Angelico
On Tue, Aug 21, 2012 at 2:01 AM, Paul Rubin 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, > shoe size is controlled

Re: Abuse of Big Oh notation

2012-08-20 Thread Paul Rubin
Oscar Benjamin 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. In neither case is k an

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 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 you the error

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 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 Google search fo

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 emul

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 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 to die of hunger and cold homeless i

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 > 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 panels have a butt

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 t

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 a

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 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 -- http://mail.pyt

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

2012-08-20 Thread andrea crotti
2012/8/20 Roy Smith : > In article , > Walter Hurry 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 > names relative to that.

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 Roy Smith
In article , Walter Hurry 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 names relative to that. Fabric (a very cool tool for writ

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 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. -- http://mail.python.org/mailman/listinfo/pytho

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

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, su

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 a

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 se

Re: New internal string format in 3.3

2012-08-20 Thread Roy Smith
In article , Michael Torrie 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 out. Other languages you have tried, likely fudge it > somehow.

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 thi

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

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

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: [CGI] Basic newbie error or server configuration error?

2012-08-20 Thread Rod Person
On Mon, 20 Aug 2012 13:41:20 +0200 Gilles 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 > > cgitb.enable() > >

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: Why doesn't Python remember the initial directory?

2012-08-20 Thread andrea crotti
2012/8/20 kj : > In Roy Smith > 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. One manifestation > of this weakness is that os.chdir breaks inspect.ge

[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 f

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)

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

Re: Abuse of Big Oh notation

2012-08-20 Thread Oscar Benjamin
On Sun, 19 Aug 2012 16:42:03 -0700, Paul Rubin wrote: Steven D'Aprano 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 value of k, say, k = 2, for which you can say "People will

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

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 wrote: On Aug 19, 12:15 pm, Steven D'Aprano 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 t

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: How to convert base 10 to base 2?

2012-08-20 Thread Benjamin Kaplan
On Mon, Aug 20, 2012 at 12:50 AM, 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 representing a number in

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: 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 wrote: > On Aug 19, 12:15 pm, Steven D'Aprano +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? > > Someth

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

2012-08-20 Thread rusi
On Aug 19, 12:15 pm, Steven D'Aprano 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? -- http://mail.python.org/mailman/listinfo/python-l

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. -- htt

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: Why doesn't Python remember the initial directory?

2012-08-20 Thread Mark Lawrence
On 20/08/2012 02:57, kj wrote: In Roy Smith writes: In article , kj wrote: As far as I've been able to determine, Python does not remember (immutably, that is) the working directory at the program's start-up, or, if it does, it does not officially expose this information. Why would you

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 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. > > > Whats this all calle