Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- pattern = '^Hostname=([a-zA-Z0-9.]+)'
- hand = open('python_test_data.conf')
- for line in hand:
- line = line.rstrip()
- if re.search(pattern, line) :
- print line
- ### Option: Hostname
- # Unique, case sensitive Proxy name. Make sure the Proxy name is known to the server!
- # Value is acquired from HostnameItem if undefined.
- #
- # Mandatory: no
- # Default:
- # Hostname=
- Hostname=bbg-zbx-proxy
- ubuntu-workstation:~$ python python_test.py
- Hostname=bbg-zbx-proxy
Add Comment
Please, Sign In to add comment