Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
WebIDE
-
this is really freaking cool! ty
-
@Ivoah , this looks great. I started the app on one ipad and connected via another ipad. I was just trying to test as I don't have a laptop or was not with my desktop computer.
I know this defeats the purpose doing it like this. But I can see the communication works.
And this may be important or not. But using safari on another ipad to connect, I got a small view of the file as in the pic below.
I haven't had a chance to view it through a desktop yet
Anyway, looks great
-
@Phuket2 Yep, that's what it's supposed to look like.
-
One thing I absolutely love on my macbook is Transmit Disk. It's a feature of Panic's wonderful app Transmit. Basically, what it does is mount a remote FTP server as a disk, and it appears like a USB drive would. It's a magical little thing such that every change I make on the drive is automatically reflected on my web server. It's absolutely awesome.
Anyway, this allows me to edit files on my server using my text editor of choice, Atom. Something like this would be great for mirroring Pythonista files, as I'm able to be much more productive on my Mac.
The Pythonista editor really does do a great job, though, it's everything I could hope for and more considering the tight restrictions it dances around.
-
@Webmaster4o Doesn't OS X support that natively? There's a "Connect to Server ..." option in one of the Finder's menus, there you can enter a server URL to connect to. This works at least with SMB (Windows), AFP (Apple) and FTP. Though last I tried the FTP support was a little broken and I could only read, not write, so perhaps it is useful after all.
-
@dgelessus Maybe, I've never noticed that in Finder. This isn't really the main functionality of Transmit, it's a general purpose FTP client, but I certainly appreciate this feature, as it works absolutely seamlessly.
-
Yeah, I'm pretty sure OS X has the ability to mount an FTP server like a flash drive natively. Anyways, it should be pretty trivial to make an FTP server in Pythonista, using something like this: python ftp server example
-
Finally tried this, and I have to say: Very cool idea and impressive implementation! Thanks for sharing!
-
I wonder if it might be possible to run the server on a background thread, so that it doesn't block the interpreter, and it would be possible to add a "Run" button in the web interface...
Another interesting addition might be Bonjour support via
objc_util
(NSNetService
or something). I don't really have experience with this, so I don't know how hard that would be, but when using Safari/Mac, you wouldn't have to know the IP address of the iOS device... -
@omz From when I've used bonjour, it's really quite cool. The VNC app I use supports it out of the box, and it's really neat. With no prior setup, I can VNC into my macbook from my iPad, and I don't have anything running on the MacBook. They kind of just magically discover each other :)
-
I've implemented Bonjour support, see my pull request.
This way, "Pythonista WebIDE" automagically shows up in Safari's bookmarks menu when it's running. You may need to enable the Bonjour menu in Safari's Advanced preferences.
-
Thanks @omz! I've merged your pull request.
-
This is awesome. Thanks for making this. Now I just need to figure out a way to access it at my school computers.
-
to run the server on a background thread, so that it doesn't block the interpreter,
I tried to run it under the famous Stash shell.
but Stash only supports python 2, and this is for python 3. -
File "...WebIDE.py" with open(fullname, encoding = 'utf-8', mode = 'r') as in_file: # Open the file... TypeError: 'encoding' is an invalid keyword argument for this function
so the problem is function open
after google I added some lines like this:import sys if sys.version_info.major == 2: import codecs open = codecs.open
now it's t compatible with both python 2 and 3.
-
another little modification to support utf-8 editing:
change def submit(): # This function will get called for each POST request to / ... f.write(request.forms.get('code').replace('\r', '')) # And dump our code into it
to:
f.write(request.forms.code.replace('\r', ''))
see [https://stackoverflow.com/questions/27432211/python-bottle-requests-and-unicode](link url)
If you use the alternative direct property access request.query.q or forms.q Bottle will give you Unicode strings instead, decoded from the byte version using UTF-8. It's usually best to work with these Unicode strings wherever you can.