P
P
Proshka172014-09-06 22:43:20
Python
Proshka17, 2014-09-06 22:43:20

Python on Denwer, how?

Hello everyone. I really need your help. I installed ActivPython from the Denwer website on my local server. Unfortunately, I don’t know how to check if it works and how to access it at all. If anyone knows, please tell me.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander, 2014-09-06
@syschel

Python is not recommended in Denver. A very short and miserable thing turns out. I have Denver, but it is used only for the database and the localhost for it. I put the python separately on the disk, registered the path to the python folder in the Windows PATH variable and call it from CMD by simply writing "python". To the file "python filename.py".
And initially in the same way, I put an add-on in Denver. I suffered for a long time and eventually scored a bolt. In Denver, it is designed for a web call (in a browser), and for this, in the folder where the file is located, there must be a kosher .htaccess (with an explanation of how and how to execute *.py files)
For a beginner under Windows, and you have it, since you talk about denver, I advise:
1. Download the python of the version you like 2.x or 3.x
2. Write the paths to the folders in the Pathpython and its script folder
3. Download gcc MinGW (windows console replacement, with *NIX commands). It will be very useful if we do not plan to switch to *NIX operating systems. Especially when you wake up to install packages (libraries) in python.
4. You may have to look for msvcr71.dll, but this is in the future.
5. Well, then Google, Google and Google again. Most of the problems, yes probably all, have long been solved by someone.
Good luck :)
Z.Y. This link is very useful for a Windows user , because not all packages, libraries under Windows are easily installed. And here are already assembled installers specifically for Windows.
Z.Y.S. But the best option is to install an operating system from the Linux family.

S
Sali_cat, 2014-09-09
@Sali_cat

Take open server, it's much newer and it has support for Python scripts.

Y
Yeah, 2014-09-09
@Yeah

I would recommend Vagrant

A
Anatoly Moskopulov, 2017-06-04
@moskopulovanv

Direct answer to your question.
Create folder z:/home/<website>/ cgi (or you can use cgi-bin)
File .htaccess

#!/usr/bin/python
# -*- coding: utf-8 -*-

print #абра-кадабра, Пайтон, работай!
print """to be or not to be?
        <br>быть или не быть?"""

The browser will work at http://<site>/cgi/test.py
PS If something goes wrong, look at the logs: z:\usr\local\apache\logs\error.log

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question