Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python config file

''' config.cfg
[whatever]
key=qwerertyertywert2345
secret=sadfgwertgrtujdfgh
'''

from configparser import ConfigParser

config = ConfigParser()
config.read('config.cfg')

my_key = config['whatever']['key']
my_secret = config['whatever']['secret']
Comment

PREVIOUS NEXT
Code Example
Python :: python set a specific datetime 
Python :: select rows with nan pandas 
Python :: how to define dtype of each column before actually reading csv file 
Python :: telethon get all channels 
Python :: how to check which python version is installed 
Python :: python sum of natural numbers recursion 
Python :: blender python save file 
Python :: libreoffice add line in table 
Python :: django phone number field 
Python :: win32api.mouse_event python 
Python :: mount drive google colab 
Python :: autopy in python install 
Python :: python last element list 
Python :: python colorama example 
Python :: Tkinter canvas draggable 
Python :: pd add column with zeros 
Python :: django static media 
Python :: show battery of my laptop python 
Python :: display pythonpath linux 
Python :: count gabarit django 
Python :: django dumpdata 
Python :: how to write your first python program 
Python :: how to cancel a input in python 
Python :: how to make a latency command discord.py 
Python :: how to separate a string or int with comma in python 
Python :: how to find no of times a elements in list python 
Python :: python initialise dataframe 
Python :: convert a tuple into string python 
Python :: how to encrypt a string python 
Python :: pd dataframe get column names 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =