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 8104617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:54:07+00:00 2026-06-05T23:54:07+00:00

To reproduce problem: In the PyScripter editor, write: outf = open(‘output.txt’, ‘w’) outf.write(‘hello, world!’)

  • 0

To reproduce problem:

In the PyScripter editor, write:

outf = open('output.txt', 'w')
outf.write('hello, world!')

Result:

For me at least, here is what happens, when output.txt does not already exist.

  1. output.txt is created
  2. output.txt will contain no data or text at all when opened by any text editor.

So my question is, how do I make this work?

Other information:

I am using PyScripter 2.5.3.0 x64, with Python 2.7.3, 64 bit as the interpreter.

Printing to the console works fine, all other functions and code work fine.

When I use python in Command Prompt, I can write to output files fine. My problem is only in PyScripter.

Thanks,
DS

  • 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. Editorial Team
    Editorial Team
    2026-06-05T23:54:09+00:00Added an answer on June 5, 2026 at 11:54 pm

    The question was already resolved in comments, but I will post a complete answer regardless.

    Writes to files may be delayed. To make sure they aren’t, force a flush by closing the file:

    outf.close()
    

    If you don’t want to explicitly call close, try using with ... as:

    with open('output.txt', 'w') as outf:
        outf.write('hello, world!')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code to reproduce the problem: sub hello { return (h =>
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
I found a strange ToolStripButton double click problem. These steps will reproduce the problem:
Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
I will explain how to reproduce my problem: Log into my page: session variables
I've run into a problem where the open function never returns when I try
EDIT: Firefox 2 windows XP Steps to reproduce problem: Firefox 2 and visit: http://resopollution.com/rentfox/html/property_setup.html
Trying to reproduce the problem from this question , I've found I can't plot
It's easy to reproduce this problem using a simple html fragment (save as test.html):
I've created solution to reproduce a problem that I'm having with MVVM-Light EventToCommand vs

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.