• Python学习记录(一)-- 最基础


    1 运行python脚本(方法一)
        python hello.py

      运行python脚本(方法二)
        在脚本第一行加上 #!/usr/bin/env python
        修改脚本权限: chmod a+x hello.py
        执行 ./hello.py

    2 注释格式
      # : #右边的代码会被忽略

    3 字符串
      1) 使用单引号和双引号没有区别
        “hello, world” == 'hello.world' ==> 'hello,world'

      2) 数值转化为字符串
        "hello" + str(123)
        "hello" + repr(123)
        '123 ?? 反引号??

      3) input 和 raw_input
        input("what is your name?") # 输入 "yilia" 必须带有""
        raw_input("what is your name?") # 输入 yilia即可 无需带有""

    4 原始字符串和unicode字符串
        原始字符串以 r 开头: print r'C:programfooar' '\'
        unicode字符串以u开头: u'hello, world!'

  • 相关阅读:
    .net 自带的两个内置委托
    Socket
    SQL EXISTS与IN的区别(2)
    一个选择题,写了一个类
    SQL Server- 存储过程(2)
    VS插件-JSEnhancements
    SQL Server- 存储过程(1)
    MVC-工作原理
    C#-属性
    SQL Server 中游标的使用
  • 原文地址:https://www.cnblogs.com/songshu-yilia/p/5235623.html
Copyright © 2020-2023  润新知