Skip to content

Tag: python

Assigning color to ttk.Button

I would like to assign color to the background of my button as well as the text of my button. I thought I could assign it with fg and bg but there seems to be no reference at all in ttk.Button. How can I assign text and background color to my button? Error when calling style Answer Python docs explain

SymPy returns wrong solution of a nonlinear ODE?

I am trying to solve the ODE of the frictional free fall: I think the solution might be wrong. I believe it should be the reciprocal of the returned expression. Therefore, if I try to find the value of the constant for an initial condition of rest (v(0) = 0), I get no real solutions: As a consequence, if I

How fulfil empy df by FOR loop

I need to create a dataframe with two columns: variable, function based on this variable. There is an error in case of next code: What do I need to fix here? Looks like answer is easy, however it is uneasy to find it… Many thanks for your help Answer I like Vaishali’s way of approaching it. If you…

How to take n block of a 3d array in python?

I had 328 grayscale images with the size 128*128 and I convert all of them into a 3D array with the shape (128,128,328). Now I want to convert it into 5 separated 3d arrays with the shape of (128,128,64) without changing in sequence. As you can see 328 is not divisible by 64 and using dsplit function is not w…

How to remove duplicates in a list of tuples

I have a list of tuples: So when the first item of the tuples in the list is double or more, i want to remove the duplicates. The end result has to be the wantedList. In a normal list i can do the “make a dictionary” trick but i dont know how to solve it with a list of tuples.

How to send a complete email using smtplib python

I am trying to send an email using Python smtplib. My objective is to include the below info in email Attachment file #works fine Paste the contents of a table in message body #works fine Write a few lines about the table (as text) in message body # not works. instead stores as an attachment So, I tried the b…