Sixth-week blog post for PSF, GSoC 2021

Welcome to my sixth blog post about my experience in Google Summer of Code (GSoC) 2021.

What am I working on

Last week I finished working with my second milestone. This is what I did. There is a lecture in the project called Hackeando con…


This content originally appeared on DEV Community and was authored by Leonardo Cumplido

Welcome to my sixth blog post about my experience in Google Summer of Code (GSoC) 2021.

What am I working on

Last week I finished working with my second milestone. This is what I did. There is a lecture in the project called Hackeando con Pyhton that is supposed to teach how to access an API and retrieve information using pyhton. Before last week, this lecture had only one exercise because others were eliminated due to the APIs they used (They have changed a lot and they are no longer public). Now, this lecture has six new exercises.

You might know these two python modules to do HTTP requests: urllib and requests. For the new exercises I used both, mainly because I encountered a problem with Runestone and I had to change the python interpreter to solve this.

This week I will be working on my third milestone.

What have I struggled with this week?

I had trouble with the dumps method from the json module. For an exercise I needed to display on screen the json data retrieved from an API. In order to print it with indentation I passed the indent argument. Like this:

print(json.dumps(datos, indent=4))

However, it wasn't working.

What solutions have I found?

So, I was using requests module before this. I had to change the python interpreter to brython for some exercises, because in Brython json.dumps with the indent arg works just fine, but Brython doesn't support the requests module yet. This is why I changed to urllib. In the Brython's console, the output finally dislplayed nicely with indentation.


This content originally appeared on DEV Community and was authored by Leonardo Cumplido


Print Share Comment Cite Upload Translate Updates
APA

Leonardo Cumplido | Sciencx (2021-07-13T17:47:54+00:00) Sixth-week blog post for PSF, GSoC 2021. Retrieved from https://www.scien.cx/2021/07/13/sixth-week-blog-post-for-psf-gsoc-2021/

MLA
" » Sixth-week blog post for PSF, GSoC 2021." Leonardo Cumplido | Sciencx - Tuesday July 13, 2021, https://www.scien.cx/2021/07/13/sixth-week-blog-post-for-psf-gsoc-2021/
HARVARD
Leonardo Cumplido | Sciencx Tuesday July 13, 2021 » Sixth-week blog post for PSF, GSoC 2021., viewed ,<https://www.scien.cx/2021/07/13/sixth-week-blog-post-for-psf-gsoc-2021/>
VANCOUVER
Leonardo Cumplido | Sciencx - » Sixth-week blog post for PSF, GSoC 2021. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/13/sixth-week-blog-post-for-psf-gsoc-2021/
CHICAGO
" » Sixth-week blog post for PSF, GSoC 2021." Leonardo Cumplido | Sciencx - Accessed . https://www.scien.cx/2021/07/13/sixth-week-blog-post-for-psf-gsoc-2021/
IEEE
" » Sixth-week blog post for PSF, GSoC 2021." Leonardo Cumplido | Sciencx [Online]. Available: https://www.scien.cx/2021/07/13/sixth-week-blog-post-for-psf-gsoc-2021/. [Accessed: ]
rf:citation
» Sixth-week blog post for PSF, GSoC 2021 | Leonardo Cumplido | Sciencx | https://www.scien.cx/2021/07/13/sixth-week-blog-post-for-psf-gsoc-2021/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.