Python Forum
what will be the best way to find data in txt file?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what will be the best way to find data in txt file?
I have created a "config" file for my code with all kind of data inside , for the code to run and use
the config.txt is :
IP =
user = root
pass = MyPass1
FreeData = test
what do I need to do in order to read IP\user\pass\FreeData and use it in the code ?

** will it be better to create a json file? and then get the data from it?

You can use configparser.
it's great solution!

Possibly Related Threads…
Thread Author Replies Views Last Post
Question in this code, I input Key_word, it can not find although all data was exact Help me! duchien04x4 3 681 Aug-31-2023, 05:36 PM
Last Post: deanhystad
  FileNotFoundError: [WinError 2] The system cannot find the file specified NewBiee 2 984 Jul-31-2023, 11:42 AM
Last Post: deanhystad
  Cannot find py credentials file standenman 5 1,223 Feb-25-2023, 08:30 PM
Last Post: Jeff900
  selenium can't find a file in my desk ? SouAmego22 0 541 Feb-14-2023, 03:21 PM
Last Post: SouAmego22
  Find (each) element from a list in a file tester_V 3 923 Nov-15-2022, 08:40 PM
Last Post: tester_V
  get data from excel and find max/min Timmy94 1 930 Jul-27-2022, 08:23 AM
Last Post: Larz60+
  find some word in text list file and a bit change to them RolanRoll 3 1,263 Jun-27-2022, 01:36 AM
Last Post: RolanRoll
  Find and delete above a certain line in text file cubangt 12 2,814 Mar-18-2022, 07:49 PM
Last Post: snippsat
Question Help to find the largest int number in a file directory SalzmannNicholas 1 1,392 Jan-13-2022, 05:22 PM
Last Post: ndc85430
Thumbs Up [SOLVED] Find last occurence of pattern in text file? Winfried 4 3,843 Aug-13-2021, 08:21 PM
Last Post: Winfried

Forum Jump:

User Panel Messages

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