I write this code in jupyther with python, to get the files in the folder
import os
path, dirs, files = next(os.walk("/Volumes/Samsung_T5/6182142"))
print(files)
and I get this result
Files in the folder
But I don't understand why this file "._6182142_V1.csv" is displayed to me even though I can't see it in the folder.
Real Folder
Can someone tell me how to view this file in the folder?
Thank you
A file starting with ._ is likely hidden on your OS. If you view the hidden files, you should see it.
Related
I know you can list the files of a directory with:
os.listdir('FOLDER_DIR')
But how do i list the files in a folder that exists in a directory above where i am right now?
For example, consider the following folder structure:
----PARENT
-------sub_dir1
-------sub_dir2
If my python program is in sub_dir2, how can i list the contents of folder sub_dir1, without changing directory?
The answer is os.listdir('../sub_dir1')
I want to extract a ZIP File with the .exe inside.
I want to execute the .exe inside the Zip to extract the Zip File.
Already tried it by executing: ZipDLL::extractall "$EXEDIR" "$DESTINATION"
I think that does not work, cause the .exe is stored in the TEMP Folder when opened, so it cannot find the.Zip file
So how do I extract that Zip when executing the .exe from inside the Zip?
Thanks for answers!
Your question does not make a lot of sense, you should just put the files inside the installer and not have a zip file at all.
Even if it made sense, it is not possible because where a exe is executed from when you double click it inside a zip file depends on the zip program you are using and there is no way of getting the path of the zip it was extracted from.
If for some reason you want to be able to update the files inside the zip file without rebuilding the installer you can use a cab file instead. The CabX plug-in supports extracting from cab files appended to the installer exe.
I try to download a tar.gz file and uncompress it on /tmp/apps.
However i don't want to uncompress it if the directory already exists.
If the file exists or even doesn't exist it is downloaded and uncompressed.
I cant find my code is missing a parameters on my exec block or if I made a mistake somewhere else.
I'm using Puppet 3.8.
Gist file of my puppet
Use the puppet/archive module, https://forge.puppet.com/puppet/archive. It will download the archive, check for existing files and even tidy up after itself.
Right now, whenever I open a file in my python folder, I would have to do this:
f = open("/Users/LazyLinh/PycharmProjects/TimeGenGUI/mass.mas12.txt", "r")
Even though TimeGenGUI is my python folder, and the file mass.mas12.txt does show up under my project files. Is there a way I can always address this file as part of my python folder or find the full directory of this file, as the full directory can change if I change the folder's location?
Thank you!
Oh thanks to #zondo's recommendation, I've figured out the problem. My __init__.py is in a package under TimeGenGUI, so as soon as I put the file into the folder for this package instead of parent folder TimeGenGUI, I can use open("mass.mas12.txt", "r")!
Im new to Nsis so pardon me if my problem is easly solveable.
I wanted to make an exe from my freshly zipped Xampp folder (it is a webserver software).
When i zipped this with total commander every folder was at the right place.
But when i run the Zip2Exe nsis application wouldn't compress into the exe my "log" named folders EVEN if they aren't empty.
Any help would greatly appriciated.
Solution:
I had to revoke the Read only permission on the folders