AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.03k stars 11.31k forks source link

TypeError: main() takes exactly 1 argument #61

Closed iBadawi closed 2 years ago

iBadawi commented 7 years ago

Hi Allen,

Thanks for the book & code. I just started working on the code & got this error message when I run the nsfg.py code:

TypeError Traceback (most recent call last)

in () 165 166 if __name__ == '__main__': --> 167 main(*sys.argv) TypeError: main() takes exactly 1 argument (3 given) Can you please explain the issue here and how to fix it? I'm new to Python and spent some time researching this issue but couldn't sort it out. Thanks
AllenDowney commented 7 years ago

If you provide command-line arguments, that would cause the error you are seeing. Are you providing command-line arguments?

On Mon, Feb 13, 2017 at 10:52 AM, iBadawi notifications@github.com wrote:

Hi Allen,

Thanks for the book & code. I just started working on the code & got this error message when I run the nsfg.py code:

TypeError Traceback (most recent call last) in () 165 166 if name == 'main': --> 167 main(*sys.argv)

TypeError: main() takes exactly 1 argument (3 given)

Can you please explain the issue here and how to fix it? I'm new to Python and spent some time researching this issue but couldn't sort it out.

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/61, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37eyNSlRbKHXifN5XsrKup-Js9oUFks5rcHw0gaJpZM4L_XqV .

AllenDowney commented 7 years ago

I just pushed a change that will avoid this problem.

On Mon, Feb 13, 2017 at 1:59 PM, Allen Downey allendowney@gmail.com wrote:

If you provide command-line arguments, that would cause the error you are seeing. Are you providing command-line arguments?

On Mon, Feb 13, 2017 at 10:52 AM, iBadawi notifications@github.com wrote:

Hi Allen,

Thanks for the book & code. I just started working on the code & got this error message when I run the nsfg.py code:

TypeError Traceback (most recent call last) in () 165 166 if name == 'main': --> 167 main(*sys.argv)

TypeError: main() takes exactly 1 argument (3 given)

Can you please explain the issue here and how to fix it? I'm new to Python and spent some time researching this issue but couldn't sort it out.

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/61, or mute the thread https://github.com/notifications/unsubscribe-auth/ABy37eyNSlRbKHXifN5XsrKup-Js9oUFks5rcHw0gaJpZM4L_XqV .

iBadawi commented 7 years ago

Thank you so much for your prompt response, I tried the new code and it's working fine.