On Thu, Feb 2, 2017 at 2:10 AM, Νίκος Βέργος <me.on....@gmail.com> wrote: > # Give user the file requested > url = "http://superhost.gr/data/files/%s" % realfile > > user, password = 'user', 'passwd' > > r = requests.get( url, auth = (user, password) ) # send auth unconditionally > r.raise_for_status() > ========================== > > How can i ASK the user for http auth data and store them isntead of giving > them to the script?
You should use the input() function (called raw_input() in Python 2) for a user name, and the getpass module for the password: https://docs.python.org/3/library/getpass.html ChrisA -- https://mail.python.org/mailman/listinfo/python-list