Skip to content

Instantly share code, notes, and snippets.

@alexandre
Last active August 29, 2015 14:01
Show Gist options
  • Save alexandre/a276175745d2b731b264 to your computer and use it in GitHub Desktop.
Save alexandre/a276175745d2b731b264 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#_*_ coding: utf-8 _*_
'''
teste simples levando em conta arquivo.txt =
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => lost
id => gustavo
interfaces => eth0,lo,wlan0
ipaddress => 10.0.8.60
ipaddress_eth0 => 10.0.8.60
'''
#versao 1
conteudo = dict()
[conteudo.update({x.strip():y.strip()}) for x,y in [x.split(' => ') for x in open("arquivo.txt",'r').readlines()]]
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment