0

I have currently installed the SL4A on my emulator and it works fine. I am able to push my scripts from my computer on the the sdcard of the emulator and run it successfully on the emulator. Now I want to know how to run these scripts from the command line ? I want to pass input parameters (Files) to my script so that the script can work on it. Usually in my computer's terminal the command I give is -

Test.py -h /Users/Documents/Test.jpeg

This automatically takes in Test.jpeg as the input file.

How do I do this from within the emulator ? I have test.jpeg stored in the sdcard of the emulator.

Denis Otkidach
  • 32,032
  • 8
  • 79
  • 100
Amritha
  • 795
  • 3
  • 9
  • 26

2 Answers2

0

There is a free app on the app store ( https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en) that will help you access your android terminal.

Step 1. Download the terminal emulator

Step 2. Run the following commands:

app_148@cdma_spyder:/ $ cd filepath_to_mypythonprogram/Test.py
app_148@cdma_spyder:/ $ Test.py -h /Filepath/to/Test.jpeg

As far as adding modules to the SL4A interpreter, it is fairly easy.

Step 1. Connect your phone to your computer and set the connection to "USB mass storage"

Step 2. Navigate to your sd card (it shows up on my computer as drive 'H:', then navigate to com.googlecode.pythonforandroid\extras\python, this is the folder where you will put your module.

Step 3. Copy your module to that folder, and enjoy!

Hope this helps!

John Dorian
  • 1,884
  • 1
  • 19
  • 29
0

You can install an app like ConnectBot which can provide a local shell terminal. From there you can run the interpretor with your given command line options.

RustyFluff
  • 720
  • 2
  • 8
  • 27
  • If i install a python package/library in my phone, will I be able to call its functions too via ConnectBot ? I m currently trying to install a library called Hachoir and I need to pass a file to call it like - Hachoir-core -f Test.jpeg – Amritha Dec 04 '11 at 04:40