'''Tcl Equivalents of Python Modules''', a resource for [Python] programmers who have seen the light and are migrating [Tcl], maps Python modules to equivalent Tcl packages. ** The Python Standard Library ** %|Python Module|Python Code|Tcl Package|Tcl Code|Notes|% %|Built-in Types|||||% |Truth Value Testing||||| |Boolean Operations||||| |Comparsions||||| |Numeric Types||||| |Iterator Types||||| |Sequence Types||||| |Text Sequence Types||||| |Binary Sequence Types||||| |Set Types||||| |Mapping Types||||| |Context Manager Types||||| |Other Built-in Types||||| |Special Attributes||||| %|String Services|||||% |string|string.(arg? arg...)|Tcl|string option arg? arg..?|Though you could get the same resolte by using the list commands (exp: lappend, lindex, and such reason why this works is because everthing is a string in tcl) but seeing that python is dealing with only string verable I think the best equvelce is string in tcl.| |re||||| |difflib||||| |textwrap||||| |upicodeata||||| |stringprep||||| |readline||||| |rlcompleter||||| %|Binary Data Services|||||% |struct||||| |codecs||||| %|Data Types|||||% |datetime|datetime.(arg? arg...?)|Tcl|clock option arg? arg..?|Though Python makes it eas to summon up current time (datetime.today()) tcl gives more of the basic of time (the current time retruns as milli or microseconds) which realys on you to format the time for you only use| |calendar||||| |collections||||| |collections.abc||||| |heapq||||| |bisect||||| |array||||| |weakref||||| |types||||| |copy||||| |pprint||||| |reprlib||||| %|Numeric and Mathematical Modules|||||% |numbers||||| |math|math. (arg? arg...?)|Tcl|expr arg? arg arg ...?|Same as cmath| |cmath|cmath. (arg? arg..?)|Tcl|expr arg? arg arg ...?|to do fancy things like random number or sin of x you will have to use mathfunc. it allows for more unice oprations. expr covers pritemuch all the mathmaticle ortations in tcl| |decimal||||| |fractions||||| |random|random arg? arg ... ?|TclX, TclSOAP, Tcl|random option? arg?, mnt_rand() isaac_rand() sub_rand(), expr rand()|as Python gives you more Randomations options i put down siverl ways to get a | %|Functional Programming Modules|||||% |itertools||||| |functools||||| |operator||||| %|File and Directory Access|||||% |os.path||||| |fileinput||||| |stat||||| |filecmp||||| |tempfile||||| |glob|glob.|Tcl|glob?switches? ?pattern ...?|| |fnmatch||||| |linecache||||| |shutil||||| |macpath||||| %|Data Persistence|||||% |pickle||||| |copyreg||||| |shelve||||| |marshal||||| |dbm||||| |sqlite3||[sqlite] (supplied with 8.6)||| %|Data Compression and Archiving|||||% |zlib|||`[zlib]` command, 8.6|| |gzip||||| |bz2||||| |lzma||||| |zipfile||||| |tarfile||[Tcllib tar]||| %|File Formats|||||% |csv||||| |configparser||||| |netrc||||| |xdrlib||||| |plistlib||||| %|Cryptographic Services|||||% |hashlib||||| |hmac||||| %|Generic Operating System Services|||||% |os||||| |io||||| |time||||| |argparse||||| |optparse||||| |getopt||||| |loging||||| |loging.config||||| |loging.handlers||||| |getpass||||| |curses||||| |curses.textpad||||| |curses.ascii||||| |curses.panel||||| |platform||||| |errno||||| |ctypes||||| %|Concurrent Execution|||||% |threading||||| |multiprocessing||||| |The concurrent package||||| |concurrent.futures||||| |subprocess||||| |sched||||| |queue||||| |select||||| |dummy_thread||||| |_thread||||| |_dummy_thread||||| %|Interprocess Communication and Networking|||||% |socket||||| |ssl||||| |asyncore||||| |asynchat||||| |signal||||| |mmap||||| %|Internet Data Handling|||||% |email||||| |json||||| |mailcap||||| |mailbox||||| |mimetypes||||| |base64||||| |binhex||||| |binascii||||| |quopri||||| |uu||||| %|Structured Markup Processing Tools|||||% |html||||| |html.parser||||| |html.entities||||| |XML Processing Modules||||| |XML Vulnerabilites||||| |xml.etree.ElementTree||||| |xml.dom||||| |xml.dom.minidom||||| |xml.dom.pulldom||||| |xml.sax||||| |xml.sax.handler||||| |xml.sax.saxutils||||| |xml.sax.xmlreader||||| |xml.parsers.expat||||| %|Internet Protocols and Support|||||% |webbrowser||||| |cgi||||| |cgitb||||| |wsgiref||||| |urllib||||| |urllib.request||||| |urllib.response||||| |urllib.parse||||| |urllib.error||||| |urllib.rebotparser||||| |http||||| |http.client||||| |ftplib||||| |poplib||||| |imaplib||||| |nntplib||||| |smtplib||||| |smtpd||||| |telnetlib||||| |uuid||||| |socketserver||||| |http.server||||| |http.cookies||||| |http.cookie jar||||| |xmlrpc||||| |xmlrpc.client||||| |xmlrpc.server||||| |ipaddress||||| %|Multimedia Services|||||% |audioop||||| |aifc||||| |sunau||||| |wave||||| |chunk||||| |colorsys||||| |imghdr||||| |sndhdr||||| |ossaudiodev||||| %|Internationalization|||||% |gettext||||| |locale||||| %|Program Frameworks|||||% |turtle||||| |cmd||||| |shlex||||| %|Graphical User Interfaces with Tk|||||% |tkinter||||| |tkinter.ttk||||| |tkinter.tix||||| |tkinter.scrolledtext||||| |IDLE||||| |Other Graphical User Interface Packages||||| %|Development Tools|||||% |pydoc||||| |doctest||||| |unittest||||| |unittest.mock||||| |unittest.mock||||| |2to3||||| |test||||| |test.support||||| |venv||||| %|Debugging and Profiling|||||% |bdb||||| |faulthandler||||| |pdb||||| |the Python Debugger||||| |timeit||||| |trace||||| %|Python Runtime Services|||||% |sys||||| |sysconfig||||| |builtins||||| |_main_||||| |warnings||||| |contestlib||||| |abc||||| |atexit||||| |traceback||||| |_future_||||| |gc||||| |inspect||||| |site||||| |fpectl||||| |distutils||||| %|Custom Python Interpreters|||||% |code||||| |codeop||||| %|Importing Modules|||||% |imp||||| |zipimport||||| |pkgutil||||| |modulefinder||||| |runpy||||| |importlib||||| %|Python Language Services|||||% |parser||||| |ast||||| |symtable||||| |symbol||||| |token||||| |keyword||||| |tokenize||||| |tabnanny||||| |pyclbr||||| |py_compile||||| |compileall||||| |dis||||| |pickletools||||| %|Miscellaneous Services|||||% |formatter||||| %|MS Windows Specific Services|||||% |msilib||||| |msvcrt||||| |winreg||||| |winsound||||| %|Unix Specific Services|||||% |posix||||| |pwd||||| |spwd||||| |grp||||| |crypt||||| |termios||||| |tty||||| |pty||||| |fcntl||||| |pipes||||| |resource||||| |nis||||| |syslog||||| <> Python | Reference