Forums

where does console appear after pressing save and run button, using chrome OS

Hi, all. I'm a newbie to python and pythonanywhere... so I've a really basic question!

In a new file, I typed in the simple command print "hello, world"

I then hit the save and run button, and the screen refreshes but no console appears. (I do allow popups from pythonanywhere.com, btw)

I tried manually opening a console, which runs like a line at a time interpreter so it seems fine, but the output of my program doesn't show up there either.

I use a chromebook using chrome OS. This setup works for a friend of mine, we are learning python together. Any help would be appreciated.

thanks, NT

Hmmm. It should pop up in a separate browser tab. When you say "this setup works for a friend of mine", is your friend also using a Chromebook?

Wait a moment... I see from my console page that there IS a console by the same name as my file! I click on it, and it opens up a console in [the same] tab, but labelled as the program file instead of console.

And now when I save and run my program, a popup window shows the results.

huh. I don't get it, but it does the job :-)

If anyone can tell me what I'm doing that's off so that I can streamline this process, I'd still appreciate some input.

Thanks again. NT

@ntelliheart: I'd like to welcome both you and your friend to PA...☺

You might have seen the same behaviour as I saw in Chrome, which is that when you first hit the Save and Run button you get a blocked pop-up notification. Then you allow popups and try again - this time no error, but no popup either. However, if you browse away to a different page (e.g. back to the file list) and then go back to the file editor and try Save and Run again then it seems to work fine.

My assumption is that this is some sort of strange interaction between the PA code and Chrome, that after OKing the "block popups" dialogue you need to reload the page for it to take effect. It could be a bug in Chrome, I'm not sure - I haven't seen it elsewhere, but it's very rare I find a site where I'm happy to unblock popups so I'm working on a very small sample.

Personally I find it more convenient to work in a bash shell, which you can open from your Dashboard page. However, if you're not used to working in the terminal on Linux / Unix / OSX then it would take a little time to pick up. If you've used a DOS terminal then that would give you a bit of a head start, but if you're not used to any kind of terminal then be prepared for a learning curve - you might be better off continuing to use the online editor in that case.

It sounds like you've got your Save and Run functionality working, though, so that should be good enough for now.

For reference, console's work on PA like separate logins to a system, so you can have more than one console open at a time (from memory, free accounts are limited to two at a time). Each one is a separate login, so you can't run a script in one and expect to see the output in another one. I suspect when you hit Save and Run then you're opening a new console which doesn't overlap with your other ones. That's why the output of your program didn't show up in the other console you opened - that was a separate login on the same system. They all share the same filesystem, so you can run your program from any of them, and any file you write will be available to all the consoles - but the actual running program is only attached to the one console which started it.

Hopefully I've explained that clearly enough, but if you're confused then do ask any questions you have.