From | To | Expression |
---|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# poswap.py | |
# | |
# Copyright (C) 2013 Santiago M. Mola | |
# Released under the terms of the MIT License. | |
# | |
""" | |
Swaps the source and target language in a Gettext PO file. | |
Learn more at http://mola.io/2013/09/17/swapping-languages-in-gettext-po-file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import ast, _ast, os | |
for root, dirs, files in os.walk('.'): | |
for name in files: | |
if name.endswith('.py'): | |
full = os.path.join(root, name) | |
t = ast.parse(open(full).read()) | |
for n in ast.walk(t): | |
if isinstance(n, _ast.Str) and not isinstance(n.s, unicode): |
статья с описанием - http://habrahabr.ru/post/233243/
Поулчаем список городов http://weather.yandex.ru/static/cities.xml https://pogoda.yandex.ru/static/cities.xml