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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
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
import os, os.path | |
def extendedFileSearch(requiredFile): | |
filePaths = [] | |
for file in os.listdir(): | |
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
import os | |
def searchFile(requiredFile): | |
if requiredFile in os.listdir(): | |
return True | |
else: |
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
import sounddevice as sound | |
from scipy.io.wavfile import write | |
duration = 5 | |
sampleRate = 4100 | |
sound.default.samplerate = sampleRate | |
sound.default.channels = 2 |
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
spamMessage = {'million': 156, 'dollars': 29, 'adclick': 51, 'conferences': 2} | |
hamMessage = {'million': 98, 'dollars': 119, 'adclick': 1, 'conferences': 12} | |
spamWordCount = 95791 | |
hamWordCount = 306438 | |
probabilitySpam = 0.00 | |
probabilityHam = 0.00 | |
def likelihood(word): |
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 PdfFileReader | |
fileName = '' #Enter the name of pdf file here | |
with open(fileName + '.pdf', 'rb') as pdf: | |
pdfReader = PdfFileReader(pdf) | |
totalPages = pdfReader.numPages |
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 PdfFileReader | |
with open('Sommerville-Software-Engineering-10ed.pdf', 'rb') as pdf: | |
pdfReader = PdfFileReader(pdf) | |
page = pdfReader.getPage(0) | |
pageText = page.extractText() |
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 gtts import gTTS | |
import os | |
with open('message.txt') as file: | |
message = file.read() | |
output = gTTS(text = message, lang = 'hi', slow = False) | |
output.save('messageFromFile.mp3') |
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 gtts import gTTS | |
import os | |
message = 'Hello Asad!' | |
output = gTTS(text = message, lang= 'en', slow = False) | |
output.save('sayHello.mp3') | |
os.system('start sayHello.mp3') |
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
import requests | |
import time | |
imageUrls = ['https://images.unsplash.com/photo-1558981396-5fcf84bdf14d', | |
'https://images.unsplash.com/photo-1583314059352-663691cfa23f', | |
'https://images.unsplash.com/photo-1583314238585-21664bba94ab', | |
'https://images.unsplash.com/photo-1583317094917-8aac805fed5a' , | |
'https://images.unsplash.com/photo-1583307266943-e0055bb40037' ] | |
NewerOlder