Repository navigation
Expand file tree
/
Copy pathsave1.py
More file actions
53 lines (51 loc) · 1.48 KB
/
Copy pathsave1.py
File metadata and controls
53 lines (51 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from wxpy import *
from bypy import ByPy
import os
import time
import datetime
import threading
bot=Bot()
bp=ByPy()
def save(filename, msg):
fh = open(filename, 'a+', encoding='utf-8')
msg=msg+'\n'
fh.write(msg)
fh.close()
@bot.register()
def face_msg(msg):
msg2=msg
print(msg2)
print(msg2.receive_time)
print(msg2.type)
global Folder_1
if msg2.type==TEXT:
print('这个是字符串类型')
print(msg2.text)
Folder_1=str(msg2.text)
print(Folder_1)
Folder_1.replace(' ','')
Folder_1.replace(':','')
Folder_1.replace('(','')
Folder_1.replace(')','')
print(Folder_1)
print(msg2.Group)
print(msg2.sender)
text1=str(msg2.receive_time)+str(msg2)
save('f:\\imag\\xiaoxi.txt', text1)
# bp.mkdir(Folder_1)
else:
print('错误')
image_name = msg2.file_name
print ('接收图片')
print (image_name)
print(msg2.receive_time)
print('folder_1'+Folder_1)
msg2.get_file('F:\\imag\\' + msg2.file_name)
path='F:\\imag\\' + msg2.file_name
print('path'+path)
print('chuangjian'+'dir_name/'+Folder_1)
Folder_2=Folder_1+'new'
bp.mkdir(Folder_2)
bp.upload(localpath= path, remotepath= Folder_2, ondup='newcopy')
print('上传成功'+path+'f:\\imag\\xiaoxi.txt')
embed()