This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from shutil import copyfile | |
# `sudo pip install walkdir` if you don't install walkdir | |
import walkdir as wd | |
import time | |
src_dir = os.environ['HOME']+'/Downloads/' | |
dst_dir = '/Volumes/NUCLEO/' | |
pattern = "*_NUCLEO_F401RE.bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fp = fopen('0016.raw','r'); | |
[a,count]=fread(fp); | |
a = reshape(a,row,col)'; | |
figure,imshow(uint8(a)) | |
imwrite(uint8(a),'0016.bmp','bmp'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# @author linjinhui | |
# @time 2016/04/01 | |
# @version 1.0 | |
# How can I save an image with PIL? | |
# http://stackoverflow.com/questions/14452824/how-can-i-save-an-image-with-pil | |
import numpy as np | |
from PIL import Image | |
import os | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# @author linjinhui | |
# @time 2016/08/04 | |
# @version 1.0 | |
import numpy as np | |
from PIL import Image | |
import os | |
import re | |
from tqdm import tqdm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
import os | |
import numpy as np | |
import walkdir as wd | |
file_info_type = np.dtype({ | |
'names': ['dir','name'], | |
'formats':['S100','S100'] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
import os | |
import numpy as np | |
import walkdir as wd | |
file_info_type = np.dtype({ | |
'names': ['dir','name'], | |
'formats':['S100','S100'] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
import os | |
import numpy as np | |
import walkdir as wd | |
file_info_type = np.dtype({ | |
'names': ['dir','name'], | |
'formats':['S100','S100'] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
import os | |
import numpy as np | |
import walkdir as wd | |
prefix = 'pre-' | |
file_info_type = np.dtype({ | |
'names': ['dir','name'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import re | |
def classify_file_type_in_current_dir(file_name, file_type): | |
f = open(file_name,'wb') | |
for root, dirs, files in os.walk(os.getcwd(), topdown=True): | |
for name in files: |