![](/img/trans.png)
[英]Running 'code .' in MacOS terminal no longer opens VSCode. Python error?
[英]Syntax error when using decorator and running code selection in terminal (macOS)
當我 select 並使用以下代碼運行選擇時:
@dataclass
class User:
name: str
surname: str
我收到以下錯誤:
>>> @dataclass
...
File "<stdin>", line 2
^
SyntaxError: invalid syntax
有沒有辦法避免這種情況?
這似乎是 VS Code 如何使用“運行選擇”處理正在運行的裝飾器的一個錯誤。
除了等到有新的更新修復它之外,您無能為力。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.