1

I am trying to import variables from 2WattTues and 2WattWed to 2WattThur but I get this error, what can I do?

enter image description here

abhijat_saxena
  • 609
  • 4
  • 19
  • JFYI: Using `import * ` isn't a good practice – Junkrat May 17 '20 at 12:41
  • 1
    python scripts mustn't start with a number. – Anwarvic May 17 '20 at 12:41
  • But in case you really have to, check [this question](https://stackoverflow.com/q/9090079/770830) out. – bereal May 17 '20 at 12:44
  • From https://stackoverflow.com/help/minimal-reproducible-example: *DO NOT use images of code. Copy the actual text from your code editor, paste it into the question, then [format it as code](https://stackoverflow.com/editing-help#code). This helps others more easily read and test your code.* – colidyre May 18 '20 at 11:57
  • @Anthony - was I able to answer your question correctly ? – abhijat_saxena May 20 '20 at 18:27

2 Answers2

1

Try importing like this

wattTues = __import__('2WattTues')


For performing import * check this out -
How does one do the equivalent of "import * from module" with Python's __import__ function?

abhijat_saxena
  • 609
  • 4
  • 19
0

Names of variables, modules (etc.) cannot start with a digit.

Ozmium42
  • 3
  • 3
  • 1
    Strictly speaking, *identifiers* cannot start with a digit. It's a syntactic issue, not a limitation of the data model. – chepner May 17 '20 at 13:17