×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    How to import a variable from a custom module?

    How to import a variable from a custom module?

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: How to import a variable from a custom module?

    Let's assume you have a custom module named mymodule, with the variable x in it. All you have to do is import the module and make reference to the variable in it:
    Code:
    import mymodule
    
    new_variable=mymodule.x
    Is that what you meant?

  3. #3
    Registered User
    Join Date
    Feb 2008
    Location
    Moscow Russia
    Posts
    25

    Re: How to import a variable from a custom module?

    Still it is possible
    Code:
    from mymodule import x
    or
    Code:
    from mymodule import x as new_variable

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: How to import a variable from a custom module?

    Thank you. By the way what do you think of that?

    main.py

    Code:
    import mymodule, appuifw
      
    a = mymodule.askword()
    print a
    mymodule.py

    Code:
    import appuifw
    
    def askword():
        d = appuifw.query(u"Write", "text")
        return d
    Last edited by DrivingMobileInnovation; 2008-06-30 at 19:14.

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: How to import a variable from a custom module?

    hi DrivingMobileInnovation
    thats absolutely perfect.
    Moreover i have written a wiki article on this have a look.
    Last edited by gaba88; 2008-07-01 at 04:05.

Similar Threads

  1. GoogleIt
    By deepika.mangla in forum Symbian
    Replies: 5
    Last Post: 2011-05-28, 11:04
  2. How to import a custom module?
    By 9600baud in forum Symbian
    Replies: 8
    Last Post: 2008-06-25, 15:37
  3. Error import module
    By akus in forum Symbian
    Replies: 0
    Last Post: 2007-10-21, 19:47
  4. problem on running my application
    By rsf in forum Symbian
    Replies: 7
    Last Post: 2007-10-21, 15:56
  5. Carbide.j 1.5 and Netbeans 5.5 beta 2
    By ovjo12 in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2007-06-11, 05:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×