Beispiel #1
0
import os
import shutil
import sys
import riqi
import configparser
import getabsopath

if __name__ == '__main__':
    yyyymmdd = riqi.isweekend()
    curr = os.path.dirname(os.path.realpath(__file__))

    localpath = getabsopath.absolufile('config.ini', 'path', 'localpath')
    try:
        os.chdir(localpath)
    except FileNotFoundError:
        os.mkdir(localpath)
    destpath = conf.get('path', 'destpath')
    destpath = os.path.join(curr, destpath)
    try:
        os.chdir(destpath)
    except FileNotFoundError:
        os.mkdir(destpath)
    dataa = getabsopath.absolufile('config.ini', 'path', 'data')
    data = open(dataa)
    datacon = data.readlines()

    for eachline in datacon:
        (dataip, xyz, biaozhun, ip1, path1, ip2, path2) = eachline.split('|')
        #xyz = xyz + '.dbf'
        biaozhun = biaozhun.replace('yyyymmdd', yyyymmdd)
        #print(biaozhun)
Beispiel #2
0
    destpath = destpath + dirname[0]
    try:
        with zipfile.ZipFile(localfile) as zfile:
            zfile.extractall(path=destpath)
            print("%s   已完成解压" % localfile)
    except zipfile.BadZipFile as e:
        print(zfile + 'is a bad zip file,please check')
    # 此处的destpath C:/untitled/un/致远天风稳健20190620


if __name__ == '__main__':
    yyyymmdd = riqi.isweekend().strftime("%Y%m%d")
    print(yyyymmdd)
    ##localpath下载到本地的目录,destpath将下载的文件解压后的目录
    curr = os.path.dirname(os.path.realpath(__file__))
    localpath = getabsopath.absolufile('config.ini', 'path', 'localpath')
    try:
        os.chdir(localpath)
    except FileNotFoundError:
        os.mkdir(localpath)
    destpath = getabsopath.absolufile('config.ini', 'path', 'destpath')
    try:
        os.chdir(destpath)
    except FileNotFoundError:
        os.mkdir(destpath)
    dataa = getabsopath.absolufile('config.ini', 'path', 'data')
    data = open(dataa)
    datacon = data.readlines()
    infofo = getabsopath.absolufile('config.ini', 'path', 'downinfo')
    info = open(infofo)
    infocon = info.readlines()
Beispiel #3
0
import getabsopath
import os

dataa = getabsopath.absolufile('config.ini', 'path', 'data')
print(dataa)