Creating a Command Line Utility In Python | Python Tutorials For Absolute Beginners In Hindi #93

  Рет қаралды 74,218

CodeWithHarry

CodeWithHarry

Күн бұрын

Пікірлер: 393
@vatsalsavani5436
@vatsalsavani5436 7 ай бұрын
Thank you harry bhai aapki nayi playlist follow kar raha hu day 85 par hu but ye thik se samajh nahi aaya to yaha aagaya aur ab badhiya tarike se samajh gaya. btw theme kafi badhiya he
@Shauryav-of8co
@Shauryav-of8co 5 ай бұрын
mai bhi
@ffgimmortal8871
@ffgimmortal8871 3 жыл бұрын
5:11 harry bahiya ka emotional blackmail 🤣😝
@programmerlovers8071
@programmerlovers8071 2 жыл бұрын
I accept the challenge 👍🏻👍🏻🔥.
@ankitasingh728
@ankitasingh728 3 жыл бұрын
Thanks Harry, so much 4 making programming tutorial in hindi
@learningwithchand6348
@learningwithchand6348 4 жыл бұрын
Very good theme bhai I learnt almost everything in programming I'm coming from c++ and java script
@leahkahn5303
@leahkahn5303 4 жыл бұрын
Harry bhai, light theme accha hota....kher abhi toh bohot late ho gaya hai...But love your videos...bohot seekhne ko mila hai...I even shared it with my friends to learn from your videos and utilize this break into adding to their skills
@DevTewatia-p5q
@DevTewatia-p5q Жыл бұрын
I accept the challenge. thanku sir to teach us like a good friend
@desichokre278
@desichokre278 Жыл бұрын
# Command line utility for faulty calculator import argparse import sys def calc(args): if args.x == 45 and args.y == 3 and args.o == 'mul': return 555 elif args.x == 56 and args.y == 9 and args.o == 'add': return 99 elif args.x == 56 and args.y == 6 and args.o == 'div': return 4 else: if args.o == 'add': return args.x + args.y if args.o == 'mul': return args.x * args.y if args.o == 'sub': return args.x - args.y if args.o == 'div': return args.x / args.y else: return "Something went wrong" if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--x',type = float, default = 1.0, help = "Enter 1st no.") parser.add_argument('--y',type = float, default = 3.0, help = "Enter 2nd no.") parser.add_argument('--o',type = str, default = "add", help = "Utility for calculation") args = parser.parse_args() sys.stdout.write(str(calc(args)))
@aksharasharma1469
@aksharasharma1469 Жыл бұрын
Ye VS code pe kaise krna h.....
@techwithpanwar1507
@techwithpanwar1507 3 жыл бұрын
7:47 you are correct harry bhai.
@gauravojha4960
@gauravojha4960 2 жыл бұрын
Nyc theme harry bhai 🥰🥰🥰
@its_nion
@its_nion 3 жыл бұрын
Thanks a lot harry sir for creating such an amazing playlist❤️
@TECHNIC-LGEEKS
@TECHNIC-LGEEKS 3 жыл бұрын
good prettyfication 🔥🎉🙏
@ManishKumar-qq5te
@ManishKumar-qq5te 4 жыл бұрын
Perfect nice teaching sir 💯💯💯
@time-is-dead
@time-is-dead 3 жыл бұрын
Bahut badiya bhaiya
@mohdkhan7072
@mohdkhan7072 2 ай бұрын
like if u came here from 100 days of code series to re-understand this concept😅😁
@tradinglover64
@tradinglover64 3 жыл бұрын
Here is my solution of faulty claculator using command line utility ------------------------------------------------------------------------------------------------------- Great harry sir , i am Manish Kumar ,very much inspired from you , you really play as my mentor role, a big thanks to you import argparse import sys def Faulty_cal(args): if args.operation == 'add': if args.number1 == 10 and args.number2 == 8: return 55 else: return args.number1 + args.number2 elif args.operation == 'sub': return args.number1 - args.number2 elif args.operation == 'mul': if args.number1 == 45 and args.number2 == 3: return 555 return args.number1 * args.number2 elif args.operation == 'div': if args.number1 == 36 and args.number2 == 6: return 9 return args.number1 / args.number2 elif args.operation == 'power': return args.number1 ** args.number2 elif args.operation == 'modulo': return args.number1 % args.number2 else: print('Unsupported Operation !!!') if __name__ == '__main__': parser = argparse.ArgumentParser(description='This is Faulty Calculator') parser.add_argument("--number1", type= int,default=1.0,help= 'Enter First Number') parser.add_argument("--number2", type= int,default= 1.0,help= 'Enter Second Number') parser.add_argument("--operation", type=str,default= 1.0,help= 'operation', choices=['add','sub','mul', 'div','power','modulo']) args = parser.parse_args() sys.stdout.write(str(Faulty_cal(args)))
@uchiha_adhyut8663
@uchiha_adhyut8663 Жыл бұрын
nice theme harry sensei!
@mayurthorat512
@mayurthorat512 4 жыл бұрын
Really vry nyc try hum log k liye...thnxx harry bhai ✌️👍
@modisonsbusiness5517
@modisonsbusiness5517 2 жыл бұрын
Bohot mast theme hai bhaiya
@kahlong.s8373
@kahlong.s8373 4 жыл бұрын
#Making a faulty calculator (Ex2) using Commd line util import sys import argparse def clac(args): if args.o=='add': if args.X==56 and args.Y==9: return (77) else: return args.X + args.Y if args.o=='div': if args.X == 56 and args.Y == 6: return (4) else: return args.X / args.Y if args.o=='sub': return args.X - args.Y if args.o=='mul': if args.X==45 and args.Y==3: return (555) else: return args.X * args.Y else: return ("There is nothing to do !") if __name__ == '__main__': parser=argparse.ArgumentParser() parser.add_argument("--X",type=float,default=1.0,help="Please contact Gags") parser.add_argument("--Y",type=float,default=1.0,help="Please contact Gags") parser.add_argument("--o",type=str,default=1.0,help="Please contact Gags") args=parser.parse_args() sys.stdout.write(str(clac(args)))
@vinsmalya
@vinsmalya 2 жыл бұрын
Use elif
@PervezAlam1
@PervezAlam1 4 жыл бұрын
for making video this theme is good, Text visibility is clear for Viewers .... comparison to white
@digitalcodingwithyashu6557
@digitalcodingwithyashu6557 3 жыл бұрын
great video harry bhai
@kumar.abhinav
@kumar.abhinav 2 жыл бұрын
I really like your videos. Good work bhai !
@rahulverma-jd1rg
@rahulverma-jd1rg Жыл бұрын
I love you harry bhai ❤❤❤❤
@shabegsinghgill732
@shabegsinghgill732 2 жыл бұрын
harry bhai you are a legend
@vinodshet345
@vinodshet345 3 жыл бұрын
Best theme!!🏆🥇
@farzeenarshad384
@farzeenarshad384 6 ай бұрын
theme is beautiful😍
@TanishkajainIITR
@TanishkajainIITR 2 жыл бұрын
awesome theme....meri fav h
@Gandhiboy
@Gandhiboy 4 жыл бұрын
Khatarnaaaakkkkk 💯
@devanshrathaur
@devanshrathaur 6 жыл бұрын
Theme is looking awesome
@abdulqadar771
@abdulqadar771 3 жыл бұрын
Theme is beautiful harry bhai
@shrishmishra1175
@shrishmishra1175 3 жыл бұрын
thanks bhai love your video
@libinTom
@libinTom 2 жыл бұрын
Thanks millions Harry.
@ramchandrainamdar6742
@ramchandrainamdar6742 6 жыл бұрын
Here is my solution for command prompt utility (Ramchandra Inamdar) (file name : pyutil.py) import argparse import sys # file pyutil.py #Uses the function, namely faultycalc giving following wrong answers # 45*3 = 555, 56 + 9 = 77 and 56/6 = 4 #all other answers correct. def faultycalc(args): if args.x == 45 and args.y == 3 and args.o == 'mul': print('multiplication of num1 and num2 = ', end='' ) return 555 elif args.x == 56 and args.y == 9 and args.o == 'add': print('sum of num1 and num2 = ', end='') return 77 elif args.x == 56 and args.y == 6 and args.o == 'div': print('division of num1 and num2 = ', end='') return 4 else: if args.o == 'add': return args.x + args.y elif args.o == 'sub': print('subtraction of num1 and num2 = ', end='') return args.x - args.y elif args.o == 'mul': print('multiplication of num1 and num2 = ', end='') return args.x * args.y elif args.o == 'div': print('division of num1 and num2 = ', end='') return args.x / args.y elif args.o == 'per': print('remainder of num1 over num2 = ', end='') return args.x % args.y else: print("Error! Please check your input") if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--x', type=float, default=1.0, help="Enter first numberPlease contact Harry") parser.add_argument('--y', type=float, default=3.0, help="Enter second number, Please contact Harry") parser.add_argument('--o', type= str, default = 'add', help=" Please contact Harry") args = parser.parse_args() sys.stdout.write(str(faultycalc(args)))
@akashghosh395
@akashghosh395 2 жыл бұрын
Thank you Harry bhai for creating such good contents
@gandharphansalkar5319
@gandharphansalkar5319 3 жыл бұрын
Best Theme Harry Bhai and You are the best
@aashishfreakin6417
@aashishfreakin6417 4 жыл бұрын
Thanks sir, i am a regular viewer
@adarshmishra357
@adarshmishra357 3 жыл бұрын
Awesome bhaii
@tpwithaman
@tpwithaman 4 жыл бұрын
awesome theme sir...bht late ho gya h but maine abhi hi dekhna shuru kiya tha
@sarv4265
@sarv4265 Жыл бұрын
# Faulty Calculator - by creating command line utility # Faulty values: 45*3=555, 56+9=77, 56/6=4 import argparse import sys def Faulty_cal(calculation): if calculation.o == "add": if calculation.a == 56 and calculation.b == 9: return 77 else: return calculation.a + calculation.b elif calculation.o == "sub": return calculation.a - calculation.b elif calculation.o == "mul": if calculation.a == 45 and calculation.b == 3: return 555 else: return calculation.a * calculation.b elif calculation.o == "div": if calculation.a == 56 and calculation.b == 6: return 4 else: return calculation.a / calculation.b if __name__ == '__main__': # object of ArgumentParser class in argparse module file parser = argparse.ArgumentParser() # adding arguments to parser object parser.add_argument("--a", type=float, default=0.0, help="Enter 1st number") parser.add_argument("--b", type=float, default=0.0, help="Enter 1st number") parser.add_argument("--o", type=str, default="add", help="Enter 1st number") # Printing result on console using sys module sys.stdout.write(str(Faulty_cal(parser.parse_args())))
@BCS_MohdMaaz-bm8vu
@BCS_MohdMaaz-bm8vu 2 жыл бұрын
Thanx harry bro for such a wonderful playlist Theme is good
@epicapitgaming7665
@epicapitgaming7665 4 жыл бұрын
the theme is awesome siir
@mahanaatma910
@mahanaatma910 4 жыл бұрын
thanks harry bahi aakhir kaa pata chala ki kaise multi language me ek program ko likha ja sakta hai
@kshitijchaudhari7441
@kshitijchaudhari7441 3 жыл бұрын
Theme is nice 😄
@darshanbothra2673
@darshanbothra2673 4 жыл бұрын
Badiya theme lag raha hai harry bhai.
@arunite6704
@arunite6704 4 жыл бұрын
East or west Harry bhai ki theme is best
@ankitchetri2968
@ankitchetri2968 3 жыл бұрын
Thank u bhaiya
@asifayub6999
@asifayub6999 5 жыл бұрын
Great Harry Bhai. Thanks
@techwithpanwar1507
@techwithpanwar1507 3 жыл бұрын
thanks harry bhai :)
@CodexGem
@CodexGem 4 жыл бұрын
Theme ekdum sahi h harryy bhai
@sanjaysaha1120
@sanjaysaha1120 3 жыл бұрын
Theme bhut accha hai bhai
@nooblighter8676
@nooblighter8676 3 жыл бұрын
I accept the challenge harry sir!
@payalbhatia5244
@payalbhatia5244 2 жыл бұрын
@Code with Harry. This is not just only for beginners. I am not a beginner but there is a tons of knowledge I learnt
@sumeetkumar6778
@sumeetkumar6778 Жыл бұрын
Nice explanation , but the negative scenarios were not covered .Plus if you have so much problem with code formatting/beautify then prefer to use flake8 ;)
@alamshah822
@alamshah822 3 жыл бұрын
And getopt module command line arguments m kya h.... Love ur explanation with (argpars)💜
@taimoorneutron2940
@taimoorneutron2940 3 жыл бұрын
video volume is always low in tutorials, i am very big fan of you working kindly update this issue
@RaviYadav-ru1nu
@RaviYadav-ru1nu 4 жыл бұрын
Thanks for your hard work towards us Harry bhai. I accept the challenge. :)
@jayeshkaushik2975
@jayeshkaushik2975 4 жыл бұрын
theme acchi hai harry bhai
@manbirjudge8415
@manbirjudge8415 4 жыл бұрын
Theme is good but not much colourful. Challenge accepted. Can you create a series on "Electron" which is a "Node.js" package used to create GUIs using HTML, CSS and JS. You may know that "Visual Studio Code" is also written in "Electron". 😊😊 🤗🤗
@officedivine1365
@officedivine1365 2 жыл бұрын
Bhai isi ne bataya hai
@aresspirit1593
@aresspirit1593 2 жыл бұрын
I accept the chaillenge🤘
@dubeynirajkumar
@dubeynirajkumar 5 жыл бұрын
Good one 👍👍
@shiveshkushwaha204
@shiveshkushwaha204 4 жыл бұрын
Awesome theme sir... And Challenge accepted...
@HARSHYADAV-nx8ug
@HARSHYADAV-nx8ug 5 жыл бұрын
Please Please cover data structure and algorithms in a different playlist.bhai please .
@hamzabintariq2597
@hamzabintariq2597 2 жыл бұрын
theme acha lgrha ha harry bhai
@priyanka89817
@priyanka89817 4 жыл бұрын
Awesome tutorial
@kanishkkumar1287
@kanishkkumar1287 2 жыл бұрын
I am also using this theme Harry Bhai CS
@hakhandare
@hakhandare 2 жыл бұрын
Thank you
@abhishekkushwaha3107
@abhishekkushwaha3107 4 жыл бұрын
Theme bahut shandar hai bhai
@poonamkanuajiya9260
@poonamkanuajiya9260 4 жыл бұрын
Theme is awesome as u r
@incognitozzz9238
@incognitozzz9238 4 жыл бұрын
so 15k people learned something till here. thanks to harry, i am one of them
@amitbudhiraja4135
@amitbudhiraja4135 4 жыл бұрын
After the oops the videos are of no use to me and this is a genuine comment but no hate to code with harry channel
@ankushmatyal1581
@ankushmatyal1581 2 жыл бұрын
Now 20 million ❤️
@usamaansari26
@usamaansari26 3 жыл бұрын
Theme accha lag raha hai bhai🥲
@Foodie_5
@Foodie_5 2 жыл бұрын
Thanks Bhai
@sanjivpaul
@sanjivpaul 3 жыл бұрын
mst hai dark theme harry bhai me bhi yehi use karta hun
@mahendrachourasiya
@mahendrachourasiya 3 жыл бұрын
Theme is good......................................................
@ajsaraf4440
@ajsaraf4440 2 жыл бұрын
Theme is too good
@RohanDasRD
@RohanDasRD 6 жыл бұрын
Bhai Tkinter Packing Buttons wala video delete kyon kiya?>>>?/
@aalokworld1517
@aalokworld1517 3 жыл бұрын
Nahi kiya ha ma na puri GUI padi ha
@yogeshtripathi7098
@yogeshtripathi7098 3 жыл бұрын
@@aalokworld1517 Hey , can I start GUI just after this video as its almost completed??
@aalokworld1517
@aalokworld1517 3 жыл бұрын
@@yogeshtripathi7098 @Yogesh tripathi No please complete all video then you learn the consept of GUI and some function are of python , some no full base on python so complete all video
@vishavgupta3717
@vishavgupta3717 3 жыл бұрын
Thanks
@AnkushSaral
@AnkushSaral Жыл бұрын
Theme is good but I think it's better to have more colours rather then only black and grey.
@musicalmaddy1082
@musicalmaddy1082 3 жыл бұрын
and theme is nice
@alokbhowmik3547
@alokbhowmik3547 6 жыл бұрын
vai fan bana lia apna
@taranathniraula3036
@taranathniraula3036 3 жыл бұрын
sir what is difference between using sys.stdout or print function in python
@arpitsoni9378
@arpitsoni9378 5 жыл бұрын
Challenge accepted . . After few minutes . . Challenge completed . . Theme kaunsi hai Dracula to nahi lag rahi muje 🤔
@ayushagrawal2405
@ayushagrawal2405 4 жыл бұрын
Color Scheme is Monokai. To set in PYCHARM ----> Editor> Color Scheme> Set your desired scheme........ Thank You
@rajnishvedi1077
@rajnishvedi1077 4 жыл бұрын
@@ayushagrawal2405 Bhai cd~ enter Karne ke baad error show kar rha h .... please help
@sudarshanmhaisdhune1039
@sudarshanmhaisdhune1039 4 жыл бұрын
@@rajnishvedi1077 go to file( at left top of pycharm software) then go to settings then search in setting "color scheme" and apply whatever scheme u wanted😊......
@rajnishvedi1077
@rajnishvedi1077 4 жыл бұрын
@@sudarshanmhaisdhune1039 thanks bro for this...but I am not asking about this ....but thanks a lot
@ayushagrawal2405
@ayushagrawal2405 4 жыл бұрын
@@rajnishvedi1077 Use cd instead of cd~
@krishnamohanty5128
@krishnamohanty5128 6 жыл бұрын
Sir how about making data structures and algorithm using python from scratch. All cover all algorithms topics.. waiting ur reply...
@SudhanshuKumar-jl8iw
@SudhanshuKumar-jl8iw 6 жыл бұрын
I too.BRO!!
@indiangamersg2585
@indiangamersg2585 2 жыл бұрын
Sir dark theme badi acchi ha!
@muhammadnajamulislam2823
@muhammadnajamulislam2823 6 жыл бұрын
brother theme is very nice
@tejasvimangal2184
@tejasvimangal2184 2 жыл бұрын
Hi Guys. I have a question here. Basically what I understood was that argparse module is used to get input from user when running a python file from cmd/powershell. This can be done using input() function as well. So why exactly we will use argparse. Harry Bhai or Anyone, Please clarify?
@johnme60
@johnme60 2 жыл бұрын
Imagine a plastic box , this box has different sections , the box is totally closed. Now you have pour down liquid in every section of this box. Input function : - this is like putting pipes in each section permanently and leave them opened for liquid pouring. agrs : - The box is closed , but you can shove down a pipe , pour liquid and pull out the pipe in any section. [ Args behave like a optional argument utility , you can have different functionality depends on the given input, the program won't ask you for any input , it's your choice what do you want to give as input from the wide variety of options]
@tejasvimangal2184
@tejasvimangal2184 2 жыл бұрын
@@johnme60 that's a great explanation... Thanks
@jackdarcy2264
@jackdarcy2264 3 жыл бұрын
Theme: Bahute Badiya!
@talhaali4343
@talhaali4343 3 жыл бұрын
harry bhai light theme ziyada acha lagta hai
@rohanbeast3381
@rohanbeast3381 3 жыл бұрын
you should add light theme (my opinion)
@ashifakhatoonansari868
@ashifakhatoonansari868 4 жыл бұрын
bahut accha theme h
@ritusharma773
@ritusharma773 4 жыл бұрын
Theme is good!
@MDAdil-bc6mv
@MDAdil-bc6mv 4 жыл бұрын
amazing theam
@mukeshnarayan9101
@mukeshnarayan9101 4 жыл бұрын
I accept this challenge 🙂
@tinkuvishwakarma6017
@tinkuvishwakarma6017 4 жыл бұрын
I accept the challenge Harry Sir !
@incognito7005
@incognito7005 3 жыл бұрын
will you code in next birth or what?
@kanuwebmedia8250
@kanuwebmedia8250 6 жыл бұрын
Very nice
@sandeepsinghnegi9220
@sandeepsinghnegi9220 6 жыл бұрын
Good one
@ritiksinghania5618
@ritiksinghania5618 3 жыл бұрын
Theme toh mast lg raha hai
@youngindianchef8207
@youngindianchef8207 4 жыл бұрын
Accha theme hai bhai
@priyanujbora9689
@priyanujbora9689 4 жыл бұрын
Theme is awesome
@amgothrenuka2358
@amgothrenuka2358 2 жыл бұрын
Sir secret key ka program banado
Argparse Tutorial - Python  2023 (Creating Your First CLI)
18:59
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Python Argparse Module - Create CLI and Run Scripts With Command Line Arguments
26:16
Fabio Musanni - Programming Channel
Рет қаралды 8 М.
Creating command line utility in python | Python Tutorial - Day #85
18:32
Top 18 Most Useful Python Modules
10:50
Tech With Tim
Рет қаралды 935 М.
Types of Arguments in Python | Python Tutorials for Beginners #lec61
21:11
Jenny's Lectures CS IT
Рет қаралды 105 М.
Argparse Basics - How I run my scripts via the Command Line
6:45
John Watson Rooney
Рет қаралды 82 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН