OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

What is difference between read and read_file in configparser in Python 3?

  • Thread starter Thread starter Manish Jindal
  • Start date Start date
M

Manish Jindal

Guest
I am wondering what is difference in usage of read and read_file in configparser. As far as I have tested

Code:
config_parser = configparser.ConfigParser()
config_parser.read(config_file)

and

Code:
config_parser = configparser.ConfigParser()
config_parser.read_file(config_file)

both works for me. config_file is name of my config_file I am passing as input parameter.
<p>I am wondering what is difference in usage of read and read_file in configparser. As far as I have tested </p>

<pre><code>config_parser = configparser.ConfigParser()
config_parser.read(config_file)
</code></pre>

<p>and </p>

<pre><code>config_parser = configparser.ConfigParser()
config_parser.read_file(config_file)
</code></pre>

<p>both works for me.
config_file is name of my config_file I am passing as input parameter.</p>
 

Online statistics

Members online
0
Guests online
3
Total visitors
3
Top