1+ {
2+ "nbformat" : 4 ,
3+ "nbformat_minor" : 0 ,
4+ "metadata" : {
5+ "colab" : {
6+ "provenance" : [],
7+ "authorship_tag" : " ABX9TyNucf25RBw3fbT9WLUbkfrH" ,
8+ "include_colab_link" : true
9+ },
10+ "kernelspec" : {
11+ "name" : " python3" ,
12+ "display_name" : " Python 3"
13+ },
14+ "language_info" : {
15+ "name" : " python"
16+ }
17+ },
18+ "cells" : [
19+ {
20+ "cell_type" : " markdown" ,
21+ "metadata" : {
22+ "id" : " view-in-github" ,
23+ "colab_type" : " text"
24+ },
25+ "source" : [
26+ " <a href=\" https://colab.research.google.com/github/Ombrack/getting-started-with-github-copilot/blob/main/Copie%20SD.ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
27+ ]
28+ },
29+ {
30+ "cell_type" : " code" ,
31+ "execution_count" : null ,
32+ "metadata" : {
33+ "id" : " iBp6Y-Umlnyd"
34+ },
35+ "outputs" : [],
36+ "source" : [
37+ " import os\n " ,
38+ " import datetime\n " ,
39+ " import shutil\n " ,
40+ " \n " ,
41+ " \n " ,
42+ " # Trouver la date courante\n " ,
43+ " today = datetime.date.today()\n " ,
44+ " \n " ,
45+ " # Enregistrer date dans variable\n " ,
46+ " date_of_day = today.strftime('%y %m ')\n " ,
47+ " \n " ,
48+ " # Répertoires source et destination\n " ,
49+ " source_dir = \" E:/DCIM/100EOS7D\"\n " ,
50+ " X=str(input(\" Saisir texte :\" ))\n " ,
51+ " Slash = \" /\"\n " ,
52+ " destination = \" D:/# Mes Pellicules photo/\"\n " ,
53+ " destination_dir = destination + date_of_day + X + Slash\n " ,
54+ " \n " ,
55+ " # Création nouveau répertoire\n " ,
56+ " os.mkdir(destination_dir)\n " ,
57+ " \n " ,
58+ " # Liste de tous les fichiers\n " ,
59+ " files = os.listdir(source_dir)\n " ,
60+ " \n " ,
61+ " # Recherche .CR3\n " ,
62+ " for file in files:\n " ,
63+ " if file.endswith(\" .CR3\" ) :\n " ,
64+ " \n " ,
65+ " file_path = os.path.join(source_dir, file)\n " ,
66+ " dest_file_path = os.path.join(destination_dir, file)\n " ,
67+ " \n " ,
68+ " # Copier les fichier\n " ,
69+ " shutil.copy(file_path, dest_file_path)"
70+ ]
71+ }
72+ ]
73+ }
0 commit comments