Spreadsheet output added

This commit is contained in:
LinlyBoi
2021-08-15 12:11:51 +02:00
parent 691f31fbe3
commit 3cadfda599
3 changed files with 164 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
# main.py
import os
import sys
from PySide6 import *
from PySide6 import QtWidgets
@@ -8,25 +8,23 @@ from PySide6.QtUiTools import QUiLoader
import twint
from PySide6.QtWidgets import QApplication, QPushButton
from PySide6.QtCore import Slot
import os
import sqlite3
#Ggsya made this :D
def backslash():
return('\ '[0])
#def check_and_create_dir(path):
# if os.path.exists(path):
# print('Dir already exists')
# print('Exiting')
# else:
# os.mkdir(path)
def check_and_create_dir(path):
if os.path.exists(path):
print('Dir already exists')
print('Exiting')
else:
os.mkdir(path)
def tweet_search():
#checking if output folder exists
# check_and_create_dir(os.getcwd() + '\output')
check_and_create_dir(os.getcwd() + '\output')
search = window.Keyword.toPlainText()
city = window.City.toPlainText()
@@ -41,6 +39,7 @@ def tweet_search():
c.Search = search
c.Near = city
c.Limit = limit
c.Store_csv = True
c.Popular_tweets = window.Popular.checkState()
#c.Since = window.Since
@@ -48,8 +47,8 @@ def tweet_search():
#c.Username =
#filename becomes the file path
#filename = os.getcwd() + '\output' + backslash() + window.Filename.toPlainText() + '.txt'
#c.Output = filename
filename = os.getcwd() + '\output' + backslash + window.Filename.toPlainText()
c.Output = filename
twint.run.Search(c)