Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Password Guesser Project
#18
1) There's nothing wrong with that.  As long as the function you're calling exists, then you can call it.  And since you're calling it immediately after defining it, that's fine.

2) Defining them in the global scope makes them globals, but it doesn't make them constants.

3) You defined it in the global scope, but not within the function's scope.  There's a couple ways to fix this.  The easiest would be to simply move the definition so it's within the function, since you never use it outside the function, anyway.  The second, would be to re-define it within the function, thus hiding whatever value is in the global scope.  The third is to use the global keyword, to make it clear that you're using a variable from a higher scope level.
Reply


Messages In This Thread
Password Guesser Project - by RedSkeleton007 - Oct-22-2017, 05:46 AM
RE: Password Guesser Project - by Lux - Oct-22-2017, 02:55 PM
RE: Password Guesser Project - by RedSkeleton007 - Oct-22-2017, 08:05 PM
RE: Password Guesser Project - by Lux - Oct-22-2017, 09:21 PM
RE: Password Guesser Project - by RedSkeleton007 - Oct-23-2017, 02:10 AM
RE: Password Guesser Project - by Lux - Oct-29-2017, 01:54 AM
RE: Password Guesser Project - by RedSkeleton007 - Nov-01-2017, 05:44 PM
RE: Password Guesser Project - by nilamo - Nov-01-2017, 06:41 PM
RE: Password Guesser Project - by RedSkeleton007 - Nov-13-2017, 03:53 AM
RE: Password Guesser Project - by metulburr - Nov-13-2017, 04:01 AM
RE: Password Guesser Project - by RedSkeleton007 - Nov-13-2017, 05:10 AM
RE: Password Guesser Project - by nilamo - Nov-19-2017, 04:43 PM
RE: Password Guesser Project - by RedSkeleton007 - Nov-20-2017, 07:03 AM
RE: Password Guesser Project - by RedSkeleton007 - Nov-27-2017, 05:33 AM
RE: Password Guesser Project - by nilamo - Nov-27-2017, 06:42 PM
RE: Password Guesser Project - by RedSkeleton007 - Nov-28-2017, 08:58 PM
RE: Password Guesser Project - by nilamo - Nov-29-2017, 07:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Brute Force Password Guesser 2skywalkers 1 3,197 Oct-05-2018, 08:04 PM
Last Post: ichabod801
  Brute Force Pad Lock Guesser RedSkeleton007 4 3,973 Mar-03-2018, 07:42 AM
Last Post: RedSkeleton007
  Speeding up Brute force password guesser Gamervote 5 6,849 Jul-20-2017, 02:52 PM
Last Post: nilamo
  Password Hacker Science Project BenjC 2 4,937 Apr-17-2017, 07:36 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020