• python全栈学习1.开课介绍


    python————web  && 爬虫

    Django pyramid Tornado Bottle Flask

    GUI图形开发 QT

    想要类似于执行shell脚本一样执行python脚本,例: ./hello.py ,那么就需要在 hello.py 文件的头部指定解释器,如下:

    #!/usr/bin/env python
      
    print "hello,world"

    ——————P6——————2018.7.26

     以下关键字不能声明为变量名
    ['and','as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield']

    输出是 可以用占位符进行格式化输出

    也可以用format

    print("{}ssss{}".format(str1,str2))

    两个大括号表示普通的大括号,大括号了可以有数字,作为输入的索引顺序

    输入密码时,如果想要不可见,需要利用getpass 模块中的 getpass方法,即:

    import getpass# 将用户输入的内容赋值给 name 变量
    pwd = getpass.getpass("请输入密码:")# 打印输入的内容
    print(pwd)
     
    while op:
    else : 执行条件while正常走完结束执行else,如果中间break,return,是不会执行的
    while还有这样的操作
    同理for也是如此
     
    对于range(起点,终点,步长)
     
    import sys
     
    print(sys.argv)————打印了相对路径
     sys.path ——打印环境变量
  • 相关阅读:
    设置VS2017背景图片
    NuGet的简单使用
    C#6.0,C#7.0新特性
    openFileDialog的Filter属性设置
    C# 获取当前路径7种方法
    正则表达式总结
    IDEA设置switch/case代码块自动补齐
    CentOS7使用yum安装RabbitMQ
    vue react 路由history模式刷新404问题解决方案
    @Component, @Repository, @Service的区别
  • 原文地址:https://www.cnblogs.com/DF-yimeng/p/9373838.html
Copyright © 2020-2023  润新知