The only thing this statement does is assure that the starting directory is always set as where python script is located.
Safe answer is yes.
If you follow snippsat's advice, you shouldn't need it at all.
I always include this statement, it's only executed once, and I always know what my current working directory is.
Quote:do i need to keep this statement in all .py filesThat's a qualified no, with qualification being that order of execution may cause path changes.
Safe answer is yes.
If you follow snippsat's advice, you shouldn't need it at all.
I always include this statement, it's only executed once, and I always know what my current working directory is.