Skip to content

install

Kimmo Koskenniemi edited this page Mar 14, 2018 · 8 revisions

Installing beta.py on your computer

Installing consists of:

  1. Checking that you have a Python 3 on your system, and perhaps installing it. See a separate page.

  2. Installing datrie package, and perhaps installing some prerequisites if necessary. See a separate page.

  3. Installing beta.py itself. See the instructions below.

You can install beta.py on a Linux, Unix, Mac OS X, or Windows 7 systems. It seems to work in an identical way on each of these platforms. Of course, the installing is a bit different.

You need a Python 3 system in order to install beta.py. A fairly recent one is recommended: at least version 3.5 is good but probably also any version from 3.3 on. On many computers a version of Python 3 is already installed. If you need to install or upgrade, see separate instructions in this wiki and elsewhere in the net.

Note: the command to start the Python compiler/interpreter may vary: it can be either python, python3, python3.6 or similar. You will find out the name and the version by trying and starting it.

Getting the whole beta.py by cloning

Git is an advanced system for collaborative program development. It is usually already present in Linux, Unix and Mac OS X systems and can be downloaded and installed for Windows 7. If you are a programmer and you know what git is (and it is available on your computer), you are advised to load beta.py by cloning the koskenni/beta by executing the following commands on your computer:

$ cd
$ mkdir github
$ cd github
$ git clone https://github.com/koskenni/beta.git

See the Github help for further instructions. If you choose to clone the beta project, it will be very simple to get new and updated versions of beta.py by simply a $ git pull command.

Downloading just the beta.py file

If you are not a programmer or not familiar with git, you can download only the beta.py file (which is sufficient for many purposes). Use your browser or the wget program e.g. in Gnu/Linux, Unix or Mac OS X to) load it from:

https://raw.githubusercontent.com/koskenni/beta/master/beta.py

Then, just save the page e.g. in your home directory.

Direct use of the file

You can put the beta.py file anywhere you like. If you have used git clone for getting it, the file might ve in e.g. in your ~/github/beta/ directory. In order to execute it, you need to call python3 and give the full path of the beta.py file, e.g.:

$ python3 ~/github/beta/beta.py myrules.py

If you saved the beta.py file in your home directory, the command will, of course, be:

$ python3 ~/beta.py myrules.bta

Proper installation

The following instructions apply to Linux, Unix and Mac OS X. You can make the using of beta.py more convenient through the following steps:

  1. First you must find out the full path of the python3 you are using (here on a Mac OS X):

     $ which python3
     /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
    
  2. Copy the beta.py file in your ~/bin directory:

     $ cp beta.py ~/bin/beta.py
    
  3. Modify the first line of the beta.py file to include the result from step 1 in it:

     #!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
    
  4. Make the copy of the beta.py executable:

     $ chmod +x ~/bin/beta.py
    

Now you can call the beta.py just like a normal program, e.g.:

$ beta.py myrules.bta