## Defining mathematical formula

Post here if you need help with creating a Graphical User Interface in Python.

### Defining mathematical formula

Hello everyone,
I joined the forum hoping to find someone who would help me.
I am writing small program in python with GUI, and what it should actually do is , using my math formula to calculate the deflektion of one simple beam. My problem is that i dont know how to define my formula in python..
The formula is : W=5/384 x ((q x l^4)/(Emodul x T))

This is what i managed to write so far:
Code: Select all
`from tkinter import *from math import*a=Tk()a.title("AG013211585")a.geometry("500x500")bild=PhotoImage(file="Unbenannt2.gif")Label(image=bild,width=500).grid(row=0,column=0,columnspan=3)Label(text="q= ").grid(row=1, column=0, sticky="e")EP=Entry(width=20)EP.grid(row=1,column=1,sticky="we")Label (text="Kn/m").grid(row=1,column=2,sticky="w")Label(text="l= ").grid(row=2, column=0, sticky="e")EP=Entry(width=20)EP.grid(row=2,column=1,sticky="we")Label (text="m").grid(row=2,column=2,sticky="w")Label(text="Emodul= ").grid(row=3, column=0, sticky="e")EP=Entry(width=20)EP.grid(row=3,column=1,sticky="we")Label (text="N\m²").grid(row=3,column=2,sticky="w")Label(text="I=").grid(row=4, column=0, sticky="e")EP=Entry(width=20)EP.grid(row=4,column=1,sticky="we")Label (text="m^4").grid(row=4,column=2,sticky="w")b1=Button(text="berechnen")b1.grid(row=5, column=1,columnspan=1,sticky="we")a.mainloop()`
Last edited by Yoriz on Sat Dec 28, 2013 5:52 pm, edited 1 time in total.
Reason: First post lock, Added code tags
Almir

Posts: 1
Joined: Sat Dec 28, 2013 5:09 pm

### Re: Defining mathematical formula

Hi welcome to the forum.
Please read the 'new users, read this' link in my signature.

It looks like the question you have has nothing to do with gui code , so it would be better to seperate the code out that is specific to your question.
Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

Yoriz

Posts: 1672
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Return to GUI

### Who is online

Users browsing this forum: No registered users and 2 guests