Python Forum
Creating a file with variable name but distinct extension
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a file with variable name but distinct extension
#1
Hello everybody,
for my current homework i need to create an amount of *.csv files, however the filename must be taken from a list that is provided as a *.txt-document .
i succesfully wrote a code that takes the right string out of the provided *txt, i fail to write the code correctly so it adds the file extension. Angry


right now it looks like this

"with open(namefromtxt,".csv","w")as csv:"

thanks in advance from germany

Moeniac
Reply


Messages In This Thread
Creating a file with variable name but distinct extension - by Moeniac - Nov-27-2017, 05:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating/Moving file DeadlyKnight 3 1,546 Mar-25-2022, 06:25 PM
Last Post: ibreeden
  creating dict out of CSV file without the headers ranbarr 6 2,697 May-09-2021, 08:26 PM
Last Post: ranbarr
  Creating Disassembler for a bin file(total beginner) SoulsKeeper 1 2,481 Sep-04-2018, 04:15 PM
Last Post: Larz60+
  Creating a variable that displays time groovydingo 3 2,952 Apr-17-2018, 04:46 AM
Last Post: tannishpage

Forum Jump:

User Panel Messages

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