sinedie / SRTranslator

SRT files translator
Do What The F*ck You Want To Public License
219 stars 27 forks source link

import os module #42

Closed Aufree closed 1 year ago

sinedie commented 1 year ago

why?

Aufree commented 1 year ago

somebody will get an error when not import os module, just like this:

... Translating chunk. 0 %
... Translating chunk. 9 %
... Translating chunk. 19 %
... Translating chunk. 29 %
... Translating chunk. 39 %
... Translating chunk. 48 %
... Translating chunk. 58 %
... Translating chunk. 68 %
... Translating chunk. 77 %
... Translating chunk. 87 %
... Translating chunk. 97 %
... Translation done
Traceback (most recent call last):
  File "sr_translator.py", line 15, in <module>
    srt.save(f"{os.path.splitext(filepath)[0]}_translated.srt")
                ^^
NameError: name 'os' is not defined