Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-31 Thread Steven D'Aprano
On Thu, 31 Oct 2013 21:41:32 -0700, rurpy wrote: > On 10/31/2013 02:41 AM, Steven D'Aprano wrote: >> On Wed, 30 Oct 2013 19:48:55 -0700, rurpy wrote: >>> On 10/30/2013 04:22 AM, Steven D'Aprano wrote: Skybuck's experience at programming *is relevant* to the question of whether or not he

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-31 Thread rurpy
On 10/31/2013 02:41 AM, Steven D'Aprano wrote: > On Wed, 30 Oct 2013 19:48:55 -0700, rurpy wrote: >> On 10/30/2013 04:22 AM, Steven D'Aprano wrote: >>> Skybuck's experience at programming *is relevant* to the question of >>> whether or not he understands what he is talking about. >> No. You claime

Re: Python wart

2013-10-31 Thread Michael Torrie
On 10/31/2013 08:56 PM, Mark Lawrence wrote: > On 01/11/2013 02:41, Michael Torrie wrote: >> On 10/31/2013 07:45 PM, Mark Lawrence wrote: >>> Quite often I type this >>> >>> print('Total of accounts %.2f', total) >>> >>> when I meant to type this >>> >>> print('Total of accounts %.2f' % total) >>>

Re: Testing python command line apps -- Running from within the projects w/o installing

2013-10-31 Thread Göktuğ Kayaalp
On Fri, Nov 01, 2013 at 10:42:23AM +1100, Ben Finney wrote: > Göktuğ Kayaalp writes: > > > I'm using python to write command line apps from time to time. I > > wonder *what is the conventional way to test-run these apps from > > within the project itself, while developing, without installing*. > >

Re: Error Testing

2013-10-31 Thread rusi
On Friday, November 1, 2013 4:29:35 AM UTC+5:30, Denis McMahon wrote: > My mistake, that was what Albert said, you were simply standing up for > him. > Please s/you/he/ in the lines of my previous post quoted above, and > accept my apologies for my mistake. Heh! Chill! Yeah there is some hamm

Re: Error Testing

2013-10-31 Thread rusi
On Friday, November 1, 2013 8:55:03 AM UTC+5:30, Mark Lawrence wrote: > On 01/11/2013 02:27, William Ray Wing wrote: > > supper computers > Somebody must have tough teeth, though thinking about it I recall people > eating bicycles :) You just have to be sufficiently non-vegetarian http://en.wik

Re: personal library

2013-10-31 Thread rusi
On Wednesday, October 30, 2013 10:18:20 AM UTC+5:30, Chris Angelico wrote: > On Wed, Oct 30, 2013 at 3:33 PM, Ben Finney wrote: > > Chris Angelico writes: > >> *Definitely* use source control. > > +1, but prefer to call it a “version control system” which is (a) more > > easily searched on the in

Re: Error Testing

2013-10-31 Thread Mark Lawrence
On 01/11/2013 02:27, William Ray Wing wrote: supper computers Somebody must have tough teeth, though thinking about it I recall people eating bicycles :) -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -

Re: Error Testing

2013-10-31 Thread William Ray Wing
On Oct 31, 2013, at 1:17 PM, Neil Cerutti wrote: > On 2013-10-31, rusi wrote: >> On Thursday, October 31, 2013 8:50:27 PM UTC+5:30, Neil Cerutti wrote: >>> wrote: This suggests that Pascal went against established practice. This is false. FORTRAN used = and that was a mistake caused by

Re: Python wart

2013-10-31 Thread Mark Lawrence
On 01/11/2013 02:41, Michael Torrie wrote: On 10/31/2013 07:45 PM, Mark Lawrence wrote: Quite often I type this print('Total of accounts %.2f', total) when I meant to type this print('Total of accounts %.2f' % total) Do I have to raise a PEP to get this stupid language changed so that it dyn

looking for a pattern to change function behaviour by context

2013-10-31 Thread Zhang Weiwu
Problem: library method request() requests data from external server. Sometimes, if a request is failed, it should be ignored, like price inquiry - if we don't get the price, then no decision could be made based on the price, then we simply do nothing about it; Sometimes, if a request is fail

Re: Python wart

2013-10-31 Thread Michael Torrie
On 10/31/2013 07:45 PM, Mark Lawrence wrote: > Quite often I type this > > print('Total of accounts %.2f', total) > > when I meant to type this > > print('Total of accounts %.2f' % total) > > Do I have to raise a PEP to get this stupid language changed so that it > dynamically recognises what

Re: Python wart

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 12:45 PM, Mark Lawrence wrote: > Quite often I type this > > print('Total of accounts %.2f', total) > > when I meant to type this > > print('Total of accounts %.2f' % total) > > Do I have to raise a PEP to get this stupid language changed so that it > dynamically recognises

Re: Python wart

2013-10-31 Thread MRAB
On 01/11/2013 01:45, Mark Lawrence wrote: Quite often I type this print('Total of accounts %.2f', total) when I meant to type this print('Total of accounts %.2f' % total) Do I have to raise a PEP to get this stupid language changed so that it dynamically recognises what I want it to do and ac

Re: Error Testing

2013-10-31 Thread Mark Lawrence
On 30/10/2013 21:43, Albert van der Horst wrote: FORTRAN used = and that was a mistake caused by the language being hacked together haphazardly. Groetjes Albert Yes, just imagine the massive amount of research that they had to go on, given that Alan Turing had written *THE* paper some 20 ye

Re: Python wart

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 12:53 PM, Chris Angelico wrote: > orig_print = print > def print(fmt, *args, **kwargs): > orig_print(fmt%args, **kwargs) PS. To be courteous to subsequent developers, you might want to instead leave print as it is, and create your own printf: def printf(fmt, *args, **k

Python wart

2013-10-31 Thread Mark Lawrence
Quite often I type this print('Total of accounts %.2f', total) when I meant to type this print('Total of accounts %.2f' % total) Do I have to raise a PEP to get this stupid language changed so that it dynamically recognises what I want it to do and acts accordingly? Yours most frustratedly.

Re: getpeername() on stdin?

2013-10-31 Thread Nobody
On Thu, 31 Oct 2013 12:16:23 -0400, Roy Smith wrote: > I want to do getpeername() on stdin. I know I can do this by wrapping a > socket object around stdin, with > > s = socket.fromfd(sys.stdin.fileno(), family, type) > > but that requires that I know what the family and type are. What I want

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread alex23
On 31/10/2013 2:14 AM, jonas.thornv...@gmail.com wrote: Well i ain't going to change Thanks for your honesty. As I use an actual standards-compliant newsreader, I can now safely killfile you and never have to notice your laziness again. -- https://mail.python.org/mailman/listinfo/python-lis

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread alex23
On 30/10/2013 8:19 PM, jonas.thornv...@gmail.com wrote: It is quite simple i could program it in a day... There is certainly nothing stopping you from doing so. Once finished, I recommend placing it on PyPI; if it reaches a critical mass of downloads that support your thesis that "it will sav

Re: Testing python command line apps -- Running from within the projects w/o installing

2013-10-31 Thread Tim Chase
On 2013-10-31 22:12, Göktuğ Kayaalp wrote: > My usual practise is to have two entry points to the program as > executable scripts. When I create stand-alone command-line scripts that take arguments, usually they're akin to version-control tools, so I have the form scriptname.py [--global-opts]

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-31 Thread Bernhard Schornak
Skybuck Flying wrote: >> Because it's logical. > > " > What is logical? > " > > To put the exit condition at the bottom is logical. As "logical" as to put it anywhere else inside the loop body. As long as we write code on machine language level, we are asked to choose the most efficient inst

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-31 Thread Bernhard Schornak
wolfgang kern wrote: > Bernhard Schornak replied to a "Flying-Bucket-post": > > Methink we all know about the often not-so-logical ideas from > Buck, they merely come from an abstracted view and are far away > from todays hardware given opportunities. > > OTOH, I sometimes got to think about his

Re: Testing python command line apps -- Running from within the projects w/o installing

2013-10-31 Thread Ben Finney
Göktuğ Kayaalp writes: > I'm using python to write command line apps from time to time. I > wonder *what is the conventional way to test-run these apps from > within the project itself, while developing, without installing*. As with making any application testable: Make small functions that do o

Re: "Backward"-Iterator - Beginners question

2013-10-31 Thread Dan Stromberg
On Thu, Oct 31, 2013 at 2:29 PM, Ulrich Goebel wrote: > Hallo, > > I'm locking for an "iterator" type with not only the .next() method, but > with a .previous(), .first() and .last() method, so that I can through it > from the beginning or from the end, and in both directions, even > alternately

Re: Try-except for flow control in reading Sqlite

2013-10-31 Thread Victor Hooi
Hi, You're right, if the databse doesn't exist, the sqlite3 library will simply create it. Hmm, in that case, what is the Pythonic way to handle this then? If the database is new, then it won't have the table I need, and it will return something like: sqlite3.OperationalError: no such tab

Re: Error Testing

2013-10-31 Thread Denis McMahon
On Thu, 31 Oct 2013 10:56:12 -0700, rusi wrote: > On Thursday, October 31, 2013 11:20:52 PM UTC+5:30, Denis McMahon wrote: >> On Thu, 31 Oct 2013 09:05:04 -0700, rusi wrote: >> > If I say: "My uncle knows more about flying planes than the Wright >> > brothers" am I disrespecting the Wright brothe

Re: "Backward"-Iterator - Beginners question

2013-10-31 Thread Terry Reedy
On 10/31/2013 5:29 PM, Ulrich Goebel wrote: I'm locking for an "iterator" type with not only the .next() method, but with a .previous(), .first() and .last() method, so that I can through it from the beginning or from the end, and in both directions, even alternately (for example two steps forwa

Re: "Backward"-Iterator - Beginners question

2013-10-31 Thread Bernd Nawothnig
On 2013-10-31, Ulrich Goebel wrote: > I'm locking for an "iterator" type with not only the .next() method, but > with a .previous(), .first() and .last() method, so that I can through > it from the beginning or from the end, and in both directions, even > alternately (for example two steps forwa

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Nick the Gr33k
Στις 31/10/2013 9:22 μμ, ο/η ru...@yahoo.com έγραψε: You set the value of 'downloads' to a list: downloads = [] if data: for torrent in data: downloads.append( torrent ) and when you use 'downloads', use have: INSERT INTO visitors (..

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Nick the Gr33k
Στις 31/10/2013 9:22 μμ, ο/η ru...@yahoo.com έγραψε: You set the value of 'downloads' to a list: downloads = [] if data: for torrent in data: downloads.append( torrent ) and when you use 'downloads', use have: INSERT INTO visitors (..

Re: personal library

2013-10-31 Thread patrick vrijlandt
Chris Angelico wrote: > On Thu, Oct 31, 2013 at 7:19 AM, Tim Delaney > But yeah. Either git or hg will serve you well, and Bazaar (bzr) also > has its advocates. Getting to know all three (or at least git/hg) to > at least some extent will serve you well - at least be comfortable > enough with the

"Backward"-Iterator - Beginners question

2013-10-31 Thread Ulrich Goebel
Hallo, I'm locking for an "iterator" type with not only the .next() method, but with a .previous(), .first() and .last() method, so that I can through it from the beginning or from the end, and in both directions, even alternately (for example two steps forward, one backward, two steps forwar

Re: Error Testing

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 4:56 AM, rusi wrote: > On Thursday, October 31, 2013 11:20:52 PM UTC+5:30, Denis McMahon wrote: >> On Thu, 31 Oct 2013 09:05:04 -0700, rusi wrote: >> > If I say: "My uncle knows more about flying planes than >> > the Wright brothers" am I disrespecting the Wright brothers??

Testing python command line apps -- Running from within the projects w/o installing

2013-10-31 Thread Göktuğ Kayaalp
Hi all, I'm using python to write command line apps from time to time. I wonder *what is the conventional way to test-run these apps from within the project itself, while developing, without installing*. My usual practise is to have two entry points to the program as executable scripts. I usuall

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread rurpy
On 10/31/2013 03:24 AM, Nick the Gr33k wrote: >[...] > # find out if visitor has downloaded torrents in the past > cur.execute('''SELECT torrent FROM files WHERE host = %s''', host ) > data = cur.fetchall() > > downloads = [] > if data: > for torrent in data:

Re: How to get final URL after redirection

2013-10-31 Thread Roy Smith
On Oct 31, 2013, at 2:43 PM, Joel Goldstick wrote: >> The "normal" way a redirect is done is to return a 301 (or 302) status code, >> and include a Location: line in the HTTP response headers. If that was the >> case, you would just do a GET on the url with a library like requests and >> exami

Re: How to get final URL after redirection

2013-10-31 Thread Joel Goldstick
On Thu, Oct 31, 2013 at 2:33 PM, Roy Smith wrote: > On Thursday, October 31, 2013 2:10:35 PM UTC-4, nishant bhakta wrote: > >> I was only giving an example as bitly, actually i need to proceed with >> "http://www.mysmartprice.com/out/sendtostore.php?id=107120529&top_category=electronics&store=ama

Re: How to get final URL after redirection

2013-10-31 Thread Roy Smith
On Thursday, October 31, 2013 2:10:35 PM UTC-4, nishant bhakta wrote: > I was only giving an example as bitly, actually i need to proceed with > "http://www.mysmartprice.com/out/sendtostore.php?id=107120529&top_category=electronics&store=amazon&mspid=51889&category=computer&rk=30"; > this is th

Re: How to get final URL after redirection

2013-10-31 Thread nishant bhakta
> There is a python module for interacting with it: > > https://github.com/bitly/bitly-api-python > > > > Bye, Andreas I was only giving an example as bitly, actually i need to proceed with "http://www.mysmartprice.com/out/sendtostore.php?id=107120529&top_category=electronics&store=amazon&msp

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Christian Gollwitzer
Am 31.10.13 17:49, schrieb Nick the Gr33k: Στις 31/10/2013 1:19 μμ, ο/η Nick the Gr33k έγραψε: someone please that is aware of what's wrong? Your attitude. -- https://mail.python.org/mailman/listinfo/python-list

Re: Error Testing

2013-10-31 Thread rusi
On Thursday, October 31, 2013 11:20:52 PM UTC+5:30, Denis McMahon wrote: > On Thu, 31 Oct 2013 09:05:04 -0700, rusi wrote: > > If I say: "My uncle knows more about flying planes than > > the Wright brothers" am I disrespecting the Wright brothers?? > No, but that's not what you said. > What you s

Re: How to get final URL after redirection

2013-10-31 Thread Andreas Perstinger
nishant bhakta wrote: >I have a link that will redirect to any-other link and i have to work >with that final link. For example if i have a link "www.bit.ly/2V6CFi" >that will redirect to "www.google.com". Here i want that i take >"www.bit.ly/2V6CFi" and find the final redirect link and append >"

Re: Error Testing

2013-10-31 Thread Denis McMahon
On Thu, 31 Oct 2013 09:05:04 -0700, rusi wrote: > On Thursday, October 31, 2013 8:50:27 PM UTC+5:30, Neil Cerutti wrote: >> wrote: >> > This suggests that Pascal went against established practice. This is >> > false. FORTRAN used = and that was a mistake caused by the language >> > being hacked t

Re: how to extract page-URL using BeautifulSoup

2013-10-31 Thread MRAB
On 31/10/2013 15:59, bhaktanish...@gmail.com wrote: I want to extract the page-url. for example: if i have this code import urllib2 from bs4 import BeautifulSoup link = "http://www.google.com"; page = urllib2.urlopen(link).read() soup = BeautifulSoup(page) then i can extract title of page by:

Re: Error Testing

2013-10-31 Thread Neil Cerutti
On 2013-10-31, rusi wrote: > On Thursday, October 31, 2013 8:50:27 PM UTC+5:30, Neil Cerutti wrote: >> wrote: >> > This suggests that Pascal went against established practice. >> > This is false. FORTRAN used = and that was a mistake caused by >> > the language being hacked together haphazardly. >

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Nick the Gr33k
Στις 31/10/2013 1:19 μμ, ο/η Nick the Gr33k έγραψε: Στις 31/10/2013 11:32 πμ, ο/η Nick the Gr33k έγραψε: The error seen form error log is: [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93] [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93] Traceback (most recent call last): [Thu

How to get final URL after redirection

2013-10-31 Thread nishant bhakta
I have a link that will redirect to any-other link and i have to work with that final link. For example if i have a link "www.bit.ly/2V6CFi" that will redirect to "www.google.com". Here i want that i take "www.bit.ly/2V6CFi" and find the final redirect link and append "#q=python" to that link an

getpeername() on stdin?

2013-10-31 Thread Roy Smith
I want to do getpeername() on stdin. I know I can do this by wrapping a socket object around stdin, with s = socket.fromfd(sys.stdin.fileno(), family, type) but that requires that I know what the family and type are. What I want to do is discover the family and type by looking at what getpee

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Skip Montanaro
> 1. How fast can Python do math calculations compared with other languages > such as Fortran and fast versions of Basic. I would have to believe that it > is much faster than Perl for doing math calculations. As others have indicated, a lot depends on the form of your calculations. There is a c

Re: Error Testing

2013-10-31 Thread rusi
On Thursday, October 31, 2013 8:50:27 PM UTC+5:30, Neil Cerutti wrote: > wrote: > > This suggests that Pascal went against established practice. > > This is false. FORTRAN used = and that was a mistake caused by > > the language being hacked together haphazardly. > Respectfully, the designers of FO

how to extract page-URL using BeautifulSoup

2013-10-31 Thread bhaktanishant
I want to extract the page-url. for example: if i have this code import urllib2 from bs4 import BeautifulSoup link = "http://www.google.com"; page = urllib2.urlopen(link).read() soup = BeautifulSoup(page) then i can extract title of page by: title = soup.title but i want to know that how to ext

Re: Error Testing

2013-10-31 Thread Skip Montanaro
On Thu, Oct 31, 2013 at 10:20 AM, Neil Cerutti wrote: > On 2013-10-30, Albert van der Horst > wrote: >> This suggests that Pascal went against established practice. >> This is false. FORTRAN used = and that was a mistake caused by >> the language being hacked together haphazardly. > > Respectfull

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread rusi
On Thursday, October 31, 2013 4:08:48 PM UTC+5:30, E.D.G. wrote: > Posted by E.D.G. October 31, 2013 > Hi Chris, >Thanks for the responses. Several of my questions were answered. >The calculation speed question just involves relatively > simple math such as multiplications and di

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread rusi
On Thursday, October 31, 2013 7:31:14 PM UTC+5:30, Mark Lawrence wrote: > On 31/10/2013 11:40, rusi wrote: > > Please treat python as a given -- like the sun, moon and taxes." > You missed the most obvious one, trolls :) :D Only that's not an element but a set -- trolls, nuts, dicks, philosopher

Re: Error Testing

2013-10-31 Thread Neil Cerutti
On 2013-10-30, Albert van der Horst wrote: > This suggests that Pascal went against established practice. > This is false. FORTRAN used = and that was a mistake caused by > the language being hacked together haphazardly. Respectfully, the designers of FORTRAN deserve more respect than that charac

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Robert Kern
On 2013-10-31 14:49, Chris Angelico wrote: On Fri, Nov 1, 2013 at 1:41 AM, Robert Kern wrote: On 2013-10-31 14:05, Chris Angelico wrote: On Fri, Nov 1, 2013 at 12:17 AM, Alain Ketterlin wrote: "E.D.G." writes: The calculation speed question just involves relatively simple math s

Re: tuple __repr__ non-ascii characters

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 1:59 AM, Yaşar Arabacı wrote: > Is there a better way to handle this problem? There is, but I don't know how easy it'll be. In Python 3, the repr of a tuple will show Unicode strings as Unicode. :) For what you're showing there, I'm not actually quite sure what's going on.

tuple __repr__ non-ascii characters

2013-10-31 Thread Yaşar Arabacı
Hi, while this: a = "yaşar" print a prints "yaşar" this: a = ("yaşar",) print a prints ('ya\xfear',) At first I tried decoding repr(a) with different encodings, but later I realised there is actually 4 charaters \, x, f and e in return value of repr. Therefore, I wrote this: def byte_repla

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Alain Ketterlin
Mark Lawrence writes: > On 31/10/2013 13:17, Alain Ketterlin wrote: >> "E.D.G." writes: >> >>>The calculation speed question just involves relatively simple >>> math such as multiplications and divisions and trig calculations such >>> as sin and tan etc. >> >> These are not "simple" comp

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 1:41 AM, Robert Kern wrote: > On 2013-10-31 14:05, Chris Angelico wrote: >> >> On Fri, Nov 1, 2013 at 12:17 AM, Alain Ketterlin >> wrote: >>> >>> "E.D.G." writes: >>> The calculation speed question just involves relatively simple math such as multiplicatio

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 1:18 AM, Alain Ketterlin wrote: > Well, sure, yes, I agree with you and hope they are left to the FP > engine (still, fp ops are often multi-cycle, but that's a minor point). > > But what I meant was: a (bytecode) interpreted program will always be > slower than a compiled p

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Robert Kern
On 2013-10-31 14:05, Chris Angelico wrote: On Fri, Nov 1, 2013 at 12:17 AM, Alain Ketterlin wrote: "E.D.G." writes: The calculation speed question just involves relatively simple math such as multiplications and divisions and trig calculations such as sin and tan etc. These are not

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Alain Ketterlin
Chris Angelico writes: > On Fri, Nov 1, 2013 at 12:17 AM, Alain Ketterlin > wrote: >> "E.D.G." writes: >> >>> The calculation speed question just involves relatively simple >>> math such as multiplications and divisions and trig calculations such >>> as sin and tan etc. >> >> These are no

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Mark Lawrence
On 31/10/2013 13:17, Alain Ketterlin wrote: "E.D.G." writes: The calculation speed question just involves relatively simple math such as multiplications and divisions and trig calculations such as sin and tan etc. These are not "simple" computations. Any compiled language (Fortran, C

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 12:17 AM, Alain Ketterlin wrote: > "E.D.G." writes: > >> The calculation speed question just involves relatively simple >> math such as multiplications and divisions and trig calculations such >> as sin and tan etc. > > These are not "simple" computations. > > Any com

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread Mark Lawrence
On 31/10/2013 11:40, rusi wrote: Please treat python as a given -- like the sun, moon and taxes." You missed the most obvious one, trolls :) -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Mark Lawrence
On 31/10/2013 10:38, E.D.G. wrote: Posted by E.D.G. October 31, 2013 Hi Chris, Thanks for the responses. Several of my questions were answered. The calculation speed question just involves relatively simple math such as multiplications and divisions and trig calculations such as

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Alain Ketterlin
"E.D.G." writes: > The calculation speed question just involves relatively simple > math such as multiplications and divisions and trig calculations such > as sin and tan etc. These are not "simple" computations. Any compiled language (Fortran, C, C++, typically) will probably go much fas

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Roy Smith
In article , "E.D.G." wrote: > 1. How fast can Python do math calculations compared with other languages > such as Fortran and fast versions of Basic. I would have to believe that it > is much faster than Perl for doing math calculations. Getting a handle on Python's execution speed is not

Re: Algorithm that makes maximum compression of completly diffused data.

2013-10-31 Thread rusi
On Thursday, October 31, 2013 3:00:24 AM UTC+5:30, Joshua Landau wrote: > What I'm confounded about is this list's inability to recognise a > troll when it slaps it vocally in the face. > This isn't like Nikos. There's no "troll vs. incompetent" debate to be > had. Its usually called "entertain

Re: trying to strip out non ascii.. or rather convert non ascii

2013-10-31 Thread Tim Chase
On 2013-10-30 19:28, Roy Smith wrote: > For example, it's reasonable to consider any vowel (or string of > vowels, for that matter) to be closer to another vowel than to a > consonant. A great example is the word, "bureaucrat". As far as > I'm concerned, it's spelled {b, vowels, r, vowels, c, r,

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread rusi
On Thursday, October 31, 2013 4:42:15 PM UTC+5:30, Antoon Pardon wrote: > Op 31-10-13 08:37, rusi schreef: > > 2. Antoon: I was a bit surprised at your siding with the indentation > > business. > > As an old-geezer programmer I can think of a number of reasons why, > > indentation=structure is a

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Chris “Kwpolska” Warrick
On Thu, Oct 31, 2013 at 11:38 AM, E.D.G. wrote: > Posted by E.D.G. October 31, 2013 no need to write that. > > Hi Chris, > > Thanks for the responses. Several of my questions were answered. > > The calculation speed question just involves relatively simple math > such as multiplicati

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Nick the Gr33k
Στις 31/10/2013 11:32 πμ, ο/η Nick the Gr33k έγραψε: The error seen form error log is: [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93] [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93] Traceback (most recent call last): [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93]

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread Antoon Pardon
Op 31-10-13 08:37, rusi schreef: > On Thursday, October 31, 2013 2:37:31 AM UTC+5:30, Antoon Pardon wrote: >> Op 30-10-13 21:52, Ned Batchelder schreef: >>> On 10/30/13 3:59 PM, Antoon Pardon wrote: Op 30-10-13 20:13, Jonas schreef: > No it isn't... > The programmers of the tools on ei

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread rusi
On Thursday, October 31, 2013 3:41:41 PM UTC+5:30, Mark Lawrence wrote: > On 31/10/2013 07:37, rusi wrote: > > If Mark had not been rude to Jonas and explained to him at a little more > > length, maybe he would not be assholing in full-blast. > What rubbish. The OP was asked repeatedly, first by

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread E.D.G.
Posted by E.D.G. October 31, 2013 Hi Chris, Thanks for the responses. Several of my questions were answered. The calculation speed question just involves relatively simple math such as multiplications and divisions and trig calculations such as sin and tan etc. Presently I am usin

Re: trying to strip out non ascii.. or rather convert non ascii

2013-10-31 Thread wxjmfauth
Le jeudi 31 octobre 2013 08:10:18 UTC+1, Steven D'Aprano a écrit : > On Wed, 30 Oct 2013 01:49:28 -0700, wxjmfauth wrote: > > > > >> The right solution to that is to treat it no differently from other > > >> fuzzy > > >> searches. A good search engine should be tolerant of spelling errors > >

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread Mark Lawrence
On 31/10/2013 07:37, rusi wrote: If Mark had not been rude to Jonas and explained to him at a little more length, maybe he would not be assholing in full-blast. What rubbish. The OP was asked repeatedly, first by Dave Angel and then by myself, not to post double spaced crap. He simply ref

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Chris “Kwpolska” Warrick
On Thu, Oct 31, 2013 at 10:31 AM, E.D.G. wrote: > Posted by E.D.G. on October 31, 2013 > > The following are several relatively basic questions regarding > Python's capabilities. I am not presently using it myself. At the moment a > number of people including myself are comparing it with o

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Nick the Gr33k
The error seen form error log is: [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93] [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93] Traceback (most recent call last): [Thu Oct 31 09:29:35 2013] [error] [client 46.198.103.93] File "/home/nikos/public_html/cgi-bin/metrites.py"

Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread E.D.G.
Posted by E.D.G. on October 31, 2013 The following are several relatively basic questions regarding Python's capabilities. I am not presently using it myself. At the moment a number of people including myself are comparing it with other programs such as XBasic for possible use. 1. H

Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Nick the Gr33k
# if first time for webpage; create new record( primary key is automatic, hit is defaulted ), if page exists then update record cur.execute('''INSERT INTO counters (url) VALUES (%s) ON DUPLICATE KEY UPDATE hits = hits + 1''', page ) # get the primary key val

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-31 Thread Steven D'Aprano
On Wed, 30 Oct 2013 19:48:55 -0700, rurpy wrote: > On 10/30/2013 04:22 AM, Steven D'Aprano wrote: >> Skybuck's experience at programming *is relevant* to the question of >> whether or not he understands what he is talking about. > > No. You claimed his proposition "made no sense" based on your

Re: First day beginner to python, add to counter after nested loop

2013-10-31 Thread rusi
On Thursday, October 31, 2013 2:37:31 AM UTC+5:30, Antoon Pardon wrote: > Op 30-10-13 21:52, Ned Batchelder schreef: > > On 10/30/13 3:59 PM, Antoon Pardon wrote: > >> Op 30-10-13 20:13, Jonas schreef: > >>> No it isn't... > >>> The programmers of the tools on either of side will have to adapt. > >

Re: trying to strip out non ascii.. or rather convert non ascii

2013-10-31 Thread Mark Lawrence
On 31/10/2013 07:10, Steven D'Aprano wrote: On Wed, 30 Oct 2013 01:49:28 -0700, wxjmfauth wrote: The right solution to that is to treat it no differently from other fuzzy searches. A good search engine should be tolerant of spelling errors and alternative spellings for any letter, not just thos

Re: trying to strip out non ascii.. or rather convert non ascii

2013-10-31 Thread Steven D'Aprano
On Wed, 30 Oct 2013 01:49:28 -0700, wxjmfauth wrote: >> The right solution to that is to treat it no differently from other >> fuzzy >> searches. A good search engine should be tolerant of spelling errors >> and >> alternative spellings for any letter, not just those with diacritics. >> Ideally, a