The docker environment could set an env var, and then the python script files could check e.g. os.environ.get('CS4246_SUBMISSION', False), that way there wouldn't be any change to make to the script before uploading and no possibility of error.
Btw: could the homeworks be uploaded to github? I would like to make some PR :)