Skip to content

Commit

Permalink
add end flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mieskolainen committed Jul 27, 2024
1 parent f5915c6 commit 2b58511
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions icenet/tools/iceprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'reset': '\033[0m'
}

def iceprint(message, color='white', file=None):
def iceprint(message, color='white', file=None, end=None):

# Get the caller frame
caller_frame = inspect.currentframe().f_back
Expand All @@ -37,15 +37,15 @@ def iceprint(message, color='white', file=None):
if file is None:

if type(message) is str and (message == '' or message == '\n'):
print(message)
print(message, end=end)

# String
elif type(message) is str:
print(f"{color_code}{prefix}: {message}{reset_code}")
print(f"{color_code}{prefix}: {message}{reset_code}", end=end)

# Print objects on a separate line
else:
print(f"{prefix}:")
print(f"{color_code}{message}{reset_code}")
print(f"{color_code}{message}{reset_code}", end=end)
else:
print(message, file=file)

0 comments on commit 2b58511

Please sign in to comment.