Skip to main content

Windows alternative of pexpect rebuild by uv

Project description

wexpect

I fork it from : raczben/wexpect

And it is rebuild by uv, for branch dev.

Description

Wexpect is a Windows variant of pexpect.

  • v0.0.1: fix the Always Timeout && failed in uv
  • v0.0.2: fix cannot read console if endwith '\r' print("",end="\r"). .
  • v0.0.3: change the catch logic(catch all even cursor not change) and catch ascii colors.

Installation

pip install wexpect-uv

Usage

import wexpect

prompt = '[A-Z]\:.+>'

child = wexpect.spawn('cmd.exe')
child.expect(prompt)    # Wait for startup prompt

child.sendline('dir')   # List the current directory
child.expect(prompt)

print(child.before)     # Print the list
child.sendline('exit')

For more information see examples folder.

How to test and develop locally

You need uv, see installation.

Then,

git clone https://github.com/XnneHangLab/wexpect-uv.git
uv lock
uv sync

Then you can use uv run wexpect to use it in command line or import wexpect in python. You can modify the code and test then PR to me if you want.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wexpect_uv-0.0.3.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wexpect_uv-0.0.3-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file wexpect_uv-0.0.3.tar.gz.

File metadata

  • Download URL: wexpect_uv-0.0.3.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.17

File hashes

Hashes for wexpect_uv-0.0.3.tar.gz
Algorithm Hash digest
SHA256 33c7e7cc39879b95432262ebfe7a9fabfe54b3ce29928f43a6defa017b1329de
MD5 11b25a3b1eb96cc779fb011c42628a29
BLAKE2b-256 c0bb599c9689157ece04859eeea61e9d12c5fc934e5b79e05cc8f6ffd49370a5

See more details on using hashes here.

File details

Details for the file wexpect_uv-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: wexpect_uv-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.17

File hashes

Hashes for wexpect_uv-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1aef06508d202bd683375ff723325f69e97658034cb586812f07304d577933dd
MD5 712c3f797adb7d1b6841b4346b5721d6
BLAKE2b-256 ccb6a5128f3d546bdf052f3d69a473ac21dd34fc9eeb1d9b8dfaba9ecbd21b9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page