Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
panyanyany committed Aug 26, 2016
1 parent 29fc86c commit fd0ec71
Showing 1 changed file with 59 additions and 64 deletions.
123 changes: 59 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,28 @@ Contents
Examples
===

Short list
Import beeprint as pp
---
```
from beeprint.printer import beeprint as pp
```

Short List
---

```
In [2]: alist = [1, 2, 3, 4, 5, 6]
In [3]: pp(alist)
[1, 2, 3, 4, 5, 6]
```

Compliated list
Complicated List
---
```
In [4]: clist = [1, [2], {'key': 'val'}]
In [5]: pp(clist)
[
1,
[2],
Expand All @@ -36,9 +49,20 @@ Compliated list
]
```

Class Instance Formatted Display
Class Instance
---
```
In [6]: class NormalClassNewStyle(object):
...: def mth():pass
...: static_props = 1
...: lists = []
...: dicts = {}
...: tupl = (1,2)
...:
In [7]: obj = NormalClassNewStyle()
In [8]: pp(obj)
instance(NormalClassNewStyle):
dicts: {
},
Expand All @@ -47,73 +71,44 @@ instance(NormalClassNewStyle):
tupl: (1, 2)
```

Long Text Auto Wrapping
Long Text
---

> auto wrapped by terminal width
```
[
'\nThe sky and the earth were at first one blurred entity like an egg. Pangu
was born into it.\n \nThe separation of the sky and the earth took eighteen
thousand years-the yang which was light and pure rose to become the sky,
and the yin which was heavy and murky(朦胧的) sank to form the earth.
Between them was Pangu, who went through nine changes every day, his wisdom
greater than that of the sky and his ability greater than that of the
earth. Every day the sky rose ten feet higher, the earth became ten feet
thicker, and Pangu grew ten feet taller.\n \nAnother eighteen thousand
years passed, and there was an extremely high sky, an extremely thick
earth, and an extremely tall Pangu. After Pangu died, his head turned into
the Five Sacred Mountains (Mount Tai, Mount Heng, Mount Hua, Mount Heng,
Mount Song), his eyes turned into the moon and the sun, his blood changed
into water in river and sea, his hair into grass.\n \nIn all, the universe
and Pangu combine in one.\n',
'\n据民间神话传说古时盘古生在黑暗团中,他不能忍受黑暗,用神斧劈向四方,逐渐
使天空高远,大地辽阔。他为不使天地会重新合并,继续施展法术。每当盘古的身体
长高一尺,天空就随之增高一尺,经过1.8万多年的努力,盘古变成一位顶天立地的巨
人,而天空也升得高不可及,大地也变得厚实无比。盘古生前完成开天辟地的伟大业
绩,死后永远留给后人无穷无尽的宝藏,成为中华民族崇拜的英雄。\n',
]
In [27]: long_text_en = "The separation of the sky and the earth took eighteen thousand years-the yang which was light and pure rose to become the sky, and the yin which was heavy and murky(朦胧的) sank to form the earth. Between them was Pangu, who went through nine changes every day, his wisdom greater than that of the sky and his ability greater than that of the earth. Every day the sky rose ten feet higher, the earth became ten feet thicker, and Pangu grew ten feet taller."
In [28]: pp(long_text_en)
'The separation of the sky and the earth took eighteen thousand years-the yang which was light and pure rose to
become the sky, and the yin which was heavy and murky(朦胧的) sank to form the earth. Between them was Pangu,
who went through nine changes every day, his wisdom greater than that of the sky and his ability greater than that
of the earth. Every day the sky rose ten feet higher, the earth became ten feet thicker, and Pangu grew ten feet
taller.'
In [30]: long_text_cn = "据民间神话传说古时盘古生在黑暗团中,他不能忍受黑暗,用神斧劈向四方,逐渐使天空高远,大地辽阔。他为不使天地会重新合并,继续施展法术。每当盘古的身体长高一尺,天空就随之增高一尺,经过1.8万多年的努力,盘古变成 一位顶天立地的巨人,而天空也升得高不可及,大地也变得厚实无比。盘古生前完成开天辟地的伟大业绩,死后永远留给后人无穷 无尽的宝藏,成为中华民族崇拜的英雄。""
In [31]: pp(long_text_cn)
'据民间神话传说古时盘古生在黑暗团中,他不能忍受黑暗,用神斧劈向四方,逐渐使天空高远,大地辽阔。他为不使天地会重新合
并,继续施展法术。每当盘古的身体长高一尺,天空就随之增高一尺,经过1.8万多年的努力,盘古变成一位顶天立地的巨人,而
天空也升得高不可及,大地也变得厚实无比。盘古生前完成开天辟地的伟大业绩,死后永远留给后人无穷无尽的宝藏,成为中华民
族崇拜的英雄。'
```

Long Text in Dict Auto Wrapping
Long Text in Dict
---

> auto wrapped by terminal width
```
[
{
'english version': '\nThe sky and the earth were at first one blurred entity
like an egg. Pangu was born into it.\n \nThe separation
of the sky and the earth took eighteen thousand
years-the yang which was light and pure rose to become
the sky, and the yin which was heavy and murky(朦胧的)
sank to form the earth. Between them was Pangu, who went
through nine changes every day, his wisdom greater than
that of the sky and his ability greater than that of the
earth. Every day the sky rose ten feet higher, the earth
became ten feet thicker, and Pangu grew ten feet
taller.\n \nAnother eighteen thousand years passed, and
there was an extremely high sky, an extremely thick
earth, and an extremely tall Pangu. After Pangu died,
his head turned into the Five Sacred Mountains (Mount
Tai, Mount Heng, Mount Hua, Mount Heng, Mount Song), his
eyes turned into the moon and the sun, his blood changed
into water in river and sea, his hair into grass.\n \nIn
all, the universe and Pangu combine in one.\n',
},
{
'simplify chinese versino': '\n据民间神话传说古时盘古生在黑暗团中,他不能忍
受黑暗,用神斧劈向四方,逐渐使天空高远,大地辽
阔。他为不使天地会重新合并,继续施展法术。每当
盘古的身体长高一尺,天空就随之增高一尺,经过1.8
万多年的努力,盘古变成一位顶天立地的巨人,而天
空也升得高不可及,大地也变得厚实无比。盘古生前
完成开天辟地的伟大业绩,死后永远留给后人无穷无
尽的宝藏,成为中华民族崇拜的英雄。\n',
},
]
In [33]: d = {'en': long_text_en, 'cn': long_text_cn}
In [34]: pp(d)
{
'en': 'The separation of the sky and the earth took eighteen thousand years-the yang which was light and pure
rose to become the sky, and the yin which was heavy and murky(朦胧的) sank to form the earth. Between
them was Pangu, who went through nine changes every day, his wisdom greater than that of the sky and his
ability greater than that of the earth. Every day the sky rose ten feet higher, the earth became ten feet
thicker, and Pangu grew ten feet taller.',
'cn': '据民间神话传说古时盘古生在黑暗团中,他不能忍受黑暗,用神斧劈向四方,逐渐使天空高远,大地辽阔。他为不使天地
会重新合并,继续施展法术。每当盘古的身体长高一尺,天空就随之增高一尺,经过1.8万多年的努力,盘古变成一位顶
天立地的巨人,而天空也升得高不可及,大地也变得厚实无比。盘古生前完成开天辟地的伟大业绩,死后永远留给后人无
穷无尽的宝藏,成为中华民族崇拜的英雄。',
}
```

Complicated data
Expand Down

0 comments on commit fd0ec71

Please sign in to comment.