I made a program for myself that shows me my class schedule for the day. It is in python, uses the easygui module and is launched via a .desktop shortcut in ubuntu. i was wondering how i could make it portable and usable on both pcs and macs, linux doesnt matter because i dont know anyone else who uses it and the program already works for me. Please be specific i wouldnt come here if 4 word answers could help
Copyright © 2024 Q2A.ES - All rights reserved.
Answers & Comments
Verified answer
It is possible. You should also distribute IDLE with your binaries. (Just like for running applet requires JRE.)
See these articles:
http://docs.python.org/2/distutils/builtdist.html
http://en.wikipedia.org/wiki/Cross_compiler
Portable Python Interpreter
it is not something to to do with maths - a minimum of, no longer inevitably. Python is a ordinary-purpose programming language, with a large style of applications. you may, as an occasion, create a working laptop or laptop programme, or an internet site, or an uncomplicated script, or something in any respect. There are quite a few arithmetic libraries obtainable for Python, which permit you to do complicated issues like records diagnosis, yet it is lots from all there is.
Python is cross platform so any machine that has the python interpreter like jared said, will run your python program.
However can be some discrepancies between systems when it comes to certain things. For example if your program needs to save data to a certain directory then there will be a difference to where you would save it between windows and linux (not sure if mac has same directories as linux, anyways).
If you come across something like that then you can handle it by using the sys module and putting the different behavior for the different platforms in a branch.
import sys
if sys.platform in ['linux2', 'linux3']:
....save_data(filename="/home/me/Documents")
elif sys.platform in ["windows", ... ]:
...# etc
else
...# etc
something like that, can't remember the exact names.
It should work on any machine that has a Python interpreter and won't work on any machine that doesn't.
I doubt OSX or Windows comes with a python interpreter (which is really dumb on the part of Apple b/c if you're going to rip off a free OS, you shouldn't make it worse), so you would have to install one so that it can be run.