this post was submitted on 29 Nov 2024
107 points (99.1% liked)

Godot

5955 readers
80 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

founded 2 years ago
MODERATORS
 

This makes it easier to print out multiple things at the same time without needing to do a bunch of string concatenation

Easy way you can remember it is thinking s for space and t for tab. When you want to print normally just call print. Otherwise add s for space or t for tab on the end of the function for the separators.

top 6 comments
sorted by: hot top controversial new old
[–] Chee_Koala@lemmy.world 11 points 6 days ago

That's very useful, thanks!

[–] Charzard4261@programming.dev 6 points 6 days ago

Does it accept arrays as an argument? If so, that'd be super useful!

[–] OwlPaste@lemmy.world 3 points 6 days ago (1 children)

What you probably want to do is write a global logger where you reference the print variant inside the logger function once and can easily change it on a single place to suit how you want to look at logs.

[–] topherclay@lemmy.world 6 points 6 days ago (1 children)

in python the print function has a sep argument that has a default value. Making three functions with a different spelling instead of one function with a variable argument seems kinda stinky here.

[–] OwlPaste@lemmy.world 2 points 5 days ago

Yeah that seems weird don't it Personally i find a custom logger useful in my projects and not just because of this print weirdness.