difference between script and prompt ! looking for the Problem
Emile van Sebille
emile at fenx.com
Sat Mar 24 11:23:56 EST 2001
You need to print from within a script. Interactive mode assumes it.
ie:
print c.r, c.i
HTH
--
Emile van Sebille
emile at fenx.com
---------
"William Famy" <william.famy at noos.fr> wrote in message
news:3ABCCA03.90871133 at noos.fr...
> Hi.
>
> I this is my problem.
>
> I have a file fonc.py where i write a class.
>
> class comp:
> def __init__(re,im):
> self.r=re
> self.i=im
>
>
>
> when i use a python shell i see this
>
>
> >>> import fonction
> >>> c=fonction.comp(3.0,4.5)
> >>> c.r,c.i
> (3.0, 4.5)
> >>>
>
> but when i use the following script
>
> test.py
> #!/usr/bin/python
> import fonction
> c=fonction.comp(3.0,-4.5)
> c.r, c.i
>
>
> i have no result
>
> bash-2.04$ ./test.py
> bash-2.04$
>
> Where is the problem? where is my error?
>
> Thanks for answer.
> --
> \\\|///
> \\ - - //
> ( @ @ )
> +-------------------------oOOo-(_)-oOOo-------------------------+
> | Famy William 36 avenue des barattes 74000 Annecy France |
> | email:william.famy at noos.fr william.famy at mail-enseignant.com |
> +---------------------------------Oooo--------------------------+
> oooO ( )
> ( ) ) /
> \ ( (_/
> \_)
More information about the Python-list
mailing list