Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Pause a script and wait for user input

mThomas (Instructor) (OP)
21 Feb 03 16:53
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
jmpurser (Programmer)
5 Mar 03 6:42
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
mThomas (Instructor) (OP)
5 Mar 03 12:16
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
sebsauvage (Programmer)
6 Mar 03 8:06
Thank you for sharing the solution.
mThomas (Instructor) (OP)
6 Mar 03 11:56
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

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close