-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestapp.py
More file actions
46 lines (33 loc) · 1.46 KB
/
testapp.py
File metadata and controls
46 lines (33 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
from bokeh.layouts import layout
from bokeh.plotting import figure, show
from bokeh.models import Button, CustomJS, ColumnDataSource
def button_click_handler():
print("test")
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
# prepare some data
data = {'x_values': [1, 2, 3, 4, 5],
'y_values': [6, 7, 2, 3, 6]}
source = ColumnDataSource(data=data)
# create a new plot with a title and axis labels
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
# add a line renderer with legend and line thickness to the plot
p.line(legend_label="Temp.", line_width=2, source=source)
button = Button(label="Foo", button_type="success")
# button.js_on_click(CustomJS(code="console.log('button: click!', this.toString())"))
button.on_click(button_click_handler)
lay = layout([
[button],
[p],
])
show(lay)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
# 2. sorting and searching - write the sorting algorithms and searching algorithms
# - check how to visualize those..