-1

I am a beginner-level Python learner. Recently, I have made a program (Github link). Out of curiosity, I want to implement it as a web app so that anyone can easily run the program without downloading or installing anything.

I tried with Google Colaboratory. But it's not much user-friendly as the web apps. Also, in Colab, the codes are directly visible to viewers. I wish to keep the program interface simple and easy by keeping the codes hidden. Hiding code is not my aim. But I feel that it won't be a user-friendly interface if the codes and compilation process are directly visible. I think it would be better for the viewers if a Github repo can be linked to access the source code.

Which online platform can I use to do so for free? Or do there exist any dedicated platforms such that I just need to upload my python code and it will be automatically implemented as a web app?

raf
  • 225
  • 1
  • 3
  • 13
  • 1
    would would be the expected behavior? just saying do you want them to pass in some data and get a visible result? something like the django answer you have would be a start. – LhasaDad Jul 23 '20 at 15:45
  • @LhasaDad, I have written my issue in detail here. Kindly check it: https://stackoverflow.com/questions/63095658/how-can-i-convert-my-python-program-into-a-web-app-on-pythonanywhere – raf Jul 26 '20 at 03:42

2 Answers2

1

Use django I guess https://www.djangoproject.com/

Of course all client-side code will still be visible.

Crapy
  • 352
  • 1
  • 8
  • I have written my issue in detail here. Kindly check it: https://stackoverflow.com/questions/63095658/how-can-i-convert-my-python-program-into-a-web-app-on-pythonanywhere – raf Jul 26 '20 at 03:41
1

The short story is that you cannot protect it completely if you are shipping it to anybody else. However, there are certain options you want to give it your best shot:

  • Ship compiled bytecode files instead of the python files (.pyc)
  • Create executables (Using applications like PyInstaller or Py2Exe
  • Use a source code obfuscator

A combination of all 3 will be able to reasonably prevent the casual individual from looking at your code, but will never be truly protected unless you are running it behind a service.

There's a page on wiki.python.org with further info on this topic named: "How do you protect Python source code?" I'm unfortunately not able to link to it since it contains spaces. Edits with link are welcome.

Dark Nebula
  • 403
  • 1
  • 4
  • 6