#πŸ”’ Why doesn't \t work

84 messages Β· Page 1 of 1 (latest)

dawn dirge
dawn sequoiaBOT
#

@dawn dirge

Python help channel opened

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.

dawn dirge
#

Why doesn't \t work

dawn dirge
#

there is a square

#

instead of a space

wary yew
#

\t?

dawn dirge
#

tab

#

\t

wary yew
#

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

dawn dirge
#

what

#

no

#

thats borinbg

#

look at this

#

one sec

oak scarab
#

hm

#

weird.

#

!e
print("\t")

dawn sequoiaBOT
oak scarab
#

works just fine.

wary yew
wary yew
oak scarab
wary yew
#

tab has a unicode value that the renderer doesn't see

wary yew
oak scarab
#

yea

wary yew
dawn dirge
#

there is no squares or wtv

wary yew
#

but it doesn't know have the unicode for tab as a displayable character

wary yew
wary yew
molten sonnet
dawn dirge
# wary yew cool

idk why the space isnt even like the second value on the same x

#

coordinate

#

or smt

dawn dirge
gritty hollow
wary yew
#

^^^

wary yew
#

change it for space and show the PyGame window

dawn dirge
molten sonnet
wary yew
#

^^^

#

thanks Nicky

wary yew
#

and show us

dawn dirge
wary yew
#

any program that doesn't have a visual for a given symbol does that

#

π“‚Ί, my favourite unicode symbol, doesn't show on discord

dawn dirge
#

π“‚Ίπ“‚Ίπ“‚Ί

wary yew
#

it's an old ancient egyptian letter

molten sonnet
molten sonnet
#

.charinfo π“‚Ί

#

!charinfo π“‚Ίπ“‚Ίπ“‚Ί

dawn sequoiaBOT
dawn dirge
molten sonnet
dawn dirge
wary yew
#

but i won't ponder on it

dawn dirge
#

ok

#

i think i should close this now

#

!lock

dawn sequoiaBOT
#
Sending images in embeds using discord.py

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.

dawn dirge
#

what

#

!close

dawn sequoiaBOT
#
Python help channel closed

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.