Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

configparser error reading relative file path

# the current directory can be changed by your program [or a module] 
# and it is in general not the directory of your program file
import configparser, os
config = configparser.ConfigParser()
config.read(os.path.join(os.path.dirname(__file__), 'config.cfg'))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #configparser #error #reading #relative #file #path
ADD COMMENT
Topic
Name
2+8 =