Python try except else invalid syntax?

前端 未结 1 883
南笙
南笙 2021-01-23 09:53

So I am trying to set up a small script in Python\'s IDLE. The IDLE syntax check tells me this code has a syntax error:

from ftplib import FTP
import os
def ftp         


        
相关标签:
1条回答
  • 2021-01-23 10:28

    In addition to the problem with my syntax (missing except statement entirely), my ftp attempt statement was outside of the try block. Since I was not "try"ing it, it failed anyway.

    0 讨论(0)
提交回复
热议问题