Skip to content

Another question from me. #589

Answered by Akascape
Jeymen asked this question in Q&A
Nov 3, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@Jeymen Don't put the variables in the function as you are not returning any value from it.
You can put them in the class directly (outside function) so that you can access it easily.

example:

import customtkinter
class Generate(customtkinter.CTk):
    
    allowed_extensions = [
             'png',
             'jpg',
             'PNG',
             'JPG',
             'jpeg',
             'JPEG',
             'jfif',
             'JFIF',
             'webp',
             'WEBP',
             ]
    
    def __init__(self):
        self.qr_gen()
        
    def qr_gen(self):
            print(self.allowed_extensions)
    
if __name__ == "__main__":
    app = Generate()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Jeymen
Comment options

@Akascape
Comment options

Answer selected by Jeymen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants