Re: None is negative?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/03/2010 01:28 PM, Mithrandir wrote: > On 08/03/2010 01:17 PM, wheres pythonmonks wrote: >> I did the google search... I must be blind as I don't see any hits... > >> None is negative in Python? (v2.6) > >> http://www.google.com/search?ie=UTF-8&q=%22none+is+negative%22+python > >>>>> if None < -999.99: print "hi" > >> hi >>>>> > >>>>> if -999 > None: print "hi" > >> hi >>>>> > >> Is there a way to have the comparison raise an exception? > >> W > > I believe it's also because None lacks any binary value at all, whereas > -.99 or 0 have a value in binary. > > For example: > > if None < 0: print "hi" > >>>> hi > > if None > 0: print "hi" > >>>> > > But in human terms, None == 0 and None > -999.99. > That and/or it works out better in Python 3. :) - -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. - From the ashes a fire shall be woken, a light from the shadows shall spring; renewed shall be blade that was broken, the crownless again shall be king." -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMWH1gAAoJEKo37V1xH7gTPSIH/igigROvz8NOy/Km5SEAPtUE 08Brr46qeqZzkKPxV/r8wH2uD4eIhHoaBUN0oOv+7FT1UoP89eg7E0eC7U8FtzXY 5uwgEXG4xHTLPCERK4UkX799zD6oVQ7eeoSmnKmbotXEbUEjZ6TONq3ErXZBn6g0 FqHX6S/GdrVvIvqjuePYNJYYC/CsF3qXDpkM69Iye0MqGsZGPaKsrmsCa2cPVI+P ZZ67nXeHEsgYZ91utu4Hb4yOtmZf8MFqFqyD8aYF2Tr1P3uEBe8WOUqIPGRkwrFF Nxw1Ne/pw2v++CDLbJUS6+rpN52IYEeBLawtUarc/iG4RG+KFE7Z0ss8jSr75+c= =uXl5 -END PGP SIGNATURE- -- http://mail.python.org/mailman/listinfo/python-list
Re: None is negative?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/03/2010 01:17 PM, wheres pythonmonks wrote: > I did the google search... I must be blind as I don't see any hits... > > None is negative in Python? (v2.6) > > http://www.google.com/search?ie=UTF-8&q=%22none+is+negative%22+python > if None < -999.99: print "hi" > > hi > if -999 > None: print "hi" > > hi > > Is there a way to have the comparison raise an exception? > > W I believe it's also because None lacks any binary value at all, whereas - -.99 or 0 have a value in binary. For example: if None < 0: print "hi" >>> hi if None > 0: print "hi" >>> But in human terms, None == 0 and None > -999.99. - -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. - From the ashes a fire shall be woken, a light from the shadows shall spring; renewed shall be blade that was broken, the crownless again shall be king." -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMWHwBAAoJEKo37V1xH7gTgvYH/j1j0fgKI5mlzIp4urxhh6Ki 49LVsZjVsISyD+NzvgV5b8hk0S9Ad+gpqaf8fBQJS36Ye1KtupA7W7CTr54roaK0 ZBN3o4XxPdRjxXeHnBUNi3bqjGMzDdIIFZbE/qKalxTj0ZYgtlCgnMiYXLEeeY5z L0dzfn/qoMr6PjAtdlB9yp5amHcUeRzDos3hp13flsAj9Vq/pHyJmlPazME/vE0f 381bMXP52ud71BGcm8gRWdDqhJOUdJ52NZeEk0fKcxHsRvscjt1nQmCRp4IMDtFl ws++tXcl0pY7KSAATb5dzzkhr/BJnKGb1JHRlQMMB0EEdtNOzJaDh63qbvSzTJI= =9jHw -END PGP SIGNATURE- -- http://mail.python.org/mailman/listinfo/python-list
Re: Why is python not written in C++ ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/01/2010 07:34 PM, Albert Hopkins wrote: > On Mon, 2010-08-02 at 01:08 +0200, candide wrote: >> Python is an object oriented langage (OOL). The Python main >> implementation is written in pure and "old" C90. Is it for historical >> reasons? >> >> C is not an OOL and C++ strongly is. I wonder if it wouldn't be more >> suitable to implement an OOL with another one. >> >> Has it ever been planned to rewrite in C++ the historical implementation >> (of course in an object oriented design) ? > > Disclaimer: I am neither a C nor C++ programmer. In fact I can barely > even program in Python ;-) > > I would propose that in fact most programming languages are implemented > in C. Sun's (Oracle's) Java compiler and runtime are written in ANSI C. > The core of the Gnu Compiler Collection (which includes C++ and > Objective-C compilers) is written in C. The official Ruby is > implemented in C. The Squeak Smalltalk implementation uses C instead of > C++. I can't even think of a programming language that is implemented > in C++ (maybe C++ is). > > C seems to be a good, portable language for writing interpreters and > compilers. > > But I wonder if someone has/has tried to write a programming language in > C++ and what were their experiences. > (Sorry if this is a double post, but apparently my last one didn't go through.) I know that LOLCode has a .NET implementation (1), although it's "very much alpha." And someone was apparently working on a C++ only implementation of LOLCode (2), although that was 3 years ago. LOLCode itself is very much alpha anyway and development seems to be very slow (or dead.) Python has a way of extending it's modules with C or C++ (3). 1: http://lolcode.com/implementations/lolcode.net 2: http://forum.lolcode.com/viewtopic.php?id=14 3: http://docs.python.org/release/2.5.2/ext/intro.html - -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. - From the ashes a fire shall be woken, a light from the shadows shall spring; renewed shall be blade that was broken, the crownless again shall be king." -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMVyNqAAoJEKo37V1xH7gTeOUH/2/KYc4busZbATSB09ZUgW+v BmydxDTZaPQd0B56JWSeUiz0/kZrufdDrVc3XUTNNF2oa8ExW51IgsaZOxn2UJGv ydplycT1axs5hrzDG72v2Oo7/poPDxSsvpF58dBsb0XSI25I+orHKrTQpwvKz9cf x6nzahUoygTbaVqZUyxCW2Tc7Rv4T2gpskssD8sIYqaRNofNnPbf3h3NA+q4LMkR +F2UF3r1RE1jwJhs6RNAvUJBdLrHkA3isRsjQE38l6AioLdeTs2yrRtc+6xUkAig RxR11qLZl5OOer/Jrmg1My0+ZTYGnIcAfChxPh1YnHuYbp+H7doqLjlKIkoXZms= =F9Ou -END PGP SIGNATURE- -- http://mail.python.org/mailman/listinfo/python-list
Re: Are those features still the same?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/26/2010 11:58 PM, Lawrence D'Oliveiro wrote: > In message , francogrex wrote: > >> By the way Peter Norvig is not biased, he works for Google research and is >> a supporter of programming in any language, especially in Python. > > Bias doesn’t have to be a conscious thing. Correct. It just has to have a rainbow logo and own half the internet. :) - -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. - From the ashes a fire shall be woken, a light from the shadows shall spring; renewed shall be blade that was broken, the crownless again shall be king." -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMT5VTAAoJEKo37V1xH7gTobAH/1QY0SN6BulkNO3QUFrzg5cO OkeDTbTmI4BJ1M/hmkECU+T76KfnkQ13NobLroWt/UJU8YA4lOQ6KsJU/EsR/27n TFrUxs3gDVeWyiKdSbWtVSZ7b7BJ8Tr41hMPkA1wyK85qJW5mA19h0hndqs/BRtg j2GWPLNv9wx7+v0gQnv7ZgSQJHSlRvp8oi016QVl3W7OcO6B0rgwWx4i1hxz/oij Wd1jF5wwhtgw/0durTFFVt7mR31l3/6zz2WrwvC9fQkSKNQ0oaNgKXZOtctWVdcV XNm+W9I9Sx70F1qO+VfFrHIRJ+kzjCf6/48bumaygol4MnbLIJ3lJ1BNIESIFAg= =iv9B -END PGP SIGNATURE- -- http://mail.python.org/mailman/listinfo/python-list
Re: newb
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/27/2010 04:07 AM, whitey wrote: > hi all. am totally new to python and was wondering if there are any > newsgroups that are there specifically for beginners. i have bought a > book for $2 called "learn to program using python" by alan gauld. > starting to read it but it was written in 2001. presuming that the > commands and info would still be valid? any websites or books that are a > must for beginners? any input would be much appreciated...cheers It may also depend on which version of Python you wish to use. Since you're a "newb", I'd probably suggest starting off with Python 3. The version in your book is probably version 2.*. The difference is minor, but, when you're starting off (I assume with computer languages in general?) the difference in syntax can kick you where it hurts. Programs that work with Python 2.*, may not work with Python 3. However, I suggest Python 3 since it seems to be the "code of tomorrow." It may also depend on what you wish to do with your knowledge of Python (applications, games, web frameworks, etc.) If you want to make games, I suggest also learning about pyGame. As for book versus website, I started off with, as others have mentioned, learning online. Not only is it free, but the boundary between page and screen is broken. Note though that some off-sites (Wikibooks for instance) may not be complete in their writing. Python.org has a wealth of knowledge about almost everything involving Python. However, *some* of the documentation there may not be suitable for absolute beginners. There are several links there to other good websites for those with no experience in coding, all the way up to a ridiculously complicated level. I highly suggest poking around there. If you wish to read a book instead, try: http://www.amazon.com/Python-Programming-Absolute-Beginner-3rd/dp/1435455002/ Or go to your local library and poke there. :) Good luck! - -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. - From the ashes a fire shall be woken, a light from the shadows shall spring; renewed shall be blade that was broken, the crownless again shall be king." -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMT5PPAAoJEKo37V1xH7gTct0IAJrhBXLD5snWBBnrvpr4G3KI 7NV+yxZAphuqXXIj/F97+TKXVgld5PaWkguFjIb5CbBcYZxBP6lk+9c014422BnH yKjmdzC0eJhg0D3FL6Vdnrw3fn2UGZNzbFRp6FDv+calxyIJS3u/hWf8nW4HiHim Q4Xe+Df5tP5OrkiuHAs34xwco/ln5g2x5lJJRZD5eyxHKi70p9ipQZ5p5f5XB/Jw pIvBNIC54Xm9PZUHAeEQIeF/cPeIvE8CEvf7xrbf1LbboB6LqwIqKqpeF7Ae7sq2 x0duNq4H7Llrl5iOMKBPEyYO23VF8T6heVbDCVH6yT4uSc6qnt+6StNVmnRrI8E= =cEZW -END PGP SIGNATURE- -- http://mail.python.org/mailman/listinfo/python-list
Re: why is this group being spammed?
On 07/18/2010 03:58 PM, Edward A. Falk wrote: In article<334170d5-a336-4506-bda1-279b40908...@k1g2000prl.googlegroups.com>, be.krul wrote: why is this group being spammed? They're *all* being spammed. Why? Because they can, and because Google doesn't care. Not only does Google not care, but they've made Usenet more accessible to the general public. How is that bad? You go back in time, before Google bought out Deja News, and ask the average Tom, Dick, or Harry if they knew what Usenet was. Their response probably would have been "No" or "Maybe..." or "Isn't that dead?" Now more people know about Usenet and don't have to go through the hassle of finding a free server (or paying), getting a reliable newsreader (Thunderbird, XNews, etc.), and learning posting "COME TO MY WEBSITE!!111!!" anywhere (except misc.test) will get you mocked and ridiculed. ;) Now there's nothing wrong with making a newsserver publicly available and free, but when you maintain it like a throw-away blog, allowing child porn, spam, et al., you might as well kiss customer trust goodbye. Welcome to the Age of Google! :) A nice little page that I found that, unfortunately, is dead, has some info on Google Groups: http://web.archive.org/web/20080124152054/http://improve-usenet.org/ -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. From the ashes a fire shall be woken, a light from the shadows shall spring; renewed shall be blade that was broken, the crownless again shall be king." -- http://mail.python.org/mailman/listinfo/python-list
Re: Worship We Must
On Tue, 13 Jul 2010 01:32:42 -0700, geremy condra wrote: > > I'm sure you're aware that the shuffle of so-called 'conflict truffles' > is highly illegal, not to mention unethical. I'm shocked you would > advocate it publicly. > > Geremy Condra Ignore them. It's just Google Groups spam. :( -- /home/mithrandir/Documents/sig.txt -- http://mail.python.org/mailman/listinfo/python-list
Re: Ignorance and Google Groups (again)
Thomas Jollans wrote in news:mailman.55.1277936519.1673.python-l...@python.org: > On 06/30/2010 10:55 PM, D'Arcy J.M. Cain wrote: >> in all it's glory. >> >> :0: Hir >> * ^List-Id:.*python-list.python.org >> * ^From:@gmail.com >> * ^Newsgroups: >> /dev/null > > * X-Complaints-To: groups-ab...@google.com > > looks like a nice header to filter on > Oops. Didn't see that you had already posted that idea. I'm sorry. :) But anyway, I had another idea (which hasn't already been mentioned.) ;) Since there are a good deal of "gems" in Google groups, and not all of them are spam artists, how about a whitelist/blacklist in the program? That way some posts from "good" people come through from G-Groups, and others (the "bad" ones) don't. Plus, the ones that you do blacklist would auto-generate a message to groups-ab...@google.com. That'll show 'em. :D Good luck! -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. >From the ashes a fire shall be woken, a light from the shadows shall spring; renenwed shall be blade that was broken, the crownless again shall be king." -- http://mail.python.org/mailman/listinfo/python-list
Re: Ignorance and Google Groups (again)
Bruno Desthuilliers wrote in news:4c2c9002$0$17075$426a3...@news.free.fr: > D'Arcy J.M. Cain a écrit : >> On Thu, 01 Jul 2010 14:07:27 +0200 >> Bruno Desthuilliers >> wrote: >>> And AFAICT you're wrong. I read and post to c.l.py using my >>> newsreader (so NOT going thru GG), and my personal address is >>> @gmail.com. >> >> But... >> >>> From: Bruno Desthuilliers >>> >> > > Sorry, there's a missing "sometimes" between "I" and "read" !-) > Posting from office now. > > ... Thinking again : I'm not sure the account I use to access > usenet from home is a @gmail.com one neither. I'll check this out. Just thought of this last night: If you view the full header you can see this: Complaints-To: groups-ab...@google.com Try blocking posts with that in the header. :) Good luck! -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. >From the ashes a fire shall be woken, a light from the shadows shall spring; renenwed shall be blade that was broken, the crownless again shall be king." -- http://mail.python.org/mailman/listinfo/python-list
Re: stupid question about html page
luca72 wrote in news:abfb7720-6132-4b7b-8084- 5c1a48164...@y11g2000yqm.googlegroups.com: > hello > with webbrowser i open the html or php etc page, how i can save the > opened page with python? > > Thanks > > Luca Not sure of a way to capture info from a browser (like Firefox.) I know though that you can save the source of an page with: import urllib urllib.urlretrieve("http://www.example.com/";, "Fun.html") You still need a web browser to read it formatted. (If you are on a web page in Firefox, and want to save it, click File>Save Page As...) If you want to save a picture from the Net see: http://www.daniweb.com/code/snippet216796.html Good luck! -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. >From the ashes a fire shall be woken, a light from the shadows shall spring; renenwed shall be blade that was broken, the crownless again shall be king." -- http://mail.python.org/mailman/listinfo/python-list
Re: Ignorance and Google Groups (again)
"D'Arcy J.M. Cain" wrote in news:mailman.46.1277931314.1673.python-l...@python.org: > On Wed, 30 Jun 2010 13:10:43 -0700 (PDT) > garryTX wrote: >> On Jun 29, 5:31 pm, nanothermite911fbibustards > [...] >> you ignorant mf. stfu. > > You shouldn't be calling people ignorant for what they post if you are > just going to repost every word again. Everything that applies to him > applies to you. > > I have had it with GG. For the last few months I have been filtering > all mail from gmail.com that comes through the news gateway into a > separate folder to see where the spam and abuse comes from. Over that > time about 99% of all the useless crap has been caught in that filter. > It's unfortunate that there are some decent posts as well but I have > finally decided that the peace and quiet is worth more than the odd > missed gem. So, if you are accessing this list through GG and wonder > why I seem to be ignoring your brilliant arguments, this is why. > > If anyone is interested in the procmail recipe I will be using, here > it is in all it's glory. > >:0: Hir > * ^List-Id:.*python-list.python.org > * ^From:@gmail.com > * ^Newsgroups: > /dev/null > > Cheers. > I only use Google Groups for quick searchs in Usenet archives, but even then I still have to manually filter out all the spam. (Heck, I don't even have a "G-Account." I use news.ett.com.ua as my server and X-News as my reader.) I know spam has almost always been on Usenet, but it really picked up when G-Groups opened up. I really wish that Google would do something about it, but hey! It's not like anyone's interested in Usenet, right? Anyway, I'm glad I'm not the only "pissed customer" out there. And thanks for the code! :) (If you're as paranoid as I am about security and Google, try GoogleSharing for Firefox.) Good luck! -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. >From the ashes a fire shall be woken, a light from the shadows shall spring; renenwed shall be blade that was broken, the crownless again shall be king." -- http://mail.python.org/mailman/listinfo/python-list
Re: Using Python for web applications
Wyatt Schwartz wrote in news:mailman.33.1277921551.1673.python-l...@python.org: > Dear Python-List members, > > Sorry for asking such a simple (or possibly complicated) question, as > I am new to Python programming. Anyways, I have read online that many > popular websites use Python for some of their web-based applications > (for example, Reddit), and that lead me to wonder how is this done? > > Thanks in advance! > > - Wyatt > - Beginning Python Programmer For something more server side see: http://wiki.python.org/moin/WebFrameworks Some nice examples are at: http://wiki.python.org/moin/WebApplications Good luck! :) -- People should read more. https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain "All that is gold does not glitter, not all those who wander are lost; the old that is strong does not wither, deep roots are not reached by the frost. >From the ashes a fire shall be woken, a light from the shadows shall spring; renenwed shall be blade that was broken, the crownless again shall be king." -- http://mail.python.org/mailman/listinfo/python-list
Re: Python as a scripting language. Alternative to bash script?
Michael Torrie wrote in news:mailman.2313.1277759925.32709.python-l...@python.org: > On 06/28/2010 02:06 PM, Mithrandir wrote: >> I can't see Python as an alt. to bash. (As I recall) Python is much >> more object-oriented than bash, but also there are many commands >> (such as apt- get, etc.) that would need Python equivs. However, I >> can see Python being used as a scripting alt. to C. > > OO is a plus for most things, in my book. As for "commands" they have > *nothing* to do with Bash. apt-get is not a Bash command. By your > logic tcsh or zsh would not be an alternate to bash, but in fact they > are. > > I use python for shell scripting quite often now. Anytime one of my > own Bash scripts exceeds 100 lines, I know it's time to switch it to > python. > Please read that link I posted a while back on how you can use > generators in python to replace many of the things that piping to > external commands did in Bash. > > There certainly are a few tasks that Bash is best at (chaining > commands together through pipes), but often Python already has support > for many of the things I'd use external commands and pipes in Bash > for. Bash is designed for working down at the level of files, > directories, and processes, but Python works pretty well too, if you > make some abstraction modules like my runcmd module that I use > extensively. > You both are correct. :) (I wrote that before my first cup of coffee, so my wording was way off. That, and I'm new to Python.) :) I think that Python "could" be a alternative to bash and have some advantages, but it's a long way off from being fully implemented. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python as a scripting language. Alternative to bash script?
Paul Rubin wrote in news:7xpqzbj8st@ruckus.brouhaha.com: > Re: Python as a scripting language. Alternative to bash script? > That's interesting but I'm having a hard time seeing how it would work. > I think environment variables didn't exist in early versions of Unix, > and argc/argv were passed to the child process on its stack. I guess > the reverse side could involve the "wait" system call taking a callback > parameter with a buffer to receive the returned data. But that still > only happens when the child actually exits, and presumably > intercommunicating netween programs should be bidirectional. But Unix > has always had pipes for that. I can't see Python as an alt. to bash. (As I recall) Python is much more object-oriented than bash, but also there are many commands (such as apt- get, etc.) that would need Python equivs. However, I can see Python being used as a scripting alt. to C. -- http://mail.python.org/mailman/listinfo/python-list