从wamp64运行python代码时遇到问题

时间:2018-11-12 16:01:23

标签: python python-3.x wamp wampserver

我刚刚编写了必须从wamp64运行的python(python 3.7)程序。但这给了我以下错误消息:禁止访问您没有权限访问此服务器上的/FileTransfer2.py。我已经对wamp服务器上的httd.conf文件进行了以下更改,就像我原本打算的那样,但是仍然出现错误。

<Directory />
    AllowOverride none
    Require all granted      # changed it from denied to granted
</Directory>

Options +Indexes +FollowSymLinks +Multiviews +ExecCGI    # added ExeCGI

AddHandler cgi-script .cgi .py       # added .py

下面是我要运行的python代码。

#!C:\python37\python.exe
from shutil import copyfile

source_path = 'Z:\packages\log\log_times.csv'
dest_path = 'c:\wamp64\www\log_times.csv'

# for copying of file from network drive to local drive
copyfile (source_path,dest_path)

# for deleting the content of the source file
Dcontent = open(source_path, 'w')
Dcontent.close()

0 个答案:

没有答案