Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.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/9/solr/3.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中刷新目录文件列表_Python_Import_Refresh_Urllib - Fatal编程技术网

如何在python中刷新目录文件列表

如何在python中刷新目录文件列表,python,import,refresh,urllib,Python,Import,Refresh,Urllib,我编写了一段代码,用于下载单个文件python库,并将其导入以自动化任务。这个库是我制作的,存储在github上。每当我在下载后导入它时,就会出错,并说库不存在或无法导入。最好是一个文件。 我的github是FranticCodeStudent1 导入urllib.request 导入操作系统 导入时间 urllib.request.urlretrieve(“https://franticcodestudent1.github.io/dlrepo/KeyLite.py“,“KeyLite.py”

我编写了一段代码,用于下载单个文件python库,并将其导入以自动化任务。这个库是我制作的,存储在github上。每当我在下载后导入它时,就会出错,并说库不存在或无法导入。最好是一个文件。 我的github是FranticCodeStudent1

导入urllib.request
导入操作系统
导入时间
urllib.request.urlretrieve(“https://franticcodestudent1.github.io/dlrepo/KeyLite.py“,“KeyLite.py”)
时间。睡眠(1)
导入KeyLite
KeyLite.SendKey(KeyLite.VK_返回)

为什么不在上创建一个正确的库呢?您的代码没有在我的端抛出错误,您可以使用相同的库。有关更多详细信息,请共享错误日志。