How to change the current directory of the command window from which a python script is invoked
I am writing a python script, that it should change directory (cd) of the current shell, to a specific directory, based on the user input.
The problem is everytime this script ends, I am back again to the original path, without changing.
bash-4.2$ pwd
/home/<username>/scripts
bash-4.2$ ./enterFW.py -fw <fw>
/filer/syslog_ng/2019/<fw>/2019/01/28 #<--I print the new directory, and it should be correct
bash-4.2$ pwd
/home/<username>/scripts #<-however after the script ends, i am back again to the original path
bash-4.2$
I change directory, using subprocess.call(['cd', <new path>])
, or os.chdir(<new path>)
...all are the same.
Please check, and advise