FINALLY. After weeks of errors and several bottles of wine, I managed to load a 3rd party module to get some more Python going.
You can download Python here by the way.
Al Sweigart, author of the best programming book of all time, has an appendix which explains that you can install 3rd party modules with pip. It comes installed standard, and you should be able to run it through the command prompt. HOWEVER, when I first tried it that way, alls I got was a deluge of errors.
Somewhere buried in a Stack Overflow thread which I can’t find anymore, someone mentioned that you can actually import pip into the Python IDLE and run it from there.
The shell will pop up afterwards with a block of text.
Ta Da. Now we have BeautifulSoup.
I wish I could tell you that here end the errors, but immediately after I started trying scripts with BeautifulSoup, I started getting a whole different set of errors.
But seeing as how it’s installed, I’m calling that progress.
The more I try to automate things with code, the more I’m coming to accept that it’s about 2% writing, 98% trying to figure out what the hell is causing this:
What’s genuinely frustrating is that once I imported one module through IDLE, pip started working through the command prompt. I have absolutely no idea why.
😀
you are beautiful! now try it with colorama in python 2 and tell me what happens. and if it works, you may have solved a problem thats been bugging me for TWO YEARS (im not using windows and you are; i dont need colorama EXCEPT for windows users.)
LikeLiked by 1 person
Couldn’t get it to work in the command prompt, but it worked in the IDLE with the code above (why? WHY? JUST WHY? THERE HAS TO BE A REASON??) — I swear I had the command prompt working yesterday. I think my computer is just toying with me.
LikeLiked by 1 person
i think idle has got to be importing stuff that it needs or something. sure, youll never find out what, but thats my guess.
LikeLiked by 1 person
Yup, that sounds about right, but yeah, I’ll never find out for sure. Happy 4th of July Codeinfig! Well, Happy 4th if you’re in the States, otherwise happy random Tuesday in July 🙂
LikeLike
its a little of both of those, really. thanks of course. hey just for fun, run python from the command line and in the repl, type this:
dir()
and then this:
for p in dir(): dir(p) # which gives you a lot more.
then do the same in idle and compare them. might help. might not. cheers.
LikeLiked by 1 person
if i say import pygame # then dir() one of the things it will list is ‘pygame’ but only if i import it.
LikeLiked by 1 person
OH. OH, THAT’S COOL. I didn’t know you could do that. Both the command prompt and IDLE gave me a ton of text–I haven’t been able to comb through them to figure out if there’s anything different yet, but thanks for sending that my way!
LikeLiked by 1 person
if you modify this code, it might help you comb through the lists:
LikeLiked by 1 person
Darn. The lists are the same. Not sure what’s happening there. Good to know I can do this in the future though. You really know your Python. Much appreciated!
LikeLike
really awesome !
LikeLiked by 1 person