Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.6 doesn't support UR prefix #92

Closed
padremayi opened this issue Feb 9, 2018 · 1 comment
Closed

Python 3.6 doesn't support UR prefix #92

padremayi opened this issue Feb 9, 2018 · 1 comment

Comments

@padremayi
Copy link

padremayi commented Feb 9, 2018

The example in the main page is incorrect:

# Low level usage using the raw `PTY` object
from winpty import PTY

# Start a new winpty-agent process of size (cols, rows)
cols, rows = 80, 25
process = PTY(cols, rows)

# Spawn a new console process, e.g., CMD
process.spawn(ur'C:\windows\system32\cmd.exe')

because Python 3.6 doesn't support UR prefix. You have to pass it as a string:
process.spawn('C:\windows\system32\cmd.exe')

For Command Prompt if you use / instead of \ in the process.spawn() it doesn't work.

Is there a way to pass complicated command using PTY instead of PtyProcess?

Thanks

@andfoy
Copy link
Owner

andfoy commented Jun 8, 2018

@padremayi Sorry for such late response to your question. Python 3 supports unicode strings by default, so you just need to declare them using the r prefix.

@andfoy andfoy closed this as completed Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants