473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to Find if user defined modules imported

How do you find if the user defined modules are imported?

This tries to see if it is imported ("-" is for easier to read):

Expand|Select|Wrap|Line Numbers
  1. Loaded modules:  
  2.  
  3. - tokenize:  LPAR,PseudoToken,ENDMARKER  
  4. - heapq:  sort,izip,_nlargest  
  5. - __future__:  __module__,getMandatoryRelease,division  
  6. - copy_reg:  _inverted_registry,_slotnames,__all__  
  7. - sre_compile:  _optimize_unicode,isstring,_sre  
  8. - _collections:    
  9. - cStringIO:    
  10. - _sre:    
  11. - functools:  wraps,partial,WRAPPER_ASSIGNMENTS  
  12. - random:  WichmannHill,_sin,_exp  
  13. - cPickle:  
  14. - __builtin__:  
  15. - subprocess:  __module__,STDOUT,__str__  
  16. - dummy_thread:  __module__,__enter__,__exit__  
  17. - gc:  
  18. - cmd:  do_help,__module__,prompt  
  19. - __main__:  PREDICTORS_CFG_DIR,sequence,tearDown  
  20. - operator:   
  21. - array:  
  22. - select:  
  23. - _heapq:  
  24. - _threading_local:  current_thread,__module__,__new__  
  25. - abc:  __module__,_InstanceType,_abc_invalidation_counter  
  26. - _bisect:  
  27. - posixpath:  _varprog,sameopenfile,splitext  
  28. - _random:    
  29. - os2emxpath:  pardir,realpath,stat  
  30. - tempfile:  _TemporaryFileWrapper,_set_cloexec,_candidate_tempdir_list  
  31. - errno:  
  32. - pprint:  __module__,format,_StringIO  
  33. - binascii:   
  34. - token:  DEDENT,LPAR,ENDMARKER  
  35. - sre_constants:  REPEAT_ONE,makedict,AT_END_LINE  
  36. - re:  __module__,finditer,_expand  
  37. - _abcoll:  __module__,Container,__isub__  
  38. - collections:  __repr__,OrderedDict,_make  
  39. - ntpath:  pardir,realpath,exists  
  40. - threading:  _BoundedSemaphore,_sleep,Semaphore  
  41. - opcode:  hasjrel,hasconst,EXTENDED_ARG  
  42. - _struct:    
  43. - _warnings:  
  44. - math:  
  45. - shlex:  __module__,get_token,file  
  46. - fcntl:  
  47. - genericpath:  isdir,stat,commonprefix  
  48. - stat:  S_IWRITE,ST_MTIME,S_IRGRP  
  49. - string:  ascii_lowercase,upper,__module__  
  50. - warnings:  __module__,filterwarnings,once_registry  
  51. - UserDict:  __module__,popitem,pop  
  52. - inspect:  CO_VARARGS,formatargvalues,findsource  
  53. - repr:  aRepr,__module__,repr_list  
  54. - struct:  _clearcache,__doc__  
  55. - sys:  
  56. - pwd:  
  57. - imp:  
  58. - getopt:  opt,__module__,short_has_arg  
  59. - readline:  
  60. - copy:  _copy_with_copy_method,__module__,_deepcopy_atomic  
  61. - ConfigParser:  optionxform,InterpolationError,set  
  62. - bdb:  __module__,get_file_breaks,clear_bpbynumber  
  63. - types:  __module__,IntType,TypeType  
  64. - strop:  
  65. - _functools:  
  66. - keyword:  iskeyword,main,kwlist  
  67. - thread:  
  68. - StringIO:  __module__,readlines,getvalue  
  69. - bisect:  insort_right,bisect,bisect_left  
  70. - pickle:  EMPTY_DICT,NEWTRUE,TypeType  
  71. - signal:  
  72. - traceback:  print_stack,print_exception,print_last  
  73. - difflib:  _count_leading,heapq,_namedtuple  
  74. - marshal:  
  75. - linecache:  updatecache,clearcache,__all__  
  76. - itertools:  
  77. - posix:  
  78. - doctest:  REPORT_UDIFF,get_doctest,_parse_example
  79. - unittest:  parseArgs,assertNotEquals,__str__  
  80. - time:  
  81. - sre_parse:  _PATTERNENDERS,SRE_FLAG_UNICODE,AT_END  
  82. - os:  pardir,__module__,sep  
  83. - pdb:  do_enable,help,help_run  
  84. - dis:  hasjrel,hasconst,HAVE_ARGUMENT
When module has these importations:

Expand|Select|Wrap|Line Numbers
  1. import os
  2. import unittest #User-Defined
  3. from ConfigParser import ConfigParser #User-Defined
  4.  
  5.  
  6. from common import RNASPACE_DIR, TEST_DIR_NAME, DATA_DIR_NAME, \
  7.                    TEST_USER_DIR_NAME, WORKSPACE_DIR, SEQ_FASTA_SUFFIX, \
  8.                    TEST_PROJECT_NAME, SEQ_DIR_NAME, SEQ_TXT_SUFFIX, \
  9.                    PREDICTORS_CFG_DIR, PREDICTOR_CFG_SUFFIX, OUTPUT_DIR_NAME, \
  10.                    TEST_RUN_NAME, OUTPUT_FILE_SUFFIX, REFERENCE_DIR_NAME, \
  11.                    REFERENCE_FILE_SUFFIX
  12. #User-Defined
  13.  
  14. import sys 
  15. path_rnaspace = "/bi/opt/RNAspace/rnaspace_sources/rnaspace/rnaspace/"
  16. sys.path.append(path_rnaspace) 
  17.  
  18. from rnaspace.core.sequence import sequence #User-Defined
  19. from rnaspace.core.conversion.gff_converter import gff_converter #User-Defined
  20. from rnaspace.core.conversion.csv_converter import csv_converter #User-Defined
  21. from rnaspace.core.conversion.fasta_converter import fasta_converter #User-Defined
  22.  
Feb 28 '14 #1
0 1313

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the...
3
by: Walter Brunswick | last post by:
I need to import modules with user-defined file extensions that differ from '.py', and also (if possible) redirect the bytecode output of the file to a file of a user-defined extension. I've...
5
by: Ed Havelaar | last post by:
I have a cool function that I want to use as a default value for a column in my table. But I can't because apparently Access doesn't allow user defined functions in expressions for default values....
0
by: Fercat | last post by:
Hi! I receive in an Outlook mail folder some custom forms that contain user defined fields (for example, Client Name, Contract Number...). The problem is that when I finish linking this folder...
2
by: groves | last post by:
Can anybody give me an example of how to import a function of module X in module y. And please if yu can use classes(Object oriented approach) would be great. The problem is that I have created...
1
by: Gregor Stich | last post by:
Dear all, I hope my question is here in the right place... What I want to achieve is a communication between Java and Python. We have a pretty strong framework of existing python scripts and...
7
AllusiveKitten
by: AllusiveKitten | last post by:
Hi All I am hoping someone can assist.... I have imported all of the table, queries, forms & modules from one database into a new database I have created. I am now getting a 'User-defined type...
1
by: =?Utf-8?B?Q2FsaWNvIFR1ZGU=?= | last post by:
I am new to C#, and created a simple Windows application in C#, just to test the logic needed. This was a simple log-in which contained a single namespace. Namespace included a class (in its own...
2
by: jmike | last post by:
I'm using some legacy code that has a user-defined exception in it. The top level program includes this line from TestRunError import * It also imports several other modules. These other...
4
by: Slaunger | last post by:
Hi there, I am a newcomer to Pyhton coming from Java working on a relatively large Pyhton project with several packages and modules. To improve exception handling I would like to introduce some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.