On 12/18/2014 08:37 AM, Lei wrote:
Hi experts,

I am using python 3. I got a module interest.py (see attachment).

But when I tried to use this module with input in the command line, it
gives error

In [1]: import interest

In [2]: interest.py A=10 p=5 n=730
   File "<ipython-input-2-82892ebb874e>", line 1
     interest.py A=10 p=5 n=730
                 ^
SyntaxError: invalid syntax

May you please tell me how to solve it?

Just realized you where trying to run it as a command line program. What I suggested previously was for using the interest module directly in the interpreter. To run as command line program in IPython do:

In [2]: !python interest.py A=10 p=5 n=730
('A0 =', 9.035879331735664)


This file "interest.py" is in the path of desktop. I think it is not a
default path for Spyder. So I added its path via "Tools" --> "PYTHONPATH
manager". Is it correct?

By the way, I am using IPython in Spyder (version, 2.3.2), my computer
is running Windows 7.

Thanks a lot.



--
Adrian Klaver
[email protected]

--
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to