python - How to get rid of frame 'blinking' effect with standard libs? -


I am currently playing with some CMD / prompt animations / graphics:

   Import OS import time df printframes (timeout, count): OS system ('CLS') L = 0 while true: for range (0, 9): for the range I (0, 9): Category in J ( 0, 9): If Jammu == Kashmir and I! = 4: print ("|", end = "", flush = true) Alief J! = K and I == 4: print ("-", end = "", flush = true) aliff j == k and i == 4: print ("+", end = "", flush = true) second : Print ("O", End = "", Flush = True) Print ("") Time.sleep (timeout) os.system ('cls') l + = 1 If L & gt; Count: __name__ == "__main__": To break printframe (0.08, 2)  

and get rid of the blinking of the frame - especially in the first line, My thought was to use another print thread:

  def printframe (timeout, count): #print example 1 DRF printframe two (timeout, count): # ) Without __name__ == "__main__": p1 = threading. Thread (target = printfram, args = (0.08, 2)) p2 = threading Thread (Target = PrintFrame Two, args = (0.08, 2)) p1.start () p2.start ()  

But the effect was disappointing - the problem with synchronization and first line still It is very blinky, the second idea was to use 'predefined frame' - but it is not very educated - the bonus here is that I can print the entire line once, but still the effect is not as expected, the third (Best) idea only I have to change the required 'pixel' / character - but here I need to go into the frame between the lines! And the curse is not working on windows (not least in standard). Do you have some ideas for how to cut it? (Windows, standard library) Perhaps how could the speed of 'OSSystem (' CLS ') be?


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -