Merge pull request #313 from Everfighting/master
add python function indent
This commit is contained in:
@@ -18,15 +18,15 @@
|
|||||||
from xml.etree.ElementTree import Element
|
from xml.etree.ElementTree import Element
|
||||||
|
|
||||||
def dict_to_xml(tag, d):
|
def dict_to_xml(tag, d):
|
||||||
'''
|
'''
|
||||||
Turn a simple dict of key/value pairs into XML
|
Turn a simple dict of key/value pairs into XML
|
||||||
'''
|
'''
|
||||||
elem = Element(tag)
|
elem = Element(tag)
|
||||||
for key, val in d.items():
|
for key, val in d.items():
|
||||||
child = Element(key)
|
child = Element(key)
|
||||||
child.text = str(val)
|
child.text = str(val)
|
||||||
elem.append(child)
|
elem.append(child)
|
||||||
return elem
|
return elem
|
||||||
|
|
||||||
下面是一个使用例子:
|
下面是一个使用例子:
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
>>> def myfun():
|
>>> def myfun():
|
||||||
... return 1, 2, 3
|
... return 1, 2, 3
|
||||||
...
|
...
|
||||||
>>> a, b, c = myfun()
|
>>> a, b, c = myfun()
|
||||||
>>> a
|
>>> a
|
||||||
|
|||||||
Reference in New Issue
Block a user