Answer the question
In order to leave comments, you need to log in
How to make a timer for a Python function?
In my program, there is a reading_keys function that works in While True mode. I need the main() function to restart the reading_keys function every 60 seconds.
PS Please do not show the method using the built-in threading library, it is not suitable for my purposes.
def main():
reading_keys()
print('test')
if __name__ == '__main__':
main()
Answer the question
In order to leave comments, you need to log in
If it’s quick, then using media queries, replace all the width in pixels of the divs with auto or 100% at the desired maximum screen width (for example, 900px) and add to the head
Those
@media screen and (max-width: 900px) {
.art-sheet {width: auto}
}
www.liquidapsive.com examples of different layout versions, switch to "Responsive" mode and resize the browser window in every possible way - you will see how the blocks move, adjusting to the screen width
Details on terminology
Details on implementation in CSS and HTML
Options:
1) Design an adaptively current site, for example on bootstrap
2) Take a special Framework similar to jquery Mobile - in general, the question is covered here Mobile web framework
import time
def main():
while True:
reading_keys()
print('test')
time.sleep(60)
if __name__ == '__main__':
main()
from time import time
def reading_keys():
t = time()
while True:
if time() - t >= 60:
return 0
# ваш код
def main():
while True:
reading_keys()
print('test')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question