Relative Content

Tag Archive for pythonfile

What is the fastest solution to remove lines from a text file?

In my project, I need to develop a program in Python to insert a UUID in a device. There will be 1.000 devices produced per day, the UUIDs need to be inserted into each device, and only once. I have a large input file (100.000 lines) containing all the available UUIDs, as follows:

Python : what is the fastest solution to remove lines from a text file

In my project, I need to develop a program in Python to insert a UUID in a device. There will be 1.000 devices produced per day, the UUIDs need to be inserted into each device, and only once. I have a large input file (100.000 lines) containing all the available UUIDs, as follows :

I am stuck on this two assignments of python working with files

A. Create a Python program that initially generates three files named “Vito Corleone.txt”, “Michael Corleone.txt”, and “Apollonia Vitelli-Corleone.txt” in a user-specified directory. Following file creation, the program enables the user to search for files in this directory based on criteria specified by the user, using either string matches or regular expressions.
B. Develop a Python program that monitors a specified directory for new or updated files. Upon detecting changes, it prompts the user to enter a search pattern and choose between string methods or regex for searching. The program then checks the modified or new files against the search criteria.
Hint: The program lists full paths of files matching the search criteria.