Most of my Python scripts (mostly written for web-scraping/data science apps) follow this kind of format:
# import whatever packages
import x, y, z
# do some web-scraping and data manipulation
# write some niche function I need
# make some plots and basically end the script
This is all done via an interactive editor/console (like Eclipse). I basically write the code above, and then copy-paste the code below for testing.
Is there a more "standard" way to go about this? I know C has functions defined above the main
function, and I see packages in Python with if __name__ == "__main__"
conventions; is this the "appropriate" way to go about development? I suppose the core question is whether you want to be able to use the functions you write in other projects, as well.