You have conflicting definitions of x
:
import DefaultX as x
x = raw_input (">>>")
Change one of them.
Question
Here is the error:
Traceback (most recent call last):
File "/home/endergreen/PyOS/SHOE/C.pyx", line 24, in <module>
x.execute()
AttributeError: 'str' object has no attribute 'execute'
Here is the set of code:
#!/usr/bin/env python
import os as os
import sys as sys
import time as time
import DefaultX as x
def setup():
execfile ("Setup.pyx")
print ("Running...")
def start():
execfile ("/HDD/BOOT.pyrx")
print ("Running...")
def end():
print ("Stopping...")
time.sleep (3)
x.machine_start
x = raw_input (">>>")
if x == 'setup':
x.setup()
if x == 'start':
x.start()
if x == 'execute':
x.execute()
if x == 'chkfile':
x.chkfile()
if x == 'chkinstall':
x.chkdisk()
if x == 'commands':
x.cmds()
else:
print ("Unsupported Command")
raw_input ("Press [Enter] to continue...")
execfile ("C.pyx")
The error appears to be saying that the 'execute' function has not been defined in DefaultX.py, but I've used the SAME EXACT CODE (a literal copy-paste situation) in another project and it worked 100%! I have no clue what I'm doing wrong and any help would be greatly appreciated!
Solution
You have conflicting definitions of x
:
import DefaultX as x
x = raw_input (">>>")
Change one of them.