Home > other >  ConfigParser function error
ConfigParser function error

Time:12-30

Area. Ini content:
 
[Numbers]

PI: 3.1415926535897931

[message]

The greeting: Welcome to the area calculation program!
Question: do enter the radius:
Result_message: The area is


Code:
 
The from configparser import configparser


If __name__=="__main__ ':
CONFIGFILE='area. Ini'
The config=ConfigParser
The config. Read (CONFIGFILE)
Print (config [' messages'] get (' greeting '))
Radius=float (input (config [r]. 'the message' get 'question' + '))
Print (config [' message '] get (' result_message), end=' ')
Print (config [' message '] getfloat (" PI ") radius, * * * 2)


Error:
Config. Read (CONFIGFILE) this line of code error, error content for
TypeError: read () missing 1 required positional argument: 'filenames'

Trouble your bosses to give directions, thank you
  • Related