The Calendar module is built into Python 3. But for some reason it is installed by default.
We can install it to
- Windows Administrator using :
pip install calendar
sudo pip install calendar
import calendar
The Calendar module is built into Python 3. But for some reason it is installed by default.
We can install it to
- Windows Administrator using :
pip install calendar
sudo pip install calendar
import calendar
To achieve what we want which is text extraction first of all we need to have the python package called PyPDF.
Open your terminal as administrator and type the command below.
pip install PyPDF2
import PyPDF2 pdfFileObject = open('mynote.pdf', 'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObject) print("Number of pages in the pdf : ",pdfReader.numPages) print() print("******************") pageObject = pdfReader.getPage(0) print(pageObject.extractText()) pdfFileObject.close()
pdfFileObject = open('mynote.pdf', 'rb')
pdfReader=PyPDF2.PdfFileReader(pdfFileObject)
print("Number of pages in the pdf : ",pdfReader.numPages)
pageObject = pdfReader.getPage(0)
print(pageObject.extractText())
pdfFileObject.close()
This is the python code to zip a file:
import zipfile zip_file = zipfile.ZipFile('temp.zip','w') zip_file.write('test.txt',compress_type=zipfile.ZIP_DEFLATED) zip_file.close()
import shutil try: shutil.make_archive('new','zip','test') except Exception as e: print(e) else: print('Zipping Done')
Assoc - it displays a full list of file name extensions and program associations.
you can a get a view all the file associations your computer knows about.
- the above is to get associate information about the .py file extension.
Cipher - it can be used to encrypt or decrypt data on NTFS drives.
this tool also lets to securely delete data by overwriting it.
Driverquery - it displays all the drivers installed on your computer.
you'll be seeing a list of all the drivers along with their name, type, and other information.
fc - this can be used to identify differences in text between two files.
Powercfg /? - allows the user to view and modify the power plans and settings.
Systeminfo - detail configuration overview of your computer will be displayed.
ex : it shows information about OS configuration, security information, product id and hardware properties.
sfc /scannow - to run this command first you should launch CMD as an administrator.
entering this command will check the integrity of all protected files.
if a problem is found files will be repaired with backup system files.
schtasks - enables an administrator to create, delete, query, change, run and end scheduled tasks.
chkdsk - to run this command first you should launch CMD as an administrator.
can be used to scan an entire disk.
attrib - used to display or change the file attributes for a file or folder.
robocopy - to make copies of files and folder.
· Assume we have the two points: 1. (X1 , Y1)
The Calendar module is built into Python 3. But for some reason it is installed by default. We can install it to - Windows Administrator u...