[PyProj] Think in Python :

Posted 机器学习水很深

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[PyProj] Think in Python :相关的知识,希望对你有一定的参考价值。

1. Programs are composed of modules.
2. Modules contain statements.
3. Statements contain expressions.
4. Expressions create and process objects.

 

Handling Errors by Testing Inputs

"""
(1) 判断输入
"""
while
True:   reply = input(Enter text:)
  
if reply == stop:     break   elif not reply.isdigit():     print(Bad! * 8)   else:     print(int(reply) ** 2) print(Bye) """
(2) 输入不是数字怎么办?
""" # 方法一
while True:   reply = input(Enter text:)   if reply == stop: break
  # 如果非法str,执行except   try:     num = int(reply)   except:     print(Bad! * 8)   else:     print(num ** 2) print(Bye) # 方法二 while True:   reply = input(Enter text:)   if reply == stop:     break   elif not reply.isdigit():  # 如果不是数字     print(Bad! * 8)   else: # 如果是数字     num = int(reply)     if num < 20:       print(low)     else:       print(num ** 2) print(Bye)

 

以上是关于[PyProj] Think in Python :的主要内容,如果未能解决你的问题,请参考以下文章

python - 如何使用pyproj在python中将lat/lon转换为UTM?

WGS84 与 UTM 互转(Python代码版)

WGS84 与 UTM 互转(Python代码版)

think in java 笔记

《Think in Java》17

FANTASY:In which way do you think the world will end?