Skip to content

Commit 6539208

Browse files
Anton VanhouckeAnton Vanhoucke
authored andcommitted
more formatting
1 parent f17a679 commit 6539208

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

docs/tutorials/python-development-environment.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,29 +82,30 @@ Yay! We have a new project. It's empty though. So let's add some code. Start a t
8282

8383

8484
Now add the following code:
85-
~~~ python
86-
from ev3dev.brickpi import OUTPUT_A, Motor #Replace brickpi with ev3 if you use that.
85+
86+
{% highlight python %}
87+
from ev3dev.auto import OUTPUT_A, Motor
8788
import time
8889

8990
m = Motor(OUTPUT_A)
9091
m.run_forever(duty_cycle_sp = 100)
9192
time.sleep(1)
9293
m.stop()
93-
~~~
94+
{% endhighlight %}
9495

9596
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.
9697

9798
Now typing code in nano is fine, but it's much nicer to do it inside a real IDE (Integrated Development Environment). There are many, like Visual Studio, Eclipse and PyCharm. My Favourite is PyCharm Community Edition. So go grab a copy of that one and start it on your development machine.
9899

100+
{% include inline-screenshot.html source="/images/osx/PyCharm/welcome.png" caption="The 'Welcome' dialog in PyCharm"%}
101+
99102
What we are going to do now is make a clone of our project on the ev3dev machine to start working on it on the development machine.
100103
In the Welcome dialog choose: 'Checkout from version control' > 'Git'
101104
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.
102105

103-
{% include inline-screenshot.html source="/images/osx/PyCharm/welcome.png" caption="The 'Welcome' dialog in PyCharm"%}
104-
105106
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.
106107

107-
{% include inline-screenshot.html source="/images/osx/PyCharm/missing-lib.png" caption="Grrr. Those curly red lines. Fix them!" %}
108+
![Curly red lines](/images/osx/PyCharm/missing-lib.png")
108109

109110
And that's logical, because the ev3dev library is 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:
110111

0 commit comments

Comments
 (0)