简体   繁体   中英

Run edited python script step by step / without reloading dataset

I work on a python script executing standard image recognition processing using tensorflow. Using Python 3.8, Tensorflow 2, Idle lauched from a virtual env.

Since I am following a tutorial, I would like to augment and execute my script chunk by chunk: eg

  • write the code for the data load
  • execute
  • write the code for training
  • execute only training (without reloading the data)

Is there a way to run a python script chunk by chunk, without restarting the idle shell, and keeping results from the previous steps?

Read–eval–print loop (REPL)

Yes, this is what exactly you are looking for.

This is an interactive environment that takes single user inputs, executes them, and returns the result to the user; a program written in a REPL environment is executed piecewise

There are lot of Platforms which offer this.

Jupyter Notebook (Local)

Google Colab (Online)

I prefer Google colab.

Its free & we don't have to waste our Local system Resources

In an IDLE editor, one can right click on multiple lines to add breakpoints. Start IDLE's debugger in Shell, using Shell menu. Run file. Click go and execution will start and stop at first breakpoint. Click go again to run to next breakpoint.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM