Skip to content

Tag: python

Discord.py client.run and bot.run in one code

Not sure that I need to use the both runs at the same time, but: If you run this code and comment the “bot.run(‘ToKeN’)”, the first part of the code will work (def on_message), however the command ‘/help’ will not work. If you change it (comment ‘client.run(‘ToK…

Executing shell commands in Python

I’m working in Linux/Python 3 and am creating some small scripts which consist of executing some commands inside of Python. Example: Pinging a server Output: This is working OK but I don´t need to print everything. How can I get only the first line of the output? Answer You can use a subprocess in pytho…

Create a DataFrame from list in lists (Pandas)

I´m having trouble creating a dataframe on my list. The list contains four columns, but instead it says on presente one column with data: The list itself is presented in this way: I know there is something happening due to the double [], but i can´t figure it out. Can´t someone help me? Here is the code so fa…