Created the following Python Script in PyCharm, MIT License
# This is a sample Python script.
import tkinter
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')
window = tkinter.Tk()
window.wm_title('Never Say Die Title!')
for i in range(10):
print('Never say die!')
print('Rock on!')
label = tkinter.Label(text='Never Say Die')
label.pack()
window.mainloop()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
I find it a little odd the title variable is exposed yet setting it doesn’t change the windows title.
Reading on how to use windows in Python here
https://realpython.com/python-gui-tkinter/#building-your-first-python-gui-application-with-tkinter
Looks like you have to use window.wm_title(‘This title works’) method and not window.title = ‘this or that’
The debug features on PyCharm Community by JetBrains are nice versus just a command line script
https://www.jetbrains.com/pycharm/
JavaFX development could learn a thing about swiftly getting projects going
All it takes to create a Button
button = tkinter.Button(text='Generate Support')
button.pack()
Quick potential for a bug in Python
button = tkinter.Button(text='Generate Support')
button.pack()
window.mainloop()
button.bind('<Button-1>', button_clicked)
If you add the button bind after window.mainloop() the event handler is never added
The following code runs
# This is a sample Python script.
import tkinter
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
def button_clicked(event):
print('Never Say Die!')
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')
window = tkinter.Tk()
window.wm_title('Never Say Die Title!')
for i in range(10):
print('Never say die!')
print('Rock on!')
label = tkinter.Label(text='Never Say Die')
label.pack()
button = tkinter.Button(text='Generate Support')
button.pack()
button.bind('<Button-1>', button_clicked)
window.mainloop()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
Does a Python Scene Builder Exist?
I wonder if custom windows can be created in Blender
Python is much faster to project creation than JavaFX right now.
I think Java Code reads more clearly than Python currently, that said speed for delivering a prototype swiftly is a lot of Power
Java gives a lot of Explicit Structure and clarity, my guess is it would be easy to build in a less structured way in Python. People that are seasoned in both languages likely have more full appreciation for migration from a Java to a Python project and from a Python to Java project.
Structure can be overhead, can also increase clarity
The double underscores is a bit confusing
public static void main(Strings args[]) likely a bit confusing to someone that has never seen Java
Java with the ability to capitalize on Python where useful could be Powerful, like Blender, Blender capitalizes on Power where useful
https://www.tutorialspoint.com/jython/jython_overview.htm
The amount of problems I have had with JavaFX has the potential to drive me towards using Python generated front end code
Less pieces to integrate can be powerful, a more robust integration can also be powerful
https://pyro4.readthedocs.io/en/stable/
Python API to Java methods, potential for Python that runs Java and Java that runs Python
A lot of projects in the World that are non ideally limited via early divests