2

I tried running a Python script in a terminal emulator (app) with ./script.py and I get an error saying "permission denied". It is to run a Twitter bot even if I close the app.

So, I googled how to do this and it said I have to download a file called python.sh, but their link is down so I can't download it. When I google the file, I only get results for how to load .sh files in Python.

How I can do this?

2
  • Why do you want to run in terminal emulator only? This open source app Q python let's you run Python scripts on Android. It's available on F Droid. Here's the website of that app qpython.com
    – beeshyams
    Commented Sep 2, 2018 at 3:40
  • Because I want to let it run even if I close the app (its for a twitter bot... Should have specified... Sorry) Commented Sep 2, 2018 at 3:51

2 Answers 2

2

You could use UserLAnd, GNURoot Debian, or Termux. Termux is probably the most lightweight, and also has Swipe keyboard support (have to swipe the entire input to the side to access it), and you can enable an extended keyboard that pops up over whatever keyboard you use to access arrows, Tab, Ctrl, etc. UserLAnd also has the extended keyboard and the same Swipe support, and runs a full version of Linux in a chroot environment so you can have root access using sudo or the root user.

Using Termux & UserLAnd on an unrootable Android and both are amazing. rsync is the greatest thing ever to keep project changes up to date because AFAIK it's not possible to edit the data stored in either of their filesystems directly using an Android app, but can be done using vi/vim/nano/etc inside of Termux or in UserLAnd's session (have to connect to it through SSH or VNC).

Just make sure to follow the suggestions during UserLAnd setup and grab ConnectBot and/or bVNC -- those are currently the only supported apps to connect to it. Also, while it claims to be able to setup for a single app I have not seen any directions for that, and have no idea how it would be possible as the UI doesn't seem to have anyway to do so.

2
  • 1
    Ok thanks I will try those but also where would I find the python.sh? I have been looking everywhere and it seems to have completely disappeared... Commented Sep 2, 2018 at 5:11
  • No problem :) Once you get setup it should be possible to follow one of the many guides. Just make sure you're looking at directions for the right Linux version if there are any version-specific directions if you go the UserLAnd route which can be Debian or Ubuntu, or GNURoot's Debian. For the minimal installation as in the above directions it should be fine to follow along. Termux doesn't seem to be any different overall, but does not appear to be a "minimal" install.
    – l3l_aze
    Commented Sep 2, 2018 at 7:43
0

Your file permissions are not appropriate. Change it using chmod +x path_to_file and then run it using file_name.py.

1
  • I tried that and found the only way to change permissions of a file is with root and I cant root my phone... But thanks for the help😀 Commented Sep 2, 2018 at 20:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .