0

When working with Azure App Functions inside of Visual Studio Code I would like to add python Classes to import into init.py by including their files?

Is there a recommended way to accomplish this?

enter image description here

3

1 Answer 1

1

I will show how to import the classes under test file outside HttpTrigger1 function, classes under test file inside HttpTrigger1 function.

Here is my file structure, :

enter image description here

  1. Import the class named Display in init.py under test file inside HttpTrigger1 function:

     from test import Display
    
  2. Import the class named Display1 in yes.py under test file inside HttpTrigger1 function:

     from test.yes import Display1
    
  3. Import the class named Display in init.py under test file outside HttpTrigger1 function:

     from ..test import Display
    
  4. Import the class named Display1 in yes.py under test file outside HttpTrigger1 function:

     from ..test.yes import Display1
    
Sign up to request clarification or add additional context in comments.

2 Comments

thank you, I'm understanding creating the subfolder to be a requirement
@ffejrekaburb Please mark the answer to end this question if it helps you. It is very important. If you are willing to mark the answer, people will be more willing to help you solve the problem. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.