我是python的新手.我在我的Windows机器上使用Pydev IDE和Eclipse进行python编程.我正在使用python 3.3 vern并希望与MS Sql Server 2008连接.有人建议我应该如何连接MS Sql Server 2008.
我在 Windows 7 x64 上使用 pydev,我发现生成器函数中的断点被忽略(如果我注释掉yield,一切正常)。
然后我发现了一个旧的 SO question Python debugger step in generators?
答案是“我刚刚测试了 eclipse,它将在安装 pydev 的情况下进行调试。”
但是当我测试代码时,断点仍然被忽略。
def example(n):
i = 1
while i <= n:
yield i
i += 1
print "hello"
print "goodbye"
if __name__ == '__main__':
example(8)
Run Code Online (Sandbox Code Playgroud)
所以我的问题是:
我正在使用 Liclipse,它基本上是带有 Eclipse 的 pydev。python 文件运行良好,但是当我尝试在同一个文件上使用 pydev 调试器时,调试器无法启动,我找不到有关此错误的任何信息。这是pydev中的错误吗?它甚至说“在处理上述异常期间,发生了另一个异常”
我正在使用 python 3.7.1
warning: Debugger speedups using cython not found. Run '"C:\Users\q4116\AppData\Local\Programs\Python\Python37-32\python.exe" "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 20104)
Traceback (most recent call last):
File "_pydevd_bundle\pydevd_cython_win32_37_32.pyx", line 134, in _pydevd_bundle.pydevd_cython_win32_37_32.set_additional_thread_info
AttributeError: '_MainThread' object has no attribute 'additional_info'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\pydevd.py", line 1951, in <module>
main()
File "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\pydevd.py", line 1945, in …Run Code Online (Sandbox Code Playgroud) 老实说,我不知道我在看什么。
当我开始调试时,我在这个 VSCode 项目(一个 Discord 机器人)中的调试配置突然出现错误。正常运行程序的时候是不会这样的,其他项目调试好像还可以。
大约 50% 的时间,尽管出现错误并且调试正常,它最终会连接到 Discord,但其他时候程序会挂起并拒绝连接到 Discord。
这是错误文本,对于转储这么多代码,我深表歉意,但我不知道其中是否有任何重要意义:
'c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\launcher' '51717' '--' 'bot/bot.py'
pydev debugger: critical: unable to get real case for file. Details:
filename: bot
drive:
parts: ['bot']
(please create a ticket in the tracker to address this).
Traceback (most recent call last):
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 221, in _get_path_with_real_case
return _resolve_listing(drive, iter(parts))
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
During handling …Run Code Online (Sandbox Code Playgroud) 我得到一个简单的打印语句错误,可能是错误,已更改为浮动并尝试但仍然存在错误.
if __name__ == '__main__':
print (i*i for i in range(5))
Run Code Online (Sandbox Code Playgroud)
错误:
<generator object <genexpr> at 0x0000000002731828>
Run Code Online (Sandbox Code Playgroud)
提前致谢...
所以这是代码,我从codecademy复制了字符,并试图改变它,只是为了得到相同的错误.我知道codecademy正在使用python 2,但差异不会那么大,以至于基本的"%s"不起作用!
from datetime import datetime
now = datetime.now()
print ("%s + %s + %s") % (now.year, now.month, now.day)
Run Code Online (Sandbox Code Playgroud)
这是我的错误信息:
Traceback (most recent call last):
File "C:\Users\Sunil\Desktop\Beginning Programming\Java\workspace\Helain\src\packag\__init__.py", line 5, in <module>
print ("%s + %s + %s") % (now.year, now.month, now.day)
TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple'
Run Code Online (Sandbox Code Playgroud)
我犯了什么错误?