Forum: Poser Python Scripting


Subject: Dialog boxes

Anthony Appleyard opened this issue on Jul 18, 2008 · 9 posts


Anthony Appleyard posted Fri, 18 July 2008 at 12:41 AM

In a Python script I want to use the function DialogFileChooser, but the manual says that it was introduced in Poser 7. I have Poser 7; but what % of Poser users still use Poser 4/5/6?


markschum posted Fri, 18 July 2008 at 1:18 AM

Hence tkinter :)

There are a lot of people with versions earlier than 7 . Its a choice to decide what you will support with scripts . V4 is really only supposed to work with Poser 6 or 7 .

Depending on what you are doing you might document the manual procedure for earlier versions or use tkinter .


semidieu posted Fri, 18 July 2008 at 2:16 AM

But don't forget that Tkinter is not available in Poser 5/6 on Mac !!!


Anthony Appleyard posted Fri, 18 July 2008 at 6:29 AM

Please what is Tkinter and where to download or buy it?


PhilC posted Fri, 18 July 2008 at 6:55 AM

Tkinter is a GUI module for Python.
It is already installed within Poser.

See:-
http://www.pythonware.com/library/tkinter/introduction/

http://docs.python.org/lib/module-Tkinter.html


markschum posted Fri, 18 July 2008 at 4:17 PM

Philc has a Python manual/tutorial product that gives working examples of stuff and explains tkinter.  I find tkinter a bit of  a pit  myself so I tend to edit scripts to get parameters and file paths into scripts . 

or check out some of these.. http://wiki.python.org/moin/TkInter
 


semidieu posted Fri, 18 July 2008 at 4:31 PM

Also, another important note:

Poser 4 users do not have python
Poser 5 users has python, but a LOT is limited...
Poser 6 users... HAS the DialogFileChooser, at least in the latest update.

I just tried this code:

import poser

dlg =
poser.DialogFileChooser(poser.kDialogFileChooserOpen, None,'')<br></br>
if dlg.Show():<br></br>
 print dlg.Path()

 


bagginsbill posted Mon, 21 July 2008 at 7:45 AM

As Semidieu says, I've found also that these functions were introduced in a Poser 6 SR, so most people have them.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)


jenay posted Tue, 22 July 2008 at 6:10 AM

here is a small test snippet that could do the job:

from Tkinter import *
import tkFileDialog

fn=tkFileDialog.asksaveasfilename()
pz2Out=open(fn,'w')
pz2Out.write("... und aus is ...")
pz2Out.close()