Jump to content

But what is Python actually for?


Arbu
 Share

Recommended Posts

w3 schools says "Python can be used on a server to create web applications." and wikipedia says "Examples of commonly-used, web applications, include: web-mail, online retail sales, online banking, and online auctions.". 

But why do you need an application on the server to access these things? Surely the information is just held in a database or as variables which you can access with PHP and AJAX? What does Python add?

I thought that a web application was something like Google Docs - something that is like a computer program but which you run in your browser. But would that actually run on the server? Surely you are better off with something like that running in the browser because otherwise there will be calls back to the server with every keystroke, which seems very inefficient.

So maybe someone can clarify for me.

Thanks.

Link to comment
Share on other sites

Python is an alternative to PHP.

PHP is actually not a great language, which is why most larger websites will use something different.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
Posted (edited)

OK, thanks. But then how do I actually use it? Presumably I have to put something in my file like I do with php: <?php.....?>

I have looked over the Python tutorial and I can't see where it tells me this fundamental piece of information. It only seems to talk about using it on my own PC.

Maybe I have to use a module and have my Python code separate from my other code?

Edit: No it's not that. When I try that I get the message "non-JS module files deprecated".

Edited by Arbu
Link to comment
Share on other sites

It seems that W3Schools does not explain how to set up and use Python on the server-side, maybe because it is very common for people to use Python for programming on their PC rather than as a server-side programming language.

I don't use Python myself, so I can't tell you how it works. This page seems to have some explanations: https://pythonbasics.org/webserver/

  • Like 1
Link to comment
Share on other sites

Posted (edited)
12 hours ago, Ingolme said:

It seems that W3Schools does not explain how to set up and use Python on the server-side, maybe because it is very common for people to use Python for programming on their PC rather than as a server-side programming language.

I don't use Python myself, so I can't tell you how it works. This page seems to have some explanations: https://pythonbasics.org/webserver/

If you want to write a program on your own PC I don't understand why you wouldn't use vb.net or the like. Do people just want the program to operate through their browser? Anyway thanks for the link, I'll have a look.

Actually I guess I can just use php instead. All I'm trying to do is make a cURL command so php ought to be adequate. Maybe Python is for full blown applications that run on the server. There's a handy converter here https://reqbin.com/req/java/c-w7oitglz/convert-curl-to-http-request

Edited by Arbu
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...