
Python
王焕龙
Hello world!
展开
-
python 3发送邮件
import smtplibfrom email.mime.text import MIMETextSMTPsever="smtp.163.com" #邮箱服务器sender="**********@163.com" #邮件地址password="Whl3386087" #密码receivers=["********@qq.com"]content = '端午节快乐哈哈...原创 2018-06-15 10:00:17 · 1386 阅读 · 1 评论 -
Python 3 网络请求
import urllib.requestimport urllib.parseurl="http://203.195.160.134:8901/quote/symbol/info?symbol=AUDUSD_ins"req=urllib.request.urlopen(url)print(req.read().decode('utf-8'))原创 2018-06-15 10:01:26 · 416 阅读 · 0 评论 -
Python连接数据库
import pymysqldb=pymysql.connect("localhost","root","","paoding",charset='utf8')cursor=db.cursor()# cursor.execute('SET NAMES UTF8')sql="select *from userdata"try: cursor.execute(sql) ...原创 2018-09-06 14:15:10 · 239 阅读 · 0 评论 -
Python执行Windows下Cmd命令
import osresult=os.popen("ipconfig")print(result.read())result=os.popen("calc")print(result.read())result=os.popen("notepad")print(result.read())result=os.popen("tasklist")print(r...原创 2018-09-27 18:53:31 · 1767 阅读 · 0 评论 -
python网络请求将json字符转为对象
class CreateOrder: def __init__(self): self.code self.data self.msg# 做多(0)、做空(1)def reqCreateOrderAndEditOrder(): createOrder_url = "/mt4/createOrder" cmd = "...原创 2018-09-27 18:58:22 · 911 阅读 · 0 评论 -
C调用py
1.pyimport numpy as npdef pyInput(): a=input() print(a)def data(): matrix=[[0,1,2,3],[1,1,1,1]] print(matrix) #a=input() #print(a) p:int=0 print(p)usePy.c#include<stdlib.h...原创 2019-03-26 15:03:42 · 339 阅读 · 0 评论 -
Tensorflow的Hello和做加法运算
import tensorflow as tfimport osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # 忽略警告msg = tf.constant("hello Tensor Flow!")with tf.compat.v1.Session() as sess: print(sess.run(msg).decode()) ...原创 2019-09-17 21:08:28 · 1075 阅读 · 1 评论