Skip to content
Advertisement

Tag: python-3.x

How to save a tkinter canvas as an image

I would like to save my drawing on a tkinter canvas as an image so I can open it for later use. I currently use this save system from this post however this is not a good way for me. First I would need to add an offset and second if i set the application so only some part of

Can’t pass parameters in Django, giving MultiValueDictKeyError

I have gone through answers of this type of question but they don’t seem relevant for my problem. I have a class defined as follows: It also requires other inputs: params[“meta”][“xgb”] params[“combined”] And I pass them as follows: I try the same in Postman by putting all these parameters in “Body” (using “raw”) but get: Need help. Thanks. Answer

POST request to TRIAS API does not work with requests

I maintain an API client for the TRIAS API (German Link) to retrieve local public transport information for various states / cities in Germany. Recently one of the TRIAS servers (Baden-Württemberg) started responding with an error message to requests. When I try to send the request via curl, the server responds just fine: However, it fails with requests.post(), while it

Trying to accurately get 100 digits of pi with Chudnovsky’s algorithm in PYTHON

I am trying to teach myself Chudnovsky’s algorithm using Python and this wikipedia page: https://en.wikipedia.org/wiki/Chudnovsky_algorithm On the wiki, I am focused on the “high performance iterative implementation, [that] can be simplified to”: I tried to code up the equation on the far right that is using the Sigma symbol. I am familiar with Python but am not that great at

Error in anyjson setup command: use_2to3 is invalid

This is a common error which the most common solution to is to downgrade setuptools to below version 58. This was not working for me. I tried installing python3-anyjson but this didn’t work either. I’m at a complete loss.. any advice or help is much appreciated. If it matters: this application is legacy spaghetti and I am trying to polish

Set Optional params in PUT method using fastAPI/mongodb

I am trying to set Optional some params in a PUT method from my API. Using fastAPI and mongodb I’ve build a simple API to insert students and delete the ones, now I am looking to allow me update the entries but not mandatory “params”. I’ve checked this Fastapi: put method and looks like something I am looking for mongodb.

Getting Rolling Sum per Group

I have a dataframe like this: I would like to get the Sum of the last three months (excluding the current month), per Product_ID. Therefore I tried this: My code is failing, because it does not only calculate it per product, but it will give me also numbers for other products (let’s say Product 2, quarter 1: gives me the

Advertisement