o
    Z¦mc  ã                   @   sF   d dl Z d dlZd dlZd dlZdd„ Zdd„ Zedkr!eƒ  dS dS )é    Nc                 C   s   t  | ¡ d S )N)ÚwgetÚdownload)Úurl© r   ú$C:\Users\intel\Desktop\proba\wget.pyÚdownload_file   s   r   c                  C   sÒ   t tjƒdkrtdƒ t d¡ tjd } tj | ¡s'td | ¡ƒ t d¡ g }t	| dƒ}|D ]	}| 
| ¡ ¡ q1W d   ƒ n1 sEw   Y  tj d¡sUt d¡ t d¡ t t ¡ ¡}| t|¡ d S )Né   z1Usage: python3 download_files.py <file_with_urls>é   zFile {} does not existÚrÚdownloaded_files)ÚlenÚsysÚargvÚprintÚexitÚosÚpathÚexistsÚformatÚopenÚappendÚstripÚmkdirÚchdirÚmultiprocessingÚPoolÚ	cpu_countÚmapr   )Úfile_with_urlsÚurlsÚfÚlineÚpoolr   r   r   Úmain	   s$   


ÿÿ

r#   Ú__main__)r   r   r   r   r   r#   Ú__name__r   r   r   r   Ú<module>   s    
ÿ