Python Hello World

2015/7/91 min read
bookmark this

So, you want to get start Python..

Also, you prefer windows enviroment, so let's get start a little bit.

Download Python

Go to this link to download Python,, select the target windows installer.

Good Article

Check this article to get start to use it,


Sample hello word code for Python

'''A simple program to create an html file froma given string,
and call the default web browser to display the file.'''

contents = '''<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html; charset=ISO-8859-1"

Hello, World!
    <input type="text"/>


def main():

def strToFile(text, filename):
    """Write a file with the given name and the given text."""
    output = open(filename,"w")

def browseLocal(webpageText, filename='tempBrowseLocal.html'):
    '''Start your webbrowser on a local file containing the text
    with given filename.'''
    import webbrowser, os.path
    strToFile(webpageText, filename)"file:///" + os.path.abspath(filename)) #elaborated for Mac


Another sample code for Python

import os
print "Content-type: text/html\r\n\r\n";

for param in os.environ.keys():
  print "<b>%20s</b>: %s<\br>" % (param, os.environ[param])

Something want to try, can I call pass Python command from UI to back-end python code and display result to the UI?