multithreading - Open a directory dialog using python -


I am trying to create a simple file dialog for the use of local server (preferably system one)

I can not use the tanker because it is run in a sub process and the dialog box will not be open in a sub-process on the Mac. I can not use a thread because it will eventually lock.

Is there a way to open the system file without using the tanker?

This first file is a self-contained job. I want the version of behavior (at the very end to ignore any kind of error)

  Import talk forms of import threading In tkFileDialog import askdirectory def createDialog (communicationQueue): Diameter = Dialog (CommunicationQE) Diameter. Show () class dialog (): def __init__ (self, communicationQueue): self.communicationQueue = communicationQueue self.root = tk.Tk () self.root.overrideredirect (True) self.root.geometry ("0x0 +% d + Print 'root' print 'root' created by self.root.update () self.root.deiconify () print 'directory' (0, 0))% '(0, 0) ask' directory 'threading.Thread (Target = self.show) t.daemon = True t.start () self.root.mainloop () print 'directory found! 'Df Show (self): Print "Show Dialog" self.root.lift () name = askdirectory () Print Name self.communicationQueue.put (name) if __name__ ==' __main__ ': createDialog (None) Print "Blocked! "  

From the time of importing this file from a sub process

  to the use of the tanker in the content def_createDialog (CommunicationsQue) from the multi-processing import process The first file is mixed with the efforts: Src.utilities Import fileDialog file from dialog.createDialog (CommunicationQue) Print 'method!' DEF Show Directory Dialog (): "" "A method of blocking that gives the directory path in the selected directory" "QU = line () P = the process (target = _createDialog, args = (CommunicationsQue,)) p.start ( ) Count = 0 while (communicationQueue.empty () and calculations <5): print "wait" time.sleep (5) count = count + 1 print 'process should start' time.sleep (1) print ' The thread should have slept for 1 second 'return name if __name__ ==' __main__ ': name = showDirectoryDialog () print name  

If someone can do this work on the Mac or at least find out why the root window opens, it will be great if askDirectory () is called as

For anyone looking to solve this problem ..

I have finished using Java The Python file dialog is very difficult to finish. There are some very strange requirements in it and you can create a second window. Areas require that you have to hide, so it makes the whole I do not need it for the intuitive way for a user. (Or also intuitive for programmers)

There is a build in the file dialog system in Java which is easy to use.

But it seems that Mac has popped up the file dialogue with the same program many times regardless of the language.

It is also something that your solution is the cross platform.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -