Sponsored Content
Top Forums Shell Programming and Scripting Python: Redirecting to tty and reading from tty Post 303017472 by wisecracker on Wednesday 16th of May 2018 01:07:28 PM
Old 05-16-2018
Hi...

I am missing something, why do you need a python script to be piped into python?
You are already calling python in your shebang...
Longhand OSX 10.13.4, default bash terminal.
Code:
Last login: Wed May 16 17:56:35 on ttys000
AMIGA:barrywalker~> cd Desktop/Code/Python
AMIGA:barrywalker~/Desktop/Code/Python> chmod 755 test.py
AMIGA:barrywalker~/Desktop/Code/Python> cat test.py
#!/usr/bin/python
import sys
print("This is a test line.")
text = raw_input("Enter your name: ")
print(text)
sys.exit()
AMIGA:barrywalker~/Desktop/Code/Python> ./test.py
This is a test line.
Enter your name: My name is Bazza...
My name is Bazza...
AMIGA:barrywalker~/Desktop/Code/Python> _

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help on processes not associated with a TTY

Hi all ^_^ Okay, here's the problem: There's an IBM RS6000 server running AIX 4.3 with Informix database in my workplace. During peak hours, it has about 350 users doing mostly database operations. It has been set up that those users can only log-in the system at one terminal at a time. Due... (3 Replies)
Discussion started by: bluefactory
3 Replies

2. Programming

TTY programming

Hi gurus, Need help to code some tools dealing with all the tty thingies, raw mode etc .... Can you juss point me to some cool links related to tty programming, i've tried google but found none so far :confused: Thanks all. (2 Replies)
Discussion started by: andryk
2 Replies

3. UNIX for Dummies Questions & Answers

tty problem

Dear all, when I do a remote shell command from a FUJITSU Unix to an HP-UX, I always get this: 15:36:35 + rsh -l storto obs2 sh /users/obs/storto/MESO-NH/tmp_olive_map_00CC/job_prepex_70JY_C00CC_20041103_19 Not a terminal stty: : Erreur inconnue stty: : Erreur inconnue... (0 Replies)
Discussion started by: stortignauz
0 Replies

4. UNIX for Dummies Questions & Answers

tty remote IP

I am fairly new to Unix Terminal outputs and I have a server that is sending print jobs to a PortServer 8 RJ45 situated in a remote location. It is working fine however we need to change the Subnet of that location and I am unable to find where the IP associated with the terminal is located. ... (4 Replies)
Discussion started by: martin_Montreal
4 Replies

5. AIX

tty

Hi All can anyone tell me what is the meaning of tty,or give me an example of this? (1 Reply)
Discussion started by: magasem
1 Replies

6. UNIX for Dummies Questions & Answers

pts and tty

hi iam very new to linux can anyone tell me about pts and tty acctually today morning i logged into my pc at 9:51 when i have given #who it has given sam tty7 9:51 sam pts/1 10:11 so what does it mean (1 Reply)
Discussion started by: praneel2k
1 Replies

7. UNIX for Dummies Questions & Answers

What does this TTY info mean?

When I do a who command I get the following: mohit :0 2009-04-07 14:07 mohit pts/0 2009-04-07 17:25 (:0.0) mohit pts/1 2009-04-09 12:07 (:0.0) mohit pts/2 2009-04-16 11:38 (:0.0) mohit pts/3 2009-04-16 16:09 (:0.0) mohit pts/4 ... (1 Reply)
Discussion started by: mojoman
1 Replies

8. UNIX for Dummies Questions & Answers

TTY Insane

Hi All, Long time reader, first time poster. I have a tip session to a v480 serial console running Solaris 9. Look at this mess I'm getting back... connected... (16 Replies)
Discussion started by: danny.hudson
16 Replies

9. UNIX for Advanced & Expert Users

tty changes?

I am not sure if I am using the correct terminology but somehow my tty keeps changing on me. The man pages are confusing to me on what exactly the tty is. This is what I see when I run the tty command. Could anyone explain why my tty keeps changing? ~ $ tty /dev/pts/1 ~ $ tty /dev/pts/0 (6 Replies)
Discussion started by: cokedude
6 Replies

10. UNIX for Dummies Questions & Answers

Reading password from /dev/tty

hi, From the below script: ##########################################pwd_auth.sh######################################################################################## #Author: Pandeeswaran Bhoopathy #Written on:26th Jan 2012 2:00PM #This script describes the feature of stty and illustrates... (3 Replies)
Discussion started by: pandeesh
3 Replies
tapset::tty(3stap)														tapset::tty(3stap)

NAME
tapset::tty - systemtap tty tapset DESCRIPTION
tty.open Called when a tty is opened See probe::tty.open(3stap) for details. tty.release Called when the tty is closed See probe::tty.release(3stap) for details. tty.resize Called when a terminal resize happens See probe::tty.resize(3stap) for details. tty.ioctl called when a ioctl is request to the tty See probe::tty.ioctl(3stap) for details. tty.init Called when a tty is being initalized See probe::tty.init(3stap) for details. tty.register Called when a tty device is registred See probe::tty.register(3stap) for details. tty.unregister Called when a tty device is being unregistered See probe::tty.unregister(3stap) for details. tty.poll Called when a tty device is being polled See probe::tty.poll(3stap) for details. tty.receive called when a tty receives a message See probe::tty.receive(3stap) for details. tty.write write to the tty line See probe::tty.write(3stap) for details. tty.read called when a tty line will be read See probe::tty.read(3stap) for details. SEE ALSO
probe::tty.open(3stap), probe::tty.release(3stap), probe::tty.resize(3stap), probe::tty.ioctl(3stap), probe::tty.init(3stap), probe::tty.register(3stap), probe::tty.unregister(3stap), probe::tty.poll(3stap), probe::tty.receive(3stap), probe::tty.write(3stap), probe::tty.read(3stap), stap(1), stapprobes(3stap) IBM
--- tapset::tty(3stap)
All times are GMT -4. The time now is 05:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy