小编Har*_*shi的帖子

来自脚本“test.py”的格式错误的标头:错误标头:FISCAL_WEEK_NUMBER .,引用:http://localhost/test.html

我正在尝试运行 pyhton cgi。在 apache wamp 服务器上。代码的 HTML 端工作正常,但是当它转向 python 脚本时。我收到以下错误:

来自脚本“test.py”的格式错误的标头:错误标头:
FISCAL_WEEK_NUMBER .,引用:http://localhost/test.html

我尝试在 IDE 上单独测试我的 python 代码,它工作正常。我无法在这里找到问题。下面是我的代码:

#!C:/Program Files (x86)/Python36-32/python.exe

import cgi
import os
import cgitb;
import pandas as pd
import teradata
import numpy as np

os.environ["USERNAME"] = "hjoshi"
form = cgi.FieldStorage()

# Get filename here.
fileitem = form['filename']

# Test if the file was uploaded
if fileitem.file:
    fn = os.path.basename(fileitem.filename)
    query = "insert into p_piw_stg.sales_goals_test_harsh (?, ?, ?, ?)" #insert query for database
    input = pd.read_excel('C:/Users/hjoshi/Downloads/' + …
Run Code Online (Sandbox Code Playgroud)

python apache cgi

3
推荐指数
1
解决办法
1065
查看次数

标签 统计

apache ×1

cgi ×1

python ×1