0

I have been writing simple python games in Atom and running them via Terminal ("python + [file name]"). I want to create a mobile app that hosts these various python files and could run them and display the games in a visually attractive way. For example, for a Guess the Number game, this app could run the python file and display the input/output file program with modern aesthetics.

My guess is the best way to do this is to run the python files on a server, like my computer, and transfer input and output back and forth between the mobile app and server, while allowing the mobile app to represent the data in a more modern way.

I still have no idea how to go about doing the above though. If that is the best way, could anyone offer me guidance on technologies? If this is not the best way, could you point me in the right direction?

I'm new and not very good at programming, but I'd like to try to make this!

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
user3161565
  • 49
  • 1
  • 5
  • 1
    As a beginner, this is far far too ambitious and complex. I'd suggest you think of another more reasonable project (it wasn't me who down voted you btw) – Gruntcakes Dec 30 '16 at 20:02

1 Answers1

1

Depending on what is the result of your script:

1. The input/output is text - most feasible option

Use Android Web app REST

  • rewrite your app for web (example)
  • set up and configure a web server (Apache2 or Nginx is a good choice). You will need a public address (either a domain name or a white IP)
  • write HTML page, to communicate with your server by the means of JavaScript / XHR
  • create a Web APP

2. GUI apps - PyQt, TK etc.

Much harder, but there are ways to run Python apps on Android

Community
  • 1
  • 1
Marat
  • 15,215
  • 2
  • 39
  • 48
  • Thanks Marat for your detailed answer. How do I get my server to interact with Terminal? For example, if a command line game prompts the user for input and produces output to that input accordingly, how do I manage that information to and from the server to the Terminal? – user3161565 Jan 02 '17 at 23:30
  • @user3161565, the first link to the Flask tutorial is a good example. Use GET parameters (or URL parts) instead of `raw_input()` or cmdline params, and return strings instead of `print()` statements. You will need to go through a tutorial on the selected web framework, but it should not take more than couple hours for a small one (Flask could be a good option) – Marat Jan 04 '17 at 19:03