Skip to content

Tag: python

Django join tables with ForeignKey

I’m trying to join 3 tables with ForeignKey but it returns Null values. I’m using select related and also I tried Insight.objects.all() but both are not working. Here are my models: My View: Answer I solved my problem by the below, I could update the DB with the result of the below query

Flask redirect without url params

I have 2 flask app, client and server respectively And I wanna download some files from server by redirecting user directly to the server So basically I want redirect to this route: So I’m write client like this: I wanna get url like: http://ipAddress/api/1.0/conf/myGreatToken But get: http://ipAddress/…

Python variable file path and string prefixes

Using tkinter to select output folder for processed files. Would like to use file_output and x as variables for my file path, My attempt: This does not work in my program. The output I need is I am reading the docs https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-stringprefix Still don&…

Finding the coordinates of max sum path in matrix

I have this method which returns the max sum of the path from top left to bottom right (can move only to the right or bottom). output : 1 + 3 + 4 + 5 = 13 But what I want to get is also the coordinates of the points of the path: [(0,0) (1,0) (1,1) (1,2)] Answer The variable

Zoom Region Not Working Properly – Matplotlib

So, I was trying to get a subplot of a region from an plot that should be zoomed in. Code: (Minimal, Reproducible one) It is showing this: It should show somewhat like this: or somewhat like this: (Collected) What should I do now? Thanks. Answer Solution: I just forgot to adding the scatter function. axins.sc…

How to get custom slider in tkinter?

I want to get a custom slider in tkinter or another slider like this one slider The default tkinter slider isn’t very good so how it can be changed ? (even the simplest way to do it) I will appreciate if the thing is not done with a class because I did’nt put a single one in 300 lines of