Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating file from editor
#7
Thank you, this finally works
baconFile = open('C:\\Python36\\kodovi\\bacon.txt', 'w')

with open('bacon.txt', 'w') as f:
    f.write('hello world')
 
with open('bacon.txt') as f:
    print(f.read())

with open('bacon.txt', 'w') as f:
	f.write('Bacon is not a vegetable.')
with open('bacon.txt') as f:
	print(f.read())
Reply


Messages In This Thread
Creating file from editor - by Truman - May-19-2018, 09:09 PM
RE: Creating file from editor - by snippsat - May-19-2018, 09:39 PM
RE: Creating file from editor - by volcano63 - May-19-2018, 09:39 PM
RE: Creating file from editor - by Truman - May-19-2018, 10:01 PM
RE: Creating file from editor - by volcano63 - May-19-2018, 10:09 PM
RE: Creating file from editor - by snippsat - May-19-2018, 10:17 PM
RE: Creating file from editor - by Truman - May-19-2018, 10:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help creating shell scrip for python file marciokoko 10 1,457 Sep-16-2023, 09:46 PM
Last Post: snippsat
  Creating csv files from Excel file azizrasul 40 5,984 Nov-03-2022, 08:33 PM
Last Post: azizrasul
  Creating file with images BobSmoss 1 1,426 Jan-08-2022, 08:46 PM
Last Post: snippsat
  Music Notation editor; how to build the editor? direction to go? philipbergwerf 1 1,738 Jan-01-2022, 04:56 PM
Last Post: Larz60+
  Creating csv file from another file pisike 0 1,628 Nov-24-2020, 02:02 PM
Last Post: pisike
  Creating Conda env from requirments.txt file ErnestTBass 7 15,945 Apr-23-2020, 06:57 PM
Last Post: snippsat
  Creating a pdf from file DT2000 4 2,370 Apr-03-2020, 07:16 PM
Last Post: DT2000
  Internal Server Error 500 on creating .py file patrickluethi 0 1,787 Aug-02-2019, 01:57 PM
Last Post: patrickluethi
  python script file not opening in IDLE editor srm 2 4,429 Jun-23-2019, 08:45 AM
Last Post: Larz60+
  Creating Dictionary form LOG /text file DG1234 7 5,568 Feb-13-2019, 08:08 PM
Last Post: DG1234

Forum Jump:

User Panel Messages

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