Python is an interpreted, object-oriented, and high-level computer programming language with very powerful features that's easy to learn because of its simple syntax. For this project, we can easily write an interface between Twitter and Arduino using the Python script.
The following steps will explain how to install Python on a Windows computer:
Downloads
folder in your computer and find the downloaded setup file. (My default downloads folder is C:Downloads
).If you have already set to Add Python 3.5 to PATH for writing the environment variables during the Python setup installation process, ignore this section. If not, then follow these steps to set environment variables for Python.
PATH
C:UsersPradeekaAppDataLocalProgramsPythonPython35;C:UsersPradeekaAppDataLocalProgramsPythonPython35Libsite-packages;C:UsersPradeekaAppDataLocalProgramsPythonPython35Scripts;
Modify the preceding paths according to your Python installation location:
python
, and then press the Enter key. The Python Command Prompt will start. The prompt begins with >>>
(three greater than marks):This ensures that the Python environment variables are successfully added to Windows. From now, you can execute Python commands from the Windows command prompt. Press Ctrl + C to return the default (Windows) command prompt.
The setuptools
utility lets you download, build, install, upgrade, and uninstall Python packages easily. To add the setuptools
utility to your Python environment, follow the next steps. At the time of writing this book, the setuptools
utility was in version 18.0.1.
setuptools
download page at https://pypi.python.org/pypi/setuptools.ez_setup.py
script by clicking on the link (https://bootstrap.pypa.io/ez_setup.py):ez_setup.py
in your local drive.ez_setup.py
file using the cd
command. We assume that the drive is labeled as the letter D:
, and the folder name is ez_setup
:C:>D: D:>CD ez_setup
python ez_setup.py
and press the Enter key to run the Python script:This installs the easysetup
utility package on your Python environment:
The pip
utility package can be used to improve the functionality of setuptools
. The pip
utility package can be downloaded from https://pypi.python.org/pypi/pip. You can now directly install the pip
utility package by typing the following command into Windows Command Prompt:
C:> easy_install pip
However, you can ignore this section if you have selected pip, under Optional Features, during the Python installation.
Follow these steps to open the Python interpreter:
C:> Python
To exit from the Python Interpreter, simply type exit()
and hit the Enter key.
The Tweepy library provides an interface for the Twitter API. The source code can be found at https://github.com/tweepy/tweepy. You do not have to download the Tweepy library to your computer. The pip install
command will automatically download the library and install it on your computer.
Follow these steps to install the Python-Twitter library on your Python installation:
C:>pip install tweepy
18.188.137.37