zoukankan      html  css  js  c++  java
  • Python Learning

    1. Octal expression: 0oxxx like 0o4578
      Or use a built-in function oct() to transfer a int into a octal
      str.
    2. Hex expression: 0x456
    3. For a dictionary, if use its method copy(), then it jsut a swallow copy, with the basic data types copied, and the others referenced.
      If wanna use a full copy, then we have to use from copy import deepcopy

    Note

    1. Why python can manipulate pakages, models, functions, classes?

      Because is an OOP (Object-Orient Programming) language, and everything is object in Python.
      For example, if a pakage is imported, then a memory address is created and used by this pakage.
      Next, I can use this pakage to do many things.

      Sometimes, there is a comfusion about the relation between class, object, and instantiation. Let me explain it now:
      For sure, to use these nouns, we need to figure out the situations and scopes. If we are talking on the macro, then a class is object,
      and many things which can be used are objects. When a class is used, then we call it is instanced, then we can say that the name of its
      instance, is an object.

      The real issue is that just don't entangle it, we need to know how it works, which is the key point.

    2. Why does PyCharm have both builtins and builtin modules in his own path?

      I can see that if I write codes in PyCharm, then I use its modules. I think that it just is for some reasons
      and of course, I need not focus on it. By the way, there are some difinitions emitted in PyCharm's modules,
      like True and False. But they still can be used.

      If I use the command line mode, then the default python builtins and builtin modules are used.

      By the way, after some checks for builtins, I found that all of functions and classes inherites object.
      And they have some different attributes.

    I have say that builtins and builtin modules can't be founded in the root directory of Python
    Now I have known how to check and use those in builtins, and that is enough

  • 相关阅读:
    java 静态和非静态代码块执行顺序
    spring boot 学习
    js中的jQuery Validate增加手机号码验证
    JAVA验证手机号码是否正确
    redis启动报错 var/run/redis_6379.pid exists, process is already running or crashed
    移动端点击a标签拨打电话
    js计算两个日期之间的天数
    JS根据日期获取判断星期几
    JAVA生成订单编号工具类
    JAVA微信支付——微信公众号内支付 代码
  • 原文地址:https://www.cnblogs.com/brad1994/p/6514811.html
Copyright © 2011-2022 走看看