You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/python-development-environment.md
+13-18Lines changed: 13 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,26 +72,25 @@ Next we need a versioning system. That's a tool for tracking changes you made to
72
72
git config --global user.name "Your Name"
73
73
74
74
Now let's make a new project using our versioning system. Just type:
75
-
```sh
76
-
mkdir myproject
77
-
cd myproject/
78
-
git init
79
-
```
75
+
76
+
mkdir myproject
77
+
cd myproject/
78
+
git init
80
79
81
80
Yay! We have a new project. It's empty though. So let's add some code. Start a text editor like this:
82
81
`nano run_motor.py`
83
82
84
83
85
84
Now add the following code:
86
-
```py
85
+
~~~py
87
86
from ev3dev.brickpi importOUTPUT_A, Motor #Replace brickpi with ev3 if you use that.
88
87
import time
89
88
90
89
m = Motor(OUTPUT_A)
91
90
m.run_forever(duty_cycle_sp=100)
92
91
time.sleep(1)
93
92
m.stop()
94
-
```
93
+
~~~
95
94
96
95
Press ctrl-X and `y` to save. It's time to let the first motor run. Plug it into port A on your brick and go: `python run_motor.py`. Tataaa! The motor is running full power for a second.
97
96
@@ -101,16 +100,12 @@ What we are going to do now is make a clone of our project on the ev3dev machine
101
100
In the Welcome dialog choose: 'Checkout from version control' > 'Git'
102
101
Now type the hostname of the ev3dev machine, followed by a semicolon the projectname. In the other fields choose a nice parent and project directory.
103
102
104
-
{% include screenshot.html source="/images/osx/PyCharm/welcome.png" %}
105
-
106
-
Now you can continue where you left of on the ev3dev machine, but with a larger screen, better keyboard and more tools! There is one problem, though: PyCharm puts red curly lines under the ev3dev library. {% include screenshot.html source="/images/osx/PyCharm/missing-lib.png" %} It doesn't recognise it. And that's logical, because it's missing on the development machine. If we install it we won't be able to run motors, but the documentation and autocomplete will be active. So on your development machine start a terminal and do:
{% include inline-screenshot.html source="/images/osx/PyCharm/welcome.png" caption="The 'Welcome' dialog in PyCharm"%}
111
104
112
-
python setup.py install
113
-
cd .. # Optional
114
-
rm -r ev3dev-lang-python/ # Optional to remove the downloaded files. It's installed now anyway.
105
+
Now you can continue where you left of on the ev3dev machine, but with a larger screen, better keyboard and more tools! There is one problem, though: PyCharm puts red curly lines under the ev3dev library. {% include inline-screenshot.html source="/images/osx/PyCharm/missing-lib.png" caption="Grrr. Those curly red lines. Fix them!" %} It doesn't recognise it. And that's logical, because it's missing on the development machine. If we install it we won't be able to run motors, but the documentation and autocomplete will be active. So on your development machine start a terminal and do:
0 commit comments