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

in #utopian-io7 years ago (edited)

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

    Sort:  

    Hello, you received a boost courtesy of @steemdunk! Steem Dunk is an automated curation platform that is easy and free for use by everyone. Need an instant boost? Send 0.200 SBD with your full post url as the memo to @steemdunk for an upvote. Join us at https://steemdunk.xyz

    Upvote this comment to support the bot and increase your future rewards!

    Thank you for the contribution. It has been approved.

    You can contact us on Discord.
    [utopian-moderator]

    Hey @faisalamin I am @utopian-io. I have just upvoted you!

    Achievements

    • WOW WOW WOW People loved what you did here. GREAT JOB!
    • You have less than 500 followers. Just gave you a gift to help you succeed!
    • Seems like you contribute quite often. AMAZING!

    Suggestions

    • Contribute more often to get higher and higher rewards. I wish to see you often!
    • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

    Get Noticed!

    • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

    Community-Driven Witness!

    I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

    mooncryption-utopian-witness-gif

    Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

    It was very nice!
    I checked how it works, I think it makes linux virtual environment. I can write or read only /data/data/com.termux.
    Even thoug, thank you for introduce nice app!

    It was a great app and tutorial. I was able to run my python script on my device.

    Coin Marketplace

    STEEM 0.20
    TRX 0.14
    JST 0.030
    BTC 68854.36
    ETH 3283.36
    USDT 1.00
    SBD 2.67