Documentation

Overview

The Python Force Server is designed to be run on almost any computer with networking capabilities and has Python version 2.7 or above.
This Python Force Server was designed from the ground up to slip quietly into the background of your code, with easily installation, implementation and self documenting functions and delegate calls.
It will handle all client connections and will guarantee that all data sent from the tiles on the Force app are of the relevant data type when you access it. For example, if a slider sends data, the data type in Python will either be a Integer or a Float, if it is a Textfield, the data will be a String.

Installation

Install Python

The Force Server requires that Python version 2.7 or newer is installed on the device it will run on.
To check if you device has the correct version of Python installed, open a Command Prompt, or Terminal of your choice and type in the command: python
If you have Python installed, you should get an output similar to the following:
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Note on the first line there is a version number, make sure that it is greater than 2.7.0.
If that does not come up, and you get an error like Command does not exist, then you must install Python on your computer.
There are many ways to do this, but the standard way is to download an installer from Python's official website here and follow their instructions on installing Python onto your computer.
Also note that the Force Server requires the following Python frameworks:

  • time
  • socket
  • thread
  • base64

These are all standard Python frameworks, so should be isntalled by default by the Python installer.

Install the Force Server

Currently there is no setup.py or install script available for the Force Server to be installed globally on a device.
However, installing and using the Force Server is as easy as following the steps below:

  1. Create a project folder on you device.
  2. Download the source code from the GitHub repository here.
  3. Copy or Move both ForceServer.py and template.py into the project folder you created in step 1.
  4. Open template.py to get started.