LemonInflux Posted October 9, 2008 Share Posted October 9, 2008 I have XAMPP installed on my localhost (windows XP SP2). I would like to add Python to this. I checked the XAMPP addons, but they only supply the files for linux (or, at least, that's how it looked). Has anyone done this? Or, does anyone know of a localhost-type software that supports python? I mean browser-based, not just the python CMD. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/ Share on other sites More sharing options...
trq Posted October 9, 2008 Share Posted October 9, 2008 You need to install mod_python. Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-660796 Share on other sites More sharing options...
LemonInflux Posted October 9, 2008 Author Share Posted October 9, 2008 Hi, I tried that, and I can now see the mod_python file in the modules/ folder. However, when I try to open a python script, all that happens is the source code is shown on screen. What's happening? Thanks, Tom Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-660844 Share on other sites More sharing options...
trq Posted October 9, 2008 Share Posted October 9, 2008 You'll need to setup a handler. Its all covered in the docs. Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-660897 Share on other sites More sharing options...
LemonInflux Posted October 10, 2008 Author Share Posted October 10, 2008 I set up my handler. The only problem is every python script (well, any file ending in .py) goes back to that file, so whatever I do it just runs the handler function. How do I change this so it executes the file I'm pointing to? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662174 Share on other sites More sharing options...
Daniel0 Posted October 10, 2008 Share Posted October 10, 2008 mod_python is not mod_php. Why don't you continue reading the docs? http://www.modpython.org/live/current/doc-html/tut-pub.html#tut-pub Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662180 Share on other sites More sharing options...
LemonInflux Posted October 10, 2008 Author Share Posted October 10, 2008 I did that part, ran the script, and was pointed back to my handler. Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662181 Share on other sites More sharing options...
Daniel0 Posted October 10, 2008 Share Posted October 10, 2008 Then you did it wrong. You're not supposed to do this AND the procedure outlined in the link I posted above. Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662183 Share on other sites More sharing options...
LemonInflux Posted October 10, 2008 Author Share Posted October 10, 2008 Aha, solved part of the problem by restarting apache. Now, when I browse to a .py, I'm told the object isn't found. Why? :S Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662186 Share on other sites More sharing options...
Daniel0 Posted October 10, 2008 Share Posted October 10, 2008 http://www.modpython.org/live/current/doc-html/hand-pub.html Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662195 Share on other sites More sharing options...
LemonInflux Posted October 10, 2008 Author Share Posted October 10, 2008 Brilliant Got that working now. But, surely there's a way to avoid the handlers and just let python interpret the script as it's written without having to go through a handler? If I put my python script on my webhost (that I don't run), it works fine without an index handler. Why is there a difference? Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662198 Share on other sites More sharing options...
Daniel0 Posted October 10, 2008 Share Posted October 10, 2008 Maybe they use another kind of handler or way of serving the scripts. Why don't you ask your host? Edit: Well, actually you could use CGI. Quote Link to comment https://forums.phpfreaks.com/topic/127686-xampp-python-windows/#findComment-662200 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.