Forums

How to switch back to bash console?

I uploaded one python main.py file. after opening it, I selected Bash Console. However, during code debugging, I accidently pressed "save and run" button to top right corner. Then the console changed to another type which I no longer can run command '$python3 main.py' anymore. Can anyone suggest how on switch the console back to Bash. Thanks!

Just open the bash console from the "Console" page.

Thank you, fjl! Yes, that's the way I do now. But still like the split window for debugging... Hope there is way to switch Bash back... Thanks!

The save and run button will run the code that you have in the editor, so you do not need to manually run the code by typing "python3 main.py"

Thank you, glenn! Yeah, the run button execute the code. However, I don't know how to use other command like" $env; $export variable=xxx"... and etc. I'm beginner and all commands I have are bash orientated... so prefer to has bash environment at least for now... Anyway, thanks for your inputs.

To be honest, I don't know how you got a Bash console on the editor page - that is not how the editor page is designed to be used.

Bash Console was an option which could be selected at the very first time when you open a python file. I used bash for a while till I accidently clicked the 'run' button which seems go back to its default setting now...

Selected how? Where was the option?

I types exit() in the console, and then I got the option to switch back to bash console.

Is there a problem?

Thanks @mathface, it took me several hours of chatting with ChatGPT going nowhere, and a simple exit() and refreshing the page worked.

Now there is this problem that when I export MY_API=mycode, it works but in reality it's not in the env at all, I can't recall it. Any idea how to export and be able to use it?

Tahr https://help.pythonanywhere.com/pages/environment-variables-for-web-apps would work not only for web apps but also for the scripts.

what after exit() i have the same problem

Could you clarify exactly what the problem is?