A
A
ametko2018-09-30 19:26:54
Python
ametko, 2018-09-30 19:26:54

How to link files to each other, similar to how it is done in java package?

There is a file where the button for the graphical interface is described, in the second file, let's say a red square is described, which has a method responsible for changing the color.
How to make it so that when the button is pressed, the square method is called, which is responsible for changing the color?
How to properly link these two files together so that one file has access to the functionality of the other?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2018-09-30
@sergey-gornostaev

https://docs.python.org/3/tutorial/modules.html

B
bqio, 2018-09-30
@bqio

Import or inherit the methods of the required class in another class file. A question the answer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question