Python, die schlange die mich beißt.

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Python, die schlange die mich beißt.

Postby pc_helferlein » 22. August 2006 19:29

python nur wie?
Ich hab mir da was geholtgehabt und @home getestet ging aber total in die hose.

Gibts für 153a da n addon? Bin wohl zu blind zum finden sry. könnt ihr mir da helfen? :oops:

Ach ja und warum heißt das xampp addon verzeichnis für python lampp :s?

BITTe HILFE...
pc_helferlein
 
Posts: 27
Joined: 10. July 2006 16:53

Postby sari42 » 23. August 2006 18:42

>Python, die schlange die mich beißt.
is das nich ne Würgeschlange?
SCNR
sari42
 
Posts: 800
Joined: 27. November 2005 18:28

Postby pc_helferlein » 23. August 2006 19:05

:lol:

jap aber was passiert mit der beute?
die geht durchs maul rein "beiß2n".

Kann mir hjemand bei dem problem helfen? Büdde
pc_helferlein
 
Posts: 27
Joined: 10. July 2006 16:53

Postby germareyam » 04. February 2008 11:59

There's no AddOn, but you can configure your XAMPP by hand:

One possibility is to install the Python stuff by hand. Following is the procedure:

1. Download the latest XAMPP (version 1.6.5) from http://www.apachefriends.de
or http://www.apachefriends.org and install it in the C:\xampp directory



2. Download Python 2.5.1 from http://www.python.org
and install it in the C:\Python25 directory



3. Download mod_python (version 3.3.1) from http://www.modpython.org
and install it.
Choose the C:\Python25 directory for the Python location
and C:\xampp\apache directory as the Apache location



4. Open the file C:\xampp\apache\conf\httpd.conf
and add the line

LoadModule python_module modules/mod_python.so

at the end of the other LoadModule lines

Also add the following lines
<Directory "C:/xampp/cgi-bin">
AddHandler mod_python .py
PythonHandler python
PythonDebug On
Order allow,deny
Allow from all
</Directory>



5. Stop and restart the Apache server with the XAMPP Control Panel
If the Apache server doesn't start you made an error in the file
C:\xampp\apache\conf\httpd.conf



6. Compile the the Python script TestPython.py (see bottom of this file) and
copy the file TestPython.pyc into the C:\xampp\cgi-bin directory

For compilation you can use the following script:

#!C:\Python25\python -u
# -*- coding: iso-8859-15 -*-

import cgi,cgitb,sys
from TestPython import *

class CompilePythonModules():
""" Compiles the needed Python modules. """

def __init__(self):
""" Constructor method. """
if __debug__:
cgitb.enable() # for CGI debugging
sys.stderr = sys.stdout


def _compile(self):
""" Compiles the needed modules. """
tstPython = TestPython()


# main program starts here
if __name__ == '__main__':
cPyMod = CompilePythonModules()
cPyMod._compile()


I don't know why one has to compile the Python scripts "by hand".

If I copy only the file TestPython.py then I get back the content of my python
script in the next step 7. I don't know the reason for this behaviour.
Under Linux the Apache server automatically compiles the Python script.
Maybe someone knows an answer for this strange bahaviour under Windows.
But my workaround works fine.



7. Enter the adress http://localhost/cgi-bin/TestPython.py into your web browser

Content of the script TestPython.py:

#!/usr/bin/python
# -*- coding: iso-8859-15 -*-

import cgi,cgitb,Cookie,sys

class TestPython():
""" Tests if the XAMPP Python Add-On and mod_python are properly installed. """

def __init__(self):
""" Constructor method. """
if __debug__:
cgitb.enable() # for CGI debugging
sys.stderr = sys.stdout


def _outputHTMLGreetingPage(self):
""" Outputs an HTML response to the browser. """
print "Content-type: ", "text/html"
print ""
print "<?xml version=1.1 ?>"
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"'
print '"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
print '<html xmlns="http://www.w3.org/1999/xhtml">'
print " <head>"
print " <title>My window title</title>"
print " </head>"
print " <body>"
print " <h1>Congatulation, Python works!</h1>"
print " </body>"
print "</html>"


# main program starts here
if __name__ == '__main__':
test = TestPython()
test._outputHTMLGreetingPage()
germareyam
 
Posts: 10
Joined: 18. January 2008 08:21
Location: D-89522 Heidenheim / Brenz


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 14 guests