score:1

when i encounter an issue like this, i like drop myself into a debugger in the command line and start poking around.

to do this, i add import pdb; pdb.set_trace() near where the issue is happening, in this case at the top of the file. once in debug mode, i starting looking at the object that is causing the issue. i'd probably start with changing the import statement to import the full cmd module, and then i would dir said module. you can print cmd.__file__ to see where it is coming from

import cmd
import pdb; pdb.set_trace()
# code stops here so you can start digging
# dir(cmd) will tell you what properties the module has
# cmd.__file__ will tell you the file path

from cmd import cmd
import pyautogui as pag #future#
import time #debugging/future#
import sys,os
clear = lambda : os.system('cls')
#############################################
from colorama import init
from ctypes.test.test_pickling import name
init(strip=not sys.stdout.isatty()) # strip colors if stdout is redirected
from termcolor import cprint 
from pyfiglet import figlet_format
##############################################

class myprompt(cmd):

    @staticmethod
    def do_lineage(self):
        """switch to lineage 2 helper"""
        print("switching to lineage 2 helper....")
        os.system(r"python c:\users\david\eclipse-workspace\cmd\src\l2.py")

    @staticmethod
    def do_ip(self):
        """ip"""
        print("switching to ip stuff.... ")
        os.system(r"python c:\users\david\eclipse-workspace\cmd\src\play.py")    

    @staticmethod
    def do_quit(self):
        """quits the program."""
        print("quitting...")
        raise systemexit

    @staticmethod
    def do_movies(self,num):
        """1-3 different sites, or all for """
        if num == 1:
            print("https://genvideos.org")
            os.system("c:\program files (x86)\google\chrome\application\chrome --app=https://genvideos.org")
        if num == 2:
            print("https://www3.gomovies.sc")
            os.system("c:\program files (x86)\google\chrome\application\chrome --app=https://www3.gomovies.sc")
        if num == 3:
            print("https://vioozgo.org/")
            os.system("c:\program files (x86)\google\chrome\application\chrome --app=google.com")
        if num == "all":
            print("https://genvideos.org")
            print("https://www3.gomovies.sc")
            print("https://vioozgo.org/")
            os.system("c:\program files (x86)\google\chrome\application\chrome --app=google.com")


if __name__ == '__main__':
    clear()
    prompt = myprompt()
    prompt.prompt = '> '
    prompt.cmdloop(cprint(figlet_format('--------\nhelper\n--------', font='smslant'), "yellow"))

Related Query

More Query from same tag