+ 2

How to make Python Websites?

I have some cool python scripts(.py files) that I want to embed into a website, their output to be written in a textarea or something, but I can't run them and control the output(where it goes) even with php... Some experienced help will be much appreciated♡

6th Mar 2018, 9:33 PM
Andrei Cereanu
Andrei Cereanu - avatar
11 Answers
+ 4
You can look into flasks or django. Those are python based web frameworks.
6th Mar 2018, 9:51 PM
Tri Trinh
Tri Trinh - avatar
+ 2
python is already a substitute to PHP, you first have to install python on the server(if you have one) and install the appropriate module for web serving. make researchs on cherrypy.
6th Mar 2018, 9:45 PM
JustCodeMore
JustCodeMore - avatar
+ 2
i agree with you 👍
6th Mar 2018, 9:52 PM
JustCodeMore
JustCodeMore - avatar
+ 2
Isn't there any way to do it in in-place web-design playgrounds lile SoloLearn or DCoder? If not, can you, @Emile Djida, walk me through some template php code, with the required files? I really appreciate your help PS: Just if it helps, yes, I do know how to use my own files in SL:))
6th Mar 2018, 10:11 PM
Andrei Cereanu
Andrei Cereanu - avatar
+ 1
have a look here, i hope that's what you are looking for. https://code.sololearn.com/cIXHYI74WPz3/?ref=app PS: run the file on your computer, open your browser and access it throught : http://localhost:8080
6th Mar 2018, 10:56 PM
JustCodeMore
JustCodeMore - avatar
+ 1
Thanks a lot @Emile Djida, I never thought you could make a website using python, I always tried to implement python into a website, not use it to make one, so thank you for waking me up!♡
7th Mar 2018, 8:42 AM
Andrei Cereanu
Andrei Cereanu - avatar
+ 1
you are welcome @Andrei 😊
7th Mar 2018, 9:27 AM
JustCodeMore
JustCodeMore - avatar
+ 1
I...ran the file finally, when I got home, @Emile Djida, and I was surprised to see that my idle had cherrypy installed, but instead got a new error... cherrypy module has no attribute 'quickstart' how can i solve that? could't find a way to upgrade the cherrypy, so maybe you can help...
7th Mar 2018, 5:13 PM
Andrei Cereanu
Andrei Cereanu - avatar
+ 1
try to download thé latest version of cherrypy for your python. As for me, I am working with python 2.7
7th Mar 2018, 7:14 PM
JustCodeMore
JustCodeMore - avatar
+ 1
thx, I did some research and found out the "pip install cherrypy" cmd command, have yet to test it out in the morning, I will keep you updated if I need further help PS:I work with Python 3.6😆 EDIT: It still does not work, with newest version of cherrypy, but i thank you for the help, maybe it works for others.
8th Mar 2018, 1:33 PM
Andrei Cereanu
Andrei Cereanu - avatar
+ 1
OK but i will try it in python 3.6 and keep you updated. PS: I started python programming using 3.6 but i prefered 2.7
8th Mar 2018, 6:16 PM
JustCodeMore
JustCodeMore - avatar