This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyPDF2 import PdfFileWriter, PdfFileReader | |
import requests | |
from io import BytesIO | |
import os | |
from io import StringIO | |
from WordpresFileUpload.wordpressFile import wordpress_file_up | |
def download_pdf(page_url, page_range): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pre rehnquist: | |
# >psycopg2 | |
# >python version 3.* | |
#> SQLAlchemy | |
# | |
# Outcome: | |
# >using Sqlalchemy create table and call data from database | |
# >Table sync in postgresql | |
from sqlalchemy import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pre rehnquist: | |
# >psycopg2 | |
# >python version 3.* | |
#> SQLAlchemy | |
# | |
# Outcome: | |
# >using Sqlalchemy create table and call data from database | |
# >Table sync in postgresql | |
from sqlalchemy import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pre rehnquist: | |
# >psycopg2 | |
# >python version 3.* | |
#> SQLAlchemy | |
# | |
# Outcome: | |
# >using Sqlalchemy create table and call data from database | |
# >Table sync in postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'giasuddin' | |
import string | |
import random | |
def code_generator(size=6, chars=string.ascii_uppercase + string.digits): | |
""" | |
Generate python short code, We need short code for sms verification, user verification , mail verification, token service | |
:param size: | |
:param chars: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'giasuddin' | |
from subprocess import call | |
call(["ls"]) | |
call(["sudo apt-get update"]) | |
call(["sudo apt-get upgrade"]) | |
call(["dir"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
import PyPDF2 | |
from openpyxl import Workbook | |
def pypd(): | |
pdfFileObj = open('principle of marketing.pdf', 'rb') | |
pdfReader = PyPDF2.PdfFileReader(pdfFileObj) | |
# allpage= pdfReader.numPages | |
pages = range(939, 959) | |
# pages = range(939, 940) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'giasuddin' | |
import os | |
import fnmatch | |
images = ['*.css', '*.jpeg', '*.ico', '*.gif', '*.png'] | |
file_path= '/home/giasuddin/pyramid_sites/test//css' | |
for (dirpath, dirnames, filenames) in os.walk(file_path): | |
for extensions in images: | |
for filename in filenames: | |
if fnmatch.fnmatch(filename, extensions): | |
print(filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'giasuddin' | |
test_html=""" <!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'giasuddin' | |
import hashlib | |
''' | |
some time we need encryption for password or other thin for your software then we can use hashlb and shah512 for encryption. | |
Encryption is needed for security, you have lot of option to encryption your password, i am just giving simple way to encryption password. | |
''' | |
def password_encyption(password): |
NewerOlder