Displaying Python on the Internet

  • Context: Python 
  • Thread starter Thread starter wScott
  • Start date Start date
  • Tags Tags
    Internet Python
Click For Summary

Discussion Overview

The discussion revolves around the application of Python in web development, specifically how to implement Python code on a web document and the limitations of using free web hosting services like Geocities. Participants explore the potential for creating dynamic web pages using Python and discuss the necessary infrastructure for running Python web applications.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • Some participants note that Python runs on the server side, meaning it cannot be directly embedded in web pages viewed by clients.
  • Warren suggests installing a local web server (like Apache) to run Python applications, emphasizing the need for server access to execute Python code.
  • There is a discussion about the differences between Python and other programming languages, such as Visual Basic, with some participants expressing confusion about Python's object-oriented nature.
  • One participant questions whether taking notes from tutorials would be beneficial while learning Python.
  • Another participant mentions that Geocities' free package does not support server-side technologies, while the paid "Pro" package does, allowing for the use of CGI and other languages.
  • Some participants recommend PHP over Python for web development due to its widespread support and design for web applications.
  • There is a suggestion that running a local web server can be rewarding and provides full control over web development projects.

Areas of Agreement / Disagreement

Participants generally agree that server access is necessary to run Python for web applications, but there is no consensus on the best approach or language for web development, with differing opinions on the use of Python versus PHP.

Contextual Notes

Participants express varying levels of familiarity with Python and web development concepts, leading to differing expectations and understandings of how Python can be applied in this context.

Who May Find This Useful

Individuals interested in learning about web development using Python, those exploring server-side programming, and beginners looking for guidance on setting up local web servers may find this discussion beneficial.

wScott
Messages
87
Reaction score
0
Can someone tell me how you would apply python to a web document. Like add the python code to a geocities.com account?
I'd like to know that I can publish Python for all to see :smile:
 
Technology news on Phys.org
Many people use Python on websites, but the Python is running on the server, not on the client. You can use Python to make a page dynamic (perhaps it changes everytime you view it, like this forum).

Unfortunately, geocities (and other free webspace providers) won't let you run your own custom-written programs on their servers, since it would constitute a security risk.

My suggestion, if you're willing to do a bit of learning, is actually to install your own webserver, and serve your own site from your own PC. You can install apache (a webserver) and modpython (the plugin which allows apache to run Python programs) even on a Windows machine, I believe.

If you want to show your dynamic, Python-powered website to the world, there are some subtleties -- for example, if your IP address changes often, you'd have to use a dynamic DNS service.

However, wScott, I strongly recommend that you don't start your career in Python by trying to develop web software. Instead, I suggest you start with command-line programs, then work your way up to desktop GUI programs, then move on to web applications.

- Warren
 
Actually, let's talk about this a bit. Maybe I can whet your apetite. :smile: Have you downloaded and installed the Python distribution from http://www.python.org/ yet?

- Warren
 
Well Chroot, to answer your first post I wasn't thinking of making a big impact or whatever just making my website more dynamic, like you said, by adding things like input output and things like that.

To answer your second post, I have indeed downloaded it and I'm going through it a little at a time, going through the examples they show me in the tutorials and trying my own things. By the way, do you think it would be a good idea to take notes from the tutorials and putting them in a notebook while I work through it?

EDIT: On the website it shows Python as an Object Object Oriented programming language, yet I haven't run into what I expected, not like the microsoft visual basic I'm being taught in school.
 
Last edited:
wScott said:
Well Chroot, to answer your first post I wasn't thinking of making a big impact or whatever just making my website more dynamic, like you said, by adding things like input output and things like that.

Well, as I said, you'll need more than just a goecities account to do web stuff with Python (or any other language), unfortunately.

EDIT: On the website it shows Python as an Object Object Oriented programming language, yet I haven't run into what I expected, not like the microsoft visual basic I'm being taught in school.

Python indeed has very powerful (and syntactically clean) object orientation. However, unlike other OO languages like Java, there's no obligation to use object orientation. Your first programs will probably be more like scripts. What were you expecting?

- Warren
 
To be honest I don't know hwta I was expecting the first time I downloaded it. I guess a bit like MS Visual Basic :p.

Out of curiosity, if I made like a test site from notepad could I put my Python into that to test it out?
 
Python is pretty far removed from Visual Basic. Given a choice between the two, Python is a much more powerful and widely accepted language.

Again, the only way to get Python in a website is to have access to a web server which you can use to run your Python code. The output from your Python code would then be sent to the client's web browser. You can't embed Python in a web page itself, because web browsers cannot execute Python.

If you'd like, you can install apache on your local computer, then run your Python programs through it. You're going to need full access to some webserver, either your own or someone else's, to run Python-based web applications.

I can guide you through the installation if you need me to.

- Warren
 
If you only want to develop web applications then you have the choice of Python, PHP, ASP/ASP.NET, JSP, CGI, etc.. There's plenty, PHP arguably being the most popular.
I went to Geocities and i saw that of the two packages "Plus" and "Pro", "Plus" doesn't support any server-side technology, but "Pro" has support for PHP and CGI and provides you with MYSQL database.
CGI programs can be built with any language, C, JAVA, Python... So you have plenty of options here if you get the "Pro" package.
From a web development perspective i would recommend PHP over python running as CGI because PHP is built for web development, and is supported across more web hosts, and because i magine there is some overhead in running an application as CGI rather than on a server running the appropriate server extension. But either one will accomplish what you want to do.
 
I also recommend you run your own local webserver, it's very rewarding and it gives you full control over what you want to do.
Finally, a good web development reference is:
http://www.w3schools.com/
 

Similar threads

Replies
3
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
Replies
6
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K