Re: [Tutor] Another OO modeling question

2015-12-22 Thread jamie hu
* * 22.12.2015, 15:26, "Alan Gauld" : On 22/12/15 22:06, jamie hu wrote: * * I am trying to write down class and object definition for a Virtual Machine type. For example, I would like to create a Virtual Machine (

[Tutor] Another OO modeling question

2015-12-22 Thread jamie hu
* * I am trying to write down class and object definition for a Virtual Machine type. For example, I would like to create a Virtual Machine (object) that can have actions like launch, terminate, stop, add_disk, remove_disk etc.. * My confusion here is that VirtualMachine obj

Re: [Tutor] Another OO modeling question

2015-12-22 Thread Alan Gauld
On 22/12/15 23:47, jamie hu wrote: > Thanks for the reply Alan. If init code calls launch method then I > would have problems in looking up objects afterwards. In that case use the init to do the config then explicitly call the launch. > For example: > 1. First or initial calls to VirtualMachine(

Re: [Tutor] Python script for ganglia

2015-12-22 Thread Steven D'Aprano
On Wed, Dec 23, 2015 at 03:15:49AM +0530, Rahul Kumar wrote: > Hi, > I would like to know about how python can be use to get data from > ganglia monitoring tool. This may be a bit too specialised for a beginner's list like this, but we can try. Is there a Ganglia discussion list or forum where y

Re: [Tutor] Another OO modeling question

2015-12-22 Thread Alan Gauld
On 22/12/15 22:06, jamie hu wrote: >* >* >I am trying to write down class and object definition for a Virtual >Machine type. For example, I would like to create a Virtual Machine >(object) that can have actions like launch, terminate, stop, add_disk, >remove_disk etc.. >

[Tutor] Python script for ganglia

2015-12-22 Thread Rahul Kumar
Hi, I would like to know about how python can be use to get data from ganglia monitoring tool. For example,this link show the live production Ganglia instance for Wikimedia http://ganglia.wikimedia.org/latest/ There are various of graphs have detail about grid load,grid memory, grid cpu, grid netwo

Re: [Tutor] Is there a Big Integer Class in Python?

2015-12-22 Thread Danny Yoo
On Tue, Dec 22, 2015 at 6:22 AM, Satya Luzy wrote: > Is there a way to extend the numbers so that there is no more L? Data can be presented in many different ways. That's something that you should have control over. Rather than change the definition of how numbers are representing in the machi

Re: [Tutor] Is there a Big Integer Class in Python?

2015-12-22 Thread Satya Luzy
Is there a way to extend the numbers so that there is no more L? Thanks :) On Tue, Dec 22, 2015 at 8:29 PM, Alan Gauld wrote: > On 22/12/15 10:05, Satya Luzy wrote: > > I'm currently making a cryptanalysis program that involves up to 150 > > integer digits. > > The number will be used for multi

Re: [Tutor] Is there a Big Integer Class in Python?

2015-12-22 Thread Alan Gauld
On 22/12/15 14:22, Satya Luzy wrote: > Is there a way to extend the numbers so that there is no more L? The L is only part of the representation it is not part of the data. You use the data just like any other integer. In Python v3 there is no L since there is no longer any distinction between lo

Re: [Tutor] Optimize the code - removing the multiple IF conditions

2015-12-22 Thread Sunil Tech
My heartly thanks to Steven D'Aprano, Alan Gauld and Peter Otten ​ for addressing this.​ I would go with Steven D'Aprano ​ point​ and will take Alan Gauld inputs. Thanks once again. On Mon, Dec 21, 2015 at 9:56 PM, Alan Gauld wrote: > On 21/12/15 12:22, Sunil Tech wrote: > > > class OptIf(obj

Re: [Tutor] Is there a Big Integer Class in Python?

2015-12-22 Thread Alan Gauld
On 22/12/15 10:05, Satya Luzy wrote: > I'm currently making a cryptanalysis program that involves up to 150 > integer digits. > The number will be used for multiplication and exponentiation purpose. > So, do I need to use something like a big integer class? or does that even > exist? Python intege

[Tutor] Is there a Big Integer Class in Python?

2015-12-22 Thread Satya Luzy
I'm currently making a cryptanalysis program that involves up to 150 integer digits. The number will be used for multiplication and exponentiation purpose. So, do I need to use something like a big integer class? or does that even exist? Thank you, Python learner _

Re: [Tutor] Object oriented design

2015-12-22 Thread Mark Lawrence
On 22/12/2015 02:15, Danny Yoo wrote: On Mon, Dec 21, 2015 at 5:58 PM, Alan Gauld wrote: On 22/12/15 00:14, jamie hu wrote: Thanks Alan. I was thinking about making a list of objects and search through it, but wasn't sure if that was right way. For small numbers of objects( aa few h