![]() ![]() The solution I found was to alias Python to python3 in my profile. I really just want to run python 3 all the time. But this was not the best solution for me. And install “requests” via pip3 requests. ![]() I was able to run the app via command python3. Apparently, Mac comes with python 2.7 and when you install brew it does not update the path. This was confusing as I had just run “brew install python” before starting the project. I then added some code that referenced how to call an API and it used the “requests”, knowing I needed to run “pip install requests” before I ran the program, I was rewarded with an error.Īfter this error, I checked what python version was on my Mac (python –version) I then learned I was running python 2.7. It worked well – opened a file of records added to an array and displayed the line items and did a count. ![]() Once I was done writing the code I jumped into a term terminal and ran the program “python GetAPIData.py”. (NOTE: I have not used Python in a long time and it was fun to quickly put something together). I fired up Visual Studio code and wrote out the framework of the program I needed in about 10 min. ![]() I quickly looked up a process I could utilize to read a Rest API then do some work based on that content. I recently had the need to create a small python script to run a process. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |