[Tutor] PDF Scrapping

2015-11-24 Thread Python Beginner
Hi, I am looking for the best way to scrape the following PDF's: (1) http://minerals.usgs.gov/minerals/pubs/commodity/gold/mcs-2015-gold.pdf (table on page 1) (2) http://minerals.usgs.gov/minerals/pubs/commodity/gold/myb1-2013-gold.pdf (table 1) I have done a lot of research and have read that

Re: [Tutor] Countdown Clock Programming Question

2015-11-24 Thread Alan Gauld
On 24/11/15 19:48, Laura Creighton wrote: > Welcome Evan. > > In a message of Tue, 24 Nov 2015 18:19:22 +, Alan Gauld writes: >> def update_display() >>display_period = target_time - time.time() >>min,sec = divmod(display_period,60) >>if min < 2: set color to yellow >>elif: min

Re: [Tutor] Countdown Clock Programming Question

2015-11-24 Thread Laura Creighton
Welcome Evan. In a message of Tue, 24 Nov 2015 18:19:22 +, Alan Gauld writes: >def update_display() >display_period = target_time - time.time() >min,sec = divmod(display_period,60) >if min < 2: set color to yellow >elif: min < 1: set color to red >else: set color to green >

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Steven D'Aprano
On Tue, Nov 24, 2015 at 03:36:21PM +, Albert-Jan Roskam wrote: > Hi, > > I have two classes with a number of methods that are the same, so I > want to define a super class that holds these methods. Sounds like a misuse of classes to me. DRY is not a good reason to make two otherwise unrelat

[Tutor] responding to command line

2015-11-24 Thread richard kappler
I need to write a script that runs ssh-copy-id to over 500 clients from one master (setting up keys to use ansible). I understand how to get my script to read each IP address in a list, use it as input and then move on to the next, but not sure how to handle the password feed, particularly as ther

Re: [Tutor] Countdown Clock Programming Question

2015-11-24 Thread Alan Gauld
On 24/11/15 14:01, Evan Sommer wrote: > goal is for the clock to change from green to yellow at 2 minutes, and > yellow to red at 1 minute. > def count_down(): > # start with 4 minutes --> 240 seconds > for t in range(240, 120, -1): > # format as 2 digit integers, fills with zer

[Tutor] Countdown Clock Programming Question

2015-11-24 Thread Evan Sommer
Hello there! I am working on a project for an engineering class that I am in at my high school, and our task has been to create a clock that counts down the time between periods, so that the students walking the hallways know how much time they have to get to class. The timer will be displayed on

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Oscar Benjamin
On 24 November 2015 at 15:36, Albert-Jan Roskam wrote: > Hi, > > I have two classes with a number of methods that are the same, so I want to > define a super class that holds these methods. But the super class (below > called _Generic) should not be instantiated, because it serves no purpose >

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Alan Gauld
On 24/11/15 15:36, Albert-Jan Roskam wrote: > I have two classes with a number of methods that are the same, > so I want to define a super class that holds these methods. So far so good. > But the super class (below called _Generic) should not be instantiated, But here it starts to feel a tad

Re: [Tutor] a class that may not be instantiated

2015-11-24 Thread Peter Otten
Albert-Jan Roskam wrote: > I have two classes with a number of methods that are the same, so I want to define a super class that holds these methods. But the super class (below called _Generic) should not be instantiated, because it serves no purpose other than the DRY principle. I raise a NotI

[Tutor] a class that may not be instantiated

2015-11-24 Thread Albert-Jan Roskam
Hi, I have two classes with a number of methods that are the same, so I want to define a super class that holds these methods. But the super class (below called _Generic) should not be instantiated, because it serves no purpose other than the DRY principle. I raise a NotImplementedError in case

Re: [Tutor] How to kill a thread

2015-11-24 Thread Peter Otten
CMG Thrissur wrote: > Thank you all. i have pasted the code on pastebin. > > http://pastebin.com/embed_iframe.php?i=kHAUJQC2 > > My one main question in the code is that there are times when my thread > using pythonwhois hangs up the process by statying active very long > time. can i hope for