Python Forum
for what is this used for? APP_NAME, APPDIRS, LOGFILE , VENDOR_CACHE
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for what is this used for? APP_NAME, APPDIRS, LOGFILE , VENDOR_CACHE
#1
I'm learning through one's code and I can not find a specific answer to my question(s). (I have an intermediate python's level)

Code: https://github.com/sumpfgottheit/lanscan...lanscan.py

[Line 52 - 55] For what is APP_NAME, APPDIRS, LOGFILE, VENDOR_CACHE used for? why is he using that?

APP_NAME = 'lanscan'
APPDIRS = AppDirs(APP_NAME)
LOGFILE = os.path.join(APPDIRS.user_log_dir, 'lanscan.log')
VENDOR_CACHE = os.path.join(APPDIRS.user_cache_dir, 'vendors')
In line 63 he made a function called initialize_directories() using some of the variables but I don't get it.

def initialize_directories():
    if not isdir(APPDIRS.user_cache_dir):
        os.makedirs(APPDIRS.user_cache_dir, mode=0o755, exist_ok=True)
    if not isdir(APPDIRS.user_log_dir):
        os.makedirs(APPDIRS.user_log_dir, mode=0o755, exist_ok=True)
I appreciate your help Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  read logfile between two specific strings FelixReiter 6 2,889 Jan-04-2021, 02:26 PM
Last Post: FelixReiter
  project/main.py import from project/bin/APP_NAME Myersj281 3 3,914 Jul-19-2017, 04:41 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020