A small example package
Project description
写在前面
我自己写的工具箱,没有api文档的,想看函数功能就直接看函数定义时的注释吧,还挺详细的
python代码功能
# 示例1,读取WRF变量计算天顶角
from szh_toolbox import get_zenith_angle
WRFfile = 'wrfout_d01_2021-07-22_04:00:00'
Longitude = getwrfvar(WRFfile, 'XLONG')
Latitude = getwrfvar(WRFfile, 'XLAT')
z2 = get_zenith_angle(123,0,35786,Longitude, Latitude)
# 示例2,实现namelist文件和python对象的相互转化
import szh_toolbox.namelist as nl
# config是python字典对象
config = nl.load("data/namelist.input")
print(nl.dump(config))
# 示例3,实现shell脚本中变量定义赋值的替换
from szh_toolbox import ShellScriptVariable
# 类功能展示
ssv = ShellScriptVariable('data/myshell.sh')
ssv.show()
ssv.update('a', '这是A', 0)
ssv.update('d', '"这是 D"')
ssv.show()
ssv.save('data/myshell2.sh')
# 一行代码替换变量
ShellScriptVariable.modify('data/myshell.sh', 'a', '这是A', 'data/myshell3.sh')
命令行工具
也就是可以直接在命令行里执行的代码
# 直接打印namelist.wps文件定义的区域的范围
stwps
stwps namelist.wps
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
szh_toolbox-0.0.7.tar.gz
(7.2 kB
view details)
Built Distribution
File details
Details for the file szh_toolbox-0.0.7.tar.gz
.
File metadata
- Download URL: szh_toolbox-0.0.7.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8813678a942722e8c0e1ff31d0583b462587788576c4661e6d7d635cbd35d30 |
|
MD5 | d59c10524997315eaf4dec298ea210ee |
|
BLAKE2b-256 | 21244268fd437f1e93522012d496bf4ebe821a6b398f9aa0ee29ae77625bdd96 |
File details
Details for the file szh_toolbox-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: szh_toolbox-0.0.7-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce77a755ba65b9e362a0d8350fbf7afa67bf4cd981190a8075fc4bf9c3b8526 |
|
MD5 | e4dfa18a222a95c9967df35b35a66121 |
|
BLAKE2b-256 | d149e6df69fe0f1025926e3f7eebbfe78e5e52356fbab8de59a63c1d291a4098 |