User Manual

Table Of Contents
95
if os.environ.get('CAMERA'):
Camera = import_module('camera_' + os.environ['CAMERA']).Camera
else:
from camera import Camera
display the Raspberry Pi on the page in real time. Camera screen.
sudo nano app.py
Here we use nano that comes with Raspbian to open app.py for editing in the console. Since it is just
some operations for commenting and deleting comments, there is no need to use other IDEs for editing.
After opening the IDE, we comment out the code:
You can comment out these lines of code by filling in # at the beginning of the code line, or you can write
a ''' at the beginning and end of the entire code to comment out a certain code. The relevant code after the
change is as follows:
# if os.environ.get('CAMERA'):
# Camera = import_module('camera_' + os.environ['CAMERA']).Camera
# else:
# from camera import Camera
or
'''
if os.environ.get('CAMERA'):
Camera = import_module('camera_' + os.environ['CAMERA']).Camera
else:
from camera import Camera
'''
Finally, uncomment the code that imports Camera from camera_pi,
# from camera_pi import Camera
delete in front of #, note that there is a space after the # here, and also delete, the changed code is as
follows:
from camera_pi import Camera
The following is the complete code of the modified app.py:
#!/usr/bin/env python