Guest User

Untitled

a guest
Feb 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import re
  2. pattern = '^Hostname=([a-zA-Z0-9.]+)'
  3. hand = open('python_test_data.conf')
  4. for line in hand:
  5. line = line.rstrip()
  6. if re.search(pattern, line) :
  7. print line
  8.  
  9. ### Option: Hostname
  10. # Unique, case sensitive Proxy name. Make sure the Proxy name is known to the server!
  11. # Value is acquired from HostnameItem if undefined.
  12. #
  13. # Mandatory: no
  14. # Default:
  15. # Hostname=
  16.  
  17. Hostname=bbg-zbx-proxy
  18.  
  19. ubuntu-workstation:~$ python python_test.py
  20. Hostname=bbg-zbx-proxy
Add Comment
Please, Sign In to add comment