User Controls
Spooky Syntax Errors that shouldn´t exist.
-
2017-04-27 at 8:53 PM UTCI am getting a syntax error in the code below. While i know for a fact the syntax is perfectly fine.
import pickle
import os.path
from blessings import Terminal
t = Terminal()
if not os.path.isfile("HDB-api-ID.p"):
print "[" + t.green("+") + "]Please provide your HoneyDB API ID\n"
DB_API_ID = raw_input("API ID: ")
pickle.dump(DB_API_ID, open( "HDB-api-ID.p", "wb" )
print "[" + t.green("+") + "]Please provide your HoneyDB API key\n"
DB_API_KEY = raw_input("API key: ")
pickle.dump(DB_API_ID, open( "HDB-api-key.p", "wb" )
print "[" + t.green("+") + "]Your API data has been saved to 'HDB-api-ID.p' and 'HDB-api-key.p' in the current directory.\n"
else:
try:
DB_API_ID = pickle.load(open( "HDB-api-ID.p", "rb" ))
DB_API_KEY = pickle.load(open( "HDB-api-key.p", "rb" ))
except IOError as e:
print "[" + t.red("!") + "]Critical. An IO error was raised while attempting to read API data.\n"
print e
sys.exit(1)
ID_path = os.path.abspath("HDB-api-ID.p")
KEY_path = os.path.abspath("HDB-api-key")
print "[" + t.green("+") + "]Your API ID was succesfully loaded from" + ID_path
print "[" + t.green("+") + "]Your API key was succesfully loaded from" + KEY_path
I don't get it. Here's my error message.
File "mimir.py", line 27
print "[" + t.green("+") + "]Please provide your HoneyDB API key\n"
^
SyntaxError: invalid syntax
Post last edited by Sophie at 2017-04-28T11:51:17.040278+00:00 -
2017-04-28 at 12:11 PM UTCYou've probably got some whitespace in there somewhere.
-
2017-04-28 at 12:39 PM UTC
Originally posted by -SpectraL You've probably got some whitespace in there somewhere.
Yeah sometimes when you indent you get spaces instead of tabs, i personally prefer tabs. But that was basically the first thing i checked. Unfortunately it still gives me a syntax error where it's not supposed to. Even after checking my indentation. -
2017-04-28 at 12:44 PM UTCMight be an uppercase/lowercase error.
-
2017-04-28 at 12:50 PM UTC
-
2017-04-28 at 4:02 PM UTCI'm only on my phone, but as a random guess, are you not escaping something? Is that bracket in need of an escaping?
-
2017-04-29 at 2:14 PM UTC
-
2017-04-29 at 7:47 PM UTCOh i figured it out i forgot to close with parenthesis right here.
pickle.dump(DB_API_ID, open( "HDB-api-ID.p", "wb" )
Was too focused on where my error message was pointing me. Lol. Thanks anyway guys. -
2017-04-29 at 8:01 PM UTCUser error.
-
2017-04-30 at 12:02 AM UTC
-
2017-04-30 at 9:01 AM UTCA syntax error IS a user error.
-
2017-04-30 at 12:07 PM UTC
Originally posted by -SpectraL A syntax error IS a user error.
No it isn't you know nothing fuck. It is a programming error made by the person writing the program not the person using the program.
syn·tax er·ror
noun
COMPUTING
a character or string incorrectly placed in a command or instruction that causes a failure in execution.A user error is any error that has been caused by the user of the computer and not the computer, hardware, or software running on the computer.
If you admit you learned something from this you will learn something from this. -
2017-04-30 at 12:14 PM UTCI just have to add this. SpectraL I am not, never have been, never will be, and never wanted to be a programmer. But I have forgotten more about programming than you will ever know. To me you are an amusing joke to slap about whenever the punch line appears. To guys like Sophie and Lanny who actually take the time to teach themselves languages you must seem pathetic.
-
2017-04-30 at 12:41 PM UTC
-
2017-04-30 at 1:03 PM UTC
-
2017-04-30 at 10:56 PM UTClol, I think SpectraL was referring to it as the user making the program error.
-
2017-04-30 at 10:59 PM UTC
-
2017-04-30 at 11:05 PM UTCNever you mind about this syntax error. I have an outdated SSL lib and i need a monkey patch unless i want to translate my program to Python 3.
https://niggasin.space/thread/10835 -
2017-05-01 at 1:31 AM UTCWhen you program, you are using a programming language to do it. People use languages. Users are people. Therefore, it is a user error when that user creates a syntax error while programming. Not hard to figure out.
-
2017-05-01 at 2:07 AM UTC
Originally posted by -SpectraL When you program, you are using a programming language to do it. People use languages. Users are people. Therefore, it is a user error when that user creates a syntax error while programming. Not hard to figure out.
This is why you can't keep up with the times Billy. You refused to admit when someone teaches you something you didn't know. I feel kind of sorry for you.