3024 views|5 replies

7173

Posts

195

Resources
The OP
 

[Solved] Why does the same If statement run differently in micropython and Python IDE? [Copy link]

  This post was last edited by Changjianze1 on 2017-11-22 09:18 As shown in the picture. I just tried the simplest If statement and it worked fine on my win64 machine python2.7 but it failed on sensortile micropython. I don't know why

Latest reply

Python3 print has become a built-in function, so you need to add brackets  Details Published on 2017-11-18 19:24
 
 

67

Posts

3

Resources
2
 
Try
  1. if 2 == 2: print(1)
复制代码

Comments

Thanks for the perfect solution  Details Published on 2017-11-22 09:17
Personal signatureArmink‘s Github & CSDN博客
 
 
 

1w

Posts

25

Resources
3
 
Micropython executes Python3 syntax which is slightly different from Python2

Comments

Thanks, D. It is true. It seems that the versions are different.  Details Published on 2017-11-22 09:18
 
 
 

366

Posts

1

Resources
4
 
Python3 print has become a built-in function, so you need to add brackets
 
 
 

7173

Posts

195

Resources
5
 
Thank you for the perfect solution
 
 
 

7173

Posts

195

Resources
6
 
dcexpert posted on 2017-11-18 19:21 Micropython executes Python3 syntax which is slightly different from Python2
Thank you, D. It seems that the versions must be distinguished.
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list