Or gnome-terminal -tab -title="tab 1" -command="bash -c '/path/to/python3 my_app. Hence, your final command is either gnome-terminal -tab -title="tab 1" -command="bash -ci 'python3 my_app.py $SHELL' 'while ] do read -n 1 -p uit? response echo done'" gnome-terminal -tab -title="tab 1" -command="bash -c 'python3 my_app.py $SHELL' 'while ] do read -n 1 -p uit? response echo done'"įor the wrong python being used, you can either load ~/.bashrc by using bash -i, or you could explicitly specify the python version with /path/to/python3 instead of plain python3 in your command. Hence, for your script, append this to the end of the bash -c command. with a prompt as follows: while ] do read -n 1 -p uit? response echo done To leave the terminal open, I generally prevent the script from completing, e.g. The terminal will close after the command is completed. I also was wondering if there is a way that the web application automatically pops up in my browser after this. I was wondering if there is a way to make a script (on Scientific Linux) that opens a terminal window and executes commands in them, and after that remains open.
#Command to reopen closed window windows
The difference is with this script, it won’t matter if the dialog box is checked or not, windows and apps will not restore. bashrc in my home directory is used, and the variable $PATH gives priority to my version of python3 (I checked that $PATH is different before and after I write bash in the terminal). Turning Off Reopen windows when logging back in by Making it Useless Remember, this script disables the feature, but the dialog window will still pop up.
![command to reopen closed window command to reopen closed window](https://www.onmsft.com/wp-content/uploads/2019/11/reopen2.png)
I've been getting around this problem by writing bash before using python3 my_app.py. There is one installed by the admin, and the anaconda version installed by me in my home directory. This is because the script is using the wrong version of python3 in this server. Second, when I click the file I received the following message (before terminal is closed): ModuleNotFoundError: No module named 'flask'. First, the terminal does not remain open.
![command to reopen closed window command to reopen closed window](https://static1.makeuseofimages.com/wordpress/wp-content/uploads/2017/10/Chrome-Reopen-Tabs.png)
I also allowed the file to be executed as program. It is very easy to reproduce, but is not a bug IMO.
![command to reopen closed window command to reopen closed window](https://static1.makeuseofimages.com/wordpress/wp-content/uploads/2017/10/Safari-Reopen-Tab.png)
Reopening the closed tab will reopen the closed window with that tab, but there is no submenu to show a list of tabs because there is only one tab for that window. (Note: I tried all other answers and they didn't work, Gabriel Staples answer was the only one that almost worked). Komposten This happens if the closed window only contained one tab. I wrote a shell script with this line: gnome-terminal -tab -title="tab 1" -command="bash -c 'python3 my_app.py $SHELL'"Īs recommended here, in the case of Ubuntu: After that, the terminal window should remain open and I should be able to check my web application in the browser. I want a way to make this easier, and just click a shell script that opens a terminal windows and runs the commands mentioned. So, I can check if my app works locally in my browser. I did a simple web application in Python3, and I found myself constantly opening a Mate Terminal (though, any terminal works), and writing bash I'm working in a remote server that uses Scientific Linux (version=7.6 (Nitrogen)).