Python Forum
importing variables from module
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing variables from module
#1
hello experts,
i am learning python.
my question:
i am trying to import string variables from separate module to avoid retyping the same strings in each module where they are used. (i am using Pydroid app on my phone for now, to get a grip on the language). while the program seems to recognize imported variables they stay highlighted as "undefined" which is annoying. is it just Pydroid behavior or I am doing a wrong thing? TYA.
Yoriz write Feb-18-2024, 01:40 PM:
Please post all code, output and errors (in its entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
How do you do the import?

Does the code run or do you get an error?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 895 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  My code displays too much output when importing class from a module lil_e 4 1,166 Oct-22-2022, 12:56 AM
Last Post: Larz60+
  Importing module in jupyter Noteboook ajitnayak1987 0 1,758 Jun-04-2021, 12:26 PM
Last Post: ajitnayak1987
  ERROR: importing desired module mbgamer28 0 1,689 Apr-05-2021, 07:46 PM
Last Post: mbgamer28
  importing module - not working jdhamblett 3 3,034 Jun-22-2020, 07:33 PM
Last Post: jdhamblett
  module to store functions/variables and how to call them? mstichler 3 2,418 Jun-03-2020, 06:49 PM
Last Post: mstichler
  importing same python library in multiple custom module escape_freedom13 6 3,842 May-10-2020, 07:01 PM
Last Post: escape_freedom13
  How to access variables from dirsync module steve_shambles 3 3,883 Apr-02-2020, 08:18 AM
Last Post: steve_shambles
  Importing module from a package results in import error goghvv 2 2,409 Mar-27-2020, 07:13 PM
Last Post: goghvv
  Importing variables from another file IILawrenceII 7 10,046 Jan-18-2020, 12:31 PM
Last Post: IILawrenceII

Forum Jump:

User Panel Messages

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