Running a Python Script: Mobile & PC

Follow this forum if u are a modder (having the modded version)
Contains announcements and how-to guides
Useful for forumers who want to learn how to help out in the game
Post Reply
User avatar
Harchie Hirondo
Posts: 335
Joined: Mon Nov 04, 2019 1:43 pm
Location: Makati City, Philippines
Contact:

Running a Python Script: Mobile & PC

Post by Harchie Hirondo »

MOBILE:

Steps to install Python on mobile (text by Harchie):

I somehow found a way to run a Python script on mobile and also edit them within that app. The app is called Pydroid 3, which is available on Google Playstore.
https://media.discordapp.net/attachment ... 185733.png

Once installed, you might be tasked to answer some questions, but in the end, it's up to you if you'd like to purchase the Python lessons or not.

You'll then see the interface, and located in the upper portion of the screen is a folder icon, click on it and you shall see this.
https://media.discordapp.net/attachment ... 185619.png

Tap "Open" and select the file that you'd like to run.
In my instance, this is what it looks like...
https://media.discordapp.net/attachment ... 185644.png

Afterwards, select the yellow "play" button that is located in the bottom right portion of the screen and you shall see something like this :)
(Results vary depending on the script written)
https://media.discordapp.net/attachment ... 185706.png

Note: Images attached here are only as links since they're too large :(


Pillow
New thing from 2023.08.25 that thy python looks into images too (for pixel sizes) that needed this library PILLOW)

Android Emulator:
for Android emulators read here how to install: https://github.com/python-pillow/Pillow/issues/1957



Steps to install Pillow (by Midonik):
1. Install Pydroid 3 from Google Play
2. Top left has a button with 3 horizontal lines, click that
3. Next click a button that says Pip
4. Should take you to a screen with a dialog window saying Library name and a button saying Install next to it. Type pillow in the dialog window and click install.
5. The app will ask you to download a plugin from Google Play if you dont have it already, do that. You can unistall it after you step 6.
6. Redo step 4


PC:

On pc Install pyhon (https://www.python.org/)

Pillow
New thing from 2023.08.25 that the python looks into images too (for pixel sizes) that needed this library PILLOW)

on PC latest python requires this library as it has image pixel size checking from now:
and after execute in command line ("cmd"):

Code: Select all

pip install Pillow

if you dont have pip than:
https://pip.pypa.io/en/stable/installation/
The war is inevitable! But what if....
User avatar
b2198
Posts: 798
Joined: Mon Aug 30, 2021 5:48 pm
Location: Brazil

Re: Running a Python Script: Mobile

Post by b2198 »

You can also use Termux and install python from its terminal, then use it with command line.
Green is the correct color, other colors are "less correct".
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Running a Python Script: Mobile

Post by Stratego (dev) »

update about PILLOW library
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Running a Python Script: Mobile & PC

Post by Stratego (dev) »

easier way updated in first post.
Midonik
Posts: 5325
Joined: Mon Sep 05, 2016 5:27 pm
Location: Poland

Re: Running a Python Script: Mobile & PC

Post by Midonik »

I think what Harche describded is about running python scripts on Android in general, while I talk about how to install Pillow on Android.
Support new AoS variant, Age of Galaxy: http://ageofstrategy.net/viewforum.php? ... 608408ebc8
All help will be welcome.
Stratego (dev)
Site Admin
Posts: 15741
Joined: Fri Apr 25, 2014 9:28 pm

Re: Running a Python Script: Mobile & PC

Post by Stratego (dev) »

Midonik wrote: Thu Sep 07, 2023 12:48 pm I think what Harche describded is about running python scripts on Android in general, while I talk about how to install Pillow on Android.
ok! i changed it!
Post Reply

Return to “Modders lounge”