Python - Running just a single line of code, and not the rest of the Multiple lines in the Script

17,886

You'll have to run your line of code form command line:

With the -c (command) argument (assuming your file is named foo.py):

$ python -c 'import foo; print foo.hello()'
Share:
17,886
Calculate
Author by

Calculate

Updated on June 28, 2022

Comments

  • Calculate
    Calculate almost 2 years

    In - Python, inside the the IDLE, in the File Editor Window,

    How do you run just a selected single line of code in the script, without having the rest of the lines of the program being runned ?