Skip to content

Tag: python-3.x

How to Use jinja to render HTML without flask?

I need to render HTML page using jinja but without flask I read some other questions here but none had clear answer kindly let me know how can i achieve the same Here I need to render 1.html using 1.py – is it possble to do it in ofline mode current 1.py currently with this I am able to print

Unittesting python?

I have some function with api I have some integration tests: Please could you show how Unittest will look like relatively mine function . Answer Solution Use unittest.mock module. More details can be found here. Explanation patch replaces a real object or function with a mock one. It requires a positional arg…

trying to get specific data from API response

Trying to get “equity” data from a API response for calculate but can’t get through. This is my code: Keep getting TypeError: And this is data I am trying to tear apart: Answer Done with this type, go through json.dumps and json.loads and track the data in equity to get number in json

Pygame Erases Previous Drawing

When I run the draw 3 nodes function, only the final node and link is drawn when I want all 3 nodes and links to be drawn. I did some testing and I believe it draws all of the nodes, but when it moves on to the next node it erases the previous one. I’m not 100% sure if my