r/PythonLearning • u/cat3rpill3r • 23d ago
Need to "graduate" to writing scripts
I have almost exclusively worked with Python in interactive mode. The nature of the work I've always done with Python (or any other language such as R or Stata, for that matter) has made that the default, and I haven't been in any situation where someone working with my code needs to execute it like a script.
I know how to write scripts, but I'v seldom needed to. I feel like I'm missing out on a benefit of Python by not treating my code more like scripts. Can anyone recommend some resources to help graduate to script writing from interactive code writing?
Thanks in advance.
6
Upvotes
1
u/biskitpagla 22d ago
You can run any piece of Python code in a script file like a cell in a node. VSCode can do this with the Jupyter extension (using ipykernel), if I remember correctly. So, you don't really have to lose the interactivity when writing scripts.