Hi,
On Feb 17, 2012, at 20:23, Robert Berman wrote:
>
>
> On Fri, Feb 17, 2012 at 10:48 PM, Kapil Shukla wrote:
> All
>
> Couple of weeks ago I was looking for a nice free IDE for python and got many
> wonderful suggestion form very helpful people. However I stumbled upon
> PyScripter and
On Fri, Feb 17, 2012 at 10:48 PM, Kapil Shukla wrote:
> All
>
> Couple of weeks ago I was looking for a nice free IDE for python and got
> many wonderful suggestion form very helpful people. However I stumbled upon
> PyScripter and I find it really amazing.
>
> I feel once u try it you will hook o
Leam Hall wrote:
I'm building a program that uses one of my own modules for a bunch of
formula defs and another module for the tkinter GUI stuff. There are
half a dozen input variables and about the same in calculated variables.
Is it better/cleaner to just build a global dict and have everythi
All
Couple of weeks ago I was looking for a nice free IDE for python and got many
wonderful suggestion form very helpful people. However I stumbled upon
PyScripter and I find it really amazing.
I feel once u try it you will hook on to it for ever
Thanks
Best Regards
Kapil
__
On 02/17/2012 09:26 AM, Dave Angel wrote:
There are two ways to think of a class. One is to hold various related
data, and the other is to do operations on that data. If you just
consider the first, then you could use a class like a dictionary whose
keys are fixed (known at "compile time").
I t
This is what I ended up using:
import time
import sys
import os
def countd():
seconds = 59
minutes = 4
five_minutes = 0
os.system('clear')
os.system('setterm -cursor off')
while five_minutes != 300:
sys.stdout.write("\r%d:%02.f\t" % (minutes, seconds))
s
On 17/02/12 11:38, brandon w wrote:
I made a timer that counts down from five minutes. This code runs fine
but I a seeing a cursor blinking on the first number as the code is
running. How do I avoid this?
Try putting the carriage return at the start of the line. You print the
line then reset
On 17/02/12 14:10, leam hall wrote:
The variables input seem to be assumed to be strings
They are not assumed to be strings, they *are* strings. Users can only
type characters at the keyboard (the usual source of input). Your
program has to interpret those characters and convert to the right
Alan Gauld wrote:
>>The "x for x in y:" syntax makes it harder to follow for learners,
>
> Read about list comprehensions first.
> It helps if you studied sets in math at school. The format is
> somewhat like the math notation for defining a set. But FWIW it took me
> a long time to get used to t
>> class Card(object):
>> def __init__(self):
>> self.score = self.deal()
>>
>> def deal(self):
>> """deal a card from 1 to 52 and return it's points"""
>> return self.getValue(int(math.floor(random.uniform(1,
>> 52
>
> I think you only
> import numpy as np
>> Vhel_fdiff3 = np.array([abs(Vmatch3_1 - Vmatch3_2), abs(Vmatch3_1 -
>> Vmatch3_3), abs(Vmatch3_3 - Vmatch3_2)])
>> your_answer = Vhel_fdiff3.max(axis=0)
>
> or
>
> import numpy as np
> a = np.array([Vmatch3_1-Vmatch3_2, Vmatch3_1-Vmatch3_3, Vmatch3_3-
> Vmatch3_2])
> print
leam hall wrote:
> On 2/17/12, Peter Otten <__pete...@web.de> wrote:
>> leam hall wrote:
>>> and they may have to have their type set
>>
>> I have no idea what you mean by "have their type set". Can you give an
>> example?
>
> Peter,
>
> The variables input seem to be assumed to be strings and I
On 02/17/2012 09:06 AM, leam hall wrote:
On 2/17/12, Dave Angel wrote:
Real question is whether some (seldom all) of those variables are in
fact part of a larger concept. If so, it makes sense to define a class
for them, and pass around objects of that class. Notice it's not
global, it's sti
On 2/17/12, Peter Otten <__pete...@web.de> wrote:
> leam hall wrote:
>> and they may have to have their type set
>
> I have no idea what you mean by "have their type set". Can you give an
> example?
Peter,
The variables input seem to be assumed to be strings and I need them
to be an integer or a
On 2/17/12, Dave Angel wrote:
> Real question is whether some (seldom all) of those variables are in
> fact part of a larger concept. If so, it makes sense to define a class
> for them, and pass around objects of that class. Notice it's not
> global, it's still passed as an argument. This can
leam hall wrote:
> My concern with variables is that they have to be passed in specific
> order to the function,
Yes, unless you use keywords. You can invoke
def div(x, y):
return x // y
a = div(3, 2)
b = div(y=3, x=2)
assert a == b
> and they may have to have their type set
I have no ide
On 2/17/12, Peter Otten<__pete...@web.de> wrote:
Leam Hall wrote:
I'm building a program that uses one of my own modules for a bunch of
formula defs and another module for the tkinter GUI stuff. There are
half a dozen input variables and about the same in calculated variables.
Is it better/c
On 17 February 2012 14:04, leam hall wrote:
> My concern with variables is that they have to be passed in specific
> order to the function, and they may have to have their type set
> multiple times so that you can perform the right functions on them. In
> a dict you could set it on insert and not
Thanks Peter!
My concern with variables is that they have to be passed in specific
order to the function, and they may have to have their type set
multiple times so that you can perform the right functions on them. In
a dict you could set it on insert and not have to worry about it.
Thanks!
Leam
On Fri, Feb 17, 2012 at 12:38 PM, brandon w wrote:
> I made a timer that counts down from five minutes. This code runs fine but I
> a seeing a cursor blinking on the first number as the code is running. How
> do I avoid this?
>
> I am using gnome-terminal and Python 2.6.6.
>
>
> #!/usr/bin/python
Leam Hall wrote:
> I'm building a program that uses one of my own modules for a bunch of
> formula defs and another module for the tkinter GUI stuff. There are
> half a dozen input variables and about the same in calculated variables.
> Is it better/cleaner to just build a global dict and have eve
Andre' Walker-Loud wrote:
> import numpy as np
> Vhel_fdiff3 = np.array([abs(Vmatch3_1 - Vmatch3_2), abs(Vmatch3_1 -
> Vmatch3_3), abs(Vmatch3_3 - Vmatch3_2)])
> your_answer = Vhel_fdiff3.max(axis=0)
or
import numpy as np
a = np.array([Vmatch3_1-Vmatch3_2, Vmatch3_1-Vmatch3_3, Vmatch3_3-
Vmatch3
I made a timer that counts down from five minutes. This code runs fine but
I a seeing a cursor blinking on the first number as the code is running.
How do I avoid this?
I am using gnome-terminal and Python 2.6.6.
#!/usr/bin/python
import time
import sys
import os
def countd():
seconds = 5
I'm building a program that uses one of my own modules for a bunch of
formula defs and another module for the tkinter GUI stuff. There are
half a dozen input variables and about the same in calculated variables.
Is it better/cleaner to just build a global dict and have everything go
into it or
On 17/02/12 03:27, Luke Thomas Mergner wrote:
In the meantime, and continuing my problem of over-cleverness,
At least you know what your problem is :-)
Bonus question: when I create a the "def score(self)" in class Hand,
> should that be an generator?
No.
And if so where do I go as a n
On Fri, Feb 17, 2012 at 3:16 AM, alain Delon wrote:
> userName = raw_input("Enter your name ")
> print "hi " + userName + ". \n "
> seconds = input("Enter the number of seconds since midnight:")
> hours = seconds/3600
> hoursRemain = hours%60
**
26 matches
Mail list logo