SHARE
TWEET

Untitled

a guest Feb 17th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top