摘要: appJar 阅读全文
posted @ 2019-01-12 20:11 CrossPython 阅读(835) 评论(0) 推荐(0) 编辑
摘要: #窗口之间数据传递(通过属性方式) from PyQt5.QtWidgets import QDialogButtonBox, QDateTimeEdit,QDialog,QComboBox,QTableView,QAbstractItemView,QHeaderView,QTableWidget, QTableWidgetItem, QMessageBox,QListWidget,QListW... 阅读全文
posted @ 2019-01-12 19:40 CrossPython 阅读(3096) 评论(1) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * class FirstWindow(QWidget): close_signal = pyqtSignal() def __init__(self, parent=None): ... 阅读全文
posted @ 2019-01-12 19:33 CrossPython 阅读(639) 评论(0) 推荐(0) 编辑
摘要: # coding=utf-8 import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * class Example(QWidget): def __init__(self): super().__init__() ... 阅读全文
posted @ 2019-01-12 19:20 CrossPython 阅读(1350) 评论(0) 推荐(0) 编辑
摘要: import pyglet class T(pyglet.window.Window): def __init__(self): super(T, self).__init__() self.player = pyglet.media.Player() # self.player.push_handlers(self.on_eos()... 阅读全文
posted @ 2019-01-11 14:33 CrossPython 阅读(408) 评论(0) 推荐(0) 编辑
摘要: http://www.php.cn/python-tutorials-394725.html 阅读全文
posted @ 2019-01-11 10:16 CrossPython 阅读(167) 评论(0) 推荐(0) 编辑
摘要: python2, 参考思路. Queue Queue是python标准库中的线程安全的队列(FIFO)实现,提供了一个适用于多线程编程的先进先出的数据结构,即队列,用来在生产者和消费者线程之间的信息传递 基本FIFO队列 class Queue.Queue(maxsize=0) FIFO即First 阅读全文
posted @ 2019-01-11 09:04 CrossPython 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 1.进程和线程 (1)进程是一个执行中的程序。每个进程都拥有自己的地址空间、内存、数据栈以及其他用于跟踪执行的辅助数据。进程也可以派生新的进程来执行其他任务,不过每个新进程都拥有自己的内存和数据栈,所以只能采用进程间通信(IPC)的方式共享信息。 (2)线程与进程类似,不过他们是在同一个进程下执行的 阅读全文
posted @ 2019-01-10 20:11 CrossPython 阅读(1228) 评论(0) 推荐(0) 编辑
摘要: #-*- coding:utf-8 -*- from threading import Thread from socket import * #1.实现接收消息 def recvDate(): while True: recvInfo = udpSocket.recvfrom(1024) print("\r\n>>%s:%s"%(str(recvInfo... 阅读全文
posted @ 2019-01-10 20:00 CrossPython 阅读(423) 评论(0) 推荐(0) 编辑
摘要: weChatThread线程类 之前一直不会python多线程,写这个程序的时候,发现不用多线程会陷入无限未响应状态。于是学了半天python多线程,但是在主函数里写的时候,发现一个问题,Ui主线程和工作线程没有分离,使用itchat等库的时候会堵塞主线程,换句话说PyQt中子线程不能操作GUI界面 阅读全文
posted @ 2019-01-10 19:39 CrossPython 阅读(823) 评论(0) 推荐(0) 编辑
摘要: Player = pyglet.media.Player() # our event handling function def on_eos(): print("on player eos") Player.push_handlers(on_eos) 阅读全文
posted @ 2019-01-08 20:26 CrossPython 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 访问模式说明 r 以只读方式打开文件。文件的指针将会放在文件的开头。这是默认模式。 w 打开一个文件只用于写入。如果该文件已存在则将其覆盖。如果该文件不存在,创建新文件。 a 打开一个文件用于追加。如果该文件已存在,文件指针将会放在文件的结尾。也就是说,新的内容将会被写入到已有内容之后。如果该文件不 阅读全文
posted @ 2019-01-08 09:55 CrossPython 阅读(1386) 评论(0) 推荐(0) 编辑
摘要: for i in range(10): self.player2.queue(pyglet.media.StaticSource(pyglet.media.load('2.mp3'))) 阅读全文
posted @ 2019-01-07 23:05 CrossPython 阅读(177) 评论(0) 推荐(0) 编辑
摘要: from flutter study: 写个小东西,一直调试,无法访问,最后定位在权限上。 .p4a 配置文件中添加一行,下方是给网络权限。 –permission INTERNET 如果是多条权限,请重复输入多条 –permission Android应用访问网络时需要先设置权限,在Android 阅读全文
posted @ 2019-01-06 12:03 CrossPython 阅读(2010) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/xiangsikai/p/7838407.html https://blog.csdn.net/fengsen321/article/details/79429141 阅读全文
posted @ 2019-01-05 16:57 CrossPython 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1.安装python3.6 sudo apt-get install python3.6 2.修改软连接 3.安装pip 阅读全文
posted @ 2019-01-02 20:29 CrossPython 阅读(3435) 评论(1) 推荐(0) 编辑
摘要: 内容来自网上查找和总结以及自己的尝试boot里面的启动项是根据其它文件生成的,如果改boot里面,会在你更新grub后再次回到原来的状态。(之后 我(有显卡驱动问题的用户)通过在开机时选择系统页面按e在倒数第二行ro quiet splash 后面加上acpi_osi=! acpi_osi="Win 阅读全文
posted @ 2019-01-02 20:21 CrossPython 阅读(5030) 评论(0) 推荐(0) 编辑
摘要: 安装工具:Pycharm 专业版2017.3PyQT5python3 pyqt5-tools 设置扩展工具的参数找到setting->tools->external tools,点击加号新建工具 先加qtdesinger的参数,program:E:\python_study\qtstudy\venv 阅读全文
posted @ 2018-12-30 13:10 CrossPython 阅读(958) 评论(0) 推荐(0) 编辑
摘要: mysql Access denied for user \'root\'@\'localhost\'”解决办法总结,下面我们对常见的出现的一些错误代码进行分析并给出解决办法,有需要的朋友可参考一下。 错误代码 1045 Access denied for user 'root'@'localhos 阅读全文
posted @ 2018-12-22 10:49 CrossPython 阅读(600) 评论(0) 推荐(0) 编辑
摘要: Django中默认支持Session,其内部提供了5种类型的Session供开发者使用: ·数据库(默认) ·缓存 ·文件 ·缓存+数据库 ·加密cookie (1)数据库中的Session (2)缓存Session (3)文件Session (4)缓存+数据库Session (5)加密Sessio 阅读全文
posted @ 2018-12-21 11:26 CrossPython 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1 下载 https://pan.baidu.com/s/1mcQM8CLUnweY02ahKEr4PQ 并将 JetbrainsCrack-release-enc.jar 放置到 pycharm安装目录的\bin目录下(位置可随意,只要配置文件填写相对应的路径)。 2 在 Pycharm安装目录的 阅读全文
posted @ 2018-12-20 17:54 CrossPython 阅读(1077) 评论(0) 推荐(0) 编辑
摘要: https://www.microsoft.com/en-us/download/details.aspx?id=40784 装之 from : https://answers.microsoft.com/en-us/windows/forum/windows_7-windows_install/m 阅读全文
posted @ 2018-12-18 20:37 CrossPython 阅读(1452) 评论(0) 推荐(0) 编辑
摘要: 2RRJMBXW33-eyJsaWNlbnNlSWQiOiIyUlJKTUJYVzMzIiwibGljZW5zZWVOYW1lIjoi5b285bK4IHNvZnR3YXJlMiIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9u... 阅读全文
posted @ 2018-12-18 20:32 CrossPython 阅读(145) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/a1368783069/article/details/52137417 阅读全文
posted @ 2018-12-13 21:22 CrossPython 阅读(658) 评论(0) 推荐(0) 编辑
摘要: # https://segmentfault.com/q/1010000010559838 import asyncio import threading import random async def fn(name,qu): while True: print(name,"ready to work") r=asyncio.run_coroutin... 阅读全文
posted @ 2018-12-13 17:58 CrossPython 阅读(191) 评论(0) 推荐(0) 编辑
摘要: from asyncio import Queue,sleep import asyncio from threading import Thread import time qu=Queue() #put async def putQ(): global qu print('start put') i=1 while True: print(... 阅读全文
posted @ 2018-12-12 11:47 CrossPython 阅读(726) 评论(0) 推荐(0) 编辑
摘要: https://www.lfd.uci.edu/~gohlke/pythonlibs/ 阅读全文
posted @ 2018-12-10 19:50 CrossPython 阅读(125) 评论(0) 推荐(0) 编辑
摘要: import asyncio from threading import Thread import time print('main start:',time.time()) async def start(i): print(i, time.time()) await asyncio.sleep(i) b=run(i) if b is not None: ... 阅读全文
posted @ 2018-12-09 11:03 CrossPython 阅读(153) 评论(0) 推荐(0) 编辑
摘要: import asyncio from threading import Thread import time print('main start:',time.time()) async def download(i): print(i, time.time()) await asyncio.sleep(i) b=linkextractor(i) if b ... 阅读全文
posted @ 2018-12-08 22:09 CrossPython 阅读(174) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/0efdc952e8ca 阅读全文
posted @ 2018-12-08 21:22 CrossPython 阅读(818) 评论(0) 推荐(0) 编辑
摘要: import asyncio from threading import Thread import time now = lambda: time.time() print('start',now()) def start_loop(loop): asyncio.set_event_loop(loop) loop.run_forever() async def do_so... 阅读全文
posted @ 2018-12-08 17:45 CrossPython 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 单个的task 阅读全文
posted @ 2018-12-08 10:55 CrossPython 阅读(213) 评论(0) 推荐(0) 编辑
摘要: close的方法主要是关闭子生成器,需要注意的有4点: 1.如果生成器close后,还继续next,会报错StopIteration [图片] 2.如果我捕获了异常,将GeneratorExit处理了,之后还有一个yield,这时候close之后,还要next会报错RuntimeError异常 3. 阅读全文
posted @ 2018-12-08 09:49 CrossPython 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 作为一名做为在前端死缠烂打6年并且懒到不行的攻城士,这几年我还是阅过很多同门从知名到很知名的各种前端框架,本来想拿15-20个框架来分享一下,但在跟几个前辈讨教写文章的技巧时果断被无情的打击了,所以这里我还是低调的只拿出10个框架来个大锅乱炖来简单介绍,凑够字数也就全剧终了。 原本写这篇文章想围绕着 阅读全文
posted @ 2018-12-04 20:06 CrossPython 阅读(334) 评论(0) 推荐(0) 编辑
摘要: import paramiko #建立连接,获取sftp句柄 def sftp_connect(username,password,host,port=22): client = None sftp = None try: client = paramiko.Transport((host,port 阅读全文
posted @ 2018-12-03 16:38 CrossPython 阅读(6525) 评论(0) 推荐(1) 编辑
摘要: xxxxxxxxxxxxxxxx 阅读全文
posted @ 2018-12-02 18:18 CrossPython 阅读(30240) 评论(0) 推荐(1) 编辑
摘要: 1. 路径操作 比起 os 模块的 path 方法,python3 标准库的 pathlib 模块的 Path 处理起路径更加的容易。 ####获取当前文件路径 前提导入 os 和 pathlib 包。。 os 版: pathlib 版: 看着好像没啥区别,然后看下面这个。 获取上两级文件目录 os 阅读全文
posted @ 2018-11-26 19:41 CrossPython 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 获取其他线程的数据用 queue, 多进程Q 阅读全文
posted @ 2018-11-26 10:10 CrossPython 阅读(288) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8 import time,asyncio a=time.time() id=1 async def hello(id,semaphore): async with semaphore: await asyncio.sleep(1) print('working id:'+str(id)) async def run(): ... 阅读全文
posted @ 2018-11-25 11:16 CrossPython 阅读(1860) 评论(0) 推荐(0) 编辑
摘要: https://my.oschina.net/backbye/blog/1919486 asyncio 提供了两个给运行中的事件循环(loop) 添加 事件的方法 call_soon_threadsafe() 、run_coroutine_threadsafe() 因为我们一般的场景中会另起一个线程 阅读全文
posted @ 2018-11-25 10:33 CrossPython 阅读(1082) 评论(0) 推荐(0) 编辑