[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Python
. . -> [Subject]  Importing Modules

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Importing Modules

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Drakonik   (20 posts)  [Biography] bio
Date Fri 08 Jun 2012 10:57 PM (UTC)  quote  ]
Message
I've recently downloaded the objectified MUSHclient objects from few threads down and I'm trying to use them in my code. The problem I'm encountering is that no matter how I manipulate sys.path or where I place the module, I cannot import ANYTHING that isn't directly in the script that MUSHclient is told to load. What am I missing here?
[Go to top] top

Posted by Worstje   Netherlands  (867 posts)  [Biography] bio
Date Reply #1 on Sat 09 Jun 2012 03:21 AM (UTC)  quote  ]
Message
It's been several years since I used Python with MUSHclient. Can you show how you manipulated sys.path and what didn't work with it?
[Go to top] top

Posted by Drakonik   (20 posts)  [Biography] bio
Date Reply #2 on Sat 09 Jun 2012 08:14 AM (UTC)  quote  ]
Message
sys.path.append(r'C:\Program Files (x86)\MUSHclient\scripts\')

My script was UL.pys in scripts\. I had my test module in a directory named foo\, and foo\ contained an __init__.py and a test.py. I added the scripts directory to the import path as listed above and I was still unable to import any variation of foo or test.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


760 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]