rachyj / hello-world Goto Github PK
View Code? Open in Web Editor NEWHello Python world!
Hello Python world!
git checkout path/to/file
How to pass variables between Python functions?
My Python format issues:
Surround top-level function and class definitions with two blank lines.
Method definitions inside a class are surrounded by a single blank line.
For comments, you should use two spaces after a sentence-ending period.
Comments shoule be complete sentences. If a comment is a phrase or sentence, its first word should be capitalized
Code alignment
weather_result = (
query + "天气" + data['HeWeather5'][0]['now']['cond']['txt'] +
"," # print the weather
+ "风向为" + data['HeWeather5'][0]['now']['wind']['dir'] +
"," # print the wind direction
+ "气温为" + data['HeWeather5'][0]['now']['tmp'] +
"。" # print the temperature
+ "更新时间" + data['HeWeather5'][0]['basic']['update']['loc'] + "。"
) # print the update time
url = "https://free-api.heweather.com/v5/now?city=%s&key=%s" % (
city, key) # url for checking real-time weather
How to align operators
# Yes: easy to match operators with operands
income = (gross_wages
+ taxable_interest
+ (dividends -
qualified_dividends)
- ira_deduction
- student_loan_interest)
import urllib.request
try:
urllib.request.urlopen("http://baidu.com", timeout = 2)
print("working connection")
except:
print("No Internet connection")
全局变量主要用在什么场景下?
write a readme to describe the project.
import datetime
now = datetime.datetime.now()
print(str(now))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.