Carver Stone
Carver Stone

Reputation: 105

how can I use a literal # in a python variable or string without it commenting out the rest?

Probably simple but I want to send a post with a color hex in it that the target is expecting but I can't set that value in the color key because it comments out everything after it.

Upvotes: 2

Views: 5292

Answers (1)

Moses Koledoye
Moses Koledoye

Reputation: 78546

You can't use # as part of the name of a Python variable (see identifiers and keywords), but you can put # followed by the color code in a string and send it as part of your payload for POSTing:

var = '#42'

Upvotes: 3

Related Questions