Updating/Replacing file in a zip folder with a python script - python

I need to replace/update an excel file which is in a zip folder but I dont want to unzip it before. Is there any way to do it without unzipping it?
Because the folder contains a tableau dashboard which is going to crash after unzipping and zipping it again.

Related

How to take the csv files from an automatically creating folders using python

a folder is creating automatically by running a function and in that folders csv files are creating. How to take the csv files from that folders using python

pyexcel : Save in downloads folder the xls file exported

I'm new with pyexcel, i'm programing in django and python and i export an array with the folowing code
pyexcel.isave_as(array=array_of_data, dest_file_name=('%(name)s.xls') % {'name':model.name})
my problem is the file is exported and save it but, i dont want to save it in the program folder, i want to select that the .xls is downloaded in the downloads folder

Jupyter Notebook/Pandas not reading excel file after moving ipynb

I'm working on automating some reporting for work which starts off with a pd.read_excel method. It worked fine and I moved on with the rest of my code. When I was done, I had a few ipynb files on my desktop and moved them into a folder called "Python". After doing so, I'm getting a "No such file or directory" error when rerunning the code. The file is in a folder called "Reporting". I can leave them on the desktop for now, but typically have everything organized in folders to avoid clutter. What do I need to do to get my code to continue read in the excel files?
RawData=pd.read_excel("Reporting/LS_Questions.xlsx",skiprows=2)
Try using an absolute path rather than a relative path.
Right now your path assumes that the file is within the same directory as the notebook.
you can either:
use a full path a.i - "C:\User{user_name}\Desktop\LS_Questions.xlsx"
Move the CSV/XL file to the directory of the notebook.

How to download folders from a huge tar.gz file?

I have a URL which is a download link http://vis-www.cs.umass.edu/lfw/lfw.tgz
It is a huge file with multiple folders tar into one tgz file.
I want to download the file in chunks and want to trigger some event when one folder gets downloaded.
I am using Python's requests library to download the file, I know how to download the file in the chunks but is there any way to download folder by folder and trigger some event when the file is downloaded?
I am okay if I have to use some Linux utility, I can execute the command using subprocess but is there a way to do it ?

shutil.rmtree(dest,ignore_errors=True) deletes other files but not .log and .tresoslog file?

I am using a python command shutil.rmtree(dest,ignore_errors=True) to remove files from .metadata folder which was generated when eclipse is launched.
This .metadata folder has .log file, .lock file and a folder which has plugins.
When I use this command to delete files inside this .metadata folder .log file and plugins folder gets deleted but not .lock folder. It throws an error saying that the process can't be accessed since it is used by another process.
Is there a way I can delete this lock file using python command or by using a batch script?

Categories

Resources