Giter Site home page Giter Site logo

hello-world's People

Contributors

rachel-dynamsoft avatar rachyj avatar

Watchers

 avatar  avatar

Forkers

woaipuppyball

hello-world's Issues

[python]How to format code properly?

My Python format issues:

  1. Surround top-level function and class definitions with two blank lines.

  2. Method definitions inside a class are surrounded by a single blank line.

  3. For comments, you should use two spaces after a sentence-ending period.

  4. Comments shoule be complete sentences. If a comment is a phrase or sentence, its first word should be capitalized

  5. 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
    
  6. How to align operators

    # Yes: easy to match operators with operands
    income = (gross_wages
              + taxable_interest
              + (dividends -
    qualified_dividends)
              - ira_deduction
              - student_loan_interest)
    

[python] How to open URL?

import urllib.request

try:
    urllib.request.urlopen("http://baidu.com", timeout = 2)
    print("working connection")
except:
    print("No Internet connection")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.