Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73352

Re: Python Noob, open file dialog

X-Received by 10.66.217.170 with SMTP id oz10mr108298pac.9.1403076989756; Wed, 18 Jun 2014 00:36:29 -0700 (PDT)
X-Received by 10.140.49.67 with SMTP id p61mr4007qga.21.1403076989705; Wed, 18 Jun 2014 00:36:29 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!r2no3367279igi.0!news-out.google.com!a8ni4126qaq.1!nntp.google.com!i13no5250890qae.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Wed, 18 Jun 2014 00:36:29 -0700 (PDT)
In-Reply-To <mailman.11108.1403026493.18130.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=213.81.70.147; posting-account=PspdQwoAAADJ98ygcJ7Jym9HDCg7CQXX
NNTP-Posting-Host 213.81.70.147
References <94cdb6dd-9071-4006-89b2-c84d6bd757b6@googlegroups.com> <mailman.11108.1403026493.18130.python-list@python.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <68cd5f3f-94d8-4c44-8b4f-28961bf1186d@googlegroups.com> (permalink)
Subject Re: Python Noob, open file dialog
From cutey Love <cuteywithlove@gmail.com>
Injection-Date Wed, 18 Jun 2014 07:36:29 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:73352

Show key headers only | View raw


No it's still paused after selection and only excutes when the window is closed.

On Tuesday, June 17, 2014 6:34:41 PM UTC+1, MRAB wrote:
> On 2014-06-17 17:49, cutey Love wrote:
> 
> > My first attempt at Python,
> 
> >
> 
> > I'm using Tkinter and all is going well except when I'm using
> 
> >
> 
> >      file_path = tkFileDialog.askopenfilename()
> 
> >      print "test"
> 
> >
> 
> > opens great and lets me select a file, the problem is it then pauses? instead of continuing with the function? until I close, then it goes and completes the function?
> 
> >
> 
> > Why is this and how do I fix it?
> 
> >
> 
> It's waiting for you to click the Open button to confirm your
> 
> selection. That's normal behaviour for such a dialog box.
> 
> 
> 
> > Full code
> 
> >
> 
> > import Tkinter, tkFileDialog
> 
> >
> 
> > from Tkinter import *
> 
> >
> 
> > emails = []
> 
> >
> 
> > def askFile():
> 
> >      file_path = tkFileDialog.askopenfilename()
> 
> >      print "test"
> 
> >
> 
> >
> 
> > window = Tkinter.Tk()
> 
> > window.title("Super Star")
> 
> >
> 
> > window.geometry("600x600")
> 
> >
> 
> > menubar = Menu(window)
> 
> > filemenu = Menu(menubar, tearoff=0)
> 
> > filemenu.add_command(label="New", command=askFile)
> 
> >
> 
> > menubar.add_cascade(label="File", menu=filemenu)
> 
> >
> 
> > window.config(menu=menubar)
> 
> >
> 
> > window.mainloop()
> 
> >

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python Noob, open file dialog cutey Love <cuteywithlove@gmail.com> - 2014-06-17 09:49 -0700
  Re: Python Noob, open file dialog MRAB <python@mrabarnett.plus.com> - 2014-06-17 18:34 +0100
    Re: Python Noob, open file dialog cutey Love <cuteywithlove@gmail.com> - 2014-06-18 00:36 -0700
      Re: Python Noob, open file dialog Chris Angelico <rosuav@gmail.com> - 2014-06-18 17:45 +1000
      Re: Python Noob, open file dialog alister <alister.nospam.ware@ntlworld.com> - 2014-06-18 08:32 +0000
        Re: Python Noob, open file dialog cutey Love <cuteywithlove@gmail.com> - 2014-06-18 02:03 -0700
          Re: Python Noob, open file dialog Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-06-18 14:10 +0100

csiph-web