Yes, if you are trying to purchase an item from a website and auto add the same in the cart and make the purchase - yes, you can do that using Python. And python has a lots of libraries that will help you do the task with less code. Also, you have actually taken a good move - when you have a task in hand its easy to learn stuffs. I hope you have experience doing coding and you logical skills are not bad. Anyways, here is how I would start if I were you:
1- Learn how to open a website and access the source code using python
2- Learn how to click on elements in the site using python
3- Learn how to take data from txt file and use that to enter data on the site.
4- Take data from the site and store it in txt file
This is how I would approach.