回答編集履歴
1
turtle例を追記
test
CHANGED
@@ -5,6 +5,12 @@
|
|
5
5
|
まずcloud9では、そのままではデスクトップ環境(GUI)が利用できないようです。
|
6
6
|
|
7
7
|
GUIが利用できないため、turtleも動作しません。
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
cloud9-vncのインストールと起動
|
12
|
+
|
13
|
+
--
|
8
14
|
|
9
15
|
|
10
16
|
|
@@ -30,19 +36,17 @@
|
|
30
36
|
|
31
37
|
表示されたURL「https://hoge-huga.c9users.io/vnc.html」をブラウザで開くことで、仮想デスクトップ画面が表示されます。このデスクトップ内ではGUI操作ができます。
|
32
38
|
|
33
|
-
た
|
39
|
+
また、デスクトップ上右クリック->Applications->Terminal->Bash にてターミナル起動して`.py`実行できます。
|
34
40
|
|
35
41
|
|
42
|
+
|
43
|
+
動作例:matplotlib
|
44
|
+
|
45
|
+
--
|
36
46
|
|
37
47
|
test.py
|
38
48
|
|
39
49
|
```Python
|
40
|
-
|
41
|
-
#!/usr/bin/env python
|
42
|
-
|
43
|
-
# -*- coding: utf-8 -*-
|
44
|
-
|
45
|
-
|
46
50
|
|
47
51
|
import numpy as np
|
48
52
|
|
@@ -60,10 +64,44 @@
|
|
60
64
|
|
61
65
|
```
|
62
66
|
|
63
|
-
![
|
67
|
+
![matplotlib](e359c9b6dadbe40b015aedba80ceaf2d.png)
|
64
68
|
|
65
69
|
|
66
70
|
|
67
|
-
|
71
|
+
動作例:turtle
|
68
72
|
|
73
|
+
--
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
test_turtle.py
|
78
|
+
|
79
|
+
```python
|
80
|
+
|
81
|
+
import turtle
|
82
|
+
|
83
|
+
w = turtle.Screen()
|
84
|
+
|
85
|
+
t = turtle.Turtle()
|
86
|
+
|
87
|
+
for i in range(10):
|
88
|
+
|
89
|
+
for j in range(2):
|
90
|
+
|
91
|
+
t.forward(100)
|
92
|
+
|
93
|
+
t.right(50)
|
94
|
+
|
95
|
+
t.forward(100)
|
96
|
+
|
97
|
+
t.right(120)
|
98
|
+
|
99
|
+
t.right(360)
|
100
|
+
|
101
|
+
w.exitonclick()
|
102
|
+
|
103
|
+
```
|
104
|
+
|
69
|
-
|
105
|
+
![turtle](1cf77479aef3f74925de10860cedf963.png)
|
106
|
+
|
107
|
+
|