如何开始使用python

2024-09-30 05:26:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚刚开始使用Python,可能无法设置我的工作目录,或者正在尝试打印一些内容。你知道吗

我正在打印“你好世界”

航向

Traceback (most recent call last):
  File "C:\Users\noahs\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-41ca3e3a1438>", line 1, in <module>
    runfile('D:/Desktop/Python/filename.py', wdir='D:/Desktop/Python')
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile
    stream = tokenize.open(file)  # @UndefinedVariable
  File "C:\Users\noahs\AppData\Local\Programs\Python\Python37\lib\tokenize.py", line 447, in open
    buffer = _builtin_open(filename, 'rb')
PermissionError: [Errno 13] Permission denied: 'D:/Desktop/Python/filename.py'

我不知道这些额外的文件是什么,或者为什么我不能让Python打印这个


Tags: inpylocallineopenfilenameusersappdata
1条回答
网友
1楼 · 发布于 2024-09-30 05:26:59

尝试在管理员模式下运行Python控制台/IDE。这应该能解决问题。你知道吗

这很可能是因为您为一个用户而不是计算机上的所有用户安装了Python。:)

相关问题 更多 >

    热门问题