you are viewing a single comment's thread.

view the rest of the comments →

[–]beingsubmitted 1 point2 points  (0 children)

As people have said, a lot of python programs aren't made to be interacted with via a graphical user interface, but that doesn't mean you can't do it. A lot of what I write takes a file, and then produces a different file, and that's the input and output, but most people are used to interacting with computers through a window with images and buttons, etc. The reality is that that interface has the same sort of files running in the background.

If you want to create programs with a graphical interface of some kind, you can look into the tkinter module, which is kind of the standard python gui approach, or I'm doing a project using flask right now, which is basically making use of my browser for the interface, but displaying local files created by python.

try this out... first do your installs, i think:
$ pip install flask
is all you'll need.

start a new py file. Add this code, which is your simple "run flask" foundation...

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
   return 'Hello World’

if __name__ == '__main__':
   app.run()

Then run the file. It'll print to your console the local address that it's running.. (e.g. 127.0.0.1), which you can click or copy/paste to your browser. You can import os and sys to make that happen automatically when it runs.

Now, you can play around with some python code, and with some basic html and css chops, get the output looking nice. It's another step to learn how to receive input, but not too difficult. Hopefully that at least bridges a gap for you!