Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
requently-Asked Questions
==========================

My script works when launched as ``python3 script.py`` but exits immediately or throws an error when launched from Brickman or as ``./script.py``
-----

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a one line title. Otherwise rst does not recognize it as such.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can tell I was distracted while writing this 😆 Three times I wrapped this line, and three times I realized it was broken and fixed it.


This may occur if your file includes Windows-style line endings, which are often
inserted by editors on Windows. To resolve this issue, open an SSH session and
run the following command, replacing ``<file>`` with the name of the Python file
you're using:

.. code:: shell
sed -i 's/\r//g' <file>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There used to be a dos2unix utility, not sure if it's available by default on the ev3 though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still exists but is not installed by default, so I decided to go with the built-in option.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

This will fix it for the copy of the file on the brick, but if you plan to edit
it again from Windows you should configure your editor to use Unix-style endings.
For PyCharm, you can find a guide on doing this `here <https://www.jetbrains.com/help/pycharm/2016.2/configuring-line-separators.html>`_.
Most other editors have similar options; there may be an option for it in the
status bar at the bottom of the window or in the menu bar at the top.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

spec
rpyc
faq

Indices and tables
==================
Expand Down