Skip to content

Commit 0ad9dd5

Browse files
committed
new examples
1 parent 7232f73 commit 0ad9dd5

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def more(text, numlines=15):
2+
lines = text.splitlines()
3+
while lines:
4+
chuck = lines[:numlines]
5+
lines = lines[numlines:]
6+
for line in chuck:
7+
print(line)
8+
if lines and input('more/mais?') not in ['y', 'Y', 's', 'S']:
9+
break
10+
11+
if __name__ == '__main__':
12+
import sys
13+
more(open(sys.argv[1]).read(), 10)

02-systemTools/ipython1.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# coding: utf-8
2+
import sys, os
3+
len(dir(sys))
4+
len(dir(os))
5+
len(dir(os.path))

02-systemTools/ipython2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# coding: utf-8
2+
import sys
3+
dir(sys)
4+
sys.__doc__

02-systemTools/ipython3.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# coding: utf-8
2+
get_ipython().run_line_magic('ls', '')
3+
get_ipython().run_line_magic('run', 'ipython2.py')
4+
print(sys.__doc__)
5+
help(sys)

0 commit comments

Comments
 (0)