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"))
Source: stackoverflow.com
Related Query
- from cmd import Cmd, (not working with class MyPrompt)
- Import from Eclipse to Android Studio not working
- eclipse organize import not working with kotlin files
- Import class from other project with java always got an error
- avarice from winavr not working with usb jtagice3
- Python script working in IDLE, but not working when run from CMD or Eclipse
- How to run a java class in Eclipse (part of a maven project with a pom file) from cmd
- Writing cmd output to a file is not working with Tomcat :(
- Import class Actions does not working in ChromeDriver
- Eclipse import from required project not working
- How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9
- Gradle compileJava task warning: [options] bootstrap class path not set in conjunction with -source 1.6
- Force Eclipse to automatically import a class with multiple options
- When using Eclipse with FindBugs can you mark a bug as not a bug and have it removed from the bug list?
- RESTful web service creation tutorial with Java, Eclipse. Apache Tomcat, not working
- graphical layout not working in eclipse with adt 10.1
- play framework 2.1 junit test not working from eclipse
- apache tomcat 9.x not working with eclipse & Java 10.0.1
- Eclipse Content Assist not working with Android
- System.out not working when calling jar-file from Windows command line
- How to move a method from a class to another class when two classes are not at all related
- Java 7 switch statement with strings not working
- Any way of working with Eclipse WTP that does not mean redeploying the _WHOLE_ application when a JSP page is changed
- eclipse debugger not working with power Rule in Junit
- Spring Boot - javax Import statements not working correctly
- Autocomplete not working with Eclipse Oxygen Javascript project
- A resource exists with a different case, and class files not generating
- Debug not working with play framework activator, scala and eclipse
- java application not working with java9 and eclipse
- Aspectj not working with eclipse Luna
More Query from same tag
- Eclipse shortcut keys do not work properly in Windows 10
- Android - Check if Runnable is running
- What is the right way to create JUnit tests for Eclipse fragments?
- Why did pressing dot after an object in Eclipse stop showing list of methods popup?
- Xilinx SDK/Eclipse Debug Configuration Issues
- Getting a java.lang.NoClassDefFoundError while executing my projects
- Get system default color from non Ui thread
- How do I include src/test/java files to run TestNG tests?
- XDebug doesn't work with proxies
- Suggestions on optimizing the EGit on Eclipse
- Issue in deploying REST Web Service in eclipse
- Issues in setting up Authentication Flows project
- Non-resolvable parent POM: Could not find artifact
- "Android Library Update” eclipse task randomly stuck my eclipse on start
- Problem with update site categories in Eclipse 3.4
- Sending apps to other devices
- Can you run xmllint within eclipse to validate xml and dtd files?
- Tomcat doesn't display (The origin server did not find a current representation for the target resource or is not willing to disclose that one exists)
- Android installation process from downloaded android sdk
- Eclipse Installer cannot find Java
- How to build neo4j-jdbc driver from official repo?
- Eclipse plugin development: Vertically scrolling table?
- console is not displaying output in eclipse
- How to import jar file (maven) into Android Studio?
- Eclipse compilation issue
- Set eclipse hyperlink color under KDE
- java.lang.IllegalArgumentException: The servlets named [X] and [Y] are both mapped to the url-pattern [/url] which is not permitted
- Is Eclipse available for any Linux distro
- Maven layout Structure creation. Only resource folder is visible, no Java folder created
- How to add a value to property file using Jenkins parameter