Vale, error arreglado, el tan idiota de mi puso date() envez de date_cmd()...
Merezco un premio a la idiotez
Merezco un premio a la idiotez
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúTraceback (most recent call last):
File "cmd_main.py", line 49, in <module>
maincmd()
File "cmd_main.py", line 28, in maincmd
date(cmd_input)
TypeError: an integer is required (got type str)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import platform
import sys
from boot import *
from commands import *
from panic import *
from dir_cmd import *
from date_cmd import *
from mkdir import *
global machine_name
machine_name = platform.node()
def maincmd():
while True:
cmd_input = input("[%s]$~ " % machine_name)
if "println" in cmd_input:
println(cmd_input)
elif "clear" in cmd_input:
clear()
maincmd()
elif "date" in cmd_input:
date(cmd_input)
elif "machine_info" in cmd_input:
machine_info()
elif "panic" in cmd_input:
panic("ran_out_mem")
elif "dr" in cmd_input:
dr(cmd_input)
elif "mkdir" in cmd_input:
mkdir(cmd_input)
elif "commd_list" in cmd_input:
commd_list(cmd_input)
else:
invalidCommand(cmd_input)
login()
maincmd()
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import calendar
from datetime import datetime, date, time, timedelta
import time
def date_cmd(args):
date_now = datetime.now()
time_epoch = time.time()
try:
cmd_input = args.split(' ')
argument = cmd_input[1]
if argument == "-e":
print("Epoch time: %s" % time_epoch)
elif argument == "-12":
date_format_12 = "%d/%m/%Y %I:%m %p"
date_12 = date_now.strftime(date_format_12)
print("Date (12 hours format): %s" % date_12)
elif argument == "-24":
date_format_24 = "%d/%m/%Y %H:%M:%S"
date_24 = date_now.strftime(date_format_24)
print("Date (24 hours format): %s" % date_24)
elif argument == "-h":
print(help_arg)
else:
print("\033[1;36m"+'invalid argument for "date" command')
help_arg()
except IndexError:
help_arg()
except TypeError:
help_arg()
finally:
print("\033[;37m")
def help_arg():
print("""Date command made by n1sendev.
╔════════════════════════╗
║ \"date\" command help: ║
╠════════════════════════╩═════════════════════════════╗
║Arguments (options): ║
║ ║
║-12 = Display the date and the hour in 12-hour format.║
║-24 = Display the date and the hour in 24-hour format.║
║-e = Display the date and time in epoch format. ║
║-h = Display this help menu. ║
╚══════════════════════════════════════════════════════╝
""")
Cita de: engel lex en 22 Octubre 2017, 20:51 PMA que te refieres con eso?
estás iniciando el python como?
Traceback (most recent call last):
File "C:\Users\usuario\Desktop\juego\main.py", line 249, in <module>
main.part1()
File "C:\Users\usuario\Desktop\juego\main.py", line 235, in part1
ob.snake()
File "C:\Users\usuario\Desktop\juego\ob.py", line 3, in snake
r = open("ascii1.txt", mode='r')
FileNotFoundError: [Errno 2] No such file or directory: 'ascii1.txt'