File size: 9,176 Bytes
f61feac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\00a58ce07a5186d4edbe9eb29bd3fe53_1.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\044ce673a55771bd2b5700318547bb89.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\06b6dc04ce7e684216090f6a333a0f24.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\0b5371361af9d5706e010e6b91af8269.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\0b5ead570498882ea2c4f83970007faf.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\127ab13e2bb2c049e409eb7fdcbc9b7a.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\1308b781e85b8c64d7ee3ba1b64bf444.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\1ad66dc78c035d3241601072bb41a455.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\1caf765f1a0301e47680520dab472744.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\20aad729e70607539a47d0a2ccdf382b.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\2241b31138f5ada56d5e14ba371f82e7.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\22e6a9e62f29ac02ea1fbc78f6bd304f.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\24ea0ace58127a97cff268843615744f.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\2877886ddfdd0177f831dccb8e68aa4f.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\2e15a82de44733126b9982987f5badf1.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\2f9f20922622a03f1c94669a6f8c00f5.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\319aa3ba392b11796db84e266b58cd38.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\330d109c6b45475765563acb5780c44c.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\331101a6a21b450274b3b3e90d7593c6.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\33e345444a93860e274794d2dd3702a1.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\3439faa91c896be8787813572547b2a9.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\351af7711b3a57c84c0c28dfce9641b3.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\3cead9d7fccf871396db6f1986ad1188.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\42681e66733bdfd38800eb01c9b21522.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\4402451c6dc515356d25e10c620f2003.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\584a8f97df450c7742ecc1df77ed37fe.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\5ade980fb60341029c46d927948cffcc.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\5c6d81b6743953086bb1f6c7d2bbbd70_1.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\6c6f0b0fd01b8cf509e44bac38032a15.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\7051f37f3a100ecd09b8b704f7756fe3.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\744500bacde986871a6d4f464266a915.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\76fc8b8c80b70271f09c383c42da1d69.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\77aeebd0874339a181566c9d683ee0c0.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\79009dc71f54764093fc00fe30bfe1ec.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\82faee78f1ad3c32ca9045619c04d50e.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\856a37de0b35e336bc17bad772badc79.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\8b3e3bc11f014e3a9ad5ab2be648fc2c.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\90e06213e04da5adedeafbdb9cd365eb.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\94f4e009078007e3ed1051bf89de4034.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\9a104277b8f586d9090864bba6ffb4c3.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\9a1e5a6ebd91cc2263503c44f85b2335.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\9e995b2e5a51203aadade15076c3e43b.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\a1bb3892776dbaa41ebb9860f5173956.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\a3ddc2fbe220dc85b585294e1b7b355f.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\a493be0b29b9390f046795cbae93b0d5.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\a4fffd4a03a0bef737b7cfec5a8cc6f4.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\adbda3e546986a40f2476ef8f3e07118.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\afd1c3f2f8ea7693fb7a6cb692b50403.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\b5ca2054eb91296ba19809ae1d306b4d.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\b8f87e4deca6cbf37396e66447e31921.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\ba77c681986211c9b7da20b5050859a3.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\babaf50487ea84064971eb0d1757df23.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\bafc1dc4937f7ecf7cc707d32500b60d.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\c2b56828f5b306a9d1ef2f4970cb2a46.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\c8f28965c1bde921f89e7f7e49c0b078.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\d125439867ab61520cf8a5f9391a0cd9.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\d28945f8c9556d071028356457f16c34.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\d309a6abca98c989f24f3050c2a1bdd1.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\d709a20dff4ec44d84a446caac98d276.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\d756957fe6549e07e9b1236d36561bde.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\e1515ab206479a8673f14e1ae6fa66b0.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\eccdc7a822051408cab1f0e791e4e308.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\ecd6c90a0ea837644ca91faab0af71e0.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\f3062506cd9a84097f937f46181bfc4f.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\f82a37b693c9c6b626f1fe9b16840d3e.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\f873d55150075322fd60a47bdf940420.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\faaea9eccdc0e63abe7379fdf21d6fee.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\fdffb5c652d76e5ff33ab65d365b6802.txt\n",
      "Created C:\\Users\\kade\\Desktop\\1_by_spaceengine\\fe5f1e6bd6a302b4830e34823a54bc34.txt\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "\n",
    "def create_empty_txt_files(directory):\n",
    "    # Check if the directory exists\n",
    "    if not os.path.exists(directory):\n",
    "        print(\"Directory does not exist.\")\n",
    "        return\n",
    "    \n",
    "    # Get a list of all files in the directory\n",
    "    files = os.listdir(directory)\n",
    "    \n",
    "    # Iterate over each file\n",
    "    for file in files:\n",
    "        # Check if the file is an image (you can add more image extensions if needed)\n",
    "        if file.endswith(\".jpg\") or file.endswith(\".png\") or file.endswith(\".jpeg\"):\n",
    "            # Extract the filename without extension\n",
    "            filename = os.path.splitext(file)[0]\n",
    "            \n",
    "            # Create a corresponding txt file with the same name\n",
    "            txt_filename = os.path.join(directory, filename + \".txt\")\n",
    "            \n",
    "            # Check if the txt file already exists\n",
    "            if not os.path.exists(txt_filename):\n",
    "                # Create an empty txt file\n",
    "                with open(txt_filename, 'w') as f:\n",
    "                    pass\n",
    "                print(f\"Created {txt_filename}\")\n",
    "            else:\n",
    "                print(f\"{txt_filename} already exists\")\n",
    "\n",
    "# Path to the directory containing the images\n",
    "image_directory = r'C:\\Users\\kade\\Desktop\\1_by_spaceengine'\n",
    "\n",
    "# Call the function to create empty txt files\n",
    "create_empty_txt_files(image_directory)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}