Re: Bitwise Operations

2013-07-30 Thread Ulrich Eckhardt
Am 30.07.2013 01:34, schrieb Devyn Collier Johnson: Typing "101 & 010" or "x = (int(101, 2) & int(010, 2))" only gives errors. What errors? Check out Eric Raymond's essay on asking smart questions, it's a real eye-opener! ;) That said, use "0b" as prefix for binary number literals (0b1000 is

Modeling life on Earth –- an object-oriented (Python?) challenge

2013-07-30 Thread quartese
Dear List, I have to start this email by saying that I have recently attended EuroPython in Florence, and it was the best and better organized conference I have ever attended in 14 years of international meetings. I apologize if this is off topic, but I read in the list's description that “[p]

How to parse the starting and ending of a loop statements in python

2013-07-30 Thread karthik sridhar
My objective is to find the line numbers of the start and the end of a loop statement in python. Example scenario #A.py Line1: a=0 Line2: while a<5: Line3:print a Line4:a=a+1 Desired output: Start of a loop Line2 End of a loop Line4 Current p

Re: Prime number generator

2013-07-30 Thread Albert van der Horst
In article , Chris Angelico wrote: >And now for something completely different. > >I knocked together a prime number generator, just for the fun of it, >that works like a Sieve of Eratosthenes but unbounded. It keeps track >of all known primes and the "next composite" that it will produce - >for

Re: Modeling life on Earth –- an object-oriented (Python?) challenge

2013-07-30 Thread David Hutto
Never used pascal, and python might not be the fastest way to implement a program such as this. In a previous discussion, this was taken place by someone using a predator prey brain class.. The simulation will vary, until a full refinement of forecast is above a certainty percentage level. Visua

Re: collections.Counter surprisingly slow

2013-07-30 Thread Serhiy Storchaka
29.07.13 14:49, Joshua Landau написав(ла): I find it hard to agree that counter should be optimised for the unique-data case, as surely it's much more oft used when there's a point to counting? Different methods are faster for different data. LBYL approach is best for the mostly unique data ca

Re: import syntax

2013-07-30 Thread Neil Cerutti
On 2013-07-29, Joshua Landau wrote: > Sure, just as one light is no brighter or dimmer than another > when disregarding luminosity. > > As people have said, it improves diffs as well. It flows > quicker into the "from module import things" form (which I oft > prefer), too. > > When asking these qu

Python descriptor protocol (for more or less structured data)

2013-07-30 Thread CWr
Hi together, Some years ago I started a small WSGI project at my university. Since then the project was grown up every year. Some classes have more than 600 lines of code with (incl. boiler-plates mostly in descriptors/properties). Many of these properties are similar or have depencies among t

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Tim
On Monday, July 29, 2013 7:52:36 PM UTC-4, Chris Angelico wrote: > On Mon, Jul 29, 2013 at 8:16 PM, Tim wrote: > > My intent is to pass it a directory name or path and if it exists, use > > shutil.rmtree to remove whatever is there (if it isn't a directory, try to > > unlink it); then use os.make

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote: > hmm, now that you mention it, this is executing on a remote box with access > to the same file system my local calling program is on. That is, there is a > local call to an intermediate script that connects to a socket on the remote > where the abov

Unexpected results comparing float to Fraction

2013-07-30 Thread Oscar Benjamin
On 29 July 2013 17:09, MRAB wrote: > On 29/07/2013 16:43, Steven D'Aprano wrote: >> >> Comparing floats to Fractions gives unexpected results: You may not have expected these results but as someone who regularly uses the fractions module I do expect them. >> # Python 3.3 >> py> from fractions im

Re: RE Module Performance

2013-07-30 Thread wxjmfauth
Le dimanche 28 juillet 2013 05:53:22 UTC+2, Ian a écrit : > On Sat, Jul 27, 2013 at 12:21 PM, wrote: > > > Back to utf. utfs are not only elements of a unique set of encoded > > > code points. They have an interesting feature. Each "utf chunk" > > > holds intrisically the character (in fact th

Re: PEP8 79 char max

2013-07-30 Thread Skip Montanaro
> In that gauge I would exclude indentation (you don't count the > number of characters the margin takes) I don't think anyone reads the margins. :-) That said, I agree that code and prose are fundamentally different beasts. Still, when reading either and you get to the end of the line, you

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Steven D'Aprano
On Tue, 30 Jul 2013 14:27:10 +0100, Chris Angelico wrote: > for delay in 100,300,600,1000,3000,5000,1: > if not os.path.exists(directory): break > sleep(delay) > > That'll sleep a maximum of 20 seconds, tune as required. Actually, that will sleep a maximum of 5.55 hours, and a minimum of

Re: Python descriptor protocol (for more or less structured data)

2013-07-30 Thread Peter Otten
CWr wrote: > Some years ago I started a small WSGI project at my university. Since then > the project was grown up every year. Some classes have more than 600 lines > of code with (incl. boiler-plates mostly in descriptors/properties). > > Many of these properties are similar or have depencies am

Re: RE Module Performance

2013-07-30 Thread Antoon Pardon
Op 30-07-13 16:01, wxjmfa...@gmail.com schreef: > > I am pretty sure that once you have typed your 127504 > ascii characters, you are very happy the buffer of your > editor does not waste time in reencoding the buffer as > soon as you enter an €, the 125505th char. Sorry, I wanted > to say z inste

Re: RE Module Performance

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 3:01 PM, wrote: > I am pretty sure that once you have typed your 127504 > ascii characters, you are very happy the buffer of your > editor does not waste time in reencoding the buffer as > soon as you enter an €, the 125505th char. Sorry, I wanted > to say z instead of eur

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 3:07 PM, Steven D'Aprano wrote: > On Tue, 30 Jul 2013 14:27:10 +0100, Chris Angelico wrote: > >> for delay in 100,300,600,1000,3000,5000,1: >> if not os.path.exists(directory): break >> sleep(delay) >> >> That'll sleep a maximum of 20 seconds, tune as required. > >

Python script help

2013-07-30 Thread cool1574
Hello, I am looking for a script that will be able to search an online document (by giving the script the URL) and find all the downloadable links in the document and then download them automatically. I appreciate your help, Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP8 79 char max

2013-07-30 Thread Neil Cerutti
On 2013-07-30, Skip Montanaro wrote: >> In that gauge I would exclude indentation (you don't count the >> number of characters the margin takes) > > I don't think anyone reads the margins. :-) > > That said, I agree that code and prose are fundamentally > different beasts. Still, when readin

Re: importing modules

2013-07-30 Thread Dave Angel
On 07/29/2013 05:57 PM, syed khalid wrote: I am attempting to import modules from Shogun to python from a non-standard python directory ie from my /home/xxx directory. is there a way on ubuntu to selectively some modules, scripts, data from one directory and others modules, scripts from another

Re: Python script help

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 3:49 PM, wrote: > Hello, I am looking for a script that will be able to search an online > document (by giving the script the URL) and find all the downloadable links > in the document and then download them automatically. > I appreciate your help, > Thank you. baseurl

Re: PEP8 79 char max

2013-07-30 Thread Skip Montanaro
> So if everyone basically follows PEP8 we all benefit from playing by > the same game rules, as it were. (I think I'm agreeing with you, but nonetheless, I will forge ahead.) To the extent that 80-column window widths have been common for so long, PEP 8 or not (and Python or not), there is a ton

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Tim
On Tuesday, July 30, 2013 9:27:10 AM UTC-4, Chris Angelico wrote: > On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote: > > hmm, now that you mention it, this is executing on a remote box with access > > to the same file system my local calling program is on. That is, there is a > > local call to an inte

Re: Python script help

2013-07-30 Thread cool1574
I know but I think using Python in this situation is good...is that the full script? -- http://mail.python.org/mailman/listinfo/python-list

Share Code: Laptop Lid State

2013-07-30 Thread Devyn Collier Johnson
Aloha everyone! I attached a script that I thought I could share with everyone for your help. This Python3 script only works on Unix systems. It prints the current state of the lid. This can be used to make a script that performs some action when the lid is closed or open. The script is li

Re: Python script help

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 4:49 PM, wrote: > I know but I think using Python in this situation is good...is that the full > script? That script just drops out to the system and lets wget do it. So don't bother with it. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Share Code: Laptop Lid State

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 3:06 PM, Devyn Collier Johnson wrote: > Aloha everyone! > >I attached a script that I thought I could share with everyone for your > help. This Python3 script only works on Unix systems. It prints the current > state of the lid. This can be used to make a script that pe

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 4:37 PM, Tim wrote: > Argg, this isn't the first time I've had troubles with the file system. This > is FreeBSD and NFS. I will code up a progressive delay as you mentioned (with > Steve's correction). I've used several different networked file systems, including NetBIOS

Re: RE Module Performance

2013-07-30 Thread MRAB
On 30/07/2013 15:38, Antoon Pardon wrote: Op 30-07-13 16:01, wxjmfa...@gmail.com schreef: I am pretty sure that once you have typed your 127504 ascii characters, you are very happy the buffer of your editor does not waste time in reencoding the buffer as soon as you enter an €, the 125505th cha

Re: Python script help

2013-07-30 Thread cool1574
** urlib, urlib2 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script help

2013-07-30 Thread Ulrich Eckhardt
Am 30.07.2013 16:49, schrieb cool1...@gmail.com: Hello, I am looking for a script that will be able to search an online document (by giving the script the URL) and find all the downloadable links in the document and then download them automatically. Well, that's actually pretty simple. Using th

Re: Python script help

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 5:10 PM, wrote: > What if I want to use only Python? is that possible? using lib and lib2? > -- > http://mail.python.org/mailman/listinfo/python-list Sure, anything's possible. And a lot easier if you quote context in your posts. But why do it? wget is exactly what you ne

Re: Python script help

2013-07-30 Thread cool1574
What if I want to use only Python? is that possible? using lib and lib2? -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-30 Thread Antoon Pardon
Op 30-07-13 18:13, MRAB schreef: On 30/07/2013 15:38, Antoon Pardon wrote: Op 30-07-13 16:01, wxjmfa...@gmail.com schreef: I am pretty sure that once you have typed your 127504 ascii characters, you are very happy the buffer of your editor does not waste time in reencoding the buffer as soon a

Re: PEP8 79 char max

2013-07-30 Thread Joshua Landau
On 30 July 2013 16:44, Skip Montanaro wrote: > > So if everyone basically follows PEP8 we all benefit from playing by > > the same game rules, as it were. > > (I think I'm agreeing with you, but nonetheless, I will forge ahead.) > > To the extent that 80-column window widths have been common for

Re: Python script help

2013-07-30 Thread Vincent Vande Vyvre
Le 30/07/2013 18:10, cool1...@gmail.com a écrit : What if I want to use only Python? is that possible? using lib and lib2? Have a look here: http://bazaar.launchpad.net/~vincent-vandevyvre/qarte/trunk/view/head:/parsers.py This script get a web page and parse it to find downloadable objects.

Re: PEP8 79 char max

2013-07-30 Thread Vito De Tullio
Ed Leafe wrote: > I had read about a developer who switched to using proportional fonts for > coding, and somewhat skeptically, tried it out. After a day or so it > stopped looking strange, and after a week it seemed so much easier to > read. By my (limited) experience with proportional fonts, th

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Göktuğ Kayaalp
On Jul 30, 2013 3:29 PM, "Chris Angelico" wrote: > > On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote: > > hmm, now that you mention it, this is executing on a remote box with access to the same file system my local calling program is on. That is, there is a local call to an intermediate script that co

Re: RE Module Performance

2013-07-30 Thread MRAB
On 30/07/2013 17:39, Antoon Pardon wrote: Op 30-07-13 18:13, MRAB schreef: On 30/07/2013 15:38, Antoon Pardon wrote: Op 30-07-13 16:01, wxjmfa...@gmail.com schreef: I am pretty sure that once you have typed your 127504 ascii characters, you are very happy the buffer of your editor does not wa

Re: RE Module Performance

2013-07-30 Thread Tim Delaney
On 31 July 2013 00:01, wrote: > > I am pretty sure that once you have typed your 127504 > ascii characters, you are very happy the buffer of your > editor does not waste time in reencoding the buffer as > soon as you enter an €, the 125505th char. Sorry, I wanted > to say z instead of euro, just

Re: RE Module Performance

2013-07-30 Thread Joshua Landau
On 30 July 2013 17:39, Antoon Pardon wrote: > Op 30-07-13 18:13, MRAB schreef: > > On 30/07/2013 15:38, Antoon Pardon wrote: >> >>> Op 30-07-13 16:01, wxjmfa...@gmail.com schreef: >>> I am pretty sure that once you have typed your 127504 ascii characters, you are very happy the bu

Re: PEP8 79 char max

2013-07-30 Thread Joshua Landau
On 30 July 2013 18:08, Vito De Tullio wrote: > Ed Leafe wrote: > > > I had read about a developer who switched to using proportional fonts for > > coding, and somewhat skeptically, tried it out. After a day or so it > > stopped looking strange, and after a week it seemed so much easier to > > rea

Re: PEP8 79 char max

2013-07-30 Thread Grant Edwards
On 2013-07-30, Joshua Landau wrote: > On 30 July 2013 18:08, Vito De Tullio wrote: > >> Ed Leafe wrote: >> >> > I had read about a developer who switched to using proportional fonts for >> > coding, and somewhat skeptically, tried it out. After a day or so it >> > stopped looking strange, and aft

Re: PEP8 79 char max

2013-07-30 Thread Vito De Tullio
Joshua Landau wrote: >> By my (limited) experience with proportional fonts, they can be useful >> only with something like elastic tabstops[0]. But, as a general rule, I >> simply found more "squared" to just use a fixed-width font. > Not if you give up on the whole "aligning" thing. and this i

Re: Share Code: Laptop Lid State

2013-07-30 Thread Ian Kelly
On Jul 30, 2013 10:06 AM, "Chris Angelico" wrote: > > On Tue, Jul 30, 2013 at 3:06 PM, Devyn Collier Johnson > wrote: > > Aloha everyone! > > > >I attached a script that I thought I could share with everyone for your > > help. This Python3 script only works on Unix systems. It prints the curr

Re: RE Module Performance

2013-07-30 Thread Antoon Pardon
Op 30-07-13 19:14, MRAB schreef: On 30/07/2013 17:39, Antoon Pardon wrote: Op 30-07-13 18:13, MRAB schreef: On 30/07/2013 15:38, Antoon Pardon wrote: Op 30-07-13 16:01, wxjmfa...@gmail.com schreef: I am pretty sure that once you have typed your 127504 ascii characters, you are very happy the

OrderedEnum examples

2013-07-30 Thread Bas van der Wulp
Using the enum34 0.9.13 package from PyPi in Python 2.7.3, the examples for OrderedEnum seem to be broken. The example in the package documentation reads: class OrderedEnum(Enum): def __ge__(self, other): if self.__class__ is other.__class__: return self._value >= other.

Announcing Picat, the next scripting language after Python

2013-07-30 Thread neng . zhou
We are pleased to announce the launch of the Picat system on picat-lang.org. Picat is a simple, and yet powerful, logic-based multi-paradigm programming language aimed for general-purpose applications. Picat is a rule-based language, in which predicates, functions, and actors are de

Re: OrderedEnum examples

2013-07-30 Thread Ian Kelly
On Tue, Jul 30, 2013 at 12:18 PM, Bas van der Wulp wrote: > Replacing each occurrence of self._value with either self._value_ or > self.value in the examples seems to make them work as expected. > > Are both examples incorrect, or not intended to work in Python 2.x? The _value attribute was renam

Re: OrderedEnum examples

2013-07-30 Thread Ethan Furman
On 07/30/2013 11:18 AM, Bas van der Wulp wrote: Using the enum34 0.9.13 package from PyPi in Python 2.7.3, the examples for OrderedEnum seem to be broken. Thanks for catching that, I'll get it fixed asap. Also, in the example in the Python 3.4 library documentation (section 8.17.2) has the

Re: RE Module Performance

2013-07-30 Thread wxjmfauth
Matable, immutable, copyint + xxx, bufferint, O(n) Yes, but conceptualy the reencoding happen sometime, somewhere. The internal "ucs-2" will never automagically be transformed into "ucs-4" (eg). >>> timeit.timeit("'a'*1 +'€'") 7.087220684719967 >>> timeit.timeit("'a'*1 +'z'") 1.568521

Re: OrderedEnum examples

2013-07-30 Thread Ethan Furman
On 07/30/2013 11:38 AM, Ethan Furman wrote: Thanks for catching that, I'll get it fixed asap. Latest code is on PyPI. -- ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: OrderedEnum examples

2013-07-30 Thread Ethan Furman
On 07/30/2013 11:58 AM, Ian Kelly wrote: On Tue, Jul 30, 2013 at 12:18 PM, Bas van der Wulp wrote: Replacing each occurrence of self._value with either self._value_ or self.value in the examples seems to make them work as expected. Are both examples incorrect, or not intended to work in Python

Re: embedding: how to create an "idle" handler to allow user to kill scripts?

2013-07-30 Thread David M. Cotter
Okay, i'm really surprised nobody knows how to do this. and frankly i'm amazed at the utter lack of documentation. but i've figured it out, and it's all working beautifully. if you want the code, go here: http://karaoke.kjams.com/wiki/Python -- http://mail.python.org/mailman/listinfo/python-l

Re: RE Module Performance

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 8:09 PM, wrote: > Matable, immutable, copyint + xxx, bufferint, O(n) > Yes, but conceptualy the reencoding happen sometime, somewhere. > The internal "ucs-2" will never automagically be transformed > into "ucs-4" (eg). But probably not on the entire document. With ev

Re: how to package embedded python?

2013-07-30 Thread David M. Cotter
yes, i've looked there, and all over google. i'm quite expert at embedding at this point. however nowhere i have looked has had instructions for "this this is how you package up your .exe with all the necessary python modules necessary to actually run on a user's system that does not have pyth

binary key in dictionary

2013-07-30 Thread cerr
Hi, In my application I have followingf lines: print curr_mac print hexlify(buf) binmac = unhexlify(curr_mac) tmpgndict[binmac] += buf curr_mac being a 3Byte MAVC address in ASCII and I want to populate a dictionary where the value(b

Re: binary key in dictionary

2013-07-30 Thread Gary Herron
On 07/30/2013 01:29 PM, cerr wrote: Hi, In my application I have followingf lines: print curr_mac print hexlify(buf) binmac = unhexlify(curr_mac) tmpgndict[binmac] += buf curr_mac being a 3Byte MAVC address in ASCII and I want t

Re: RE Module Performance

2013-07-30 Thread Terry Reedy
On 7/30/2013 1:40 PM, Joshua Landau wrote: Additionally, who says a language couldn't use, say, B-Trees for all of its list-like types, including strings? Tk apparently uses a B-tree in its text widget. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

PyPy3 2.1 beta 1 released

2013-07-30 Thread Philip Jenvey
PyPy3 2.1 beta 1 We're pleased to announce the first beta of the upcoming 2.1 release of PyPy3. This is the first release of PyPy which targets Python 3 (3.2.3) compatibility. We would like to thank all of the people who donated_ to the `py3k proposal`_ for suppo

Re: Newbie: Python 3 and web applications?

2013-07-30 Thread Wayne Werner
On Fri, 26 Jul 2013, Rui Maciel wrote: I'm currently learning Python, and I've been focusing on Python3. To try to kill two birds with one stone, I would also like to learn the basics of writing small web applications. These web applications don't need to do much more than provide an interface

Re: PEP8 79 char max

2013-07-30 Thread Cameron Simpson
On 30Jul2013 01:41, Rhodri James wrote: | On Tue, 30 Jul 2013 01:11:18 +0100, Joshua Landau wrote: | >On 30 July 2013 00:08, Rhodri James wrote: | >>I'm working on some shonky C code at the moment that inconsistent | >>indentation and very long lines. [...] Have you tried the indent(1) command?

Re: Python script help

2013-07-30 Thread Cameron Simpson
On 30Jul2013 09:12, cool1...@gmail.com wrote: | ** urlib, urlib2 Sure. And I'd use BeautifulSoup to do the parse. You'll need to fetch that. So: urllib[2] to fetch the document and BS to parse it for links, then urllib[2] to fetch the links you want. http://www.crummy.com/software/BeautifulSoup/

Re: PEP8 79 char max

2013-07-30 Thread Cameron Simpson
On 29Jul2013 16:24, Devyn Collier Johnson wrote: | So, I can have a script with large lines and not negatively | influence performance on systems that do not use punch cards? Well, running anything will negatively impact the performance of a system for others...o Please think about what CPython

Re: OrderedEnum examples

2013-07-30 Thread Bas van der Wulp
On 30-7-2013 21:30, Ethan Furman wrote: On 07/30/2013 11:58 AM, Ian Kelly wrote: On Tue, Jul 30, 2013 at 12:18 PM, Bas van der Wulp wrote: Replacing each occurrence of self._value with either self._value_ or self.value in the examples seems to make them work as expected. Are both examples inc

Re: Python testing tools

2013-07-30 Thread cutems93
On Tuesday, July 23, 2013 3:51:00 PM UTC-7, Ben Finney wrote: > cutems93 writes: > > > > > On Saturday, July 20, 2013 1:11:12 AM UTC-7, Ben Finney wrote: > > > > You will find these discussed at the Python Testing Tools Taxonomy > > > > http://wiki.python.org/moin/PythonTestingToolsTaxonomy>.

Re: how to package embedded python?

2013-07-30 Thread CM
On Tuesday, July 30, 2013 4:23:06 PM UTC-4, David M. Cotter wrote: > yes, i've looked there, and all over google. i'm quite expert at embedding > at this point. > > > > however nowhere i have looked has had instructions for "this this is how you > package up your .exe with all the necessary p

Re: Share Code: Laptop Lid State

2013-07-30 Thread Devyn Collier Johnson
On 07/30/2013 12:00 PM, Chris Angelico wrote: On Tue, Jul 30, 2013 at 3:06 PM, Devyn Collier Johnson wrote: Aloha everyone! I attached a script that I thought I could share with everyone for your help. This Python3 script only works on Unix systems. It prints the current state of the lid.

Re: RE Module Performance

2013-07-30 Thread Neil Hodgson
MRAB: The disadvantage there is that when you move the cursor you must move characters around. For example, what if the cursor was at the start and you wanted to move it to the end? Also, when the gap has been filled, you need to make a new one. The normal technique is to only move the gap

Re: RE Module Performance

2013-07-30 Thread Michael Torrie
On 07/30/2013 12:19 PM, Antoon Pardon wrote: > So? Why are you making this a point of discussion? I was not aware that > the pro and cons of various editor buffer implemantations was relevant > to the point I was trying to make. I for one found it very interesting. In fact this thread caused me t

Re: RE Module Performance

2013-07-30 Thread Michael Torrie
On 07/30/2013 01:09 PM, wxjmfa...@gmail.com wrote: > Matable, immutable, copyint + xxx, bufferint, O(n) > Yes, but conceptualy the reencoding happen sometime, somewhere. > The internal "ucs-2" will never automagically be transformed > into "ucs-4" (eg). So what major python project are you wo

Re: Prime number generator

2013-07-30 Thread bryanjugglercryptographer
Chris Angelico wrote: > Bas wrote: > > Still trying to figure out your algorithm ... > > It's pretty simple. (That's a bad start, I know!) Like the Sieve of > Eratosthenes, it locates prime numbers, then deems every multiple of > them to be composite. Unlike the classic sieve, it does the "deem" >

Re: Python script help

2013-07-30 Thread Denis McMahon
On Tue, 30 Jul 2013 07:49:04 -0700, cool1574 wrote: > Hello, I am looking for a script that will be able to search an online > document (by giving the script the URL) and find all the downloadable > links in the document and then download them automatically. > I appreciate your help, Why use Pyth

Re: Best python web framework to build university/academic website

2013-07-30 Thread bryanjugglercryptographer
b.kris...@gmail.com wrote: > I got a chance to build an university website, within very short period of > time. > I know web2py, little bit of Django, so please suggest me the best to build > rapidly. Web2py rocks like nothing else for getting up fast. If you already know it, problem solved.

Re: Modeling life on Earth –- an object-oriented (Python?) challenge

2013-07-30 Thread Luigi Ponti
[...forgot to reply to the list...] Dear David, Thanks for your feedback -- you got right to the point: ...python would be more of a prototyping language, and later translated > into another language for faster maneuvering of data > exactly! I was hoping that, since the modeling framework is co

Re: RE Module Performance

2013-07-30 Thread Steven D'Aprano
On Tue, 30 Jul 2013 12:09:11 -0700, wxjmfauth wrote: > And do not forget, in a pure utf coding scheme, your char or a char will > *never* be larger than 4 bytes. > sys.getsizeof('a') > 26 sys.getsizeof('\U000101000') > 48 Neither character above is larger than 4 bytes. You forgot to de

Re: PEP8 79 char max

2013-07-30 Thread Joshua Landau
On 30 July 2013 18:52, Grant Edwards wrote: > On 2013-07-30, Joshua Landau wrote: > > On 30 July 2013 18:08, Vito De Tullio wrote: > > > >> Ed Leafe wrote: > >> > >> > I had read about a developer who switched to using proportional fonts > for > >> > coding, and somewhat skeptically, tried it o

Re: Python script help

2013-07-30 Thread Joshua Landau
On 30 July 2013 22:47, Cameron Simpson wrote: > On 30Jul2013 09:12, cool1...@gmail.com wrote: > | ** urlib, urlib2 > > Sure. And I'd use BeautifulSoup to do the parse. You'll need to fetch that. > So: urllib[2] to fetch the document and BS to parse it for links, > then urllib[2] to fetch the lin