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

Gammon 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

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Drakonik   (20 posts)  [Biography] bio
Date Fri 08 Jun 2012 10:57 PM (UTC)
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  (899 posts)  [Biography] bio
Date Reply #1 on Sat 09 Jun 2012 03:21 AM (UTC)
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)
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.


3,938 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]