Category Archives: Python

Batch convert PDF to WORD using Python

Scenario: you have 100’s of pdf files which needs to be converted to .docx format Tools required : Python Packages : pip install pdf2docx Keep all pdf files in src folders create a dest folder and all converted docx files will appear here Python Code:

Exporting Anaconda Environment to Another Machine

Scenario : Copy entire environment as it is to another machine Step 1 : Switch to base environment Step 2: Install conda-pack conda install -c conda-forge conda-pack Step 3: conda pack -n envi_name_to_be_cloned -o any_new_name.tar.gz Step 4: Copy the created file any_new_name.tar.gz to new pc Step 5: Extract the new file to a folder .… Read More »

Enabling CUDA Gpu support for TensorFlow

Setup : Windows 10 computer with NVIDIA GPU Anaconda Installed Installing cuda GPU spport for tensorflow Create enivronment conda create -n gpuhaneef python==3.8 activate environment conda activate gpuhaneef install pre requisites conda install cudatoolkit=11.0 cudnn=8.0 -c=conda-forge install tensorflow pip install –upgrade tensorflow-gpu==2.4.1 Test Installation Open python import tensorflow as tftf.test.is_gpu_available() If you want to install… Read More »

Creating Event Certificates in Python

Requirement: Creating a python script which will generate bulk certificates for any event in a specified template and send mail to their email id. Complete Source Code: Features of this script: Uses Excel sheet as database of users – Only Name and Email column is required. Can be used to generate pdf files without sending… Read More »

Google Collab Alternative Jupyterhub run from Home

Scenario : Want to install jupyter notebook from a single machine and can be utilized by more than 50 users at a time. This can be a ideal solution for schools or python lab where students or users can access from anywhere using their own devices. We have a windows 10  machine with Desktop /… Read More »

Convert Python into EXE file

Scenario : We want to convert a python application into standalone windows application.   Required Package :   What is Pyinstaller : PyInstaller bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules. PyInstaller supports Python 2.7 and Python 3.4+,… Read More »

Python – Check TensorFlow Using GPU

To check weather Tensorflow using GPU follow these steps:   from tensorflow.python.client import device_lib print(device_lib.list_local_devices()) If GPU support is not enabled you will see the output as follows If you have GPU support enabled then you will see the output as follows.   Run Below code to assign specific GPU to your code if you… Read More »