上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 81 下一页
摘要: 一.生成器简介 在python中,带yield的方法不再是普通方法,而是生成器,它的执行顺序不同与普通方法. 普通方法的执行是从头到尾,最后return返回,或者没有返回值 生成器是到yield就返回yield之后的值,然后阻塞,等待next()/send()继续调起生成器 二.next()/sen 阅读全文
posted @ 2020-06-04 17:12 Mars.wang 阅读(1080) 评论(0) 推荐(0)
摘要: import sys.process._ "ipconfig /all"! 阅读全文
posted @ 2020-06-03 20:38 Mars.wang 阅读(1052) 评论(0) 推荐(0)
摘要: import logging # 创建一个logger logger = logging.getLogger() logger.setLevel(logging.INFO) # 创建一个handler,用于写入日志文件 fh = logging.FileHandler('log.txt', mode 阅读全文
posted @ 2020-06-03 17:23 Mars.wang 阅读(1482) 评论(1) 推荐(0)
摘要: from typing import TypeVar, Generic T = TypeVar('T') class Stack(Generic[T]): def __init__(self) -> None: # Create an empty list with items of type T 阅读全文
posted @ 2020-05-27 14:27 Mars.wang 阅读(6322) 评论(0) 推荐(0)
摘要: class Operator(object): def __init__(self, task_id): self.task_id = task_id def __rshift__(self, other): if isinstance(other, Operator): print('%s=>%s 阅读全文
posted @ 2020-05-21 19:15 Mars.wang 阅读(669) 评论(0) 推荐(0)
摘要: # -*- coding: UTF-8 -*- import time import phoenixdb import psycopg2 import pymysql from urllib.parse import urlparse """ 将数据库的连接信息组装成一个connection对象 " 阅读全文
posted @ 2020-05-20 20:40 Mars.wang 阅读(165) 评论(0) 推荐(0)
摘要: class HadoopCommand(object): def __init__(self, path, command=HADOOP_COMMAND_PATH): self.command = command self.path = path def remove(self): command_ 阅读全文
posted @ 2020-05-20 20:35 Mars.wang 阅读(872) 评论(0) 推荐(0)
摘要: command+shift+P:查看变量类型(Scala) 阅读全文
posted @ 2020-05-14 13:41 Mars.wang 阅读(119) 评论(0) 推荐(0)
摘要: public static Map<String,String> loadDataFromFile() { Map<String,String> map = new ConcurrentHashMap<>(); try { File file = new File("filename.txt"); 阅读全文
posted @ 2020-05-12 10:57 Mars.wang 阅读(723) 评论(0) 推荐(0)
摘要: //spark读取数据 Dataset<Row> df = spark.read().textFile(currentSrcPath, 1); Dataset<Row> df = spark.read().json(path); Dataset<Row> df = spark.read().orc( 阅读全文
posted @ 2020-05-08 17:39 Mars.wang 阅读(580) 评论(0) 推荐(0)
上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 81 下一页