Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause a script and wait for user input

Status
Not open for further replies.

mThomas

Instructor
May 3, 2001
404
US
Paint Shop Pro version 8 is out. They have a recorder that records steps and uses Python to record the steps. I'm wondering if there is a way to pause a script and wait for a user to press a key to continue.

mike
 
Mike,

From the Python Library reference:
raw_input([prompt])
If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised. Example:

>>> s = raw_input('--> ')
--> Monty Python's Flying Circus
>>> s
"Monty Python's Flying Circus"


If the readline module was loaded, then raw_input() will use it to provide elaborate line editing and history features.

Good Luck.

John Purser
 
Thank you for your reply. I have found a solution. I did look into raw_input, but couldn't get it to work.

What I wanted to do was ask for user input and then pass it on to a variable, or at least pause. Here is what I got to work.

Thanks for taking the time to respond.

mike

Result = App.Do( Environment, 'GetString', {
'DefaultText': DefaultCaption,
'DialogTitle': 'Text on a Path Generator',
'Prompt': 'Enter your text.',
'MaxLength': 40,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive,
'AutoActionMode': App.Constants.AutoActionMode.Default
}
})
if Result[ 'OKButton' ] == App.Constants.Boolean.false:
return
 
Hi Sebsauvage,

Now that Paint Shop Pro has introduced Python scripting to the program I'll be posting in this forum more often. I know perl to some extent, well... I use it every work day, but still have a lot to learn.

Python seems cool. I wrote a script for Paint Shop Pro version 8 now out in Beta, that dynamically creates a vector shape and applies text to the path based on user input. It is so cool.

I write a lot of tutorials and author articles and books on Paint Shop Pro and am looking forward to lots more fun with Python and PSP.

mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top