#π Why doesn't \t work
84 messages Β· Page 1 of 1 (latest)
@dawn dirge
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Why doesn't \t work
what doesn't seem to work
look at the second screenshot
there is a square
instead of a space
\t?
well, yeah???
that's why it's a square
it works as you designed it to work
tab is not just a fancy space
it's tab
if you want space there - put space there
:warning: Your 3.12 eval job has completed with return code 0.
works just fine.
well, yeah, on discord
whatever the output window is here doesn't perceive tab as that
tab has a unicode value that the renderer doesn't see
that's the command prompt
yea
i don't know what you're using in the second thing as a renderer
there is no squares or wtv
but it doesn't know have the unicode for tab as a displayable character
cool
show me the thing you render this in
What is the thing on the right? Like, is it some gui? Terminal? What exactly?
idk why the space isnt even like the second value on the same x
coordinate
or smt
wdym you mean my ide?
The problem is your text renderer, they probably have some way of spacing text that isn't \t
^^^
its a pygame window
yes, it doesn't know Tab
change it for space and show the PyGame window
Then it probably has problems with tabs. It may be a good idea to report is as issue (bug) in their repo
alr
anyways, PyGame window Font doesn't know what the visual for tab is, so it displays a square
any program that doesn't have a visual for a given symbol does that
πΊ, my favourite unicode symbol, doesn't show on discord
what is it?
πΊπΊπΊ
It does. It's your system that doesn't know this Unicode probably
you see it??
π³
\U000130ba: EGYPTIAN HIEROGLYPH D053 - πΊ
\U000130ba: EGYPTIAN HIEROGLYPH D053 - πΊ
\U000130ba: EGYPTIAN HIEROGLYPH D053 - πΊ
\U000130ba\U000130ba\U000130ba
pls kys π
See the character name in Unicode π
"EGYPTIAN HEIROGLYPH DO53"
πΊ U+130BA penis, phallus with emission | EGYPTIAN HIEROGLYPH D053, copy and paste, unicode character symbol info,
but i won't ponder on it
i am NOT opening that ππ
ok
i think i should close this now
!lock
Thanks to discord.py, sending local files as embed images is simple. You have to create an instance of discord.File class:
# When you know the file exact path, you can pass it.
file = discord.File("/this/is/path/to/my/file.png", filename="file.png")
# When you have the file-like object, then you can pass this instead path.
with open("/this/is/path/to/my/file.png", "rb") as f:
file = discord.File(f)
When using the file-like object, you have to open it in rb ('read binary') mode. Also, in this case, passing filename to it is not necessary.
Please note that filename must not contain underscores. This is a Discord limitation.
discord.Embed instances have a set_image method which can be used to set an attachment as an image:
embed = discord.Embed()
# Set other fields
embed.set_image(url="attachment://file.png") # Filename here must be exactly same as attachment filename.
After this, you can send an embed with an attachment to Discord:
await channel.send(file=file, embed=embed)
This example uses discord.TextChannel for sending, but any instance of discord.abc.Messageable can be used for sending.
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.