Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pydrive upload file to folder

folderName = '###'  # Please set the folder name.

folders = drive.ListFile(
    {'q': "title='" + folderName + "' and mimeType='application/vnd.google-apps.folder' and trashed=false"}).GetList()
for folder in folders:
    if folder['title'] == folderName:
        file2 = drive.CreateFile({'parents': [{'id': folder['id']}]})
        file2.SetContentFile('new_test.csv')
        file2.Upload()
Comment

pydrive upload file to folder

file2 = drive.CreateFile({'parents': [{'id': '### folder ID ###'}]})
Comment

PREVIOUS NEXT
Code Example
Python :: how to convert dataframe to text 
Python :: change django administration text 
Python :: pd.read_csv 
Python :: slice notation python 
Python :: make an android app with python 
Python :: print first word of a string python and return it 
Python :: unique list values python ordered 
Python :: Compute the 2d histogram of x and y. 
Python :: django admin override save 
Python :: python random number guessing game 
Python :: python while true loop 
Python :: if substring not in string python 
Python :: default orange and blue matplotlib 
Python :: plt text matplotlib white background 
Python :: Write a program that prints #pythoniscool, followed by a new line, in the standard output. Your program should be maximum 2 lines long You are not allowed to use print or eval or open or import sys in your file 
Python :: python keyboard key codes 
Python :: integer xticks 
Python :: python put console window on top 
Python :: buttons on canvas tkinter 
Python :: converting numpy array to dataframe 
Python :: how to merge two pandas dataframes on a column 
Python :: the python libraries to master for machine learning 
Python :: python dataclass 
Python :: python simple web app 
Python :: import system in python 
Python :: zip multiple lists 
Python :: find all indices of element in string python 
Python :: Upper letter list 
Python :: click a button using selenium python 
Python :: making a return from your views 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =