1

I made a script which automates some processes using Selenium and another Script where I store variables like password and email.

I converted it to an a .exe file but the user needs to be able to edit the Details.py file.

Is there any work around since as soon as I convert it to .exe theres no way for me to edit and save files?

Edit: Posted code to help with an answer:

from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from Details import *

driver = webdriver.Firefox()

url = "https://discordapp.com/channels/530588470905929729/538868623981412362"
driver.get(url)
email = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//input[@type='email']")))
email.send_keys(Email)

password = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//input[@type='password']")))
password.send_keys(Password + Keys.ENTER)

sleep(5)

textbox = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//textarea[@placeholder='Message #bot-commands']")))
textbox.send_keys("!work" + Keys.ENTER)

sleep(30)

driver.quit()

This is Details.py:

Password = "Password"
Email = "mail@mail.com"
Nouman
  • 6,947
  • 7
  • 32
  • 60
itsolidude
  • 1,119
  • 3
  • 11
  • 22

1 Answers1

0

You need to rethink the design of your program. It's not secure or user-friendly to edit .py files in order to alter saved credentials. I suggest you have a look around for already proven methods of storing sensitive information. There are lots of options out there and you can start with this post.

Lucan
  • 2,907
  • 2
  • 16
  • 30