What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-23 21:07:10
python read all jpg files in a directory and display the first picture
# -*- coding: UTF-8 -*-import numpy as npimport osfrom scipy.misc import imread, imresizeimport matplotlib.pyplot as pltfrom glob import glob # Read all the jpg image directorydef load_image(image_path, image_size): file_name=glob(image_path+"/*j... Add solution -
Python 2021-10-14 20:20:08
python pool
"""A very simple parallel code example to execute parallel functions in python""" import multiprocessing import numpy as np def multiprocessing_func(x): """Individually prints the squares y_i of the elements x... Add solution -
Python 2021-10-12 03:26:08
__name__ == '__main__'
# If the python interpreter is running that module (the source file) # as the main program, it sets the special __name__ variable to have # a value “__main__”. If this file is being imported from another # module, __name__ will be set to the ... Add solution -
Python 2021-09-21 10:09:02
run multiple function with multiprocessing python
from multiprocessing import Process import sys rocket = 0 def func1(): global rocket print ('start func1') while rocket < sys.maxsize: rocket += 1 print ('end func1') def func2(): global rocket print ('start func2') ... Add solution -
Python 2021-09-03 13:41:02
counting inversions python
'''for counting pairs the best algo has time complexty O(n*log(n))''' ''' for collecting such pairs the best algo. has time complexity O(n*n)''' PAIRS=0 def merge(left,right): global PAIRS length_1,length_2=len(left),len(right) index1,index2... Add solution
Best helpers
Ranking is empty