å®çŸãããããš
win32comã䜿çšããvalueã®å€ã1ã«ãªã£ãæã«å€æ°flagã1ã«å€æŽã
flagã1ã«ãªã£ãæã«ãã®ä»æ¡ä»¶ãæã£ããã»ã«ã«'1âãæžã蟌ã¿1ç§åŸã«'0'ã«æžãçŽãã
flagã0ã«æ»ããåã³æ¡ä»¶ãæããŸã§ã¯åŸ
æ©ããå床æ¡ä»¶ãæã£ããšãã«æžã蟌ã¿ãšæžãçŽããè¡ãããã
çºçããŠããåé¡ã»åãããªãããš
valueã®å€ã1ã§ã»ã«ãžã®æžã蟌ã¿(1â0â1â0)ãè¡ããŸãããvalueã®å€ã1ã§ã¯ç¡ããªã£ãŠãåæ§ã®åŠç(1â0â1â0)ããã£ãšç¹°ãè¿ããŠããŸããŸãã
flagã0ã«æ»ããŠããªããšæããã®ã§ããã解決æ¹æ³ãããããŸããã
該åœã®ãœãŒã¹ã³ãŒã
python
1import win32com.client as win32 2import time 3 4trend = ws.Cells(5, 5).Value 5difference = ws.cells(6, 5).value 6value = ws.cells(7, 5).value 7 8flag = 0 9 10while value == 1: 11 flag += 1 12 13 if flag == 1 and trend <= -3 and difference <= -2: 14 ws.cells(11, 6).value = '1' 15 16 time.sleep(1) 17 18 ws.cells(11, 6).value = '0' 19 # ãã©ã°ãçŽã 20 flag -= 1 21 22 else: 23 continue
è©Šããããšã»èª¿ã¹ãããš
- teratailãGoogleçã§æ€çŽ¢ãã
- ãœãŒã¹ã³ãŒããèªåãªãã«å€æŽãã
- ç¥äººã«èãã
- ãã®ä»
äžèšã®è©³çŽ°ã»çµæ
ã³ãŒããèªåãªãã«è²ã
è©ŠããŸããã解決ã§ããŸããã§ããã
çŽ äººè³ªåã§ç³ãèš³ãããŸãããå®ãããé¡ãèŽããŸãã
è£è¶³
ç¹ã«ãªã
![guest](/img/icon/icnUserSample.jpg)
åç1件
ããªãã®åç
tips
ãã¬ãã¥ãŒ
15å調ã¹ãŠãããããªãããšã¯
teratailã§è³ªåãããïŒ
ãã ããŸã®åçç
85.40%
質åããŸãšããããšã§
æèãæŽçããŠçŽ æ©ã解決
ãã³ãã¬ãŒãæ©èœã§
ç°¡åã«è³ªåããŸãšãã