zoukankan      html  css  js  c++  java
  • Python之路,day14-Python基础

    1.paramiko模块

     1 import paramiko
     2 import os
     3 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
     4 print(BASE_DIR)
     5 class SSH():
     6     def __init__(self,host,port,user,passwd):
     7         self.host = host
     8         self.port = port
     9         self.user = user
    10         self.passwd = passwd
    11         self.transport = None
    12     def connect(self):
    13         self.transport = paramiko.Transport((self.host,self.port,))
    14         self.transport.connect(username=self.user,password=self.passwd)
    15 
    16     def cmd(self,cmd):
    17         ssh = paramiko.SSHClient()
    18         ssh._transport = self.transport
    19         stdin,stdout,stderr = ssh.exec_command(cmd)
    20         return stdout.read()
    21     def _get(self,server_path,local_path):
    22         sftp = paramiko.SFTPClient.from_transport(self.transport)
    23         sftp.get(server_path,local_path)
    24 
    25     def _put(self,local_path,server_path):
    26         sftp = paramiko.SFTPClient.from_transport(self.transport)
    27         sftp.put(local_path,server_path)
    28 
    29     def close(self):
    30         self.transport.close()
    31 obj = SSH('192.168.12.72',22,'root','123')
    32 obj.connect()
    33 # df_re = obj.cmd('df')
    34 # print(df_re)
    35 # obj.get(r'/root/install.log',r'C:UsersheshaochuanPycharmProjectspy_s15')
    36 obj._get('/root/install.log',BASE_DIR+'/1.txt')
    37 # obj._put('/tmp',BASE_DIR)
    38 
    39 obj.close()

    2.HTML语法

        在服务器端是一个文件,文件内部:
    <h1>内容</h1>

    学习:HTML标签的对应关系

    学习HTML:
    - socket服务端
    - 直接利用浏览器打开(*******)
    pycharm创建服务端



    标签
    快级标签()占一行
    行内标签,内联标签(自己多少占多少)

     1 <!DOCTYPE html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>Title</title>
     6 </head>
     7 <body>
     8     <h1 style="color: #a55729">liwenqiang</h1>
     9     <textarea>dasdsdasdfd</textarea>
    10     <select><option>hsc</option><option>lwq</option></select>
    11     <p>ewqerrrrrr<br/>rrrrrrr</p>
    12     <p>ewqerrrrrrrrrrrrr</p>
    13     <p>ewqerrrrrrrrrrrrr</p>
    14     <!--跳转-->
    15     <a href="http://www.baidu.com" target="_blank">百度</a>
    16     <!--锚点-->
    17     <a href="#11">第一章</a>
    18     <a href="#22">第二章</a>
    19     <a href="#33">第三章</a>
    20     <!--<div id=11 style="background-color: green;height: 900px;">&nbsp;明朝那些事</div>-->
    21     <!--<div id=22 style="background-color: red;height: 900px;">康熙王朝</div>-->
    22     <!--<div id=33 style="background-color: pink;height: 900px;">陆小凤传奇</div>-->
    23     <div>用户名:
    24         <input type="text"/>
    25     </div>
    26     <div>密码:
    27         <input type="password"/>
    28     </div>
    29     <div>
    30         男<input type="radio" name="qwqe"/>
    31     </div>
    32      <div>
    33         女<input type="radio" name="qwqe"/>
    34     </div>
    35      <div>
    36         爱好:篮球<input type="checkbox"/>游戏<input type="checkbox"/>女<input type="checkbox"/>
    37     </div>
    38       <div>
    39         传文件<input type="file"/>
    40     </div>
    41     <div>
    42         <select>
    43             <option>上海</option>
    44             <option>上海</option>
    45             <option>上海</option>
    46             <option>上海</option>
    47         </select>
    48     </div>
    49 </body>
    50 </html>

    提交

     1 <!DOCTYPE html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>Title</title>
     6 </head>
     7 <body>
     8 <div>
     9     <form action="http://192.178.12.90:8000/index/" method="POST" enctype="multipart/form-data">
    10         <h1>用户登录</h1>
    11         <p>用户名<input type="text" name="username"/></p>
    12         <p>密码:<input type="password" name="pwd"/></p>
    13         <div>性别:
    14             男<input type="radio" name="qwqe" value="1"/>
    15             女<input type="radio" name="qwqe" value="0"/>
    16         </div>
    17          <div>
    18             爱好:篮球<input type="checkbox" name="hobby" value="11"/>游戏<input type="checkbox" name="hobby" value="22"/>女<input type="checkbox" name="hobby" value="ewefesfdf"/>
    19         </div>
    20       <!--<div>-->
    21         <!--传文件<input type="file"/>-->
    22     <!--</div>-->
    23         <select name="city1">
    24             <option>上海</option>
    25             <option>上海</option>
    26             <option>上海</option>
    27             <option>上海</option>
    28         </select>
    29         <select name="city2" multiple>
    30             <option>上海</option>
    31             <option>上海</option>
    32             <option>上海</option>
    33             <option>上海</option>
    34         </select>
    35         <textarea name="memo"></textarea>
    36 
    37         <input type="submit" value="提交"/>
    38     </form>
    39 </div>
    40 </body>
    41 </html>

    table

     1 <!DOCTYPE html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>Title</title>
     6 </head>
     7 <body>
     8     <table border="1">
     9         <thead>
    10             <tr>
    11                 <th>序号</th>
    12                 <th>用户名</th>
    13                 <th>密码</th>
    14                 <th>操作</th>
    15             </tr>
    16         </thead>
    17         <tbody>
    18             <tr>
    19                 <td>1</td>
    20                 <td>dsaddad</td>
    21                 <td>ewdsad</td>
    22                 <td><a href="http://www.baidu.com">删除</a> | <a href="#">编辑</a></td>
    23             </tr>
    24               <tr>
    25                 <td>1</td>
    26                 <td>dsaddad</td>
    27                 <td>ewdsad</td>
    28                 <td><a href="#">删除</a> | <a href="#">编辑</a></td>
    29             </tr>
    30             <tr>
    31                 <td>1</td>
    32                 <td>dsaddad</td>
    33                 <td>ewdsad</td>
    34                 <td><a href="#">删除</a> | <a href="#">编辑</a></td>
    35             </tr>
    36             <tr>
    37                 <td>1</td>
    38                 <td>dsaddad</td>
    39                 <td>ewdsad</td>
    40                 <td><a href="#">删除</a> | <a href="#">编辑</a></td>
    41             </tr>
    42         </tbody>
    43 
    44     </table>
    45 </body>
    46 </html>
  • 相关阅读:
    买二手房的税费详细版本
    实时推荐部分代码
    卡片推荐部分代码
    详解一下网络广告cpc、cpm、cpl、cpa、cps、cpr的计费方法是什么
    吴军硅谷来信《三板斧破四困境》
    JS实现的在线推荐逻辑
    mongo数据库时间存储的问题
    crontab 定时的陷阱
    【剑指offer】栈的压入、弹出序列
    【剑指offer】包含min函数的栈
  • 原文地址:https://www.cnblogs.com/heshaochuan/p/6388746.html
Copyright © 2011-2022 走看看