Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14271

When I try to run a new script via another script, the current script reruns

$
0
0

When I try to run a second script from a first script, the first script reruns from the beginning. Below is the code where i try to run the new script. I don't know where the problem lies.

def log_user_in(self):        self.cursor.execute('SELECT username AND password, COUNT(*) FROM users WHERE username=%s AND       password=%s GROUP BY username',(self.login_username_entry.get(), self.login_password_entry.get()))        self.cursor.fetchall()        self.row_count = self.cursor.rowcount        if self.row_count == 1:            self.login_window.destroy()            call(['python3', 'HabitTracker.py'])

I expected this code to run a script called HabitTracker.py, but instead it reruns my main.py script where this snippet of code is found.


Viewing all articles
Browse latest Browse all 14271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>