#coding = utf8
import threading,time,random count = 0
class MyThread (threading.Thread): def __init__(self,lock,threadName):
super(MyThread,self).__init__(name = threadName)
self.lock = lock def run(self):
global count
self.lock.acquire()
for i in range(100):
count = count + 1
time.sleep(0.3)
print(self.getName() , count)
self.lock.release() lock = threading.Lock()
for i in range(2):
MyThread (lock,"MyThreadName:" + str(i)).start()

吴裕雄 python深度学习与实践(2)的更多相关文章

  1. 吴裕雄 python深度学习与实践(18)

    # coding: utf-8 import time import numpy as np import tensorflow as tf import _pickle as pickle impo ...

  2. 吴裕雄 python深度学习与实践(17)

    import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import time # 声明输 ...

  3. 吴裕雄 python深度学习与实践(16)

    import struct import numpy as np import matplotlib.pyplot as plt dateMat = np.ones((7,7)) kernel = n ...

  4. 吴裕雄 python深度学习与实践(15)

    import tensorflow as tf import tensorflow.examples.tutorials.mnist.input_data as input_data mnist = ...

  5. 吴裕雄 python深度学习与实践(14)

    import numpy as np import tensorflow as tf import matplotlib.pyplot as plt threshold = 1.0e-2 x1_dat ...

  6. 吴裕雄 python深度学习与实践(13)

    import numpy as np import matplotlib.pyplot as plt x_data = np.random.randn(10) print(x_data) y_data ...

  7. 吴裕雄 python深度学习与实践(12)

    import tensorflow as tf q = tf.FIFOQueue(,"float32") counter = tf.Variable(0.0) add_op = t ...

  8. 吴裕雄 python深度学习与实践(11)

    import numpy as np from matplotlib import pyplot as plt A = np.array([[5],[4]]) C = np.array([[4],[6 ...

  9. 吴裕雄 python深度学习与实践(10)

    import tensorflow as tf input1 = tf.constant(1) print(input1) input2 = tf.Variable(2,tf.int32) print ...

  10. 吴裕雄 python深度学习与实践(9)

    import numpy as np import tensorflow as tf inputX = np.random.rand(100) inputY = np.multiply(3,input ...

随机推荐

  1. 17 RAID与mdadm管理命令

    在"14 磁盘及文件系统管理详解"中,我们详细介绍了磁盘的工作原理,但是,有一点我们一定要明白,作为现在存储数据的主要设备,机械磁盘早就是上个世纪的产品,而它的读写速度与内存.CP ...

  2. CS229 6.17 Neurons Networks convolutional neural network(cnn)

    之前所讲的图像处理都是小 patchs ,比如28*28或者36*36之类,考虑如下情形,对于一副1000*1000的图像,即106,当隐层也有106节点时,那么W(1)的数量将达到1012级别,为了 ...

  3. Spring Boot 整合mybatis-generator

    Maven 引入 mybatis-generator插件 <build> <plugins> <plugin> <groupId>org.springf ...

  4. Html盛放媒体/视频标签

    播放视频: <video id="video1" width="420" style="margin-top:15px;" contr ...

  5. c#,Model 实体转json,字符串转json

    public class JsonF { #region 字符串转json /// <summary> /// 字符串转json /// </summary> /// < ...

  6. Python 文件的操作

    新建 # ==================新建==================# 新建文件夹,若倒数第二层文件夹不存在则会报错os.mkdir(r"/home/python" ...

  7. FileInputStream与FileOutputStream 复制文件例子代码

    try { File sourceFile = new File("C:\\Users\\prize\\Desktop\\Demo1\\盗墓笔记7.txt");//创建源文件 In ...

  8. cmd批处理命令及powershell

    https://blog.csdn.net/wenzhongxiang/article/details/79256937 Powershell查询IP地址及主机名信息:1.foreach($ipv4  ...

  9. 在Ubuntu 14.04 64bit上安装百度云Linux客户端BCloud

    参考:https://www.cnblogs.com/kluan/p/6014989.html 下载 网盘安装包,Bcloud 是一个 Linux 下超赞的客户端, 官网 github: https: ...

  10. ThinkPHP同时操作多个数据库

    除了在预先定义数据库连接和实例化的时候指定数据库连接外,我们还可以在模型操作过程中动态的切换数据库,支持切换到相同和不同的数据库类型.用法很简单, 只需要调用Model类的db方法,用法: $this ...