Learn Python the Hard Way - Ex 13 - Parameters, Unpacking, Variables

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Thank you so much. Been stuck on this exercise for a week.

ahmedice
Автор

Due to my poor English reading, you helped me a lot. Thank you so much!!

Ai-Lan-Yen
Автор

Hi thanks for all your videos they are awesome! However I dont quite get what is the significance of the line " sys import arv"

is that so that the 4 variables of the argument vector can be typed in scripts bash?

notia
Автор

I understand to do that but i still do not understand what does that use for?  Just like you do something but dont know what dose that use for. Im wating for explaination!

yourdailymusic
Автор

Hi, I am using windows and sublime text editor to run python, which are all installed.
But I got stuck in this exercise since sublime text editor does not allow me to type in python file name, and first, second, third as argument variable.. can you suggest where to look up or find a way to usher thru this? Of course, using window shell, it works.

Jodingowal
Автор

THANK YOU. The example on the site using first second third, and 1st 2nd 3rd, is incredibly confusing. Also, why does his code start with $?

rafaellewis
Автор

This is the first exercise that has me stumped. I type it as it's written and I get :

from sys import argv
script, first, second, third = argv
File "<stdin>", line 1, in <module>
ValueError: need more than 1 value to unpack

When I try the part before that, I type python ex13.py and I get another error right up front for invalid syntax.

It's gotta be something simple that I'm missing but I don't know where to look right now.

gbravy
Автор

Hej, Thanks for the video. I have figured it out same as you did on the video, but I wanted to run this in pycham, could you/anyone explain briefly how could I do that ? Many thanks in advance :D

klaudiagaczynska
Автор

First thank you for this videos and thank to Zed.

I using notepad++ for this and executing on F5 (I make shortcut for execute in shell directly)
What I must to do in them (in Notepad++) because I get error.
zou put in command line file name and name. Where I put that in Notepad++?

DusanTomic
Автор

Thanks Mr.Poulson.
Please, keep working

mukhammadzokhidov
Автор

For people watching this in 2020 put parenthesis on argv like this:

(script, first, second, third) = argv

It should probably run. Hope this helps

kromatv
Автор

Could you tell me what to do for the study drill, where he wants us to combine "raw_input" and "argv"? What am I supposed to do, where am I supposed to put "raw_input". I put it after the comma's in the last 4 lines and that did something. Other than that, I don't know what do to.

natashatheunclean
Автор

does it work the same way on jupyter notebook?

felipemurakawa
Автор

Traceback (most recent call last):
File Python\LPTHW Practice Coding\ex13.py", line 9, in <module>
script, first, second, third = argv
ValueError: need more than 1 value to unpack

I am getting this error, what to do. Please help

MukeshSharma-gmrc
Автор

omg thank you im so braindead that was so simple

gutrap_
Автор

guys, i just did
from sys import argv # it worked perfectly
script, first, second, third = argv # I have an error message

how to solve this..
i am on python 2.7 windows 10
i am using IDLE

bibekrai
join shbcf.ru