Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9189279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:12:14+00:00 2026-06-17T20:12:14+00:00

I can not retrieve a variable from Entry and then enter the variable to

  • 0

I can not retrieve a variable from “Entry” and then enter the variable to a function. For example, I want to retrieve “NbF” which is a variable “entry”. I did in “set” and I can retrieve it with “get” but when I get a new text “entry” I do not get the new value.

This is my code:

#!/usr/local/bin/python
# -*- coding:utf-8 -*-
from Tkinter import *
import tkFileDialog, tkMessageBox

application = Tk()
application.title("Application Drone - Analyse Vidéo")


def getFile(): 
        varName = tkFileDialog.askopenfilename().encode('utf-8')
        Name.set('Path : ' + varName)

def convert(nbFrame):
    print 'ffmpeg -i pathVideo -r '+nbFrame+' -f image2 "temp%4d.png"' 

def detect():
    pass

def analyse():
    pass

frame1 = Frame(application, bg="blue",   width=560, height=100)
frame1.pack(side=TOP, fill=X)

frame2 = Frame(application, bg="red",   width=560, height=100)
frame2.pack(side=TOP, fill=X)

frame3 = Frame(application, bg="green",   width=560, height=100)
frame3.pack(side=TOP, fill=X)

frame4 = Frame(application, bg="yellow",   width=560, height=100)
frame4.pack(side=TOP, fill=X)

frame5 = Frame(application, bg="grey",    width=560, height=100)
frame5.pack(side=BOTTOM, fill=BOTH, expand=1)

#frame 1
Name=StringVar()
lab1 = Label(frame1, text="Step 1 : Recup video").grid(row=0,column=0)
butt1 = Button(frame1,text="browse",command=getFile).grid(row=0,column=1)
nameVideo = Label(frame1, textvariable=Name).grid(row=1,column=0)

#frame 2
NbF = StringVar()
NbPictures=StringVar()
lab2 = Label(frame2, text="Step 2 : Convert video to images").grid(row=0,column=0)
ent2 = Entry(frame2, textvariable=NbF).grid(row=0,column=1)
# ent2.pack()
NbF.set('nb frame')
recup2 = NbF.get()
butt2 = Button(frame2,text="convert",command=lambda :convert(recup2)).grid(row=0,column=2)
nbP = Label(frame2, textvariable=NbPictures).grid(row=1,column=0)

#frame 3
NbS=StringVar()
lab3 = Label(frame3, text="Step 3 : Detect shape").grid(row=0,column=0)
butt3 = Button(frame3,text="detect",command=lambda :detect).grid(row=0,column=1)
numberShape = Label(frame3, textvariable=NbS).grid(row=1,column=0)

#frame 4
NbC=StringVar()
lab4 = Label(frame4, text="Step 4 : Analyse QrCode").grid(row=0,column=0)
butt4 = Button(frame4,text="analyse",command=lambda :analyse).grid(row=0,column=1)
numberCoord = Label(frame4, textvariable=NbC).grid(row=1,column=0)

#frame 5
lab5 = Label(frame5, text="Step 5 : Send coordonates").grid(row=0,column=0)
butt5 = Button(frame5,text="send",command=lambda :send).grid(row=0,column=1)

application.mainloop()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:12:15+00:00Added an answer on June 17, 2026 at 8:12 pm

    Perhaps you meant:

    butt2 = Button(frame2,text="convert",command=lambda :convert(NbF.get())).grid(row=0,column=2)
    

    This defers calling NbF.get() until the button is actually pressed. As the code was before, you were calling NbF.get() before the button was created and then passing that value to the function whenever you pressed the button.


    As a side note, butt2 in the above code will always be None which is almost certainly not what you wanted it to be. The reason for this is because Widget.grid always returns None. I would advise you to not create a widget and pack/grid it on the same line — always split that into 2 lines:

    butt2 = Button(frame2,text="convert",command=lambda :convert(NbF.get()))
    butt2.grid(row=0,column=2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a scanner to retrieve rows from HBase. I can set which
How can I retrieve document from CouchDB based on its field, not by ID?
How can I use the indices returned from 'min' function in matlab to retrieve
can anyone help me on how to retrieve function parameter names? For example: var
Can not run following SQL from ant's sql task : BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE( queue_table =>
I can not get logs from some customers, can I use Google Urchin in
I want the number of address book items to be variable - not known
Have a question about stored procedure: How to retrieve the variable's value from stored
I am using LINQ to retrieve data from the Database, the variable name relative
How can I get a variable that contains the currently executing function in Python?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.