[Tutor] The very first program in python

Sajjadul Islam sajjadul.islam.bd at gmail.com
Sat Nov 14 22:23:48 EST 2015


Hi

I am on Ubuntu 15.10 and using Python 3.4.

The following suggestion is not clear to me :

"

If you defined your function in a separate module using IDLE
you can use the run menu to run the module directly. That will
in turn load it into the IDLE shell for you to use.

"

Let me explain again what I did. I created a .py file and defined a
function that takes a last as input argument. Then  i saved the file.

1.Start python3 interpretor from the command line
2. Defined a list in the interpreter.
3. Send the list as input argument to the function in the .py file.

Eventually, I got the error message as mentioned in my previous post.

How to call the run menu once you are in the command line at linux env ?



Thanks



On Thu, Nov 12, 2015 at 6:16 PM, Sajjadul Islam <sajjadul.islam.bd at gmail.com
> wrote:

> Hello
>
> I have coded the first snippet in python  - defined a function , then I am
> getting error if I try call the function from the IDLE window. The error is
> :
>
> ///////////////////////////////////
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'print_lol' is not defined
>
>
>
> //////////////////////////////////
>
> print_lol is the name of the function that is declared and defined inside
> the file called nester.py and IDLE is called in the same path. What is that
> I am missing here ?
>
>
>
> Thanks
>
>
>


More information about the Tutor mailing list