Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7129001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:11:49+00:00 2026-05-28T11:11:49+00:00

I am learning python at college. I have got a very stupid question. How

  • 0

I am learning python at college. I have got a very stupid question. How do i make a web page with python?

I do this and save as test.py

print "Hello test \n";
print "\n"
print "Just testing \n";

When i go to the url I get the same output

print "Hello test \n";
print "\n"
print "Just testing \n";

I am really confused. What am i doing wrong? My hosting is with hostgator. On their web site it says to do like this:

#!/usr/bin/python
print "Content-type: text/html\n\n";
print "<html><head>";
print "<title>CGI Test</title>";
print "</head><body>";
print "<p>Test page using Python</p>";
print "</body></html>";

this gives me the same error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:11:50+00:00Added an answer on May 28, 2026 at 11:11 am

    Ok. it works perfect.

    There were some problems with whole thing.

    1- The problem i was getting with hostgator was:

    Windows and Linux use different line endings for text files. Windows uses the CR and LF characters to terminate a line, but Linux just uses the LF character. This can lead to problems when you write a script on Windows and then try to execute it directly on Linux. 
    

    2- I had to add

    AddHandler cgi-script .py
    

    to my .htaccess file

    I edited again on notepad++ and added htaccess file then it worked.

    The problem i was having on local is sorted aswell.

    I had apache on memory stick.

    All i had to do is

    1- add this to apache:

    Options Indexes FollowSymLinks ExecCGI
    

    2- add .py to end of this line

    AddHandler cgi-script .cgi
    

    3- Add the python path at the beginning of my oy file

    #!E:/EasyPHP-5.3.8.1/Python27/python.exe -u
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started learning python and django and I have a question. I got
im currently learning python (in the very begining), so I still have some doubts
After learning python (cpython) and using this page to search for tkinter widgets' options,
WARNING: I have been learning Python for all of 10 minutes so apologies for
I'm learning Python now because of the Django framework. I have been a Perl
I'm learning Python, and I have a situation where I want to consume items
I'm interested in learning python to have access to a more agile language for
I'm still learning python. I just wrote this method to determine if a player
I am learning Python (I have a C/C++ background). I need to write something
I have recently started learning Python and I have 2 questions relating to modules.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.