# Exercise 11: Stand-alone program (optional) **(30 minutes)** :::{note} Why would you want to write a stand-alone program instead of using ROOT interactively? - You can't live in a notebook forever.[^f97] Typical analysis scripts get so large that you may want to use a regular text editor to work with them, instead of the limited editing available in a notebook cell. - One method of speeding up a Python program is to use Cython, a Python optimizing compiler: . You can use [Cython within a notebook](https://twiki.nevis.columbia.edu/twiki/bin/view/Main/IPython), but you'll get better results if you create a stand-alone program. - Stand-alone programs are necessary if you want to submit your Python program to a batch system. ::: So far, you've used ROOT interactively to perform the exercises. Your task now is to write a stand-alone program that uses ROOT. Start with the script you created in Exercise 10: you have a notebook cell that reads an n-tuple, performs a calculation, and writes a plot to a file. Create a stand-alone program that does the same thing. :::{hint} If you tried to do the {ref}`C++ version of this Exercise `, you may have found it difficult. The Python equivalent is much easier. Part of the reason is that all the clues you need are in the {ref}`condor tutorial ` in the {ref}`appendix `. Look at the instructions for the `.py` files in that tutorial, then look at the comments in the `.py` files themselves. Don't forget to use `module load root` (or the equivalent if you're not using a Nevis particle-physics server) if you expect a stand-alone Python program to be able to import the ROOT libraries! ::: :::{figure-md} reassuring-fig :class: align-center xkcd reassuring by Randall Munroe ::: [^f97]: Whether this is a programming tip or general life advice I leave up to you.