Python Exercise 8: Solution + Tips | Python Tutorials For Absolute Beginners In Hindi #88

preview_player
Показать описание


Best Hindi Videos For Learning Programming:

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

Watching tutorial after 1 year and doing all exercises

jaibhansinghgaur
Автор

def organiser(path, file, format):
import os
f=open(file)
os.chdir(path)
i=1
for file1 in os.listdir(path):
if file1 not in f:
os.rename(file1, file1.capitalize())
for file2 in os.listdir(path):
if format in file2:
os.rename(f"{file2}", f"{i}.{format}")
i=i+1

Sierraa_
Автор

Harry bhai, Exercises karne me jyada explore hota hai Modules, Concepts etc.. Really amazing Exercises you are giving to us....

patelfenilkumarsunilkumar
Автор

I tried my best and implemented in my own ways -:
def findAllFilesInFolder():
i=1
files=os.scandir("New Folder/test_dir")
for every_file in files:
print(every_file)


print(every_file)

with open("New Folder/test_dir/harry.txt") as f:
data=f.readline()
convertedData=str(data)
if convertedData.__contains__("this, that"):
print("Invalid operation")

else:
oldFile=every_file
fsf=os.rename(oldFile, 'myfile.txt')
print(fsf)
f.close()
findAllFilesInFolder()

vivekjalankar
Автор

By Commenting I am just doing an interaction so YouTube Will Recommend More People

NKMishra
Автор

Really impressed with this tutorial. I have gone through almost all the videos here and really liked them. Thank you very much for the tutorial. :)

pushpkiran
Автор

harry bhai mera app path input se leta hai aur extension jisko rename karna hai vo bhi input se leta hai bhai bahut time laga tha banane me pls check kar lena


import time
import os
def prettier(path, efiles, rfiles):
global isthere
pathfd=path
count=1
countf=count

os.chdir(pathfd)


for i in range(len(filestorename)):
text=str(filestorename[i])
print(text)
if text.endswith(rfiles):
print("Ok sir doing")
# time.sleep(0.4)
os.rename(f"{text}", f"{countf}{rfiles}")
countf+=1
print("Done sir you can go and check")
if text.endswith(efiles):
print("Ok sir doing")
# time.sleep(0.4)

f=open(text, "a")
ffr=open(text, "r")
ff=ffr.read()
ff=ff.split("\n")


print(ff)
lines=[]
for i in range(len(ff)):
fg=ff[i]
print(fg)
lines.append(fg)
# print(lines) for debug



# for i in range(len(lines)):
fgdd=open(text, "r+")
fgdd.truncate(0)
fgdd.close()
for i in lines:
ifl=str(i)
ifl=ifl.capitalize()
# print(i+"\n") for debug
f.write(ifl+"\n")
# print(ff)
print("Done sir you can go and check")



pass

# count=1
while True:
isthere=input("Enter your path -")
print(isthere)
os.chdir(isthere)



if iftheref:
whichfiletorename = input("Which file extension to rename - ")
# print(whichfiletorename)
whichfileeditname = input("Which file extension to edit - ")

# =input("Which file to capatalize - ")
prettier(isthere, whichfileeditname, whichfiletorename)
else:
print("not present")

bestest
Автор

I have done exercises as well as taking reference from others I have made my separate note and separate pycharm project in computer for practice it's long I have completed its been 2.5 month 88 videos

santanakirakshyahamariutta
Автор

i've learned a lot by your hard effort harry sir.

uchiha_adhyut
Автор

Thank you Harry bhai for this amazing course.Really appreciate it bro❤

alexsimons
Автор

Waiting for.. Big data ...
Harry sir ji

RahulGupta-pwei
Автор

Bhai 25dec 2020 ko dekh rha hu.. or
1st language h meri ye .... Mko kuch ni pta tha .. but bht kuch sikha 😍😍😍..

ravishekhawat
Автор

ekdm essay way me solution -

import os




a1=0
def function(n):
global a1
a1 +=1
# comment jo h usser first letter ko capital(upper) ya small(lower) kr skte h
# k = n[0].upper()+n[1:]
# os.rename(n, k)

# is wale se jiste bhi file h usko 1, 2, 3 jitne bhi file h sbke age ek sequence se
# number likh jye to wo krte h essay h bs logic lgana h
os.rename(n, str(a1)+n)

m1 = os.listdir()

mohitkumaryadav
Автор

I watched all your python series videos

mayankpathak
Автор

bhai aap great ho yrr
please dont worry
love you bhai

shadabsiddiqui
Автор

What is your favorite programming language Harry sir ????

real_yoplayer
Автор

bhai ye ext.txt file location kis lie deni padi hame??? ye ext, txt file banay hi kiyun hamne...??

babulaswain
Автор

From starting i solved every problem given by harry but dont know why🤷‍♂️ i am getting confuse here

vinaymishra
Автор

Harry bhaiya you made a mistake in/*for file in files*/ bcz your solution will not fullfill your question. And thnx for making me good in programming so blessed to have you☺

vinaymishra
welcome to shbcf.ru