First Project using python (GUI next )

  Рет қаралды 66,993

Harshit vashisth

Harshit vashisth

Күн бұрын

Пікірлер: 230
@ajmeershahtricks6666
@ajmeershahtricks6666 3 жыл бұрын
Sir finally today i completed core python with full satisfaction. I really recommended this playlist to my freinds even matric student could be also expert in python after watching this love you sir Thank you so much💖💖💖
@Divyammugrai1532
@Divyammugrai1532 11 ай бұрын
Do you know about some playlist about advanced python?
@shivprasad920
@shivprasad920 5 жыл бұрын
Sir followed your entire playlist .. hats off to your work. Please upload remaining videos asap. Thank you so much.
@kv9170
@kv9170 4 жыл бұрын
Yes
@curtezyt1984
@curtezyt1984 2 жыл бұрын
sir I tried to make this program before watching your video and due to your amazing teaching I solved these 2 problems before watch your video
@shakirhussainitoo7410
@shakirhussainitoo7410 Жыл бұрын
Bro can you please paste the whole solution here
@curtezyt1984
@curtezyt1984 Жыл бұрын
@@shakirhussainitoo7410 drive.google.com/file/d/1enB2-fhl_WOsH9WIYDHqdg-kujQ8j8BQ/view?usp=sharing python file drive link
@shakirhussainitoo7410
@shakirhussainitoo7410 Жыл бұрын
Thank you, ❤️ man
@saranshEXE
@saranshEXE 5 жыл бұрын
Brother in ur python tutorial 14, you told us about ur book, but you haven't give the link, can u share to me!! Plz!!
@mr.dynamic9869
@mr.dynamic9869 5 жыл бұрын
Aur videos Kab milega yaar. Aur Bhi bohot seekhna hai. Your video really motivates me to learn more. Jaldi se daalo bhai.
@rohanmukherjee6741
@rohanmukherjee6741 5 жыл бұрын
import os, shutil # here we import os module & shutil module defined_extension = { 'audio_extension' : ('.mp3', '.wav', '.aif', '.cda'), # define extensions in dictionary as a key/value pair 'video_extension' : ('.mp4', '.mov', '.wmv', '.flv', '.avi'), 'document_extension' : ('.doc', '.pdf', '.tex', '.txt'), } user_path = input("Enter path :") # input file path from user def files_short(folder_path, folder_extension): # define func, which takes 2 parameters, 1. file path, 2. file extension files_list = [] # create empty list for store output in it for file in os.listdir(folder_path): # looping for check all elements in folder for extension in folder_extension: # looping for check extensions if file.endswith(extension): # check matching extensions files_list.append(file) # store files in empty list return files_list # return file as output for extension_type, extension_value in defined_extension.items(): for extension_type,extension_tuples in defined_extension.items(): # here we check if list is != 0, then perform remaining codes folder_name = extension_type.split('_')[0] + "files" # generate folder name to store files, from extension_type, where split name from '_' # and split method gives results in list, so that we need only 1st name. thats why we use indexing [0]th position and "files" as name. folder_path = os.path.join(user_path,folder_name) # generate folder path for new folder, where we store files. for that we use 'OS' module's # sub module "path's" 'join()'. here we join (user_input_path + folder_name) if os.path.exists(folder_path): pass else: os.mkdir(folder_path) # here we create new folder, by using folder path, # if we use 'folder_name' the folder is create where these python file exists. if files_short(user_path,extension_value)==0: # if function return nothing or 0 then remove existing folder os.rmdir(folder_path) else: for items in files_short(user_path,extension_value): # use for loop to generate all items by calling function. item_path = os.path.join(user_path, items) # genearte item_path, means from which files we want to move item_moving_path = os.path.join(folder_path, items) # generate moving_path, means from where we move files shutil.move(item_path, item_moving_path) # perform move operation
@abhishekkamboj7150
@abhishekkamboj7150 5 жыл бұрын
Very nice it is very helpful for me to understand the program
@kartikeymishra8676
@kartikeymishra8676 4 жыл бұрын
if os.path.exists(folder_path): pass yae kyu use kra
@rohanmukherjee6741
@rohanmukherjee6741 4 жыл бұрын
@@kartikeymishra8676 isliye ki aager folder exists krta hai tab nahi folder nahi bahayega, aur aager folder exist nahi krta hai toh nxt line ka code se neya folder ban jayega
@mridulsharma7454
@mridulsharma7454 4 жыл бұрын
@@rohanmukherjee6741 if files_short(user_path,extension_value)==0: # if function return nothing or 0 then remove existing folder os.rmdir(folder_path) else: bhai iska use kya h btaoge
@mridulsharma7454
@mridulsharma7454 4 жыл бұрын
@@rohanmukherjee6741 can you tell me how to convert this in application
@ajmeershahtricks6666
@ajmeershahtricks6666 3 жыл бұрын
Sir im really interested in machine learning...sir should i keep watching remaining videos or turn to other playlist for matchin learning?
@sahilkumar158
@sahilkumar158 5 жыл бұрын
sir please upload the video for next chapter too as soon as possible.. ur way of teaching is awsome.. thanks..
@adityajha1889
@adityajha1889 4 жыл бұрын
Sir in some scenes there was tuple coming in the first argument of vedios extentions Check your problem Awesome vedio 😎 👏
@MahendraKumar-xe5hk
@MahendraKumar-xe5hk 5 жыл бұрын
Vande matram sir, please make a video on VS environment setup for java. We are facing problem in it. By the way your work is very good. Keep doing it.......Good luck. Jay Hind.
@sajidasamdi5331
@sajidasamdi5331 5 жыл бұрын
add below line before folder_name variable and make it in if condition till mkdir() line if len(file_finder(folderpath,extension_tuple)) > 0:
@shivammalhotra9790
@shivammalhotra9790 5 жыл бұрын
What it change?
@hc5682
@hc5682 4 жыл бұрын
NICE Bro
@prateekbansal2014
@prateekbansal2014 5 жыл бұрын
Sir series ko stop mt krna request hain apse complete krna series ko bda mja aa rha hain python sekhne me
@ideepakpandey
@ideepakpandey 3 жыл бұрын
folder already exist then to remove error write this code after line 25 if os.path.exists(folder_path): print(f'{folder_name} already exist') else: os.mkdir(folder_path)
@akashkashyap8756
@akashkashyap8756 5 жыл бұрын
I'm not seeing this video now first I'll try and then come and see...
@avibirla9863
@avibirla9863 3 жыл бұрын
Yes pls make complete video playlist on numpy and pandas
@himanshudixit6728
@himanshudixit6728 5 жыл бұрын
Bro you didn't moved file. I think you just created two copies because why do you need to write a new item_new_path. Its working fine with old folder_path. But apart from every thing your sequential lectures are very helpful to me and my circle. Give me some direction to develop a OS or compiler in python.
@sanjibpramanik9268
@sanjibpramanik9268 5 жыл бұрын
Sir, os.listdir(folderpath) kr k ek list bana lunga jisme sab file ka list hoga, fir us list ka har element ko . se split kr k ek aur list bana lunga jisme k sab file ka extensions hoga, dict_extensions['audio_extensions'], dict_extensins['video_extention'] and dict_extension['document_extension'] jo 3 tuple return krega, in 3 tuple ko ek tuple bana lunga, fir us tuple pe loop chala k dekhna hoga k uska element us file extension wala list pe hai v ya nhi, aagar nhi hoga to else statement pe next dal dunga, ta k woh folder create na kr k next loop pe jump ho jaye, but ye ayse krna padega k woh folder extension wala list har bar naya create ho, ta k jo file move ho jaye uska extension usme fir se na rahe. AYSA KRNE SE HOGA SIR? But main koshish krunga code likh k fir se comment kru.
@DEEPAKYADAV-vb2ee
@DEEPAKYADAV-vb2ee 4 жыл бұрын
hello harish, oo vala step bta skte hoo aap ki if koi bi ext. ki file present naa ho to uska folder empty naa bne. for eg. doc file naa mare directri mai to uska empty folder naa bne.
@shivampal4356
@shivampal4356 5 жыл бұрын
Hi Bro, How can we apply case constraint on the tuple so that it reads both e.g; 'jpg and 'JPG' in file folder path (I don't want to add both lowercase and uppercase format in dictionary instead I want to use case method). Also how can we apply condition to check whether the video folder is already present or not, if present then directly move the files into it else create the folder and then move.
@Naushad_jerry
@Naushad_jerry 5 жыл бұрын
Next video kb aayegi sir? We are waiting
@deeptisingh7390
@deeptisingh7390 5 жыл бұрын
Mene overall Python k video dekh liye h aapke saare..kya m interview dene layak hun..plz tell me dear
@Sonu-nv1gd
@Sonu-nv1gd 5 жыл бұрын
Kya in videos se pura python cover ho chuka hai ya baki h ?
@ajeet.k.shridhar8595
@ajeet.k.shridhar8595 5 жыл бұрын
Pura python cover ho Gaya kya ?
@kanwaradnan4849
@kanwaradnan4849 5 жыл бұрын
Well, Actually Nhi..
@SohailMughal
@SohailMughal 4 жыл бұрын
@@kanwaradnan4849 me kya kru???
@kanwaradnan4849
@kanwaradnan4849 4 жыл бұрын
@@SohailMughal hahahah
@krishnachaudhary9840
@krishnachaudhary9840 5 жыл бұрын
I want to make tutorials on your data science like Pandas Numpy Machine Learning and all the tools. This will benefit a lot of people
@sandeepbhardwaj253
@sandeepbhardwaj253 Жыл бұрын
lot of thanks you sir
@indranilkarmakar2604
@indranilkarmakar2604 4 жыл бұрын
Here is the final code :- import os,shutil dict_extensions = { 'videos' : ('.mp4','.mkv','.MKV','.flv','.mpeg'), 'audios' : ('.mp3','.m4a','.wav','.flac'), 'images' : ('.jpg','.jpeg','.png') } folderpath = input("Enter Folder Path :- ") def file_finder(folder_path,file_extensions): files = [] for file in os.listdir(folder_path): for extensions in file_extensions: if file.endswith(extensions): files.append(file) return files for extensiontype,extensions in dict_extensions.items(): Folderpath = os.path.join(folderpath,extensiontype) if os.path.exists(Folderpath): for i in (file_finder(folderpath,extensions)): item_path = os.path.join(folderpath,i) shutil.move(item_path,Folderpath) print(f" {extensiontype} move successfully") else: a = file_finder(folderpath,extensions) if(len(a)>0): os.mkdir(Folderpath) for i in (file_finder(folderpath,extensions)): item_path = os.path.join(folderpath,i) shutil.move(item_path,Folderpath) print(f" {extensiontype} move successfully")
@sunilsingh5593
@sunilsingh5593 6 ай бұрын
Wao yr
@siraatsoft1241
@siraatsoft1241 5 жыл бұрын
Excellent Video. Bhai PyQt5 per bi video banai.
@krishnachaudhary9840
@krishnachaudhary9840 5 жыл бұрын
Nice python tutorial sir ...... Great !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@DeepSingh-vf4fi
@DeepSingh-vf4fi 3 жыл бұрын
Virji Ek full course python da pado Ek video vich
@jatinparmar3424
@jatinparmar3424 5 жыл бұрын
Sir , ap numpy or pandas k liye b video bano na plz sir
@chinmaydas4053
@chinmaydas4053 5 жыл бұрын
Please Sir make more some good python projects..
@RahulChoudhary-ln4fv
@RahulChoudhary-ln4fv 2 жыл бұрын
for i in os.listdir(folderpath): if i.endswith(ext_tuple): if os.path.exists(folder_path): pass else: os.mkdir(folder_path)
@karanvirmangal388
@karanvirmangal388 5 жыл бұрын
🙏🙏🙏🙏🙏 Thanks HARSHIT !!! 👍👍👌👍👍
@shubhamkamble9246
@shubhamkamble9246 5 жыл бұрын
sir can u help to solve the problem definition which u have mention above (about existing folders)
@bishwajitsamanta770
@bishwajitsamanta770 5 жыл бұрын
Can you make videos on Paramiko ssh connection remote execution of commands on remote servers, and API requests through python
@naazarmoohammad
@naazarmoohammad 5 жыл бұрын
share market ki strategies kaise code kare iss bare me bhi video banayein aur apna email id batayein
@johnobama6754
@johnobama6754 5 жыл бұрын
Sir, I don't wanna connect to the net because of some issues. Plz give some alternate solutions to install any extention etc.
@nitesh107
@nitesh107 5 жыл бұрын
Nice tutorial bro, Can you please uplaod playlist for DJANGO framework...??
@hardcode5394
@hardcode5394 5 жыл бұрын
Harshit sir plz make few vedios on python interview questions and answers too. Thank u. And sir आपने जो एक्सरसाइज़ दी थी कि चेक करें कि वह फोल्डर जो folder_path variable में बनता है, वह फोल्डर पहले से मौजूद है कि नहीं, उसका सोल्यूशन इस प्रकार है--- folder_path=os.path.join(folderpath, folder_name) if(os.path.exists(folder_path)): print(str(folder_path)+' folder already exists!') else: os.mkdir(folder_path) # rest of the code will remain the same. Sir यह प्रोजेक्ट मैं एन्ड्राईड ऐप्प है, उस पर डेवलप कर रहा हूं; तो हो सकता किसी और का रिजल्ट मेरे से भिन्न आए। यह एप्प पाएथन का ही है जो गूगल प्लेस्टोर से डाऊनलोड किया था। धन्यवाद।
@ankitmehta4133
@ankitmehta4133 5 жыл бұрын
Bhai....Django p bhi bnaogey videos??
@Naushad_jerry
@Naushad_jerry 5 жыл бұрын
video 4:45 per jo humne if condition lagayi h : - if file.endswith(extention) ye kese kaam kr rha h smjh nhi aaya ?
@kanwaradnan4849
@kanwaradnan4849 5 жыл бұрын
loop lgi hai na.... is liya jo jo extension hai tuple mai un sb ko test kr raha hai.
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 5 жыл бұрын
Love the regular uploads.
@Maheshkumar-ph7zg
@Maheshkumar-ph7zg 5 жыл бұрын
Sir, django pr videos bhaiye ...
@juttjublee5142
@juttjublee5142 5 жыл бұрын
Great sir
@manishsinghrajput2954
@manishsinghrajput2954 5 жыл бұрын
sir pls upload more videos asap and create another playlist of data analysis and data science asap it's your follower request. sir please make videos on data analysis with python
@kathanpatel3677
@kathanpatel3677 5 жыл бұрын
awsome video sir plz upload django video
@saurabhbarasiya4721
@saurabhbarasiya4721 5 жыл бұрын
Sir second last line me Item_new_path=os.path.join(folder_path,item) Yaha pr. Item likne ki kya need h. Jb mene is code ko dry run kiya to me samaj nhia pya . Me vaha item nahi likh Raha to bhi program proper work Kar Raha h To pls ap muje bateye ki vaha item kyo Likha h
@piyushp3780
@piyushp3780 4 жыл бұрын
because every item such as audio , video has its name also in its path so we have joined the folder path and its name to create the new path of the item
@deeptisingh7390
@deeptisingh7390 5 жыл бұрын
Sir aapke videos dekhne k bad kya m interview k liye apply kr sakti hun
@Naushad_jerry
@Naushad_jerry 5 жыл бұрын
mera bhi same question h bcuz meri BCA complete ho jayegi feb mein, so can i apply ? (for what profile?)
@naazarmoohammad
@naazarmoohammad 5 жыл бұрын
sir,please tell me your book;s name and also give the link to purchase
@fforfun8931
@fforfun8931 4 жыл бұрын
thank you brother
@mohd.anassiddiqui1521
@mohd.anassiddiqui1521 4 жыл бұрын
Where is GUI part of this video ???
@knowledgeworld1520
@knowledgeworld1520 5 жыл бұрын
bhai video bahut slow aa rahi hi pehle daily aati thi lekin ab koi time hi nahi hota .pls bhai jaldi jaldi video upload karo
@NaveenKumar-bi2ku
@NaveenKumar-bi2ku 4 жыл бұрын
Thanks
@RajuPal-zs8pr
@RajuPal-zs8pr 5 жыл бұрын
Bro plz... Also Keep uploading some mini project so that we can practice....
@imranawan3766
@imranawan3766 5 жыл бұрын
Great Work
@rihanansari3486
@rihanansari3486 5 жыл бұрын
ye thoda smjh nhi aaya def file_finder(folder_path , file_extention) koi hai jo help kr sake bta kr?
@mukulsinghal3468
@mukulsinghal3468 5 жыл бұрын
Sir i have facing the problem in vs code ( i written the code but my code not give output and goes to the next line )you dont reply my comment
@yash1694
@yash1694 5 жыл бұрын
You are doing great Brother!
@rihanansari3486
@rihanansari3486 5 жыл бұрын
hey bro tumhe def file_finder(folder_path , file_extention) wala smjh aaya? agr aaya tho pls thodi help krdo bta kr
@amritraj3293
@amritraj3293 4 жыл бұрын
Solve karliya sir Empty files hone pr new file nhi create hota hai File k length 1 s less hota hai too new file nhi create hota hai
@devashishsharma6951
@devashishsharma6951 4 жыл бұрын
@Amit Raj please tell the solution??
@devashishsharma6951
@devashishsharma6951 4 жыл бұрын
please tell
@kapilbhardwaj7232
@kapilbhardwaj7232 2 жыл бұрын
if os.path.exists(folder_path): print('folder already exists') else: os.mkdir(folder_path) adding this if-else statement after joining folder path and folder name
@_ranjanchauhan
@_ranjanchauhan 4 жыл бұрын
bro in 14 line waht end switch is doing . you didnt tell us abour end switch plz help tell me
@ujjwalgupta8945
@ujjwalgupta8945 3 жыл бұрын
if len(FileFInder(folderPath,extensionValue)) ==0 : continue now this program will not create any empty folder
@darksoulgaming715
@darksoulgaming715 3 жыл бұрын
Bro and agar folder already exist krta hai to user ko kaise btayenge
@ideepakpandey
@ideepakpandey 3 жыл бұрын
@@darksoulgaming715 if os.path.exists(folder_path): print(f'{folder_name} already exist') else: os.mkdir(folder_path)
@akshaychaudhary3455
@akshaychaudhary3455 5 жыл бұрын
Bhai aapko kitna time Laga all languages sikhne ke liya
@un9444
@un9444 5 жыл бұрын
Dear harshit sir what happened you uploaded last video but why is remove ,I hope you will upload as soon as possible , Thanks for the videos Please reply me
@Harshitvashisth
@Harshitvashisth 5 жыл бұрын
Nhi maine remove nhi ki
@un9444
@un9444 5 жыл бұрын
@@Harshitvashisth ok , muze ek help chaiya aapse resume format chaiya please send me on this mail ID : uddhav8@gmail.com help me and thanks for the reply I hope you will reply me as soon as possible Thanks broo
@Tannn123
@Tannn123 4 жыл бұрын
@@Harshitvashisth hello sir Please send me a solution of this project
@kunalthakur509
@kunalthakur509 5 жыл бұрын
Wait kaar rahe hai bhai
@johnobama6754
@johnobama6754 5 жыл бұрын
I checked folder exists or not to avoid error and found solution. But I don't knw how to avoid empty folder. Plz guide.
@TahirKhan-kt6mc
@TahirKhan-kt6mc 4 жыл бұрын
In order to ensure that empty folder not created, use following code: files2 = file_finder (folderpath, extension_tuple) if not os.path.exists (folder_path) and len (files2) != 0: os.mkdir (folder_path)
@lifehacks9450
@lifehacks9450 5 жыл бұрын
Awesome
@deeppatel117
@deeppatel117 5 жыл бұрын
Next video kab aaye gi sir???
@asadmajeed7977
@asadmajeed7977 5 жыл бұрын
So Nice
@johnobama6754
@johnobama6754 5 жыл бұрын
AttributeError: 'str' object has no attribute 'endwith'. This error came at 06:19.
@simranpreetsingh3052
@simranpreetsingh3052 5 жыл бұрын
Type endswith instead of endwith
@adityajha1889
@adityajha1889 4 жыл бұрын
I got a error on 6:29
@FirozBaksh
@FirozBaksh 5 жыл бұрын
Nice
@smartnewmovie9287
@smartnewmovie9287 5 жыл бұрын
sir upload video where are you its been so long we are waiting for next video .
@jagadish_moahanty_0263
@jagadish_moahanty_0263 4 жыл бұрын
final code: def file_finder(folder_path,file_extensions): return [fle for fle in os.listdir(folder_path) for extension in file_extensions if fle.endswith(extension)] files1={} for i in extensions: temp=file_finder(folder_path,extensions[i]) name,ext=i.split('_') files1[f'{name}_files']=temp os.chdir(folder_path) for key,value in files1.items(): if value!=[]: os.mkdir(key) for i in value: shutil.move(i,f'{key}/{i}')
@Naushad_jerry
@Naushad_jerry 5 жыл бұрын
can we go for interview after watching your video?? if yes then for what profile ?
@Sonu-nv1gd
@Sonu-nv1gd 5 жыл бұрын
Certificate nahi mangte kya company vale
@Naushad_jerry
@Naushad_jerry 5 жыл бұрын
shubham vyas na bhai bus concept clear hone chiye
@amantyagi6057
@amantyagi6057 4 жыл бұрын
Nhi ansari bro, this playlist is not enough for job purpose. It only teaches u basic concepts , you have to make projects 2,3 by yourself, and you should also start doing coding on hackerearth hackerrank, code forces etc on etc platforms, and try to achieve 4 star or gold badge, it's take your more patience so be ready for that . Now I think an individual is ready to crack an interview.
@Loveraj6
@Loveraj6 5 жыл бұрын
GOOD TUTORIAL
@kunalthakur509
@kunalthakur509 5 жыл бұрын
Bhai awesome video like always
@ayushmaanchauhan377
@ayushmaanchauhan377 5 жыл бұрын
Bhai C/C++ ki video banao
@kunalthakur509
@kunalthakur509 5 жыл бұрын
@@ayushmaanchauhan377 hmmm
@ketansingh4016
@ketansingh4016 5 жыл бұрын
How to set count again to zero automatically after every minute in python. Please help
@sefa_computer_class
@sefa_computer_class 5 жыл бұрын
Python corse kb smapt hoga???
@NeelamSharma-wo9zi
@NeelamSharma-wo9zi 4 жыл бұрын
I cant use the input function in vs code Vs code simply dosnt execute the input func line The code works fine on other editor
@yourdad8818
@yourdad8818 4 жыл бұрын
pycham
@waqasdevolper3488
@waqasdevolper3488 4 жыл бұрын
import os, shutil # NOTE: You can write every single extensions inside tuples dict_extensions = { 'audio_extensions' : ('.mp3', '.m4a', '.wav', '.flac'), 'Image_extensions' : ('.jpg','.png','.raw','.icn','.jpeg'), 'video_extensions' : ('.mp4', '.mkv', '.MKV', '.flv', '.mpeg'), 'document_extensions' : ('.doc', '.pdf', '.txt'), } path = input('Enter the Path Where you want to Opration : ') #Finding Existing files def Files_Finder(files_path,file_extnsions): files = [] for file in os.listdir(files_path) : for extension in file_extnsions: if file.endswith(extension): files.append(file) return files for extension_type , extentions_tuples in dict_extensions.items(): folder_name = extension_type.split('_')[0] + ' Files' folder_path = os.path.join(path,folder_name) for item in Files_Finder(path,extentions_tuples): if os.path.exists(folder_path): pass elif item == [] : pass else : os.mkdir(folder_path) item_path = os.path.join(path,item) item_new_path = os.path.join(folder_path,item) shutil.move(item_path,item_new_path)
@thor9938
@thor9938 2 жыл бұрын
bhai great work bhai ek cheez bta skte ho ki pass continue ka use kahan krte hain aur kahan nahi actually mujhe pta hai but zaida nahi
@santhoshkumarbesingular8736
@santhoshkumarbesingular8736 4 жыл бұрын
hi can you help to me its showing error t line number 26,27
@techieroy6177
@techieroy6177 5 жыл бұрын
Sir regular expression complete ho gaya hai??
@harshitraj8409
@harshitraj8409 5 жыл бұрын
No
@electronictechnology1102
@electronictechnology1102 5 жыл бұрын
Nice...Awesome bro... :)
@abhishekanand6776
@abhishekanand6776 5 жыл бұрын
Please suggest me best book of python for beginner
@subashsubedi2058
@subashsubedi2058 5 жыл бұрын
No need to follow books bro.. You can learn from tutorials itself... Better your try to make your own logic.... learning syntaxes and premade programms are not at all enough untill you can develop your skill to make logics.....
@abhishekanand6776
@abhishekanand6776 5 жыл бұрын
@@subashsubedi2058 thanks bhai
@tapank415
@tapank415 5 жыл бұрын
LPTHW
@salmanali7594
@salmanali7594 5 жыл бұрын
sir please thora jldi videos upload kre.
@The_Absolute_Truth
@The_Absolute_Truth 4 жыл бұрын
sir,shutil.move does't work..
@shivammalhotra9790
@shivammalhotra9790 5 жыл бұрын
How to solve folder already exist in this project
@vbhvprksh
@vbhvprksh 5 жыл бұрын
Bro ur gdrive link is not working plz provide with the source code
@AdityaSingh-ks9gl
@AdityaSingh-ks9gl 3 жыл бұрын
Please tell how to solve these problems
@utkarshsalaria3952
@utkarshsalaria3952 4 жыл бұрын
Here is my code with all the problems solved : problem1: create the folder only if files exist problem2 :if folder already exist then move the files into the same folder without creating the new one import os,shutil supported_files={ "audio_extensions":('.mp3','.m4a','.wav','.flac'), "video_extensions":('.mp4','.mkv','.MKV','.flv','.mpeg'), 'document_extensions':('.docx','.doc','.pdf','.txt','.csv') } working_directory=input("Enter directory path:") def find_files(dir,extensions): return [file for file in os.listdir(dir) for ext in extensions if file.endswith(ext) ] for file_type,extension_tuple in supported_files.items(): destination_folder_name=file_type.split("_")[0]+" Files" destination_path=os.path.join(working_directory,destination_folder_name) for pos,file in enumerate(find_files(working_directory,extension_tuple)): if(pos==0 and os.path.exists(destination_path)==False): os.mkdir(destination_path) source=os.path.join(working_directory,file) destination=os.path.join(destination_path,file) shutil.move(source,destination)
@nehagaur6444
@nehagaur6444 4 жыл бұрын
what is function of pos==0 in this?
@anonymous2982
@anonymous2982 4 жыл бұрын
why have u used enumerate funct, and what the use of keeping pos ==0?. I tried it using for file in file_finder(working_directory,destination) : , and it wrks fine i suppose
@utkarshsalaria3952
@utkarshsalaria3952 4 жыл бұрын
@@anonymous2982 yes it was not actually required as such the condition for mkdir() will become false after first iteration of inner for loop if the folder didn't exist already ...... When I wrote that code I thought of 🤔 using pos== 0 so that the mkdir() runs only for first file found.... .. But it was not required as such...
@utkarshsalaria3952
@utkarshsalaria3952 4 жыл бұрын
@@nehagaur6444 it was not required I guess... Will work absolutely fine if you don't use it
@anonymous2982
@anonymous2982 4 жыл бұрын
@@utkarshsalaria3952 ok . Thnks for confirming
@Vikramaudi
@Vikramaudi 5 жыл бұрын
HI if new file comes and how it will move automatically
@shubhamsonawane4291
@shubhamsonawane4291 3 жыл бұрын
how to correct our mistakes??? u didn't explained!!!! anyone have answers?
@pikatube3473
@pikatube3473 4 жыл бұрын
Solution: (with problems solved) import os,shutil dict_extensions = { 'audio_extensions' : ['.mp3','.m4a','.wav','.flac'], 'video_extensions' : ['.mp4','.mkv','.MKV','.flv','.mpeg'], 'documents_extensions' : ['.doc', '.docx', '.pdf','.txt'] } folderpath = input('Enter folder path') def file_finder(folder_path,file_extensions): return [file for file in os.listdir(folder_path) for extension in file_extensions if file.endswith(extension)] for extension_type, extension_tuple in dict_extensions.items(): if len(file_finder(folderpath,extension_tuple)) > 0 : folder_name = extension_type.split('_')[0] + 'Files' folder_path = os.path.join(folderpath,folder_name) if os.path.exists(folder_path) == False : os.mkdir(folder_path) for item in file_finder(folderpath,extension_tuple): item_path = os.path.join(folderpath, item) item_new_path = os.path.join(folder_path,item) shutil.move(item_path,item_new_path)
@rihanansari3486
@rihanansari3486 5 жыл бұрын
Sir videos uplod krdo aage ki kaha chle gye????
@kunalthakur509
@kunalthakur509 5 жыл бұрын
Bhai next video kaab ayegi
@yaboikanav4713
@yaboikanav4713 4 жыл бұрын
Tooople, good job 😂😂
@tusharwadile2548
@tusharwadile2548 5 жыл бұрын
pleasee make a video on "Django 2 installation on windowds"
@nirmalrathaur8752
@nirmalrathaur8752 5 жыл бұрын
Sir upload more videos
@Naushad_jerry
@Naushad_jerry 5 жыл бұрын
koi smjha do pls loop kese work kr rhi h ismein smjh nhi aaya mujhe def file_finder (folder_path , file_extention): files = [] for file in os.listdir(folder_path): for extention in file_extention: if file.endswith(extention): files.append(file) return files
@rajatjain8697
@rajatjain8697 4 жыл бұрын
First loop copy karo new file mai le ke jao or use print kar lo easy hai pata chal jata hai loop kya return kar raha hai
@Yash-thakur8126
@Yash-thakur8126 4 жыл бұрын
Sir empty folder create hogye hai unko delete kese kre
@prahladsoni4796
@prahladsoni4796 3 жыл бұрын
Anybody tell me that how solve the already exists problem?
@mayankkansara6848
@mayankkansara6848 4 жыл бұрын
i got error dict object has no attribute 'item'
Python for Beginners - Learn Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 19 МЛН
Edit IMAGES using PYTHON
18:44
Harshit vashisth
Рет қаралды 64 М.
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 1,5 МЛН
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 15 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 13 МЛН
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,2 МЛН
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 525 М.
Making a Game in Python with No Experience
5:57
Goodgis
Рет қаралды 1,7 МЛН
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 447 М.
Learn Java in 14 Minutes (seriously)
14:00
Alex Lee
Рет қаралды 4,8 МЛН
Let's code a beginner's Python BANK PROGRAM 💰
15:01
Bro Code
Рет қаралды 221 М.
Work with CSV files using python
9:19
Harshit vashisth
Рет қаралды 37 М.
OS Module python part 1 (hindi)
12:36
Harshit vashisth
Рет қаралды 51 М.
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 1,5 МЛН