Skip to content

Commit 39bfece

Browse files
committed
v1.1.0: Bugfixes and more options for popups
1 parent 5965ee1 commit 39bfece

File tree

5 files changed

+211
-118
lines changed

5 files changed

+211
-118
lines changed

demo/pyPadDemo.gif

-261 KB
Loading

demo/pyPadDemo.py

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#%% Execution with Keyboard and Mouse
44

5-
# <Shift> + <Return> executes the smalles possible piece of code
5+
# <Shift> + <Return> executes the smallest possible piece of code
66
# that includes the line at the cursor or next to the cursor.
77

88
print "hello world"
@@ -13,7 +13,7 @@
1313
# The value of a single expression line will be printed
1414
1+2
1515

16-
# Muliline commands are executed as a whole and can be started
16+
# Multi line commands are executed as a whole and can be started
1717
# from any line inside the indented block. A yellow line shows
1818
# which lines have been executed.
1919

@@ -42,15 +42,16 @@
4242

4343
#%% Marker lines
4444

45-
# An animated dark line indicates that python is busy.
45+
# An animated dark line indicates that Python is busy.
4646
import time
4747
for i in 1,2,3,4,5:
4848
print "wait for", i, '*'*i
4949
time.sleep(1)
5050
# you can interrupt and restart the kernel with <Alt> + <R>
51+
# when you use an external python installation of your system
5152

5253
# A red line indicates an syntax or runtime error.
53-
# The python traceback error message is clickable.
54+
# The Python traceback error message is clickable.
5455

5556
# find the syntax error
5657
a = [(1,13), (4,12),
@@ -59,27 +60,29 @@
5960
(1,12), (5,14)]
6061

6162
def test(x):
62-
print 'We now divide', x, 'by zero.'
63+
print 'We divide', x, 'by another number.'
6364
print 'The result is:'
6465
print x / 0
65-
print "Now you"
66-
print 'removed the'
67-
print 'runtime error'
66+
print 'No runtime'
67+
print 'error is present'
68+
print 'any more.'
6869

69-
test(5) # runtime error
70+
# demonstrates a runtime error
71+
test(5)
7072

7173

72-
#%% Code completion and call tips
74+
#%% Code completion and popups
7375

7476
# A code completion list is shown for any objects.
75-
class car:
76-
nWheels = 4
77-
speed = 100
78-
color = "red"
77+
class planet:
78+
name = 'Proxima b'
79+
EarthSimularityIndex = 0.85
80+
distance = 4.2
81+
habitable = True
7982
# add a point "." after the variable to display the list
80-
car
83+
planet
8184

82-
# Code completion is also available for dictionarys.
85+
# Code completion is also available for dictionaries.
8386
# This also works for h5py file objects.
8487
bike = {
8588
'nWheels': 2,
@@ -96,20 +99,20 @@ def twice(x, factor=2):
9699
# add a parenthesis "(" after the function to display the doc string
97100
twice
98101

99-
#%% Tool tips
102+
#%% Autoinspection popups
100103

101104
var1 = {'two': 2}
102105
var2 = [1,2,3]
103106
var3 = (1,2,3)
104107
var4 = "test"
105108

106109
# Select each variable (double click) and hover with the mouse.
107-
# The type and string representation will be shown in a tooltip
108-
# When clicking at the tooltip the full content is printed in
110+
# The type and string representation will be shown in a popup
111+
# When clicking at the popup the full content is printed in
109112
# the console. Use <Ctrl> + <Z> in the console to remove it again.
110-
var1, var2, var3, var4, test, time
113+
var1, var2, var3, var4, twice, time
111114

112-
# Select the "True" and click at the tooltip to change to "False"
115+
# Select the "True" and click at the popup to change to "False"
113116
swich = True
114117

115118

@@ -122,14 +125,14 @@ def twice(x, factor=2):
122125

123126
# The console has an undo buffer. Print some lines, click in the console
124127
# and press undo (<Ctrl> + <Z>) to unto the print.
125-
print '1.', multiline
126-
print '2.', multiline
127-
print '3.', multiline
128+
print '1.' + ((' First long multi line output.'*3)+'\n')*3
129+
print '2.' + ((' Second long multi line output.'*3)+'\n')*3
130+
print '3.' + ((' Third long multi line output.'*3)+'\n')*3
128131

129132

130133
#%% Matplotlib
131134

132-
# When an external python kernel is used that has matplotlib installed,
135+
# When an external Python kernel is used that has matplotlib installed,
133136
# multiple interactive plots can be plotted at the same time
134137

135138
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)