Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how do i create a file in specific folder in python

import os

filepath = os.path.join('c:/your/full/path', 'filename')
if not os.path.exists('c:/your/full/path'):
    os.makedirs('c:/your/full/path')
f = open(filepath, "a")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #file #specific #folder #python
ADD COMMENT
Topic
Name
1+8 =