Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 120241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:46:48+00:00 2026-05-11T03:46:48+00:00

I’m trying something like this Output.py print Hello Input.py greeting = raw_input(Give me the

  • 0

I’m trying something like this

Output.py

print 'Hello' 

Input.py

greeting = raw_input('Give me the greeting. ') print 'The greeting is:', greeting 

At the cmd line

Output.py | Input.py 

But it returns an EOFError. Can someone tell me what I am doing wrong?

Thanks for your help.

EDIT
Patrick Harrington solution works but I don’t know why…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T03:46:49+00:00Added an answer on May 11, 2026 at 3:46 am

    I tested this on my Windows machine and it works if you specify the Python exe:

    C:\>C:\Python25\python.exe output.py | C:\Python25\python.exe input.py Give me the greeting. The greeting is: hello 

    But I get an EOFError also if running the commands directly as:

    output.py | input.py  

    I’m not sure exactly why that is, I’m still looking into this one but at least this should provide you with a workaround for now. It may have something to do with the way the file handler is invoked for .py files.

    UPDATE: well, what do you know. Looks like this is actually a bug in Windows where stdin/stdout redirection may not work properly when started from a file association. So the workaround is as noted by myself and Patrick, you need to specify ‘python’ will be running input.py, otherwise it will not redirect stdout from output.py to the stdin for input.py correctly.

    Reference:

    http://mail.python.org/pipermail/python-bugs-list/2004-August/024923.html

    http://support.microsoft.com/default.aspx?kbid=321788

    UPDATE 2:

    To change this behavior and make Windows pipes work as expected for stdin/stdout redirection, you can add this value to the registry (tested on my box and verified this works as desired).

    1. Start Registry Editor.
    2. Locate and then click the following key in the registry:

      HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    3. On the Edit menu, click Add Value, and then add the following registry value:

      Value name: InheritConsoleHandles
      Data type: REG_DWORD
      Radix: Decimal
      Value data: 1

    4. Quit Registry Editor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.