Splitting a large file into separate modules in C / C ++, Java and Python

| | | | | | | | | | |

This approach is doomed to failure and usually requires rewriting from scratch.

So, to solve this scenario, we can try to divide the problem into several sub-problems and then try to solve it one by one.

This not only makes our task easier, but also allows us to achieve

Now the big question is how to "break" not theoretically, but SOFTWARE .

We will see several different types of such units in popular languages ‚Äã‚Äãsuch as C / C++, Python & amp; Java.

C / C++

For illustrative purposes,

Let’s assume we have all the basic linked list inserts in one program. Since there are many methods (functions), we cannot clutter the program by writing all the method definitions above the required main function. But even if we did, there might be a problem of ordering methods, when one method should be before another, and so on.

So, to solve this problem, we can declare all prototypes at the beginning of the program, and then the main method and below that we can define them in any particular order:

Program :

FullLinkedList.c

// insert a complete linked list


# include & lt; stdio.h & gt;
# include & lt; stdlib.h & gt;


// ------------ --------------------
// Announcements - START:
// --------------------------------

struct Node;

struct Node * create_node ( int data);

void b_insert ( struct Node ** head, int data);

void n_insert ( struct Node ** head, int data, int pos);

void e_insert ( struct Node ** head, int data);

void display ( struct Node * temp);


// ------------ --------------------
// Announcements - END:
// --------------------------------

int main ()

{

struct Node * head = NULL;

int ch, data, pos;

printf ( " Linked List: " );

while (1) {

printf ( "1.Insert at Beginning" );

printf ( "2.Insert at Nth Position" );

printf ( "3.Insert At Ending" );

printf ( "4.Display" );

printf ( "0.Exit" );

printf ( "Enter your choice:" );

scanf ( "% d" , & amp; ch);

switch (ch) {

case 1:

printf ( "Enter the data:" );

scanf ( "% d" , & amp; data);

b_insert (& amp; head, data);

break ;

case 2:

printf ( "Enter the data:" );

scanf ( "% d" , & amp; data);

printf ( " Enter the Position: " );

scanf ( "% d" , & amp; pos);

n_insert (& amp; head, data, pos);

break ;

case 3:

printf ( "Enter the data:" );

scanf ( "% d" , & amp; data);

e_insert (& amp; head, data);

break ;

case 4:

display (head);

break ;

case 0:

return 0;

default :

printf ( "Wrong Choice" );

}

}

}


// -------------------------- ------
// Definitions - START:
// ---- ----------------------------

struct Node {

int data;

struct Node * next;

};

struct Node * create_node ( int data)

{

struct Node * temp

= ( struct Node *)

malloc ( sizeof ( struct Node));

temp- & gt; data = data;

temp- & gt; next = NULL;

return temp;

}

void b_insert ( struct Node ** head, int data)

{

struct Node * new_node = create_node (data);

new_node- & gt; next = * head;

* head = new_node;

}

void n_insert ( struct Node ** head, int data, int pos)

{

if (* head == NULL) {

b_insert (head, data);

return ;

}

struct Node * new_node = create_node (data);

struct Node * temp = * head;

for ( int i = 0; i & lt; pos - 2; ++ i)

temp = temp- & gt; next;

new_node- & gt; next = temp- & gt; next;

temp- & gt; next = new_node;

}

void e_insert ( struct Node ** head, int data)

{

if (* head == NULL) {

b_insert (head, data);

return ;

}

struct Node * temp = * head;

while (temp- & gt; next! = NULL)

temp = temp- & gt; next;

struct Node * new_node = create_node (data);

temp- & gt; next = new_node;

}

void display ( struct Node * temp)

{

printf ( "The elements are:" );

while (temp! = NULL) {

printf ( "% d" , temp- & gt; data);

temp = temp- & gt; next;

}

printf ( " " );

}


// --------------------------------
// Definitions - END
// --------------------- -----------

Compiling the code: we can compile the above program:

 gcc linkedlist.c -o linkedlist 

And it works!

The main problems in the above code:
We can already see the main problems with the program, it is not so easy to work with the code either individually or in a group .

If someone wants to work with the above program, then some of the many problems that person is facing:

  1. One has to go through the Full Source File. to improve or improve some functionality.
  2. Cannot be easily reused the program as a basis for other projects.
  3. The code is very cluttered and is not attractive at all, which makes it very difficult to navigate through the code.

In the case of a group project or large programs, the above approach is guaranteed to increase overall costs, energy, and failure rates.

Correct approach:

We see that these lines begin in every C / C++ program that starts with "#include".
This means to include all functions declared in the "library" header (.h files) and defined possibly in library.c / cpp files.

These lines are preprocessed at compile time.

We can manually try to create such a library for our own purposes.

Important things to remember:

  1. The ".h" files contain only prototype declarations (such as functions, structures) and global variables.
  2. The ".c / .cpp" files contain the actual implementation ( declaration definitions in header files)
  3. When compiling all source files, make sure that multiple definitions of the same function, variable, etc. do not exist for the same project. (VERY IMPORTANT)
  4. Use static functions, to restrict yourself to the file in which they are declared.
  5. Use the extern keyword to use variables referenced by and external files.
  6. When using C++, be careful with namespaces, always use namespace_name :: function (), to avoid collisions.
  7. By splitting the program into smaller codes:
    After examining the above program, we can see how this large program can be split into suitable small parts and then easily processed.

    The above program has essentially 2 main functions:
    1) Create, insert and save data in nodes.
    2) Displaying nodes

    This way I can split the program accordingly so that:
    1) The main file is & gt; Program driver, Nice Wrapper from Insertion Modules and where we use additional files.
    2) Paste - & gt; The real implementation lies here.

    With the important points mentioned, the program is divided into:

    linkedlist.c - & gt; Contains Driver Program
    insert.c - & gt; Contains Code for insertion

    linkedlist.h - & gt; Contains the necessary Node declarations
    insert.h - & gt; Contains the necessary Node Insertion Declarations

    In each header file we start with:

     #ifndef FILENAME_H #define FILENAME_H Declarations ... #endif 

    The reason we write our declarations between #ifndef, #define and #endif, is to prevent multiple declarations of identifiers such as data types, variables, etc., when one and the same header file is called in a new file belonging to the same project.

    For this sample program:

    insert.h - & gt; Contains the declaration of the insert node as well as the declaration of the node itself.

    It is very important to remember that the compiler can see declarations in the header file, but if you try to write code that includes the declaration elsewhere, this will result in an error, as the compiler compiles each .c file individually before moving on to the link step. ,

    connectedlist.h - & gt; A helper file that contains Node and its Display declarations that must be included for files that use them.

    insert.c - & gt; Include a Node declaration via #include "connectedlist.h", which contains the declaration as well as all other method definitions declared in insert.h.

    connectedlist.c - & gt; Simple Wrapper, containing an infinite loop prompting the user to insert integer data at the required positions, and also containing a method that displays the list.

    And the last thing to keep in mind is that meaningless inclusion files into each other can lead to multiple overrides (s) and will result in an error.

    Taking the above into account, you should carefully divide into suitable routines.

    linkedlist.h

    // connectedlist.h


    # ifndef LINKED_LIST_H
    # define LINKED_LIST_H

    struct Node {

    int data;

    struct Node * next;

    };

    void display ( struct Node * temp);


    # endif

    insert.h

    // insert.h


    # ifndef INSERT_H
    #define INSERT_H

    struct Node;

    struct Node * create_node ( int data);

    void b_insert ( struct Node ** head, int data);

    void n_insert ( struct Node ** head, int data, int pos);

    void e_insert ( struct Node ** head, int data);


    # endif

    insert.c

    // insert.c


    # include "linkedlist.h"
    // & quot; & quot; so the preprocessor looks
    // to the current directory and
    // standard library files later.


    # include & lt; stdlib.h & gt;

    struct Node * create_node ( int data)

    {

    struct Node * temp = ( struct Node *) malloc ( sizeof ( struct Node));

    temp- & gt; data = data;

    temp- & gt; next = NULL;

    return temp;

    }

    void b_insert ( struct Node ** head, int data)

    {

    struct Node * new_node = create_node (data);

    new_node- & gt; next = * head;

    * head = new_node;

    }

    void n_insert ( struct Node ** head, int data, int pos)

    {

    if (* head == NULL) {

    b_insert (head, data);

    return ;

    }

    struct Node * new_node = create_node (data);

    struct Node * temp = * head;

    for ( int i = 0; i & lt; pos - 2; ++ i)

    temp = temp- & gt; next;

    new_node- & gt; next = temp- & gt; next;

    temp- & gt; next = new_node;

    <

    Splitting a large file into separate modules in C / C ++, Java and Python _files: Questions

    How do I list all files of a directory?

    5 answers

    How can I list all files of a directory in Python and add them to a list?

    3467

    Answer #1

    os.listdir() will get you everything that"s in a directory - files and directories.

    If you want just files, you could either filter this down using os.path:

    from os import listdir
    from os.path import isfile, join
    onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
    

    or you could use os.walk() which will yield two lists for each directory it visits - splitting into files and dirs for you. If you only want the top directory you can break the first time it yields

    from os import walk
    
    f = []
    for (dirpath, dirnames, filenames) in walk(mypath):
        f.extend(filenames)
        break
    

    or, shorter:

    from os import walk
    
    filenames = next(walk(mypath), (None, None, []))[2]  # [] if no file
    

    3467

    Answer #2

    I prefer using the glob module, as it does pattern matching and expansion.

    import glob
    print(glob.glob("/home/adam/*"))
    

    It does pattern matching intuitively

    import glob
    # All files ending with .txt
    print(glob.glob("/home/adam/*.txt")) 
    # All files ending with .txt with depth of 2 folder
    print(glob.glob("/home/adam/*/*.txt")) 
    

    It will return a list with the queried files:

    ["/home/adam/file1.txt", "/home/adam/file2.txt", .... ]
    

    3467

    Answer #3

    os.listdir() - list in the current directory

    With listdir in os module you get the files and the folders in the current dir

     import os
     arr = os.listdir()
     print(arr)
     
     >>> ["$RECYCLE.BIN", "work.txt", "3ebooks.txt", "documents"]
    

    Looking in a directory

    arr = os.listdir("c:\files")
    

    glob from glob

    with glob you can specify a type of file to list like this

    import glob
    
    txtfiles = []
    for file in glob.glob("*.txt"):
        txtfiles.append(file)
    

    glob in a list comprehension

    mylist = [f for f in glob.glob("*.txt")]
    

    get the full path of only files in the current directory

    import os
    from os import listdir
    from os.path import isfile, join
    
    cwd = os.getcwd()
    onlyfiles = [os.path.join(cwd, f) for f in os.listdir(cwd) if 
    os.path.isfile(os.path.join(cwd, f))]
    print(onlyfiles) 
    
    ["G:\getfilesname\getfilesname.py", "G:\getfilesname\example.txt"]
    

    Getting the full path name with os.path.abspath

    You get the full path in return

     import os
     files_path = [os.path.abspath(x) for x in os.listdir()]
     print(files_path)
     
     ["F:\documentiapplications.txt", "F:\documenticollections.txt"]
    

    Walk: going through sub directories

    os.walk returns the root, the directories list and the files list, that is why I unpacked them in r, d, f in the for loop; it, then, looks for other files and directories in the subfolders of the root and so on until there are no subfolders.

    import os
    
    # Getting the current work directory (cwd)
    thisdir = os.getcwd()
    
    # r=root, d=directories, f = files
    for r, d, f in os.walk(thisdir):
        for file in f:
            if file.endswith(".docx"):
                print(os.path.join(r, file))
    

    os.listdir(): get files in the current directory (Python 2)

    In Python 2, if you want the list of the files in the current directory, you have to give the argument as "." or os.getcwd() in the os.listdir method.

     import os
     arr = os.listdir(".")
     print(arr)
     
     >>> ["$RECYCLE.BIN", "work.txt", "3ebooks.txt", "documents"]
    

    To go up in the directory tree

    # Method 1
    x = os.listdir("..")
    
    # Method 2
    x= os.listdir("/")
    

    Get files: os.listdir() in a particular directory (Python 2 and 3)

     import os
     arr = os.listdir("F:\python")
     print(arr)
     
     >>> ["$RECYCLE.BIN", "work.txt", "3ebooks.txt", "documents"]
    

    Get files of a particular subdirectory with os.listdir()

    import os
    
    x = os.listdir("./content")
    

    os.walk(".") - current directory

     import os
     arr = next(os.walk("."))[2]
     print(arr)
     
     >>> ["5bs_Turismo1.pdf", "5bs_Turismo1.pptx", "esperienza.txt"]
    

    next(os.walk(".")) and os.path.join("dir", "file")

     import os
     arr = []
     for d,r,f in next(os.walk("F:\_python")):
         for file in f:
             arr.append(os.path.join(r,file))
    
     for f in arr:
         print(files)
    
    >>> F:\_python\dict_class.py
    >>> F:\_python\programmi.txt
    

    next(os.walk("F:\") - get the full path - list comprehension

     [os.path.join(r,file) for r,d,f in next(os.walk("F:\_python")) for file in f]
     
     >>> ["F:\_python\dict_class.py", "F:\_python\programmi.txt"]
    

    os.walk - get full path - all files in sub dirs**

    x = [os.path.join(r,file) for r,d,f in os.walk("F:\_python") for file in f]
    print(x)
    
    >>> ["F:\_python\dict.py", "F:\_python\progr.txt", "F:\_python\readl.py"]
    

    os.listdir() - get only txt files

     arr_txt = [x for x in os.listdir() if x.endswith(".txt")]
     print(arr_txt)
     
     >>> ["work.txt", "3ebooks.txt"]
    

    Using glob to get the full path of the files

    If I should need the absolute path of the files:

    from path import path
    from glob import glob
    x = [path(f).abspath() for f in glob("F:\*.txt")]
    for f in x:
        print(f)
    
    >>> F:acquistionline.txt
    >>> F:acquisti_2018.txt
    >>> F:ootstrap_jquery_ecc.txt
    

    Using os.path.isfile to avoid directories in the list

    import os.path
    listOfFiles = [f for f in os.listdir() if os.path.isfile(f)]
    print(listOfFiles)
    
    >>> ["a simple game.py", "data.txt", "decorator.py"]
    

    Using pathlib from Python 3.4

    import pathlib
    
    flist = []
    for p in pathlib.Path(".").iterdir():
        if p.is_file():
            print(p)
            flist.append(p)
    
     >>> error.PNG
     >>> exemaker.bat
     >>> guiprova.mp3
     >>> setup.py
     >>> speak_gui2.py
     >>> thumb.PNG
    

    With list comprehension:

    flist = [p for p in pathlib.Path(".").iterdir() if p.is_file()]
    

    Alternatively, use pathlib.Path() instead of pathlib.Path(".")

    Use glob method in pathlib.Path()

    import pathlib
    
    py = pathlib.Path().glob("*.py")
    for file in py:
        print(file)
    
    >>> stack_overflow_list.py
    >>> stack_overflow_list_tkinter.py
    

    Get all and only files with os.walk

    import os
    x = [i[2] for i in os.walk(".")]
    y=[]
    for t in x:
        for f in t:
            y.append(f)
    print(y)
    
    >>> ["append_to_list.py", "data.txt", "data1.txt", "data2.txt", "data_180617", "os_walk.py", "READ2.py", "read_data.py", "somma_defaltdic.py", "substitute_words.py", "sum_data.py", "data.txt", "data1.txt", "data_180617"]
    

    Get only files with next and walk in a directory

     import os
     x = next(os.walk("F://python"))[2]
     print(x)
     
     >>> ["calculator.bat","calculator.py"]
    

    Get only directories with next and walk in a directory

     import os
     next(os.walk("F://python"))[1] # for the current dir use (".")
     
     >>> ["python3","others"]
    

    Get all the subdir names with walk

    for r,d,f in os.walk("F:\_python"):
        for dirs in d:
            print(dirs)
    
    >>> .vscode
    >>> pyexcel
    >>> pyschool.py
    >>> subtitles
    >>> _metaprogramming
    >>> .ipynb_checkpoints
    

    os.scandir() from Python 3.5 and greater

    import os
    x = [f.name for f in os.scandir() if f.is_file()]
    print(x)
    
    >>> ["calculator.bat","calculator.py"]
    
    # Another example with scandir (a little variation from docs.python.org)
    # This one is more efficient than os.listdir.
    # In this case, it shows the files only in the current directory
    # where the script is executed.
    
    import os
    with os.scandir() as i:
        for entry in i:
            if entry.is_file():
                print(entry.name)
    
    >>> ebookmaker.py
    >>> error.PNG
    >>> exemaker.bat
    >>> guiprova.mp3
    >>> setup.py
    >>> speakgui4.py
    >>> speak_gui2.py
    >>> speak_gui3.py
    >>> thumb.PNG
    

    Examples:

    Ex. 1: How many files are there in the subdirectories?

    In this example, we look for the number of files that are included in all the directory and its subdirectories.

    import os
    
    def count(dir, counter=0):
        "returns number of files in dir and subdirs"
        for pack in os.walk(dir):
            for f in pack[2]:
                counter += 1
        return dir + " : " + str(counter) + "files"
    
    print(count("F:\python"))
    
    >>> "F:\python" : 12057 files"
    

    Ex.2: How to copy all files from a directory to another?

    A script to make order in your computer finding all files of a type (default: pptx) and copying them in a new folder.

    import os
    import shutil
    from path import path
    
    destination = "F:\file_copied"
    # os.makedirs(destination)
    
    def copyfile(dir, filetype="pptx", counter=0):
        "Searches for pptx (or other - pptx is the default) files and copies them"
        for pack in os.walk(dir):
            for f in pack[2]:
                if f.endswith(filetype):
                    fullpath = pack[0] + "\" + f
                    print(fullpath)
                    shutil.copy(fullpath, destination)
                    counter += 1
        if counter > 0:
            print("-" * 30)
            print("	==> Found in: `" + dir + "` : " + str(counter) + " files
    ")
    
    for dir in os.listdir():
        "searches for folders that starts with `_`"
        if dir[0] == "_":
            # copyfile(dir, filetype="pdf")
            copyfile(dir, filetype="txt")
    
    
    >>> _compiti18Compito Contabilità 1conti.txt
    >>> _compiti18Compito Contabilità 1modula4.txt
    >>> _compiti18Compito Contabilità 1moduloa4.txt
    >>> ------------------------
    >>> ==> Found in: `_compiti18` : 3 files
    

    Ex. 3: How to get all the files in a txt file

    In case you want to create a txt file with all the file names:

    import os
    mylist = ""
    with open("filelist.txt", "w", encoding="utf-8") as file:
        for eachfile in os.listdir():
            mylist += eachfile + "
    "
        file.write(mylist)
    

    Example: txt with all the files of an hard drive

    """
    We are going to save a txt file with all the files in your directory.
    We will use the function walk()
    """
    
    import os
    
    # see all the methods of os
    # print(*dir(os), sep=", ")
    listafile = []
    percorso = []
    with open("lista_file.txt", "w", encoding="utf-8") as testo:
        for root, dirs, files in os.walk("D:\"):
            for file in files:
                listafile.append(file)
                percorso.append(root + "\" + file)
                testo.write(file + "
    ")
    listafile.sort()
    print("N. of files", len(listafile))
    with open("lista_file_ordinata.txt", "w", encoding="utf-8") as testo_ordinato:
        for file in listafile:
            testo_ordinato.write(file + "
    ")
    
    with open("percorso.txt", "w", encoding="utf-8") as file_percorso:
        for file in percorso:
            file_percorso.write(file + "
    ")
    
    os.system("lista_file.txt")
    os.system("lista_file_ordinata.txt")
    os.system("percorso.txt")
    

    All the file of C: in one text file

    This is a shorter version of the previous code. Change the folder where to start finding the files if you need to start from another position. This code generate a 50 mb on text file on my computer with something less then 500.000 lines with files with the complete path.

    import os
    
    with open("file.txt", "w", encoding="utf-8") as filewrite:
        for r, d, f in os.walk("C:\"):
            for file in f:
                filewrite.write(f"{r + file}
    ")
    

    How to write a file with all paths in a folder of a type

    With this function you can create a txt file that will have the name of a type of file that you look for (ex. pngfile.txt) with all the full path of all the files of that type. It can be useful sometimes, I think.

    import os
    
    def searchfiles(extension=".ttf", folder="H:\"):
        "Create a txt file with all the file of a type"
        with open(extension[1:] + "file.txt", "w", encoding="utf-8") as filewrite:
            for r, d, f in os.walk(folder):
                for file in f:
                    if file.endswith(extension):
                        filewrite.write(f"{r + file}
    ")
    
    # looking for png file (fonts) in the hard disk H:
    searchfiles(".png", "H:\")
    
    >>> H:4bs_18Dolphins5.png
    >>> H:4bs_18Dolphins6.png
    >>> H:4bs_18Dolphins7.png
    >>> H:5_18marketing htmlassetsimageslogo2.png
    >>> H:7z001.png
    >>> H:7z002.png
    

    (New) Find all files and open them with tkinter GUI

    I just wanted to add in this 2019 a little app to search for all files in a dir and be able to open them by doubleclicking on the name of the file in the list. enter image description here

    import tkinter as tk
    import os
    
    def searchfiles(extension=".txt", folder="H:\"):
        "insert all files in the listbox"
        for r, d, f in os.walk(folder):
            for file in f:
                if file.endswith(extension):
                    lb.insert(0, r + "\" + file)
    
    def open_file():
        os.startfile(lb.get(lb.curselection()[0]))
    
    root = tk.Tk()
    root.geometry("400x400")
    bt = tk.Button(root, text="Search", command=lambda:searchfiles(".png", "H:\"))
    bt.pack()
    lb = tk.Listbox(root)
    lb.pack(fill="both", expand=1)
    lb.bind("<Double-Button>", lambda x: open_file())
    root.mainloop()
    

    Splitting a large file into separate modules in C / C ++, Java and Python cos: Questions

    cos

    How do I install pip on macOS or OS X?

    5 answers

    I spent most of the day yesterday searching for a clear answer for installing pip (package manager for Python). I can"t find a good solution.

    How do I install it?

    1672

    Answer #1

    UPDATE (Jan 2019):

    easy_install has been deprecated. Please use get-pip.py instead.


    Old answer:

    easy_install pip
    

    If you need admin privileges to run this, try:

    sudo easy_install pip
    

    1672

    Answer #2

    ⚡️ TL;DR — One line solution.

    All you have to do is:

    sudo easy_install pip
    

    2019: ⚠️easy_install has been deprecated. Check Method #2 below for preferred installation!

    Details:

    ⚡️ OK, I read the solutions given above, but here"s an EASY solution to install pip.

    MacOS comes with Python installed. But to make sure that you have Python installed open the terminal and run the following command.

    python --version
    

    If this command returns a version number that means Python exists. Which also means that you already have access to easy_install considering you are using macOS/OSX.

    ℹ️ Now, all you have to do is run the following command.

    sudo easy_install pip
    

    After that, pip will be installed and you"ll be able to use it for installing other packages.

    Let me know if you have any problems installing pip this way.

    Cheers!

    P.S. I ended up blogging a post about it. QuickTip: How Do I Install pip on macOS or OS X?


    ✅ UPDATE (Jan 2019): METHOD #2: Two line solution —

    easy_install has been deprecated. Please use get-pip.py instead.

    First of all download the get-pip file

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    

    Now run this file to install pip

    python get-pip.py
    

    That should do it.

    Another gif you said? Here ya go!

    1672

    Answer #3

    You can install it through Homebrew on OS X. Why would you install Python with Homebrew?

    The version of Python that ships with OS X is great for learning but it’s not good for development. The version shipped with OS X may be out of date from the official current Python release, which is considered the stable production version. (source)

    Homebrew is something of a package manager for OS X. Find more details on the Homebrew page. Once Homebrew is installed, run the following to install the latest Python, Pip & Setuptools:

    brew install python
    

    Shop

    Best laptop for Fortnite

    $

    Best laptop for Excel

    $

    Best laptop for Solidworks

    $

    Best laptop for Roblox

    $

    Best computer for crypto mining

    $

    Best laptop for Sims 4

    $

    Best laptop for Zoom

    $499

    Best laptop for Minecraft

    $590

    Latest questions

    NUMPYNUMPY

    psycopg2: insert multiple rows with one query

    12 answers

    NUMPYNUMPY

    How to convert Nonetype to int or string?

    12 answers

    NUMPYNUMPY

    How to specify multiple return types using type-hints

    12 answers

    NUMPYNUMPY

    Javascript Error: IPython is not defined in JupyterLab

    12 answers

    Wiki

    Python OpenCV | cv2.putText () method

    numpy.arctan2 () in Python

    Python | os.path.realpath () method

    Python OpenCV | cv2.circle () method

    Python OpenCV cv2.cvtColor () method

    Python - Move item to the end of the list

    time.perf_counter () function in Python

    Check if one list is a subset of another in Python

    Python os.path.join () method