Python Forum
eric6 IDE no output into text file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
eric6 IDE no output into text file
#1
I read in, reformat, and output a text file from the command line, but if I execute the same code in the eric6 IDE it produces an empty output file.

From a complete Python newbie, albeit ex-IT professional
Reply
#2
It would help us to help you if you provided:
  • Code that reproduces the issue
  • The code in code tags
  • The code should be minimal (usually can be just 5-10 lines)
  • Example input if important for running the code
All that said, I'm not familiar with eric6, so it would probably good to give further details on that as well.
Reply
#3
Trying to reduce the code to the minimum has narrowed down the problem. When using eric6, it works if the program is left to run, but as soon as soon as I put in debugging breaks the output file is empty.
As I was familiar with for example Visual Studio, I decided to usee an IDE , and chose ERIC6, which seems to be the recommended one.
def jsonconvert() :
    fw = open('C:\\Users\\Dave Q\\Documents\\test.json', 'w')
    fw.write('Output')
    fw.close

jsonconvert()
Reply
#4
(Mar-22-2019, 09:38 PM)daveq Wrote: and chose ERIC6, which seems to be the recommended one.
That's not right VS Code and PyCharm is editors that much more used in Python.
Python extension has 34,892,370 downloads.
My tutorial VS Code from start,has nothing to with Visual Studio.
Reply
#5
You need to call the close function. So not
fw.close
but rather
fw.close()
Reply
#6
OK, thanks. Works now. Clearly I am still a Python baby!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,046 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,061 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  Modify values in XML file by data from text file (without parsing) Paqqno 2 1,575 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  Converted Pipe Delimited text file to CSV file atomxkai 4 6,840 Feb-11-2022, 12:38 AM
Last Post: atomxkai
  Search text in PDF and output its page number. atomxkai 21 8,670 Jan-21-2022, 06:20 AM
Last Post: snippsat
  Getting a GET request output text into a variable to work with it. LeoT 2 2,883 Feb-24-2021, 02:05 PM
Last Post: LeoT
  Increment text files output and limit contains Kaminsky 1 3,135 Jan-30-2021, 06:58 PM
Last Post: bowlofred
  [split] How to convert the CSV text file into a txt file Pinto94 5 3,247 Dec-23-2020, 08:04 AM
Last Post: ndc85430
  Saving text file with a click: valueerror i/o operation on closed file vizier87 5 4,325 Nov-16-2020, 07:56 AM
Last Post: Gribouillis
  saving data from text file to CSV file in python having delimiter as space K11 1 2,353 Sep-11-2020, 06:28 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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