Python Forum
Can read files in command prompt but not IDE
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can read files in command prompt but not IDE
#1
Why does writing files work in both the command prompt and PyCharm (IDE)...

a = open("workfile.txt", "w")

a.close()
but reading them only works in the command prompt?

a = open("workfile.txt", "r")

a.read()

a.close()
Reply


Messages In This Thread
Can read files in command prompt but not IDE - by Exsul - Sep-12-2019, 11:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy and Paste Files - Command MicheliBarcello 2 134 Yesterday, 05:04 AM
Last Post: rodiongork
  What is the difference between Command Prompt and Sublimes yaoyao22 1 763 Jul-09-2023, 02:56 PM
Last Post: snippsat
  How to read in mulitple files efficiently garynewport 3 1,015 Jan-27-2023, 10:44 AM
Last Post: DeaD_EyE
  Read directory listing of files and parse out the highest number? cubangt 5 2,655 Sep-28-2022, 10:15 PM
Last Post: Larz60+
  Python code to read second line from CSV files and create a master CSV file sh1704 1 2,560 Feb-13-2022, 07:13 PM
Last Post: menator01
  Facing Problem while opening a file through command prompt vlearner 4 2,126 Jan-30-2022, 08:10 AM
Last Post: snippsat
  Open and read multiple text files and match words kozaizsvemira 3 6,942 Jul-07-2021, 11:27 AM
Last Post: Larz60+
  Noob warning: trying to use pip to install pytest and pep8 in Command Prompt adifrank 4 5,618 Dec-20-2020, 04:23 AM
Last Post: adifrank
  code to read files in folders and transfer the file name, type, date created to excel Divya577 0 1,952 Dec-06-2020, 04:14 PM
Last Post: Divya577
  Running Python in Command Prompt Anwar 3 3,278 Nov-15-2020, 03:15 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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