Forums

How to share the normal file editor?

It's lovely to share my console with other people, but letting them type inside a vim editor for files is not very user-friendly, because it's slow in my opinion. So I prefer the normal file editor (you'd see URL's like /blablah/blah.py?edit in the address bar). It would be cool if I could collaborate with others inside the normal file editor instead of inside the console. That would definitely speed things up a bit. However, if you don't think that PythonAnywhere will need this feature, please explain why.

That is one of the many, many great things we'd like to do. I have upvoted the ticket for you so it should move up in our priorities.

I'll wait patiently, because collaboration is very important to me. In fact, it's the only good way to learn a programming language.

I like this too

I'll add a +1 on our list.

Another +1 here. I'd happily move from the free plan to a paid plan if this feature was added.

wow, good to hear this is popular! It'll bump up the list, the more people ask for it...

bump

I've added the +1 to our list.

This would be my #1 feature request as well. I signed up under the mistaken impression I would be able to share the source of the file, not just the output (useful for interviews / phone screens, where you still want to be able to run the code on a capable host)

@Michael,

As a temporary workaround, why not run an editor in the console, which can then be shared?

Thanks for the thought - I can see where running an editor would work completely fine if I was doing a live demo, or something along those lines. (Since I would feel be pushing the buttons for them, essentially).

My goal was find a place which has a "pretty" code display, and an output panel on the same screen... and of course a "Run Me" button. Essentially, the less effort for the viewer (and the less technical skill required), the better.

Example: http://repl.it/QPN

That site would meet my needs, but the example I chose imports urllib which most (all?) online python interpreters prevent from accessing the public internet.

The editor here looked nice and was very close to meeting my needs :)

I'll add an upvote on your behalf. We've seen a couple of JavaScript libraries that might help with getting this working.

Please add an upvote for me. Thanks

upvoted.

Upvote for me to!

upvoted! it's now on the top half of the first page of tickets...

This would be great! With the current upsurge in Computing in schools many teachers (including myself) are looking around for a browser-based zero-install Python environment to use with students.

I'm currently using codepad.org (minimalist interface, super simple setup, but limited to Python 2.7 which is confusing for my already-overwhelmed 3.4 IDLE students) and pythontutor (fabulous for visualising what's going on inside the computer, something they find very difficult to do).

I'm planning to start 'remote teaching' across the internet and having a live editor a la Google Drive would be fabulous.

+1

upvote

Noted!

By the way, we've recently added the ability to share a file from the editor. It's a "static" share -- that is, if you share it with someone and they accept the share, they get a copy of the file at the point in time when they accept the share -- so it doesn't help for pair-programming, etc., but it might help in some other use cases.

There are a couple editors for microPython (Python 3.4 or pretty close) intended to run on embedded systems that may also work for PythonAnywhere. They are in browser editors that could run from within a venv, though a Javascript one may be more responsive/compatible on the user side.

You can actually use emacs or vim in a console, and those can be shared live with other users -- so for people who are comfortable with terminal-mode editors, pair-programming is definitely doable right now. We do that ourselves when people are working from home.

But, of course, that's not so good for education -- I dread to think what would happen in a "learn to code" course where the first lesson started with "this is the vim editor, which we're going to be using"...

I think there may be Floobits plugins for vim/emacs as well, but like you said, definitely not the first editor you want to use when coding.

vim is the best! :p

:-)

I would want to upvote too. Since I want to share a website! Besides using a vim editor would be hard on iOS!!!!

Thanks, upvote recorded. And yes, you're certainly right about vim on iOS. Emacs might be even worse :-S

Any updates on this feature? I was trying to add the pythoanywhere file editor directly into a page. I tried using an iframe, but the window says that pythonanywhere refuses the connection. Is there any way to enable this, or is there another (more preferred) way of doing this sort of thing?

No updates on the requested feature yet. You could try to implement your own editor in a web app and use our files API, but there would be a lot of caveats, I suppose, as you would basically expose your files.

CORS blocks the ussage of Pythonanywhere's file api, so i had to make my own. Only logged-in users can make GET/POST requests to the api, else it redirects to the login page. The file data gets sent back and is loaded into ACE editor, the editor PythonAnywhere uses as well. A plus is that you can set your own (dark :) ) theme. To use ACE I downloaded the minified source code, and uploaded it to PythonAnywhere (only like 15mb), and then added the static path to the static path list. I used json for sending and recieving file data/requests.

Hope this helps someone else!

Interesting! Thanks for sharing!