This sounds fun and I would really love to get it up and running. Any help will be greatly appreciated.
It is completely possible to build desktop applications with Python (think tkinter).
If this is definitely what you want, then you will be starting from scratch, anyway. Just use the correct Python libraries, and you can make a desktop application. There might be a Python library out there that also works with HTML/CSS files, but that sounds messy. If you want Python, I recommend starting with Tkinter.
Refer to above - Python/JS/HTML/CSS do not need the internet.
Practically, there are many YouTube tutorials showing you how to make desktop applications with Python. Perhaps start there so you can familiarise yourself with the common libraries used for this.
Some key things to keep in mind:
Python requires the Python interpreter to run. So, it must be compiled into a binary, in order to be a stand-alone application.
You need to keep in mind the architecture of the system your app will be running on.
You cannot run x86=built applications on arm systems, and vice-a-versa.
You cannot run 64-bit applications on 32-bit systems.
I have limited knowledge on this, but, as far as I am aware, you can build a 32-bit application on a 64-bit system, but you cannot build a 64-bit application on a 32-bit machine. That is, you should be able to bundle your app for a 32-bit Raspberry Pi, with your 64-bit PC, but you will have to tell the tools (compiler) to do this.
I hope this helps, and take what I have mentioned with a grain of salt, because there is a good chance I have misused terms.
Not sure what this is yet but I will look more into it … Is it like an IDE? Ive been noodling around with Thonny Python so that’s all I know as of right now
Soo the main reason I choose to attempt this idea in python is because I thought that it may be easier to get running; seeing as how python has a ‘run’ button and the raspberry pi seems to work so well with python… Does that make sense?
I don’t know, im kind of confused. Wouldn’t python be easier when wanting to boot files automatically, say verses a node.js type of file situation? I have no idea which is why I ask.
oh man, I have no idea what this means I was thinking that I could just run the python script via the Thonny IDE. Is that what you mean by an interpreter?
I know I have a lot of questions, and I will definitely try and find some YouTube videos on the subject. Ive never done anything like this before.
This shouldn’t be too difficult because I already have the program working for web right??? (not that im afraid of difficult, ijs)
Ahhhh I see! THIS is probably what I should be using. Upon researching the many things you’ve mentioned, I see that this one is probably the better option to go with. (I get why you mentioned it first now )
Do you know if there is a way to have the application fill the entire screen in a way that shows no borders or menus or those pesky buttons to minimize or enlarge or exit out of the window? Basically true full screen like when using a gaming application or when watching a full screen video?
Is it possible to do this type of design choice with electron?
(sorry for all of the questions Im just working on gaining an understanding of this concept. )
Yes, this makes sense. If I were to write a small application for Raspberry Pi on the Raspbian software, I would use the built-in Python stuff. From what I am aware, most Raspberry-aimed OSes do not come with Node.js. So, yes.
I have never heard of Thonny. So, I cannot say. I have made automated scripts using both Python and Node.js. All you do is create a bash file (on Windows - I assume this works for Linux-based OSes as well), and write something like start C:/path/to/Node/or/Python/executable C:/path/to/file/you/want/to/run (there is a bit more than that, but then you just set a task using the built-in software (Ubuntu has it) to start the bash script on start.
Thats great! Im going to look into this. Ive seen tutorials using the bash file but I didn’t quite understand what it was and Ive never used it myself. But I see that this is basically the file that is used to automate the load. Im googling it now
Will a bash file work with all types of scripts? Like scripts made in Electron JS for example?
Code is just text.
In order to run a program, some other program has to “read” the text and actually interprete it’s meaning to execute the commands.
Obviously this cannot go on forevery. Every computer has a fundamental code-base, which is within it’s hardware (like the CPU) and every command to be executed has to be translated to the CPU-language. As computers work with binary code, calling something the computer can execute is a binary-file. You might know them as files ending with .exe → for “executeable”.
Ofcourse writing binary code is horrible. So is the next best thing (machine code, then assembler). Because computer work binary but we speak a complex language, it’s nice to have programming-languages so we can write human understandable code and have programs inbetween turning it into computer-language.
Now there are two ways of doing this: One is creating .exe (or similar) files. This is called “compiling” (with a compiler) and it means the written code is turned into a file the computer can understand → then you execute the file.
The other way is “interpreting” (with an interpreter) meaning the code is read line by line and translated into the computer-language on the spot.
The first way creates a file which is independent from your coding-program because it’s already translated.
The second is faster to execute on the fly (because it doesn’t need to translate everything before execution), but it only translates the commands for execution and then saves the calculated results in memory NOT the translation itself. Hence it doesn’t provide a computer-readable file and must always use the interpreter to execute code. Making interpreter-languages slower in their execution of commands as they need to be translated every time.
An IDE is a “integrated developement environment”. They contain various features like code-highlighting, help to find errors and whatnot.
Ok great! Thanks for clearing that up! You did a fantastic job of explaining all of this.
I’ve heard there are Python libraries which actually allow to compile code into executables, but I haven’t looked into it.
Usually you want compilers if you are looking for optimized and efficient code. Hence those are low-level languages where you have to write a lot more to make it work - but at the same time save a lot of computational power because it’s just optimized for the problem. Those are used for games and engines, where a lot of data has to be calculated fast, so players can enjoy the games without lag and such.
Interpreter languages are used for things where you can accept some level of delay. They take more computational-power and -time, but are easier to write and maintain. If a website takes two seconds longer to load, that’s ok. If a machine-learning algorithm takes 10 hours instead of 9 for training, nobody cares → because you save weeks of writing the code and worst case, it’s easier and cheaper to just upgrade the machine, than to find and pay additional programmers.
Data-types are one key difference. C++ has strict typing: meaning if you make an integer variable, it will have a fixed size in memory ( like one Byte ), a max and min value and if you go beyond those or try to write anything but an integer number on that variable, the program will produce garbage.
Python doesn’t give a damn. If you create an integer variable there, it will be like 20 Bytes because it comes pre-made with all kinds of additional functionality. And if you combine it with a float and/or a string, Python will try to produce something reasonable - meaning a lot of stuff happening in the background.
That’s why compiling it is pretty hard. Because there is so much background functionality within script-languages, turning them into an executable would need the inclusion of all the background stuff. And if you’d need to put the entire interpreter into the .exe, you could just install the interpreter directly and not bother, instead of having it added into every single executable file.