On 07/24/2011 07:59 PM, Steven D'Aprano wrote:
brandon w wrote:
Thank you. I understand that this ( x = 1+2 ) assigns a variable to
"x" and will not print in Idle, but how would I get the 'class' that
I created to run from the script like it does in Idle? Will I have to
put print before every
brandon w wrote:
Thank you. I understand that this ( x = 1+2 ) assigns a variable to "x"
and will not print in Idle, but how would I get the 'class' that I
created to run from the script like it does in Idle? Will I have to put
print before everything I have to print?
Yes. If you want someth
On 24-Jul-11 16:21, brandon w wrote:
Then I try to run it from a script in Gnome-terminal and it does not
run. I do not get output. I have to add print. to get any output like this:
When you type a Python expression at the interactive prompt in IDLE or
the python command-line interpreter, it w
brandon w wrote:
I wrote this in Idle and ran it in Idle and it worked fine.
[...]
Then I try to run it from a script in Gnome-terminal and it does not
run. I do not get output. I have to add print. to get any output like this:
[...]
What is the difference? This is what was confusing me befo
Python version 2.6.6
I wrote this in Idle and ran it in Idle and it worked fine.
class ExClass:
eyes = "brown"
age = 99
height = '5\'11'
def thisMethod(self):
return 'This method works.'
This is me running it in Idle.
>>> ExClass
**
>>> x = ExClass()
>>> x.eyes
*'brown'