3 ms·
When I try to set __name__ with -n it says it's a bad flag. This is with the shell command. Is there something special I need to do?
by ninetax 14y ago
When I try to set __name__ with -n it says it's a bad flag. This is with the shell command. Is there something special I need to do?
- takluyver 14y agoYou use it inside IPython, with a command like: %run -n foo.py You can't set __name__ to arbitrary values. It's either '__main__' like when running a script, or (with -n) the module name, like when performing an import.