Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hatop issue
#2
If I understand the question well, you want to read the paths to the sockets in an external file. You can use a configuration file for this and the configparser module

Output:
# configuration-file.ini [spam] sockets: /var/run/haproxy-main-hello.sock /var/run/haproxy-main-hello1.sock
Your program
import configparser
config = configparser.ConfigParser()
config.read('configuration-file.ini')
sockets = config.get('spam', 'sockets').split('\n')
Reply


Messages In This Thread
hatop issue - by deepakkr3110 - Nov-28-2019, 06:12 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 07:03 AM
RE: hatop issue - by Malt - Nov-28-2019, 10:22 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 07:18 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 07:38 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 07:40 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 08:10 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 08:13 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 08:17 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 08:19 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 08:21 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 08:25 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 08:30 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 08:31 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 08:35 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 08:38 AM
RE: hatop issue - by Gribouillis - Nov-28-2019, 08:54 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 08:59 AM
RE: hatop issue - by deepakkr3110 - Nov-28-2019, 10:28 AM
RE: hatop issue - by deepakkr3110 - Nov-29-2019, 04:21 AM
RE: hatop issue - by buran - Nov-29-2019, 07:50 AM
RE: hatop issue - by Malt - Dec-03-2019, 08:20 AM
try and catch - by deepakkr3110 - Nov-29-2019, 07:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  need code for hatop in python deepakkr3110 2 2,176 Nov-15-2019, 09:06 AM
Last Post: deepakkr3110

Forum Jump:

User Panel Messages

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