pty

ser.inWaiting() always returns 0 when reading a virtual port

孤者浪人 提交于 2020-01-06 02:22:46
问题 I'm having difficulties getting pyserial to play nicely with a virtual port . I know this is an area which a few others have written about, but I couldn't find anything which solved my problem in those answers. Forgive me if I'm just being dense, and the solution exists ready-made elsewhere. This is what I'm trying to achieve: I want to set up a virtual port, to which I can write data in one .py file, and from which I can then read data in another .py file. This is for the purposes of

ser.inWaiting() always returns 0 when reading a virtual port

雨燕双飞 提交于 2020-01-06 02:22:05
问题 I'm having difficulties getting pyserial to play nicely with a virtual port . I know this is an area which a few others have written about, but I couldn't find anything which solved my problem in those answers. Forgive me if I'm just being dense, and the solution exists ready-made elsewhere. This is what I'm trying to achieve: I want to set up a virtual port, to which I can write data in one .py file, and from which I can then read data in another .py file. This is for the purposes of

Perl SFTP password authentication issues using Net::SFTP::Foreign. Pyt error. permission deny

点点圈 提交于 2020-01-02 21:02:54
问题 I'm using Net::FTP::Foreign with password authentication. and I get error about pty and permission error. firstly, cannot connect to pty slave. secondly, Foreign seems not use password authentication mode. IO:Pty is installed. the machine is solaris. Code: my %args = (password => 'pwd', user => 'usr', port => 22, more => '-v'); log->info("Starting SFTP...\n"); my $sftp = Net::SFTP::Foreign->new($O->{sftp_server}, %args); is there any wrong with my script or any configuration issue on my

node-gyp error while doing npm install

霸气de小男生 提交于 2019-12-30 02:08:23
问题 I am doing npm install from a project and I am getting this wierd error in node-gyp. > pty.js@0.2.3 install /home/charizard/Open/terminal-codelearn/node_modules/pty.js > node-gyp rebuild npm http GET https://registry.npmjs.org/commander npm http GET https://registry.npmjs.org/nan npm http GET https://registry.npmjs.org/tinycolor npm http GET https://registry.npmjs.org/options gyp ERR! configure error gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag

sshpass throwing error 'Failed to get a pseudo terminal: Success'

三世轮回 提交于 2019-12-25 01:44:16
问题 I am trying to run the sshpass tool to automate an sftp action. On another server, the command works, but on this server it just returns one line of error mesage. Here is the command I am using: sshpass -p Password sftp Uname@Host And I get the error: Failed to get a pseudo terminal: Success I've tried it with lots of different hosts and as the root user, and I can sftp in without a problem so I am pretty sure it is either a sshpass or pseudo terminal issue. I don't know a whole lot about

Pass sudo password prompt to stdout of spawned process in Node.js

孤街醉人 提交于 2019-12-24 17:56:08
问题 I have built a GUI with Node.js that allows a user to run custom binaries, designed for CLI. These binaries are spawned with child_process module. A user is able to write to stdin and read from stdout of those child processes. Yet, when a binary uses sudo command, a password prompt bypass stdout and is headed for (pseudo-)terminal device, therefore I can't catch it programmatically and ask user for a password with a fancy GUI notification. I am aware, that -S argument allows sudo to expect

How do I obtain the output from a program that uses screen redrawing for use in a terminal screen scraper?

笑着哭i 提交于 2019-12-24 03:23:46
问题 I am trying to obtain the output of a full-screen terminal program that uses redrawing escape codes to present data, and which requires a tty (or pty ) to run. The basic procedure a human would follow is: Start the program in a terminal. The program uses redrawing to display and update various fields of data. The human waits until the display is consistent (possibly using cues such as "it's not flickering" or "it's been 0.5s since the last update"). The human looks at the fields in certain

How to switch terminal to new child process of process launched with NSTask?

☆樱花仙子☆ 提交于 2019-12-23 03:37:32
问题 I made a pseudo terminal with method described here: http://lists.apple.com/archives/student-dev/2005/Mar/msg00019.html The terminal itself worked well. Anyway the problem is terminal cannot being switched to child process. For an example, I launched bash with NSTask , and if I execute ftp within the bash , it stops automatically. ftp ftp ftp> [1]+ Stopped ftp bash-3.2$ And if I try to continue the ftp with fg , it terminates quietly. (I checked this with Activity Monitor ) fg fg ftp bash-3.2

Python os.forkpty why can't I make it work

大城市里の小女人 提交于 2019-12-21 06:19:33
问题 import pty import os import sys import time pid, fd = os.forkpty() if pid == 0: # Slave os.execlp("su","su","MYUSERNAME","-c","id") # Master print os.read(fd, 1000) os.write(fd,"MYPASSWORD\n") time.sleep(1) print os.read(fd, 1000) os.waitpid(pid,0) print "Why have I not seen any output from id?" 回答1: You are sleeping for too long. Your best bet is to start reading as soon as you can one byte at a time. #!/usr/bin/env python import os import sys pid, fd = os.forkpty() if pid == 0: # child os

Can you fool isatty AND log stdout and stderr separately?

久未见 提交于 2019-12-20 09:47:59
问题 Problem So you want to log the stdout and stderr (separately) of a process or subprocess, without the output being different from what you'd see in the terminal if you weren't logging anything. Seems pretty simple no? Well unfortunately, it appears that it may not be possible to write a general solution for this problem, that works on any given process... Background Pipe redirection is one method to separate stdout and stderr, allowing you to log them individually. Unfortunately, if you