Python Forum
start interactive pyhton shell with pre-loaded custom modules
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
start interactive pyhton shell with pre-loaded custom modules
Hi all,
I'm a beginner & giving myself a few simple projects to try to find stuff out. I'm trying to make a sort of desktop calculator in the form of a interactive python shell with some modules already loaded so i can just press a shortcut and go.
OS: kubuntu 18.04
python 3.6.9
#!/usr/bin/env python3

# import some modules
import math
import compound_interest
import check_prime

# Go to interactive mode
import code
the build-in module math works, but the self-mades ones don't (see error below). also, i'd like to suppress the version information that's printed when switching to interactive.
TypeError: 'module' object is not callable
Thanks for any help
Show us your modules, because it's working.

def a():

import a
import code

>>> a.a()
Thank you for replying.
It was indeed in the modules. I wrote them first as little programs and didn't realise i needed to remove the "#!/usr/bin/...".

Possibly Related Threads…
Thread Author Replies Views Last Post
  Package cannot be loaded into PBS queue file emersonpl 1 477 Sep-09-2021, 08:06 PM
Last Post: emersonpl
  PyQt5 MySQL Drivers Not Loaded AdeS 7 1,310 Aug-06-2021, 08:34 AM
Last Post: AdeS
  Reading Multiple text Files in pyhton Fatim 1 670 Jun-25-2021, 01:37 PM
Last Post: deanhystad
  MacOS BigSur Python3 - dyld: Library not loaded: trillionanswers 1 2,702 Mar-02-2021, 11:00 PM
Last Post: nilamo
  Why is mpl_toolkits loaded? Gribouillis 1 669 Jan-30-2021, 08:39 PM
Last Post: Serafim
  interactive map and function hurc60248 1 773 Jan-08-2021, 09:22 PM
Last Post: Larz60+
  Pyhton code help from head first with python Shaikat_99 3 1,334 Jun-07-2020, 09:12 AM
Last Post: snippsat
  PYHTON not opening files profficial 11 9,282 Feb-15-2020, 09:06 AM
Last Post: bharathendra
  Basic Pyhton for Rhino 6 question about variables SaeedSH 1 1,026 Jan-28-2020, 04:33 AM
Last Post: Larz60+
  Pyhton Coding Help Needed (very small error) friduk 2 1,243 Oct-23-2019, 08:41 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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