T
T
toarugakusei2021-03-14 19:45:41
Python
toarugakusei, 2021-03-14 19:45:41

Problems with logging library in python how to solve it?

Tried to port the game from Nscripter to Rren'py found on

gidhabe
https://github.com/franckv/nscripter2renpy
ready-made code (The code is very old, it was written 10 years ago) for this, only there were problems when starting it, at first it cursed at the parser file, I decided to just rename it, then it cursed at import Image, I replaced it with from PIL import Image
and now it curses at logging604e3b4308d03512119126.png
D:\ren'py games\Retsukihime2\game\nscripter2renpy-master\src>python nscripter2renpy.py -f script.txt > script.rpy
Traceback (most recent call last):
  File "nscripter2renpy.py", line 8, in <module>
    logging.basicConfig(
  File "C:\Users\gama\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1973, in basicConfig
    h = FileHandler(filename, mode)
  File "C:\Users\gama\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1143, in __init__
    StreamHandler.__init__(self, self._open())
  File "C:\Users\gama\AppData\Local\Programs\Python\Python38\lib\logging\__init__.py", line 1172, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\tmp\\pygmail.log'

here is the code file
https://drive.google.com/file/d/1GZG6qCdafDoLtWQq9...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-03-14
@toarugakusei

Paste somewhere on run code:

import os

LOG_DIR = 'D:\\tmp\\'
if not os.path.exists(LOG_DIR):
        os.makedirs(LOG_DIR)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question