爱意满满的作品展示区。
nayihz

用 Python 写的一个在终端中查询天气预报的脚本,欢迎提意见。

  •  
  •   nayihz · Jun 27, 2015 · 6280 views
    This topic created in 3985 days ago, the information mentioned may be changed or developed.

    Python新手一枚,用Python写了一个Linux终端下查询天气预报的脚本。
    API用的是: https://developer.worldweatheronline.com/
    还请大家多提宝贵意见,多多指教。也欢迎大家在不同机器上测试,有BUG的话烦请告知。多谢大家!
    本项目的Github地址为: https://github.com/smartczy/weather_py
    如果大家觉得还不错的话,给个star将是对我莫大的鼓励。多谢大家。

    30 replies    2015-06-29 23:00:53 +08:00
    nayihz
        1
    nayihz  
    OP
       Jun 27, 2015
    发帖的时候忘记选择节点了
    麻烦管理员移一下帖子,抱歉。
    @Livid
    PhanKiap
        2
    PhanKiap  
       Jun 27, 2015
    不支持城市名中文么。
    thankyourtender
        3
    thankyourtender  
       Jun 27, 2015
    英文的
    nayihz
        4
    nayihz  
    OP
       Jun 27, 2015
    @Dashit 查询的时候不支持中文城市名
    matsuijurina
        5
    matsuijurina  
       Jun 27, 2015 via Android
    和王依依那个rust项目好像,还是你们都是基于同一套ui做的
    nayihz
        6
    nayihz  
    OP
       Jun 27, 2015
    @matsuijurina 是同一套ui,都是基于https://github.com/schachmat/wego ,用别的语言重写的。
    phx13ye
        7
    phx13ye  
       Jun 27, 2015
    看过一个叫wego 的,好厉害
    nayihz
        8
    nayihz  
    OP
       Jun 27, 2015
    @phx13ye 就是根据那个重写的
    aheadlead
        9
    aheadlead  
       Jun 27, 2015
    有很多地方并不是拼音啊…比如说呼和浩特就是hohhot
    sneezry
        10
    sneezry  
       Jun 27, 2015
    nice job!
    loading
        11
    loading  
       Jun 27, 2015 via Android
    不错,我看看这种代码是如何写的,我写的终端界面都最原始那种的…
    halfcrazy
        12
    halfcrazy  
       Jun 27, 2015
    可以用pypinyin来支持汉字啊
    zonghua
        13
    zonghua  
       Jun 28, 2015 via iPhone
    怎么实现排布得这么规整
    aheadlead
        14
    aheadlead  
       Jun 28, 2015
    @halfcrazy 多个库觉得麻烦嘛… 而且很多上面也说了,有些城市并不是拼音……
    nayihz
        15
    nayihz  
    OP
       Jun 28, 2015 via iPhone
    @aheadlead 嗯嗯,api是用的国外的,所以准确来说是英文名,不是汉语拼音
    nayihz
        16
    nayihz  
    OP
       Jun 28, 2015 via iPhone
    @halfcrazy 个人感觉没必要支持汉字吧,还是输拼音方便吧,Python weather.py Beijing 这样还不需要切换输入法
    nayihz
        17
    nayihz  
    OP
       Jun 28, 2015 via iPhone
    @zonghua 设计好表格
    Tiande
        18
    Tiande  
    PRO
       Jun 28, 2015
    @latteczy 不,用户的需求你不能拒绝。hhh
    zonghua
        19
    zonghua  
       Jun 28, 2015 via iPhone
    @latteczy 拼音就台山和泰山
    cxl008
        20
    cxl008  
       Jun 28, 2015
    北京联通 访问不到 https://developer.worldweatheronline.com/ 是个什么情况
    tLbf2p3UC4BM3H1N
        21
    tLbf2p3UC4BM3H1N  
       Jun 28, 2015
    调用API还是?~
    nayihz
        22
    nayihz  
    OP
       Jun 28, 2015 via iPhone
    @cxl008 我这边是可以访问的
    nayihz
        23
    nayihz  
    OP
       Jun 28, 2015 via iPhone
    @zonghua 重名的回头我再测试一下。多谢提醒
    aheadlead
        24
    aheadlead  
       Jun 28, 2015
    @zonghua 台山用toishan可以搜索到
    dofine
        25
    dofine  
       Jun 28, 2015
    学习一下。。这种终端的 ui 看起来好酷
    kcworms
        26
    kcworms  
       Jun 28, 2015
    “终端需要在全屏状态下,否则排版会被打乱”不会很糟糕吗,建议砸时间改进……
    iichenbf
        27
    iichenbf  
       Jun 28, 2015
    年度最佳天气
    nayihz
        28
    nayihz  
    OP
       Jun 29, 2015
    @kcworms 您说的对。感谢!
    nayihz
        29
    nayihz  
    OP
       Jun 29, 2015
    @iichenbf 不敢当,小菜鸟一只,还请多多指教啊。
    recall704
        30
    recall704  
       Jun 29, 2015
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1138 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 17:56 · PVG 01:56 · LAX 10:56 · JFK 13:56
    ♥ Do have faith in what you're doing.