Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在浏览器中打开JavaScript以继续_Python_Pythonanywhere - Fatal编程技术网

Python 在浏览器中打开JavaScript以继续

Python 在浏览器中打开JavaScript以继续,python,pythonanywhere,Python,Pythonanywhere,我正在pythonywhere上使用python3.6,当我尝试运行pydrive(自动将文件上载到google drive)时,我遇到以下错误:- You've reached this page because we have detected that Javascript is disabled in your browser. The page you attempted to load cannot display properly if scripts are disabled.

我正在
pythonywhere
上使用
python3.6
,当我尝试运行pydrive(自动将文件上载到google drive)时,我遇到以下错误:-

You've reached this page because we have detected that Javascript is disabled in your browser. The page you attempted to load cannot display properly if scripts are disabled.                               

   Please enable scripts and retry the operation or go back in your browser.
它要求我登录我的gmail帐户,所以我认为这就是问题所在,我如何解决这个问题

这是我的全部代码

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive


def uploadimg(kart, band, fraction):
    gauth = GoogleAuth()
    gauth.LoadCredentialsFile("mycreds.txt")
    if gauth.credentials is None:
        gauth.LocalWebserverAuth()
    elif gauth.access_token_expired:
        gauth.Refresh()
    else:
        gauth.Authorize()
    # Save the current credentials to a file
    gauth.SaveCredentialsFile("mycreds.txt")
    drive = GoogleDrive(gauth)
    ######################

    file1 = drive.CreateFile({'title': "lqi"+fraction+"bandi"+band+"karti"+kart})
    file1.SetContentFile("hi.jpg")
    file1.Upload()

    file3 = drive.CreateFile({'id': file1['id']})

uploadimg("h","h","e")

我必须使用
gauth.CommandLineAuth()
而不是
gauth.LocalWebserverAuth()
才能在远程服务器上使用它

如何调用
PyDrive
?我已经添加了全部代码