Python Forum
How to send output to stout?
Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to send output to stout?
#2
Hey natv,

From what I can read in the docs, you should specify a logfile after spawning your leviathan6 program.

Something like
p.logchild = open('/tmp/leviathan6-log', 'w') #you could name it whatever you want
Regarding sending that program's standard output to the terminal where you're running pexpect, maybe this could work:

import sys

#Your code here including the spawn call

p.logchild = sys.stdout
I'm just talking out loud, sort of speak, here. Haven't tested any of this, but maybe this can get you going a bit further.

PS: is that from the overthewire challenges?

Cheers!
Reply


Messages In This Thread
How to send output to stout? - by natv - Sep-28-2016, 11:31 AM
RE: How to send output to stout? - by Crimson King - Sep-28-2016, 01:01 PM
RE: How to send output to stout? - by natv - Sep-28-2016, 01:59 PM
RE: How to send output to stout? - by sparkz_alot - Sep-28-2016, 01:05 PM
RE: How to send output to stout? - by Larz60+ - Sep-28-2016, 06:48 PM
RE: How to send output to stout? - by micseydel - Sep-28-2016, 06:53 PM
RE: How to send output to stout? - by Larz60+ - Sep-29-2016, 10:32 AM
RE: How to send output to stout? - by natv - Sep-29-2016, 01:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Send The output of Gyroscope sensor to node red jenkins43 1 2,139 Feb-07-2019, 11:00 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020