首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

零门槛的Python

人生苦短,我用Python

废话不多说,全是

!!干货!!

我毕生所学,全都在这了,您自己看着办吧

Python2 or 3 (Get started to >3!)

Character encoding

If you need Chinese character:

Python 2.7:

http://stackoverflow.com/questions/2688020/how-to-print-chinese-word-in-my-code-using-python, you need add

Python 3.5: (in Pycharm: Project: xxx -> Project Interpreter, choose Project Interpreter you installed in your computer)

No need, it can support Chinese

Windows install Python

Python 2.7: C:\Pthon27

Python 3.5: C:\Program Files\Python35->python.exe (add it to environment variable for terminal-if there is python2, you can rename it as python3.exe then add it in case of name conflict )

Run hello.py

When run (bash) without indicator

You might encounter: syntax error near unexpected token.

You should check:

ll hello.py -> checkexecutable right: 'x'

tell linux you are using python to execute this file, or it will treat .py as shell script:

Add as the first line of the file. Note you should use /usr/bin/envpython so that path will not bother you. ( like Shell script: bin/bash )

Indent

DO NOT USE [tab], if in Linux vim, use [tab]--it will be a [tab] NOT SAME AS INDENT

Break a long line

http://stackoverflow.com/questions/53162/how-can-i-do-a-line-break-line-continuation-in-python

http://stackoverflow.com/questions/4172448/is-it-possible-to-break-a-long-line-to-multiple-lines-in-python?noredirect=1&lq=1

感谢您的关注 !至此 --您在Python之路的成长将是我们关心的 !我们接受任何意见和建议

本文图片均来源于网络,如有侵权,请联系删除。

  • 发表于:
  • 原文链接http://kuaibao.qq.com/s/20180505G17X8X00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券