Chris Angelico schrieb am Dienstag, 7. Dezember 2021 um 19:16:54 UTC+1: > On Wed, Dec 8, 2021 at 4:49 AM Mohsen Owzar <mohsen...@gmail.com> wrote: > > ******************************************************************* > > GPIOContrl.py > > ******************************************************************* > > class GPIOControl: > > def my_print(self, args): > > if print_allowed == 1: > > print(args) > > > > def __init__(self): > Can't much help with your main question as I don't do Windows, but one > small side point: Instead of having a my_print that checks if printing > is allowed, you can conditionally replace the print function itself. > > if not print_allowed: > def print(*args, **kwargs): pass > > ChrisA
Thanks Chris Your answer didn't help me to solve my problem, but gave me another idea to write a conditional print statement. Regards Mohsen -- https://mail.python.org/mailman/listinfo/python-list