How to setup and run python and C++ in Android Termux

Words
340
Reading
2 min
Listen
Play
9y

What Will I Learn?

  • You will learn the basic commands of Termux
  • You will learn how to write and run Python Language in Termux
  • You will learn how to write and run a C++ Program in Termux

Requirements

Termux :
Download Link
Hacker's Keyboard
Download Link

Difficulty

  • Intermediate

Procedure

1: Install the Termux App and Hacker's keyboard from the Requirement section, these apps are also available in Google Play Store.

How to configure the Hacker's keyboard

  • Open the Hacker's keyboard by click on Open.

    Screenshot_20180118-002759.png

  • Click on ENABLE KEYBOARD and Turn on the Hacker's keyboard and press back key

    Screenshot_20180118-002807.png

  • Click on SELECT INPUT METHODand select Hacker's keyboard . Hacker's keyboard is now configured! Now follow the next steps carefully
    .

    Screenshot_20180118-003229.png

    2: Open the Termux app and wait until it starts completely until it shows a welcome note in Terminal.

    Screenshot_20180118-002722.png

  • Now type you first command pkg update and hit enter, wait until it complete.

  • Screenshot_20180118-005927.png

  • Now type the command pkg install clang. This command installs the c language in Termux app.

  • Screenshot_20180118-010014.png

    3: Now we need to install a text editor in Termux app.
  • You just simply use this command pkg install nano and wait until it finished. It will automatically download and install the nano text editor.


  • Screenshot_20180118-010103.png

    4: How to write and run a C++ program
  • Type command nano tutorial.c and interface open as shown in this screenshot
  • Screenshot_20180118-010252.png

  • Write down the C++ program and press ctrl+o and then press enter. Now press ctrl+x

  • Screenshot_20180118-010259.png





    Screenshot_20180118-010333.png

    Screenshot_20180118-010625.png

  • Now run your program by type the command clang tutorial.c and press enter then ./a.out and press enter. It will execute and compile your program and give you the output

    Screenshot_20180118-011702.png

    Screenshot_20180118-011706.png

    5: Now for Python we need to install python in Termux
  • Type this command pkg install python and press enter wait until its completion.

  • Screenshot_20180118-012342.png

  • Now type this command pkg install python2 and press enter and wait until it complete the installation.

  • Screenshot_20180118-012346.png

    6: Run Python Language
  • Type commandpython and then write your python program

  • Screenshot_20180118-012639.png

    Screenshot_20180118-012805.png



    Posted on Utopian.io - Rewarding Open Source Contributors

    How to setup and run python and C++ in Android Termux | Ecency