No video

Python Command Line Arguments tutorial for Beginners

  Рет қаралды 7,323

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 18
@PeranMe
@PeranMe Жыл бұрын
I have to admit that I felt a little sceptical when someone recommended I use the argparse module when all I was looking for was if Python exposes arguments like in a list or something. But 5 minutes later, after skimming the documentation, boy, was I grateful that whoever it was that suggested argparse had done so! You’re definitely right to be introducing it this early in your Python series; it’s a great example of why your FIRST instinct when looking to solve a problem in Python should be to google for a module. As always a great video, thanks!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@alhabib_o
@alhabib_o 20 күн бұрын
Shouldn't we remove the 'required=True' from the add_argumetn( ) ? but this way we can run from anywhere not just from the terminal window..... And, why do I need to mark the name parameter as 'nonlocal' if I'm not going to modify it? Thank you so much, Dave for this amazing tutorial !!
@deepatterson1894
@deepatterson1894 5 ай бұрын
For some reason I keep getting : can't open file error message, I've tried everything even copying your lesson running it directly I save it in the LESSON 15 directory. It seems when I have to use commands in the terminal is when I run into problems. One thing I notice is that you always have a $ that comes before the py but mine doesn't the $. Everything else has been great, It must be something changed with Python since you did these lessons.
@deepatterson1894
@deepatterson1894 5 ай бұрын
Figured out what I did wrong. The folder DAVE GREY or whatever name for folder chosen to put lessons in. Example in my case I used DAVE GREY. It needs the underscore in-between first and last name DAVE_GREY. Simple thing I thought I even did this at one point but now works! Just incase anyone else has the same or similar issue.
@ahmad-murery
@ahmad-murery Жыл бұрын
Thanks for the shoutout Dave! I really appreciate that. Now, we can go further and localize this game by expanding the technique used in the hello_person example, msg = { "English": { "player choice": " {name}, please enter... 1 for Rock, 2 for Paper, or 3 for Scissors: ", "choice confirm": "{name}, please enter 1, 2, or 3", }, "German": { "player choice": " {name}, bitte geben Sie ein... 1 für Stein, 2 für Papier oder 3 für Schere: ", "choice confirm": "{name}, bitte geben Sie 1, 2 oder 3 ein.", } } lang = "German" data = {"name": "Ahmad"} print(msg[lang]["player choice"].format(**data)) # or maybe use # print(msg[lang]["player choice"].format(name = 'Ahmad')) Maybe it's better to save language dictionary to a separate module per language and then import necessary one into the main game file, this will allow contributors to add more languages (and will keep the game small, clean and easier to update independently) Google translate was used for German messages, so please forgive me for any mistakes😁
@ayushman1325
@ayushman1325 Жыл бұрын
Dave The Great!❤❤
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@quarkorion
@quarkorion 4 ай бұрын
My code works fine without the ".title" in line 33 and 34. Why do you include that?
@mrsengeel
@mrsengeel 3 ай бұрын
to convert the first character of a word to upper case while the rest of the character will be in lower case For example: friends = "hello world" find = friends.title() print(find) #output will be "Hello World" hope this helps
@markyuuki5736
@markyuuki5736 Ай бұрын
Thank you for your videos. I am recently dealing with this error: File "", line 1 py rps8.py -n "Dave" ^^^^ SyntaxError: invalid syntax Can you help me in fixing it? Thank you in advance
@johnaweiss
@johnaweiss 7 ай бұрын
Does "description" refer to the entire function?
@herway1875
@herway1875 6 ай бұрын
This is a good tutorial.
@deepatterson1894
@deepatterson1894 5 ай бұрын
you were able to get your code to work? It's not working for me.
@dimabrinza
@dimabrinza Жыл бұрын
Thank you!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@utinthein7274
@utinthein7274 Жыл бұрын
Thanks you, sir.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome!
Python Challenges for Beginners with Solutions
15:52
Dave Gray
Рет қаралды 6 М.
Python Modules for Beginners
18:03
Dave Gray
Рет қаралды 9 М.
My Cheetos🍕PIZZA #cooking #shorts
00:43
BANKII
Рет қаралды 28 МЛН
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 77 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 27 МЛН
Argument Parsing with argparse in Python
11:27
NeuralNine
Рет қаралды 14 М.
Python Closures for Beginners | Python tutorial
19:32
Dave Gray
Рет қаралды 7 М.
Python File Handling for Beginners
22:40
Dave Gray
Рет қаралды 12 М.
Argparse Tutorial - Python  2023 (Creating Your First CLI)
18:59
Python OOP (Object-Oriented Programming) Project for Beginners
30:19
Object Oriented Programming vs Functional Programming
18:55
Continuous Delivery
Рет қаралды 752 М.
why are switch statements so HECKIN fast?
11:03
Low Level Learning
Рет қаралды 405 М.
*Args and **Kwargs in Python
3:49
b001
Рет қаралды 268 М.