Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Tkinter Buttons action
Post: Tkinter Buttons action

First of all, I do not have any code yet to show. I am new to python and coding in generel, so please if you can, explain in simple english. :). *I am using Tkinter* So i want a window with a set of...
d3fi GUI 1 1,998 Nov-20-2019, 03:44 PM
    Thread: UnboundLocalError: local variable ' ' referenced before assignment
Post: RE: UnboundLocalError: local variable ' ' referenc...

def adrenalin(): weight = int(input("Hvad vejer patienten? ")) #what does the patient weight left = weight % 5 weight -= left if weight >= 50: dosis = 0.5 else: ...
d3fi General Coding Help 10 5,537 Sep-03-2019, 06:46 PM
    Thread: UnboundLocalError: local variable ' ' referenced before assignment
Post: RE: UnboundLocalError: local variable ' ' referenc...

(Sep-03-2019, 05:51 PM)buran Wrote: one thing I think is wrong is left = weight % 5 Do you know what modulo operator does? I am not sure. I got help from an earlier post with the "%". i want the pr...
d3fi General Coding Help 10 5,537 Sep-03-2019, 06:09 PM
    Thread: UnboundLocalError: local variable ' ' referenced before assignment
Post: RE: UnboundLocalError: local variable ' ' referenc...

def fentanyl(): weight = int(input("Hvad vejer patienten? ")) max_dosis = vaegt * 4 max_volumen = weight * 4 * 2 / 100 print(f"Du må max total give ptt. {max_dosis} mikrogram, sv. {max...
d3fi General Coding Help 10 5,537 Sep-03-2019, 05:20 PM
    Thread: UnboundLocalError: local variable ' ' referenced before assignment
Post: RE: UnboundLocalError: local variable ' ' referenc...

(Sep-03-2019, 03:28 PM)buran Wrote: show full traceback in error tags note that when tilbage <= 2 then if body (lines 17-18) will not be executed and dosis is not defined. opsie daisy... thak yo...
d3fi General Coding Help 10 5,537 Sep-03-2019, 04:48 PM
    Thread: UnboundLocalError: local variable ' ' referenced before assignment
Post: UnboundLocalError: local variable ' ' referenced b...

I just cant find the problem here. I have searched for it. but that did not solve my problem. def fentanyl(): # This one Works vaegt = int(input("Hvad vejer patienten? ")) max_dosis = vae...
d3fi General Coding Help 10 5,537 Sep-03-2019, 03:23 PM
    Thread: Number bug, calculation is wrong
Post: Number bug, calculation is wrong

so here is my code elif im.lower() in ("inh, inhalation, inhala"): # inhalation barn = (input("Barn eller voksen? ")) if barn.lower() in ("voksen", "vok"): ...
d3fi General Coding Help 2 2,444 Aug-26-2019, 09:11 PM
    Thread: find nearest number
Post: RE: find nearest number

Thanks ichabod801 & ndc85430 That solved my problem. This must be very simple coding for you. But for me this is an achivement. Cant get my arms down this is how the outcome is from your help. va...
d3fi General Coding Help 7 3,940 Aug-26-2019, 08:24 PM
    Thread: find nearest number
Post: RE: find nearest number

(Aug-26-2019, 02:34 PM)ichabod801 Wrote: Why don't you try to code it? Then I can help you if it doesn't work.I dont understand the "%" i could do it like this elif vaegt in (10, 11, 12): vaegt = ...
d3fi General Coding Help 7 3,940 Aug-26-2019, 03:17 PM
    Thread: find nearest number
Post: RE: find nearest number

(Aug-26-2019, 02:20 PM)ichabod801 Wrote: vaegt % 5 is how far vaegt is above the next lowest five. So if vaegt % 5 is 0, 1, or 2, you want to subtract vaegt % 5 from vaegt. If vaegt % 5 is 3 or 4, y...
d3fi General Coding Help 7 3,940 Aug-26-2019, 02:26 PM
    Thread: find nearest number
Post: find nearest number

so first here is my code. elif medicin in ("adrenalin", "ad"): vaegt = int(input("Hvad vejer patienten? ")) #what does the patient weight dosis_adrenalin = vaegt * 0.01 ...
d3fi General Coding Help 7 3,940 Aug-26-2019, 01:22 PM
    Thread: if statement
Post: if statement

Hello. hope you can help me. first. here is my code medicin = input("hvilken medicin skal du give? ").lower() #What medicine are you giving? if medicin == "fentanyl": ...
d3fi General Coding Help 2 1,687 Jul-30-2019, 03:19 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020