7 Replies - 370 Views - Last Post: 03 December 2019 - 02:47 AM Rate Topic: -----

#1 Rockercrest   User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 3
  • Joined: 10-September 19

Importing Python into a program

Posted 10 September 2019 - 06:08 PM

Hello I am trying to import a file of python code through a program by telling it which folders it is in see code bellow

import jbPolyReport
jbPolyReport.jbPolyReportGo()
C:\users\chupacabra\Documents\maya\2019\Sripts


This is what i have and there is always a syntex error can you tell me why

jbPolyReport is the file i want to import

This post has been edited by modi123_1: 10 September 2019 - 06:16 PM
Reason for edit:: Name removed.

Is This A Good Question/Topic? 1
  • +

Replies To: Importing Python into a program

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15362
  • View blog
  • Posts: 61,610
  • Joined: 12-June 08

Re: Importing Python into a program

Posted 10 September 2019 - 06:17 PM

Please copy/paste the full error message.
Was This Post Helpful? 0
  • +
  • -

#3 Rockercrest   User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 3
  • Joined: 10-September 19

Re: Importing Python into a program

Posted 10 September 2019 - 06:21 PM

View Postmodi123_1, on 10 September 2019 - 06:17 PM, said:

Please copy/paste the full error message.




This is the exact thing it tells me


import jbPolyReport
jbPolyReport.jbPolyReportGo()
C:\users\Emma Shea\Documents\maya\2019\Sripts
# Error: invalid syntax #
Was This Post Helpful? 1
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15362
  • View blog
  • Posts: 61,610
  • Joined: 12-June 08

Re: Importing Python into a program

Posted 10 September 2019 - 06:30 PM

Are you sure you have thing spelled right? Like 'scripts'?
Was This Post Helpful? 0
  • +
  • -

#5 Rockercrest   User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 3
  • Joined: 10-September 19

Re: Importing Python into a program

Posted 10 September 2019 - 06:44 PM

View Postmodi123_1, on 10 September 2019 - 06:30 PM, said:

Are you sure you have thing spelled right? Like 'scripts'?




I fixed all spelling and it still wont work
Was This Post Helpful? 1
  • +
  • -

#6 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 981
  • View blog
  • Posts: 3,871
  • Joined: 13-June 14

Re: Importing Python into a program

Posted 11 September 2019 - 12:32 AM

What are you trying to do with that line? It isn't valid Python code. Should it be a string that's passed to something or what?
Was This Post Helpful? 0
  • +
  • -

#7 ghostname0x00   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 29-September 19

Re: Importing Python into a program

Posted 29 September 2019 - 06:37 PM

You gave us very little info, Idk whats your OS or IDE etc.
Maybe your import is neither nor in your cwd or path. Try:
'jbPolyReport' in list(os.walk(os.getcwd()))


If it returns 'False' then you have to point compiler to the import somehow cause its not seeing it.
If you have 'True' then make sure its not a bridge too far, depends on IDE and its settings but most of it wont find a file in sub-directory of a current project.
Was This Post Helpful? 0
  • +
  • -

#8 Histiogge   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 03-December 19

Re: Importing Python into a program

Posted 03 December 2019 - 02:47 AM

It'd help a lot if you also shared the information about your OS, IDE at least, as now too hard to understand what's wrong
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1