I had a function all by itself in the file [filename].py, and the file was properly executable. This is how people advised me to call it externally:
import func func.[filename]()
But I was getting errors all over the place. So I contacted Python help and they told me something different, which worked when I tested it.
Let's say the function inside [filename].py is called funcname. This is what I did:
>>> import [filename] >>> [filename].[funcname]() [function returned output successfully]
Now, I navigated to the directory in which [funcname].py was located, so there were no path issues. If not in that directory, I'd have to add it to the $PATH variable, although Linux people probably know of a better way to do it.