a guest Feb 17th, 2019 46 Never
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=
- ubuntu-workstation:~$ python python_test.py
RAW Paste Data