I have a very large python script, 200K, that I would like to use as little memory as possible. It looks something like:
# a lot of data structures
r = [34, 78,
Moving functions around won't change your memory usage. As soon as you import that other module, it will define all the functions in the module. But functions don't take up much memory. Are they extremely repetitive, perhaps you can have less code by refactoring the functions?
@eumiro's question is right: are you sure your script uses too much memory? How much memory does it use, and why is it too much?