LearningPython

How Python Run:python ’s source code save in “.py”.the byte code save in “.pyc”.if you have compile a “.py” file ,it will build a “.pyc”file ,the next time when you rerun the “.py”file ,the.system will find if the “.py”file ’s timestamp is same as “.pyc”file ’s timestamp ,if is same ,it will cot compile again ,if not it will be compile again.and if you run the same “.py”file on the other python version next time ,it will also recompile the source code again.
?python’s traditional runtime execution model:source code you type is translated to byte code, which is then run by the python virtual machine.your code is automatically compiled, but then it is interpreted.
?the PVM is not a separate program, and it need not to be installed by itself.in fact ,the PVM is just a big code loop that iterates through your byte code instructions, one by one to carry out their operations.
?at a more fundamental level, keep in mind that all we really have in python is “runtime”,there is. no initial “compile-time” phase at all ,and everything happens as the program is running.although we know the “source code”will change to”byte code”and then the “PVM”,but actually we do not truly see what the “python interpreter”do these, what we can only see is the “python interpreter ”run the program the programmer type.
?How to debug:1.do nothing(there will be error message by python itself);2.insert “print”statements(remember to add “#”before you ship your code, this method is very fast ) 3.use IDE GUI debuggers;
4.use the pdb command-line debugger.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值