语言小结
  • program-language-note
  • contact
  • common
    • 代码风格
    • 概念语法
      • 类型
      • 注释
      • 字符
      • 语句
      • 操作符
      • 函数
        • 递归
    • 格式化参数
    • 源码结构
    • 数据结构
    • 名词
  • 电路
    • 内存地址
    • Untitled
    • Code
  • C
    • note
    • overview
      • helloworld.c
      • c标准
      • 关键字
      • tips
      • util.c
    • 语法
      • 函数
        • main
      • const
      • static
      • 作用域
    • 编译和运行
      • c代码内存模型
      • 预处理
        • include
        • define
    • 头文件
    • 基本数据类型
      • 整型
      • 枚举
      • 浮点型
      • 指针
      • 数组
      • 结构和联合
    • 指针&数组、指针&函数
    • API
    • 存储结构
    • 操作符
      • sizeof
    • typedef
    • 输入输出
    • 格式化参数
    • 左値右値
    • 性能思考
    • volatile
    • 字符串
      • find_char.c
    • 动态分配
      • alloc.h
      • alloc.c
      • alloc_usage.c
    • note
  • cpp
    • 资源
    • note
    • 数据结构
    • 智能指针
    • 编译过程
  • shell
    • usage
    • Untitled
  • Rust
    • overview
  • Lisp
    • Untitled
  • web
    • overview
      • index
      • 软件工具
      • ARIA规范
      • SEO
    • style
    • html
      • 标签、元素
        • 标签快记
        • 联系信息
        • 引用
        • 列表
        • 语言设置
        • meta
      • 页面结构
        • 图片
        • 视频
        • 引用css、js文件
      • 等价字符
      • 链接
        • 邮件
      • 表单
        • note
      • 表格
    • css
      • 字体
      • 布局
        • position
        • float
        • display
        • flexbox
    • js
    • note
  • java
    • note
    • java语言程序设计
    • 设计模式
      • 大话设计模式-吴强-2010
      • 大话设计模式-程杰
      • 设计模式-gof
      • 设计模式解析
      • 原则
      • 单例
    • java程序设计第10版-基础
    • java程序设计第10版-进阶
    • java核心技术第9版-I
    • jar包
    • 安全
    • 反射
  • python
    • note
    • index
    • 个人记忆点
    • 疑惑
    • simple
    • 精通Python爬虫框架scrapy
    • 语法
    • scrapy
      • notice
      • index
  • 汇编
    • Untitled
  • kotlin
    • index
    • note
    • by android
      • note
      • index
  • groovy
    • gradle
Powered by GitBook
On this page

Was this helpful?

  1. python

疑惑

function

>>> def parrot(voltage, state="a stiff") :  
...     print("--this is voltage :" , voltage)  
...     print("--this is state :", state)  
...  
>>> parrot(voltage = 1, "stiff")  
  File "<stdin>", line 1  
SyntaxError: positional argument follows keyword argument  
>>> parrot(voltage = 1, state = "stiff")  
--this is voltage : 1    
--this is state : stiff

这里的设计有点疑问,positional argument 完全可以取顺位,是因为没必要做这点完善吗?

文档

读取空行之后缩进格数作为标准的理由是: (We can’t use the first line since it is generally adjacent to the string’s opening quotes so its indentation is not apparent in the string literal. 不太懂。从编码上看很明确吧?

module

当module更改的时候,可以使用improtlib.reload(modulename)来重新加载,但是这样子会加载整一个module,如果之前只是加载了这个module的一个方法,并且只是修改了这个方法,应该怎么重新加载更好?

package

当package中文件列表发生变化的时候,"init.py"需要被更新,那么肯定有对应的已经写好的函数或者方法?

#这几句话的描述没有看明白  
import sound.effects.echo
import sound.effects.surround
from sound.effects import *

file方法

这句话没看明白。。随便写了几个offset都是可以的。。

In text files (those opened without a b in the mode string), only seeks relative to the beginning of the file are allowed (the exception being seeking to the very file end with seek(0, 2)) and the only valid offset values are those returned from the f.tell(), or zero. Any other offset value produces undefined behaviour.

语句理解

脚本被拉进来之后,其变量会被执行到top levl以及处于calculator mode 这里的calculator mode不是很理解

Previous个人记忆点Nextsimple

Last updated 5 years ago

Was this helpful?

-- the collection of variables that you have access to in a script executed at the top level and in calculator mode

https://docs.python.org/3/tutorial/modules.html