原创 python3 利用socket和i/o多路複用實現簡易羣聊服務器

服務端 import socket import select # i/o複用實例,利用操作系統對i/o流的阻塞,單線程多人羣聊服務器 ss = socket.socket(socket.AF_INET, socket.SOCK

原创 vim8+python2安裝youcompleteme

因爲要使用vim寫代碼,但是vim沒有自動提示補全功能啊,沒辦法,只有去下載插件了,在網上找了下,大家都覺得youcompleteme不錯,我也就試了下,結果坑到吐血。 因爲項目要用python2寫,而youcompleteme2

原创 git筆記,命令集合

git commit -m ‘記錄’ #添加記錄到倉庫中 git commit -am ‘xx’ #git add 加commit,只能用於修改文件 git log #查看變化的日誌 git diff #顯示git status的

原创 純html+css做的頂部四級菜單欄,僞類選擇器和定位的高級用法

html內容 <ul class="one"> <li><a href="#">一級菜單1</a> <ul class="two"> <li><a href="#">二級菜單1</a> <ul

原创 原生js+html+css實現從表單(form)動態加數據到表格(table)

css部分 <style> .info{ width: 150px; margin-bottom: 10px; } th{ width: 100px; padding-left:

原创 python3利用socket和threading實現類似qq的多用戶羣聊

利用多線程threading實現簡單的羣聊服務器 服務端 import socket import threading users = {} def msg_chat(cc, addr): userName = cc.r

原创 centos7.4安裝python3.7.4和pip3

1.去官網下載Python-3.7.4.tar.xz包,然後上傳到服務器/usr/local/目錄,或者使用wget去下載到/usr/local/ 2.解壓,沒有xz就yum install xz xz -d Python-3.7

原创 純html+css做的側邊三級菜單導航

html部分 <ul> <li> <a href="#">章節</a> </li> <ul> <li> <a href="#">py

原创 python3 手動編寫的簡單的web服務器(HttpServer)

httpserver代碼如下 import socket import pymysql import re from uuid import uuid4 from datetime import datetime, timedel

原创 sqlachemy查詢集轉化字典或者json格式的方法

方法一 在model中加入 def to_dict(self): return {c.name: getattr(self, c.name) for c in self.__table__.columns} 在服務中調用 de

原创 在angularjs的函數中使用foreach的坑

關於angularjs的foreach遍歷函數中使用return的問題 一般來說,函數中使用return,執行到return就會退出函數,不會向下執行。但是如果在函數中使用foreach,在foreach中使用return,執行到