#code-help-voice-text

5 messages · Page 1 of 1 (latest)

peak raven
#

!rule 6

keen onyxBOT
#

6. Do not post unapproved advertising.

peak raven
#

@finite grove, is a self promo of youtube playlists allowed in Python Discord?

lost abyss
# peak raven !rule 6

As I asked and this is not a YouTube channel I was trying to share my screen so now I will update without the YouTube

#

Done removed, I’m not an YouTuber

prisma juniper
#

@finite grove nice badges

unkempt harbor
#

ll

keen onyxBOT
#

Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.

ivory palm
#

hello

past laurel
tender hill
#
@__bank.error
async def bank_error(ctx, error):
  if isinstance(error, discord.ext.commands.errors.MissingRequiredArgument):
    await ctx.send("Enter the specified arguments")
  elif isinstance(error, discord.ext.commands.errors.BadArgument):
    await ctx.send("Enter the correct datatype for the specified arguments")
#

@past laurel

#

i have some edits to fix it

#

@past laurel

past laurel
#

oof

#

but
async def __bank(ctx, arg1 = None, member: discord.Member = None, amount: int = None):
not your:
async def __bank(ctx, arg1 = None, member: discord.Member = None, amount: int):

past laurel
#

message

tender hill
#

you cant post link

past laurel
#

yeah

#

i send u my test server

#

u can see all problem

#

he not send any problem

tender hill
#

aah i would recommend you to make separate commands for specific arg1

past laurel
#

and any messages

tender hill
#

like !command.group()

#

!command.group()

past laurel
#

sorry how i can do that

past laurel
#

pls example

tender hill
#

ok let me show you

past laurel
#

voice?

#

pls example code

tender hill
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

tender hill
#

heres an example from my bot

past laurel
#

thx

#

oh it's hard

tender hill
#

!d discord.ext.commands.group

keen onyxBOT
#

discord.ext.commands.group(name=None, **attrs)```
A decorator that transforms a function into a [`Group`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Group "discord.ext.commands.Group").

This is similar to the [`command()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.command "discord.ext.commands.command") decorator but the `cls` parameter is set to [`Group`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Group "discord.ext.commands.Group") by default.

Changed in version 1.1: The `cls` parameter can now be passed.
past laurel
#

ignore_extra=True

#

can u give example for my code

tender hill
# past laurel ignore_extra=True

it means like won't give an error if someone did this

prefix. requried_arg it_would_thorw_error # if ignore_extra wasn't enabled it would throw an error
past laurel
#

I only understood the name of the group

#

what about example for my code

past laurel
tender hill
past laurel
#

it's don't see what i can use in my code

#

ok i see group

tender hill
#

like you can group it like this

past laurel
#

idk what i need to do

#

and idk how i can use group

tender hill
#

i am showing it in your code

past laurel
#

?

#

ok

#

how i can detect arg1

past laurel
#

i starter in discord py

tender hill
#

here an eg inside your code

#

you can continue using it like this

@__bank.command(name = 'balance', aliases = ["баланс"])
async def bank_bal(ctx):
  if cursor.execute(f"SELECT id FROM users WHERE id = {ctx.author.id}").fetchone() is None:
      cursor.execute(f"INSERT INTO users VALUES ('{ctx.author}', {ctx.author.id}, 0, 0, 0)")
      connection.commit()
      await ctx.send(embed = discord.Embed(description ="**Вы {} создали счёт. Номер счёта {}**".format(ctx.author.mention,ctx.author.id)))
    else:
      await ctx.send(embed = discord.Embed(description ="**Вы {} уже создали счёт. Номер счёта {}**".format(ctx.author.mention,ctx.author.id)))
pliant night
#

@fallen blaze Read the voice verification again, it says that if you have any issues with your mic you should contact ModMail.

past laurel
#

Thx

ruby hemlock
#

Baidu

past laurel
#

f ctx.invoked_subcommand is None:
await ctx.send('Invalid sub command passed'
'
')
what is it?

faint hinge
#

@pale turtle client.voice_clients.channel

random stump
#

!stream 471958767735537664 15min

keen onyxBOT
#
Bad argument

Could not convert "duration" into Duration or ISODateTime.
15min is not a valid ISO-8601 datetime string

#
Command Help

!stream <member> [duration]
Can also use: streaming

*Temporarily grant streaming permissions to a member for a given duration.

A unit of time should be appended to the duration.
Units (∗case-sensitive):
y - years
m - months∗
w - weeks
d - days
h - hours
M - minutes∗
s - seconds

Alternatively, an ISO 8601 timestamp can be provided for the duration.*

random stump
#

!stream 471958767735537664 15M

faint hinge
#

!stream 471958767735537664 15M

keen onyxBOT
#

@pale turtle

✅ @pale turtle can now stream.

#

❌ @pale turtle can already stream.

stone breach
#

Database normalization is the process of structuring a database, usually a relational database, in accordance with a series of so-called normal forms in order to reduce data redundancy and improve data integrity. It was first proposed by Edgar F. Codd as part of his relational model.
Normalization entails organizing the columns (attributes) and ...

#

In this video we will begin learning SQL Basics. To get started writing SQL, we need to first set up a server and a database. The server we will be using for these tutorials is Postgres. We'll walk through how to download, install, and setup PostgreSQL. Then we will create our first database so that we can begin writing SQL code. Let's get start...

▶ Play video
tender hill
#
@client.group()
async def __bank(ctx):
  if ctx.invoked_subcommand is None:
    await ctx.send('Invalid sub command passed'
      '')
#

so what this does

#

!

#

!binary encode decimal

stone breach
#

@flat juniper Error Lens

#

Sourcery

flat juniper
#

Thanks again 😄

proven prism
#

incredible

junior otter
#

hey

#

@frank hollow can ya help me

#

my bad thought that was 0

frank hollow
tame knoll
#

!voiceverify

fallen blaze
midnight solar
#

@tender hill @wide rose

#

hey are u guys here for help?

#

can anyone help me

stark compass
#

Hey

hoary arch
#

Hey #code-help-voice-text #off-topic-lounge-text Help Needed (Educational Purpose)
Please help me. I want the code of this:

**The question is about scraping data of colleges in the following order:

College name
Website URL
Principal / Director name
Phone number
E-mail id
Hod name CSE
Phone number
Email id
Scrap the data from the following cities
Maharashtra:
Amaravati
Solapur
Thane

Karnataka;
Mangalore
Belagavi
Shivamogga
Hubi

TamilNadu :
Tiruchirapalli
Salem
Tirunelveli
Puducherry

Odisha:

Cuttack
Rourkela
Sambalpur
Balasore**

#

Please help me with the code.

#

What will be its code ?

plush dagger
plush dagger
hoary arch
plush dagger
#

where do you want to get data from ?

stark compass
#

i have a doubt on pytorch

#

i cant seem to understand the input shate of a conv2d

#

shape*

hoary arch
plush dagger
hoary arch
plush dagger
hoary arch
#

I want the code

stark compass
#

you want us to give code?

plush dagger
#

you wont get such a specific code to do what you want you need to write it

hoary arch
stark compass
#

you can use requests to get the content of page and then use bs4 to use selectors to scrape tha page

#

take a look at bs4 it might help you

plush dagger
stark compass
#

oh

#

im just really confused with the input shape of conv2d

plush dagger
#

like what in a input shape

#

how to pass it ...or what is it ?

stark compass
#

what is it and what to pass in it

plush dagger
#

might find something explaining on youtube

stark compass
#

okay

coarse isle
#

Ayone can help me for this error?

proven otter
#

@coarse isle I don't think you need to make them as variables.

#

Just import them into another file later.

#

@coarse isle but before that what is the output?

quaint totem
#

could i join the vc just bc

#

i like background noise

faint hinge
#

Absolutely

#

The only thing that's gated is talking

#

You're more than free to join

quaint totem
#

mmkay

indigo vortex
#

can anyone help me with tkinter

#

im trying to make a rock paper scissors game with it, and i cant rearrange the buttons that is in a frame. I tried everything and nothing works. I am new to tkinter btw

coarse isle
#

@proven otter i want to deploy this model from jupyter to flask, so i have this code

coarse isle
proven otter
#

Any syntax?

#

@coarse isle

coarse isle
#

this on flask @proven otter

plush dagger
elfin olive
#

Quick question I have installed "Pyenv" eventually after windows 10 issues, however it does not pick up the current global version of python which was installed prior to installing "Pyenv" So I am presuming this is why it is not seeing it when I run "Pyenv versions" . Would I have to manually remove all interpritors installed as well as packages to avoid conflicts when I add them back via "poetry" and "Pyenv" ?

plush dagger
tall forge
#

anyone have tips you can give me, im new to making discord bots

#

all I know so far is how to make a event

#

and commands

long robin
#

@faint hinge May I share my screen for a while?

#

Code help 0

faint hinge
#

!stream 710999172597284884

keen onyxBOT
#

@long robin

✅ @long robin can now stream.

faint hinge
#

Go for it

long robin
#

Thanks

coarse isle
main solar
#

@tidal nest

#

check DM plz

tidal nest
#

Hey guys

#

My first time drawing a Pokémon.

#

This one's a Rockruff

tidal nest
faint hinge
#

That's really good actually

tidal nest
#

Next time I'll draw an Inkling learning Python

tidal nest
#

@hazy dew B***h please. I once created a no-graphics turn-based fighting game in Python.

#

Hey @hazy dew

#

@hazy dew Have you ever met any Brazilian?

#

Hello @vital sinew

faint hinge
#

@little badger I'll be right back, have to talk to mah boss

wild kestrel
#

sure. the rest of us don't miss you at all 😢

faint hinge
#

In fairness I'm working on helping her with all this

worthy badger
#

Can I be dragged in? wigglecheer

#

@faint hinge ^

faint hinge
tired gyro
#

ADARSHRAJ

#

6

#

Go

#

OK

#

😄😁👍💟

faint surge
#

need help with this game i am "trying" to make

#

can someone vc who has experience

#

i started coding yesterday

ruby remnant
#

hi!

ruby remnant
#

@patent cliff hi!

patent cliff
#

hi

#

one sec

#

ah i cant talk

#

oh well

#

@ruby remnant

ruby remnant
#

me too

#

😭

patent cliff
#

i just wanna learn python

ruby remnant
#

me too

#

hello!

past laurel
#

Ignoring exception in on_ready
Traceback (most recent call last):
File "D:\Py\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\artbo\Desktop\ds bot\bot.py", line 40, in on_ready
login = response.message.content()
TypeError: 'str' object is not callable

#

@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
await client.change_presence(status=discord.Status.online, activity=discord.Game(config.GAME))
DiscordComponents(client)
channel_verify = client.get_channel(862786498923593748)
await channel_verify.purge(limit=100)
await channel_verify.send(
embed=discord.Embed(title="Зарегистрироваться на сервере"),
components=[
Button(style=ButtonStyle.green, label="Принять", emoji="✔"),
Button(style=ButtonStyle.blue, label="Почему?")
]
)
response = await client.wait_for("button_click")
if response.channel == channel_verify:
if response.component.label == "Принять":
await response.author.send('Напишите логин')
login = response.message.content()
await response.author.send('Пароль')
password = response.message.content()
print(login,password)
else:
await response.author.send(config.WHY)

naive ore
#

await channel_verify.send(

#
Ignoring exception in on_ready
Traceback (most recent call last):
  File "D: \ Py \ lib \ site-packages \ discord \ client.py", line 343, in _run_event
    await coro (* args, ** kwargs)
  File "C: \ Users \ artbo \ Desktop \ ds bot \ bot.py", line 40, in on_ready
    login = response.message.content ()
TypeError: 'str' object is not callable
[3:07 PM]
@ client.event
async def on_ready ():
  print ('We have logged in as {0.user}'. format (client))
  await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME))
  DiscordComponents (client)
  channel_verify = client.get_channel (862786498923593748)
  await channel_verify.purge (limit = 100)
  await channel_verify.send (
    embed = discord.Embed (title = "Register on the server"),
    components = [
      Button (style = ButtonStyle.green, label = "Accept", emoji = ""),
      Button (style = ButtonStyle.blue, label = "Why?")
    ]
  )
  response = await client.wait_for ("button_click")
  if response.channel == channel_verify:
    if response.component.label == "Accept":
      await response.author.send ('Write login')
      login = response.message.content ()
      await response.author.send ('Password')
      password = response.message.content ()
      print (login, password)
    else:
      await response.author.send (config.WHY)
past laurel
#

I do verification using roles. That is, when a person enters he is given a role and access to the verification channel where he clicks on a button and a text is sent to him in a personal message (Enter login) he writes and then (Enter password) and he writes the password and then he enters this into the database but for the given time for the test, I did it just to output

modern hemlock
#

if response.channel == channel_verify: if response.component.label == "Accept": await response.author.send ('Write login') login = response.message.content await response.author.send ('Password') password = response.message.content print (login, password) else: await response.author.send (config.WHY)

past laurel
#

Russian version: я делаю верификацию с помощью ролей. То есть когда человек заходит ему дают роль и доступ к каналу верефикация где он нажимает на кнопку и ему в личные сообшение отсылают текст (Введите логин) он пишет и потом (Введите пароль) и он пишет пароль и псоле этого он вводит в базу даных но на даное время для теста я сделал чтобы просто выводило

modern hemlock
#

login = response.message.content

#

password = response.message.content

naive ore
#

channel_verify = client.get_channel (862786498923593748)
await channel_verify.purge (limit = 100)
await channel_verify.send ( !!!!!! )
embed = discord.Embed (title = "Register on the server"),
components = [
Button (style = ButtonStyle.green, label = "Accept", emoji = ""),
Button (style = ButtonStyle.blue, label = "Why?")

#

!!!!!

past laurel
#

C:\Users\artbo\Desktop\ds bot>python bot.py
File "C:\Users\artbo\Desktop\ds bot\bot.py", line 29
await channel_verify.send ( !!!!!! )
^
SyntaxError: invalid syntax

#

Ignoring exception in on_ready
Traceback (most recent call last):
File "D:\Py\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\artbo\Desktop\ds bot\bot.py", line 41, in on_ready
login = response.message.content()
TypeError: 'str' object is not callable

naive ore
#
async def on_ready ():
  print ('We have logged in as {0.user}'. format (client))
  await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME))
  DiscordComponents (client)
  channel_verify = client.get_channel (862786498923593748)
  await channel_verify.purge (limit = 100)
  await channel_verify.send 
    embed = discord.Embed (title = "Register on the server"),
    components = [
      Button (style = ButtonStyle.green, label = "Accept", emoji = ""),
      Button (style = ButtonStyle.blue, label = "Why?")
    ]
  )
  response = await client.wait_for ("button_click")
  if response.channel == channel_verify:
    if response.component.label == "Accept":
      await response.author.send ('Write login')
      login = response.message.content ()
      await response.author.send ('Password')
      password = response.message.content ()
      print (login, password)
    else:
      await response.author.send (config.WHY)
past laurel
naive ore
#
async def on_ready ():
  print ('We have logged in as {0.user}'. format (client))
  await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME))
  DiscordComponents (client)
  channel_verify = client.get_channel (862786498923593748)
  await channel_verify.purge (limit = 100)
  await channel_verify.send (" ")
    embed = discord.Embed (title = "Register on the server"),
    components = [
      Button (style = ButtonStyle.green, label = "Accept", emoji = ""),
      Button (style = ButtonStyle.blue, label = "Why?")
    ]
  )
  response = await client.wait_for ("button_click")
  if response.channel == channel_verify:
    if response.component.label == "Accept":
      await response.author.send ('Write login')
      login = response.message.content ()
      await response.author.send ('Password')
      password = response.message.content ()
      print (login, password)
    else:
      await response.author.send (config.WHY)
past laurel
#

C:\Users\artbo\Desktop\ds bot>python bot.py
File "C:\Users\artbo\Desktop\ds bot\bot.py", line 29
embed = discord.Embed (title = "Register on the server"),
IndentationError: unexpected indent

naive ore
#
async def on_ready ():
  print ('We have logged in as {0.user}'. format (client))
  await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME))
  DiscordComponents (client)
  channel_verify = client.get_channel (862786498923593748)
  await channel_verify.purge (limit = 100)
  await channel_verify.send (
embed = discord.Embed (title = "Register on the server"),
  
    components = [
      Button (style = ButtonStyle.green, label = "Accept", emoji = ""),
      Button (style = ButtonStyle.blue, label = "Why?")
    ]
  )
  response = await client.wait_for ("button_click")
  if response.channel == channel_verify:
    if response.component.label == "Accept":
      await response.author.send ('Write login')
      login = response.message.content ()
      await response.author.send ('Password')
      password = response.message.content ()
      print (login, password)
    else:
      await response.author.send (config.WHY)
past laurel
#

C:\Users\artbo\Desktop\ds bot>python bot.py
We have logged in as RpProjetcRed#2154
Ignoring exception in on_ready
Traceback (most recent call last):
File "D:\Py\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\artbo\Desktop\ds bot\bot.py", line 41, in on_ready
login = response.message.content ()
TypeError: 'str' object is not callable

naive ore
#
async def on_ready ():
  print ('We have logged in as {0.user}'. format (client))
  await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME))
  DiscordComponents (client)
  channel_verify = client.get_channel (862786498923593748)
  await channel_verify.purge (limit = 100)
  await channel_verify.send (embed = discord.Embed (title = "Register on the server"),

  
    components = [
      Button (style = ButtonStyle.green, label = "Accept", emoji = ""),
      Button (style = ButtonStyle.blue, label = "Why?")
    ]
  )
  response = await client.wait_for ("button_click")
  if response.channel == channel_verify:
    if response.component.label == "Accept":
      await response.author.send ('Write login')
      login = response.message.content ()
      await response.author.send ('Password')
      password = response.message.content ()
      print (login, password)
    else:
      await response.author.send (config.WHY)

past laurel
#

C:\Users\artbo\Desktop\ds bot>python bot.py
We have logged in as RpProjetcRed#2154
Ignoring exception in on_ready
Traceback (most recent call last):
File "D:\Py\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\artbo\Desktop\ds bot\bot.py", line 41, in on_ready
login = response.message.content ()
TypeError: 'str' object is not callable

modern hemlock
#

response = await client.wait_for ("button_click") if response.channel == channel_verify: if response.component.label == "Accept": await response.author.send ('Write login') login = response.message.content () await response.author.send ('Password') password = response.message.content () print (login, password) else: await response.author.send (config.WHY)

First of all it should be like login = response.message.content and password = response.message.content

Second of all, you need to have some to listen for client event here
await response.author.send ('Write login') # some client event listener login = response.message.content await response.author.send ('Password') # some client event listener password = response.message.content

past laurel
#

()

naive ore
#
@client.event
async def on_ready():
  print('We have logged in as {0.user}'.format(client))
  await client.change_presence(status=discord.Status.online, activity=discord.Game(config.GAME))
  DiscordComponents(client)
  channel_verify = client.get_channel(862786498923593748)
  await channel_verify.purge(limit=100)
  await channel_verify.send("~")
    embed=discord.Embed(title="Зарегистрироваться на сервере"),
    components=[
      Button(style=ButtonStyle.green, label="Принять", emoji=""),
      Button(style=ButtonStyle.blue, label="Почему?")
    ]
  )
  response = await client.wait_for("button_click")
  if response.channel == channel_verify:
    if response.component.label == "Принять":
      await response.author.send('Напишите логин')
      login = response.message.content()
      await response.author.send('Пароль')
      password = response.message.content()
      print(login,password)
    else:
      await response.author.send(config.WHY)
modern hemlock
#

@past laurel , try this:
async def on_ready (): print ('We have logged in as {0.user}'. format (client)) await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME)) DiscordComponents (client) channel_verify = client.get_channel (862786498923593748) await channel_verify.purge (limit = 100) await channel_verify.send embed = discord.Embed (title = "Register on the server"), components = [ Button (style = ButtonStyle.green, label = "Accept", emoji = ""), Button (style = ButtonStyle.blue, label = "Why?") ] ) response = await client.wait_for ("button_click") if response.channel == channel_verify: if response.component.label == "Accept": await response.author.send ('Write login') response = await client.wait_for('message') login = response.message.content await response.author.send ('Password') response = await client.wait_for('message') password = response.message.content print (login, password) else: await response.author.send (config.WHY)

past laurel
#

await channel_verify.send(embed=discord.Embed(title="Зарегистрироваться на сервере"), components=[Button(style=ButtonStyle.green, label="Принять", emoji=""),Button(style=ButtonStyle.blue, label="Почему?")])

#

()

modern hemlock
#

try this:
async def on_ready (): print ('We have logged in as {0.user}'. format (client)) await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME)) DiscordComponents (client) channel_verify = client.get_channel (862786498923593748) await channel_verify.purge (limit = 100) await channel_verify.send( embed = discord.Embed (title = "Register on the server"), components = [ Button (style = ButtonStyle.green, label = "Accept", emoji = ""), Button (style = ButtonStyle.blue, label = "Why?") ] ) response = await client.wait_for ("button_click") if response.channel == channel_verify: if response.component.label == "Accept": await response.author.send ('Write login') response = await client.wait_for('message') login = response.message.content await response.author.send ('Password') response = await client.wait_for('message') password = response.message.content print (login, password) else: await response.author.send (config.WHY)

naive ore
#
@client.event
async def on_ready():
  print('We have logged in as {0.user}'.format(client))
  await client.change_presence(status=discord.Status.online, activity=discord.Game(config.GAME))
  DiscordComponents(client)
  channel_verify = client.get_channel(862786498923593748)
  await channel_verify.purge(limit=100)
  await channel_verify.send(embed=discord.Embed(title="Зарегистрироваться на сервере"),
                                         
    components=[
      Button(style=ButtonStyle.green, label="Принять", emoji=""),
      Button(style=ButtonStyle.blue, label="Почему?")
    ]
  )
  response = await client.wait_for("button_click")
  if response.channel == channel_verify:
    if response.component.label == "Принять":
      await response.author.send('Напишите логин')
      login = response.message.content()
      await response.author.send('Пароль')
      password = response.message.content()
      print(login,password)
    else:
      await response.author.send(config.WHY)
past laurel
#

print("lol")

#

print(
"lol",
"kek"
)

modern hemlock
#

@past laurel , try the code i send you last. it will work

past laurel
#

Ignoring exception in on_ready
Traceback (most recent call last):
File "D:\Py\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\artbo\Desktop\ds bot\bot.py", line 41, in on_ready
login = response.message.content
AttributeError: 'ComponentMessage' object has no attribute 'message'

near gust
#

this is discord bot

modern hemlock
#

okay. login = response.content and password = response.content

#

try doing this

#

here's the whole code:
async def on_ready (): print ('We have logged in as {0.user}'. format (client)) await client.change_presence (status = discord.Status.online, activity = discord.Game (config.GAME)) DiscordComponents (client) channel_verify = client.get_channel (862786498923593748) await channel_verify.purge (limit = 100) await channel_verify.send( embed = discord.Embed (title = "Register on the server"), components = [ Button (style = ButtonStyle.green, label = "Accept", emoji = ""), Button (style = ButtonStyle.blue, label = "Why?") ] ) response = await client.wait_for ("button_click") if response.channel == channel_verify: if response.component.label == "Accept": await response.author.send ('Write login') response = await client.wait_for('message') login = response.content await response.author.send ('Password') response = await client.wait_for('message') password = response.content print (login, password) else: await response.author.send (config.WHY)

past laurel
#

abds = await client.wait_for('message')

modern hemlock
#

dm me if you want and we can talk

past laurel
#

THATS WORK!

#

and how i can send a link to a site and not a text?

modern hemlock
#

you can put links in the embed object

#

link this:
embed = discord.Embed(description="LINK HERE!") await channel_verify.send(embed= embed)
Like this maybe

glossy terrace
#

hey how can i access the voice chat

jaunty marsh
#

Can someone help me i dont know how to make it: i need a list where i can put words and when you do $nice the bot sends you a random word out of this list but it only can be send it one time then it got deletet out of the list

arctic maple
#

iiiing aslamalaicum

main solar
#

@pastel valley I can't speak! Because I haven't a rights!

#

If you want... I can show my Python game on PyGame, called Snake Game For Android!

keen onyxBOT
#

Hey @main solar!

It looks like you tried to attach file type(s) that we do not allow (.zip). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.

Feel free to ask in #community-meta if you think this is a mistake.

#

Hey @main solar!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

elfin olive
#

anyone here very knowledgeable about "Pyenv" ?

outer sandal
#

yea i kinda need help with somthing

#

i think i'm clinically stupid and need help coding

#

img = img.resize((new_d, new_d))
img.save(result)

#

that's the part of code that isn't working

#

result = list(Path("D:").rglob("*.[jJ][pP][gG]"))

#

here's what "result" does

modern hemlock
# outer sandal yea i kinda need help with somthing

I heard somewhere someone talking some research about human behaviour saying, "stupid people think they are stupid and the intelligent people know that they are intelligent"! I guess you do not fall to any of the category

outer sandal
#

oh wait

#

wait

#

i don't get it

slender flume
#

hi guys can someone please help me in debug

light basin
#

Someone know how i can to start python and coding in python?

#

I need some help with it

#

And i really want to know how to coding in python.

sharp merlin
thick pasture
#

I am interested in learning Python...I know some part of beginners but i want to gradually learn the advanced through Jupyter notebook

past laurel
#

if def is before all the variables and it was called after the creation of the variable, will it take the variables or just won't see it? and it is possible to call the same function in a function? Or call the one above in the function below?

stone breach
warm elm
#

Hi

#

I am New to python

#

Can I get Help form this Server

warm elm
#

Thank You Bro

rustic stream
faint hinge
#

!stream 411031233364099072

keen onyxBOT
#

@trail spoke

✅ @trail spoke can now stream.

grave quartz
teal cosmos
#

@turbid lion ?

tender hill
#

@turbid lion ?

faint hinge
#

@toxic walrus Dude, new nickname if you ever make a lot of money: Investergurkan

toxic walrus
#

I’ll wear that name with pride

faint hinge
#

HA

#

That's amazing

timber sequoia
#
def delTip(msg):
    msg = msg.replace("!del tip ", "")    
    msg = normalize(msg)
    print(msg)
    lines, isLine = [], False
    Tips = open(("Python_Bot/Tips.txt"), "r")
    Tips.readlines()
    for line in Tips:
        print(1)
        print(line)
        if line != msg:
            lines.append(line)
        else:
            isLine = True    
    if isLine:
        Tips = open(("Python_Bot/Tips.txt"), "w")
        for line in lines:
            Tips.write(line)
        return "Command deleted"
    else:
        return "Command not found"
knotty holly
#

Tips.readlines() will consume all the lines of the file.

#

Yeah, what Hemlock said!

fallen blaze
#
def delTip(msg):
    msg = normalize(msg.replace("!del tip ", ""))
    print(msg)
    with open("Python_Bot/Tips.txt", "r+") as f:
      d = f.readlines()
      f.seek(0)
      for line in d:
        if line != msg + '\n':
          f.write(line)
      f.truncate()
#

@timber sequoia

onyx dove
#
print(f"{ma = }, {ma.tolist() = }")
print(f"{mb = }, {mb.tolist() = }")
mb[0] = 7
print(f"{ma = }, {ma.tolist() = }")
print(f"{mb = }, {mb.tolist() = }")
#
ma = <memory at 0x7f474406ce80>, ma.tolist() = [1, 2]
mb = <memory at 0x7f474406cf40>, mb.tolist() = [2, 9, 9, 48]
ma = <memory at 0x7f474406ce80>, ma.tolist() = [1, 7]
mb = <memory at 0x7f474406cf40>, mb.tolist() = [7, 9, 9, 48]
plush dagger
faint hinge
#
a b c
    c d e 
onyx dove
#

!e

import numpy as np

class Protocol:
    pass

protocol = Protocol()

a = np.array([1,2])

protocol.__array_interface__ = {'data':a.data, 'shape':(4,), 'typestr':'<i8', 'offset':8}

b = np.array(protocol,dtype=int,copy=False)
b[1:3]=9
ma=a.data
mb=b.data

print(f"{ma = }, {ma.tolist() = }")
print(f"{mb = }, {mb.tolist() = }")
mb[0] = 7
print(f"{ma = }, {ma.tolist() = }")
print(f"{mb = }, {mb.tolist() = }")
keen onyxBOT
#

@onyx dove :white_check_mark: Your eval job has completed with return code 0.

001 | ma = <memory at 0x7fe289e34280>, ma.tolist() = [1, 2]
002 | mb = <memory at 0x7fe289e34400>, mb.tolist() = [2, 9, 9, 140611006434576]
003 | ma = <memory at 0x7fe289e34280>, ma.tolist() = [1, 7]
004 | mb = <memory at 0x7fe289e34400>, mb.tolist() = [7, 9, 9, 140611006434576]
wheat anchor
#

!e

while True:
  print("Lets go!")
keen onyxBOT
#

@wheat anchor :x: Your eval job has completed with return code 143 (SIGTERM).

001 | Lets go!
002 | Lets go!
003 | Lets go!
004 | Lets go!
005 | Lets go!
006 | Lets go!
007 | Lets go!
008 | Lets go!
009 | Lets go!
010 | Lets go!
011 | Lets go!
... (truncated - too many lines)

Full output: too long to upload

faint hinge
#

Good effort

#

We actually encourage people to try to break the eval

terse heath
#

What's typestr in array interface

faint hinge
#

But if you're going to, #bot-commands

wheat anchor
#

!e

curl -v 'https://api.ipify.org?format=json'
keen onyxBOT
#

@wheat anchor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     curl -v 'https://api.ipify.org?format=json'
003 |             ^
004 | SyntaxError: invalid syntax
wheat anchor
#

!e

from requests import get

print(get("https://api.ipify.org?format=json").json()))
keen onyxBOT
#

@wheat anchor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 3
002 |     print(get("https://api.ipify.org?format=json").json()))
003 |                                                           ^
004 | SyntaxError: unmatched ')'
wheat anchor
#

!e

from requests import get

print(get("https://api.ipify.org?format=json").json())
keen onyxBOT
#

@wheat anchor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'requests'
weak token
#

!e

keen onyxBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code
block. Code can be re-evaluated by editing the original message within 10 seconds and
clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an
issue with it!*

weak token
#

!e [while True: print("Noice")]

keen onyxBOT
#

@weak token :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     [while True: print("Noice")]
003 |      ^
004 | SyntaxError: invalid syntax
weak token
#

!e while True:
print("Noice")

keen onyxBOT
#

@weak token :x: Your eval job has completed with return code 143 (SIGTERM).

001 | Noice
002 | Noice
003 | Noice
004 | Noice
005 | Noice
006 | Noice
007 | Noice
008 | Noice
009 | Noice
010 | Noice
011 | Noice
... (truncated - too many lines)

Full output: too long to upload

edgy zinc
#

Could anyone demo for me how to make a linked list from a list?

orchid rampart
#

!e
print("Hello")

#

!e import pygame

#

pip install pygame

#

!e pip install pygame

#

!e help

#

!e

#

!e
for i in range(1000):

#

!e for i in range(100):
print("Hi guys")

#

!e for i in range(100): print("hello world")

swift berry
#

!e print('hello world')

#

<@&267628507062992896> be carefully with this .!e that can run codes python, is possible to find some exploit in this easily....

uneven belfry
#

We encourage you to try and break it.

swift berry
#

okay

round socket
#

It's a sandboxed environment. It's fine.

swift berry
#

nice

errant tendon
#

You can't override inner functions in a method right?

swift berry
errant tendon
#

class Foo:
    """ Class to format strings """

    def bar(self, string: str) -> str:
        """ Formats string """

        def _formatter(string: str) -> str:
            return string.lower()

        return _formatter(string)


class BetterFoo(Foo):
    """ Extension class to replace formatter in bar() """

    # obviously this doesn't work
    def bar._formatter(string: str) -> str:
        pass```
faint hinge
swift berry
swift berry
#

If i find something i will talk with you admins as well

faint hinge
#

Like the def bar._formatter

errant tendon
#

just needed a shorthand for it

#

since i can't do it anyway i just made it up haha

faint hinge
#

Right right

errant tendon
# faint hinge Right right

the outer method i want to override requires globals and stuff that i just don't want to copy into my own file.

faint hinge
#

I mean you could still use the formatter in the class space and have the bar still call it

#

Would... no wait, that'd still call it's local one

#

Hmm

keen onyxBOT
#

Lib/json/encoder.py line 223

def floatstr(o, allow_nan=self.allow_nan,```
frank mortar
#

heey can someone help me with a thing

#

like i cant plot a list and i've tried some stuff but doesnt work

faint hinge
#

Gotta give more information

frank mortar
#

i have to plot "previsao" = predictions

#

i tried to turn "previsao' into a df, but i cant set the index (?)

split topaz
#

ok bro

#

yea

#

i joined server on 15th of july

#

yea yea

#

now audible

#

@main solar

#

yea

#

at 2 am i will get access

#

yes yes

#

u know python right?

#

wow

#

great to meet u

#

actually i am noob in english

#

yes

#

ohh

#

so ur native is english?

#

ur english is good

#

i am doing engineering, wbu?

#

lol

#

i am at first year

#

and u know python and i didn't

#

sad

#

no

#

mechanical eng

#

but i have to learn python

#

i learned it as a beginner

#

yea

#

i am a beginner

#

i learned functions loops data types

#

only

#

correct

#

yea yea

#

u?

#

nice bro

#

can u accept friend req?

#

please

#

so u know hindi as well?

#

no no there are south people who didn't knew hindi

#

thats why i asked u

#

lol

#

it was random

#

hahaha

#

@trail spoke

#

aur bta bhai

#

lol no bruh

#

thats not i mean

#

😁

#

even i am also against it

#

yes bro @main solar

idle basin
keen onyxBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

idle basin
#

Uh Oh I am just sayin!

#

Well, the chats aha!

#

Long long long

split topaz
#

yea

#

u forgot me i guess?

#

isn't it?

idle basin
#

No>

#

The internship thing you asked?

split topaz
#

ya

#

haha

idle basin
#

😉

split topaz
#

😁

restive prism
#

@main solar

#
cats = ["Meowie", "Poato", "Pickle"]
cats.append("Lolo")
#

cats = cats.append("Lolo")

#

@main solar

tawdry rampart
#

wtf i have a bot

restive prism
#

sorry

#

wrong tag xD

tawdry rampart
#

dw lol

main solar
#

no you don't

#

lmao

restive prism
#
catnames = ["meowieee", "potato", "pickle"]
main solar
#

random.choice(catnames)

restive prism
#

catnames[0]

#

0 1 2

main solar
#
name_dict = [
    "Alysa": 1,
    "Jeff": 2,
    "Aiden": 3
]

print([name_dict(Alysa)])```
restive prism
#

print(name_dict[Alysa])

tidal glade
#

can someone help me and my friend with a code in a vc

plush dagger
tidal glade
tender hill
#

@unique plank you want help?

unique plank
#

Does anyone have a lot of experience using the matplotlib backend for Tkinter?

hexed moat
#

In for loop patterns, the iterations and the changing of variables, how do I know what pattern for example program X output? Like, It's hard to follow each step and iterations. Does anyone has solutions or ideas to help me?

past laurel
#

code:

 response = await client.wait_for("button_click")
 role_join = discord.utils.get(response.guild.roles, id=859133201770348586)
 await response.add_roles(role_join)```
error:
```AttributeError: 'Interaction' object has no attribute 'add_roles'```
topaz sail
#

!voiceverify

tender hill
#

join vc

#

remove the space in print (The_Text)

#

make it print(The_Text)

#

and add this line at the end of the while True loop and show me the output

#
print(timer-current_time)
#

okay i see why it dosent owrk

#

work*

#

because untill the user enters his input we dont reach that while statment

#
while True:
    Options = ['Rearrange and Type', 'Subscribe to MrBeast', 'I love using Discord', 'Give me the Money', 'Shoutout to People for halp', 'I love my Parents xddd', 'North Korea is amazing ngl', 'Roblox is shit lol']

    bruh = random.choice(Options)
    The_Text = Spin_Back(bruh)
    The_Text2 = Spin_Front(bruh)
    print(The_Text)

    The_Write = input('Write this Backwards!')
    current_time = time.perf_counter()
    if current_time - timer >= 5:
         print('You failed to Complete this in Time')
         break
    if The_Write == The_Text2:
        print('Correct!')
    else:
        print('Keep Trying!')
#

ye cause it dosent reaches the logic untill the user enter the input

#

you might want to use threading for this

#

why?

#

okay watch a video on threading.timer

#

it would help

hazy dew
#

Arch Kansas

potent mortar
#

yo, someone wanna help me gettin started?

queen finch
#

pip is like nuget

#

windows comes with linux

#

wow

#

not mingw

#

I mean real linux

#

personally I like the mac M1 way better than all that jazz

frank hollow
#

@small storm you can ask here

small storm
#

@frank hollow I have completed my python project. When I run it in compiler it works so good without any problem. However, the problem is that I have no idea about how can I convert into application or normal consol application to run it in another pc
if you have knowledge about it
please can you help me

#

I have py file
it is kinda bot
it will work endless in the consol
when I run it in visual studio it works
but wanna convert it as an application
when I click it, it should work without compailer

#

no it will have access

#

but if I try to run it in py file

#

it doesn't work

#

how can I convert it like console project

#

yes

vital sinew
#

we are always here

#

we are the Everpresent

snow spire
sudden dew
#

\

#

wap to enter the number and limit at runtime and display the multiples in pytho

#

can anyone help me to find the output

hallow saddle
#

i need help

#

I need help am work on python crash course alien invasion and keep getting errors pyTraceback (most recent call last):

File "C:\Users\Ryan Saroop\PycharmProjects\pythonProject3\venv\alien_invasion.py", line 55, in <module>
  run_game()
File "C:\Users\Ryan Saroop\PycharmProjects\pythonProject3\venv\alien_invasion.py", line 40, in run_game
  gf.update_screen(ai_settings, screen, ship,alien ,bullets )
File "C:\Users\Ryan Saroop\PycharmProjects\pythonProject3\venv\game_functions.py", line 80, in update_screen
  for bullet in bullets.sprite():
AttributeError: 'Group' object has no attribute 'sprite'
#
this is alien_invasion 
import pygame.display

from setting import Settings
from ship import Ship
from alien import Alien
import game_functions as gf
from pygame.sprite import Group

def run_game():
    bg_color = (230, 230 , 230)

    pygame.init()
    ai_settings = Settings()
    screen = pygame.display.set_mode(
        (ai_settings.screen_width, ai_settings.screen_height))
    pygame.display.set_caption("Alien Invasion")
    # Make a ship, a group of bullets, and a group of aliens.
    #Make a SHIP
    ship = Ship(ai_settings, screen)
    # Make a group to store bullets in.
    bullets = Group()
    aliens = Group()
    # Make an alien.
    alien = Alien(ai_settings, screen, )

    # Create the fleet of aliens.
    gf.create_fleet(ai_settings, screen, aliens)



    while True:
        screen.fill(bg_color)
        ship.update()
        gf.check_events(ai_settings, screen, ship, bullets,)
        # Get rid of bullets that have disappeared.
        for bullet in bullets.copy():
            if bullet.rect.bottom <= 0:
                bullets.remove(bullet)
        print(len(bullets))
        gf.update_screen(ai_settings, screen, ship,alien ,bullets )
        # Redraw the screen during each pass through the loop.
        screen.fill(ai_settings.bg_color)
        ship.blitme()

        # Make the most recently drawn screen visible.
        pygame.display.flip()

        bullets.update()
        gf.update_bullets(bullets)





run_game()
keen onyxBOT
#

Hey @hallow saddle!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

hot quiver
boreal bluff
#

What should i do for learning python very fast

plush dagger
boreal bluff
plush dagger
#

do you have experience with programming ?

boreal bluff
#

Find the sum of elements arr = “10,20,30,40,50,60,70” like this type

boreal bluff
plush dagger
#

learn variables ..data types ..then data structures ...later learn loops then start solving this

terse wasp
#

Hi guys, i am getting this error, anyone could help? ``/usr/local/bin/python3.9 /Users/vincentz/Documents/sre-rre/app/src/controller/init.py
Traceback (most recent call last):
File "/Users/vincentz/Documents/sre-rre/app/src/controller/init.py", line 2, in <module>
import pandas
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/init.py", line 11, in <module>
import(dependency)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/init.py", line 139, in <module>
vinfo = get_versions()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/_version.py", line 21, in get_versions
return json.loads(version_json)
AttributeError: module 'json' has no attribute 'loads'

Process finished with exit code 1``

#

and this is my code:


# This file was generated by 'versioneer.py' (0.19) from
# revision-control system data, or from the parent directory name of an
# unpacked source archive. Distribution tarballs contain a pre-generated copy
# of this file.

import json

version_json = '''
{
 "date": "2021-07-18T11:34:41-0600",
 "dirty": false,
 "error": null,
 "full-revisionid": "df6d2600c51502e1877aac563658d0616a75c5e5",
 "version": "1.21.1"
}
'''  # END VERSION_JSON


def get_versions():
    return json.loads(version_json)
brittle mirage
#

bye have a grate time

main solar
#

@tame fulcrum

short field
#

hey i need some help with a python problem. I'm new to the community. Whats the best way to go about getting some help?

#

so I am trying to code a solution to this problem. I reckon I could do it using iteration but im practicing my recursion. I managed to get the base maths working. All thats left to do is the recursive part. But every time i do i get an error 😦

#

def pascals_triangle(n):
from math import factorial
if n ==1:
return 1
else:
answer = [(factorial(n)/(factorial(k)*factorial(n-k)) for k in range(n+1)), pascals_triangle(n-1)]
print(answer)

pascals_triangle(2)
[<generator object pascals_triangle.<locals>.<genexpr> at 0x7ff50bf21e40>, 1]

#

anyone have any ideas?

#

also I know this wont return a list in the case n=1 but im just trying to get it working for n>1 for now

tacit tinsel
#

Hi, I'm very new to python.

I need to get first line of the file, how do I do this?

#

Guys?

#

Of a simple text file

wheat anchor
#
with open("test.txt", "r") as my_file:
    print(my_file.read())
tacit tinsel
#

I mean yeah, I've googled it

wheat anchor
tacit tinsel
#

But I don't really understand how it works

#

doesn't read() returns you the whole file?

#

yeah, readline is a good thing

#

Didn't noticed it

wheat anchor
#
[*open("test.txt", "r")][0]
tacit tinsel
#

Yes, that's what I was searching for

wheat anchor
#
with open('myfile.txt') as f:
    first_line = f.readline()
tacit tinsel
#

Alright

#

tx

cold schooner
#

can anyone help me solve 4 queen using pysat gulucose3 ? thanks very much

main solar
#

اه

#

hi

keen onyxBOT
main solar
#

come someone help me with Tkinter?

main solar
upbeat delta
#

yep

weak bay
#

hey everyone

#

I needed some help

burnt prawn
#

hi

#

with>

#

?*

bitter pumice
#

i cant run tkinter from vs code can someone help me?

thick flower
grim crescent
#

can some one help to learn

thick flower
faint hinge
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

thick flower
#
  width: 96%;
  height : 10%;
  background-color : rgb(255,255,255);
  position:fixed;
  top: 0;
}

body{
  background-color : rgb(123,123,164);
}

ul#nav li{
  display:inline;
  padding : 30px;
  text-align : center;
  font-size : 16pt;
}```
#

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Resu-Me</title>
  <link rel="stylesheet" href="../static/style.css">
</head>

<body>
    <ul style="list-style-type:none;" id="nav">
      <li>Home</li>
      <li>About</li>
      <li>Search</li>
      <li>Contact Us</li>
    </ul>
</body>
</html>```
faint hinge
#
ul#nav{
  width: 96%;
  height : 10%;
  background-color : rgb(255,255,255);
  position:fixed;
  top: 0;
  margin: 0;
}
thick flower
#

helllp

night barn
#

df_cleaned[df_cleaned['...'].value_counts() > 20_000]

#

@untold terrace

crystal flame
#

sry man

night barn
#
that_column_name = ...
enough_instances = (df_cleaned[that_column_name].value_counts() > 20_000).reset_index()
enough_instances.columns = [that_column_name, 'enough']
counted = pd.merge(df_cleaned, enough_instances, on=that_column_name)
counted[counted['enough']]
untold terrace
#

Thanks @night barn 🙏 Appreciated 👍

night barn
crystal flame
#

@boreal comet thanks , yea i will do that

gloomy plover
#

How do you tell how long you have been on the server?

#

Oops wrong channle

shadow schooner
#

?whoami

#

nvm not that

#

.whois @shadow schooner

#

!whois @shadow schooner

#

ok i give up

gloomy plover
#

!whoami

#

!home

keen onyxBOT
#
Python Discord website

Our official website is an open-source community project created with Python and Django. It contains information about the server itself, lets you sign up for upcoming events, has its own wiki, contains a list of valuable learning resources, and much more.

faint hinge
#

!e

import numpy as np
from dis import dis

def np_test_1(data):
  return data[0][data[1] >= 0.75]

def np_test_2(data):
  index_list = np.where(data[1] >= 0.75)
  return data[0][index_list]

def np_test_alt_2(data):
  return data[0][np.where(data[1] >= 0.75)]

def np_test_3(data):
  return data[0, data[1] >= 0.75]

dis(np_test_1)
dis(np_test_2)
dis(np_test_alt_2)
dis(np_test_3)
keen onyxBOT
#

@faint hinge :white_check_mark: Your eval job has completed with return code 0.

001 |   5           0 LOAD_FAST                0 (data)
002 |               2 LOAD_CONST               1 (0)
003 |               4 BINARY_SUBSCR
004 |               6 LOAD_FAST                0 (data)
005 |               8 LOAD_CONST               2 (1)
006 |              10 BINARY_SUBSCR
007 |              12 LOAD_CONST               3 (0.75)
008 |              14 COMPARE_OP               5 (>=)
009 |              16 BINARY_SUBSCR
010 |              18 RETURN_VALUE
011 |   8           0 LOAD_GLOBAL              0 (np)
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/oyoxecogoh.txt?noredirect

faint hinge
#

!e

import numpy as np
from dis import dis

def np_test_1(data):
  return data[0][data[1] >= 0.75]

def np_test_2(data):
  index_list = np.where(data[1] >= 0.75)
  return data[0][index_list]

def np_test_alt_2(data):
  return data[0][np.where(data[1] >= 0.75)]

def np_test_3(data):
  return data[0, data[1] >= 0.75]

print("Testing first implementation")
dis(np_test_1)
print("\nTesting second implementation")
dis(np_test_2)
print("\nTesting alternative second implementation")
dis(np_test_alt_2)
print("\nTesting third implementation")
dis(np_test_3)
keen onyxBOT
#

@faint hinge :white_check_mark: Your eval job has completed with return code 0.

001 | Testing first implementation
002 |   5           0 LOAD_FAST                0 (data)
003 |               2 LOAD_CONST               1 (0)
004 |               4 BINARY_SUBSCR
005 |               6 LOAD_FAST                0 (data)
006 |               8 LOAD_CONST               2 (1)
007 |              10 BINARY_SUBSCR
008 |              12 LOAD_CONST               3 (0.75)
009 |              14 COMPARE_OP               5 (>=)
010 |              16 BINARY_SUBSCR
011 |              18 RETURN_VALUE
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/yexovatevo.txt?noredirect

gloomy plover
#

brb]

#

My sisters are being quite loud

#

@stone breach , Sorry to bother you, but what VS-Code theme do you have?

stone breach
gloomy plover
#

oops

main solar
#

i created a program in python it works but not until the end

i also created a path that compiles the .py to .exe

does it matter
?

still pier
#

i am new to python so i want a guy who helps me and chill

robust atlas
#

so you can just chill in coice chat and i think some1 will come and help you

#

or just watch youtube tutorials

#

therre are a few good 12h or jsut 8h courses

keen onyxBOT
#

Hey @spiral crane!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

spiral crane
#

The code:
https://pastebin.com/wSkKb5RM
The out put
https://i.imgur.com/hHPpZ9g.png

Hi... i need help
it isnt realy hard but i donst get it.

i start to analyse data with Panda. So first i have to convert my list 4 exampel ping = [14.547, 11.589 , ...]
in to panda data frames. so far ist works good but now i donst understand wy he does things like that Output

i just wonne the Speed_test_frame looks like Speed_Test only that Uhrzeit is now a Index.

But now he put the List in evvry part of a index reealy strange https://i.imgur.com/vaGHjUX.png
but i wonne that he just take only one part of the list not all the parts togeher. like in the Spedtest before

#

so i just wont [Uhrzeit] to Index. it works also . but now he dons strange thing with the data

spiral crane
#

oh i figurout

#

i put a dict in a dict

#

thats wrong

grand ridge
#

hi

forest hill
twilit vine
#

1 more day so i can speak

#

idk, the coding den discord will help u

random stump
#

need help @pastel zodiac ?

pastel zodiac
#

Hi yes need help please

random stump
#

what is it about?

pastel zodiac
#

python lists - I'll share an example

#

I have two lists

#

a = [0,1,2,3,4,5,6,7,8,9,10,11]

#

b = [1,2,5,6,8,9,10]

#

I want to find the range of values in list b that occur in list a

random stump
#

do you want a voice chat for this or will text do as well?

pastel zodiac
#

e.g the expected output would be: 1-2, 5-6, 8-10

#

voice chat would be great thanks!

random stump
#

am I audible ?

pastel zodiac
#

yes I can hear you

#

can you hear me?

random stump
tender hill
random stump
#

thats a great solution

#

I was also thinking of using filter/list comprehensions

#

have you heard of the filter method or list comprehensions before @pastel zodiac ?

pastel zodiac
#

thanks for the suggestion - I have done that already, I'm having trouble defining the ranges for the expected output

tender hill
#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,4,5,6,8,9,10]

common = list(set(b) & set(a))
print(len(common))
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

8
random stump
tender hill
#

is that the expected output?

pastel zodiac
#

the expected output would be: 1-2, 5-6, 8-10

random stump
#

do you want them to be range() objects?

tender hill
#

why did you exclude it?

pastel zodiac
#

sorry - typo

#

I edited the list a few seconds ago

#

apologies

random stump
#

ah, that would require a little bit more work, the logic should be to check if the next number is +1 of the current number, if yes, then keep incrementing the range final num, this sorta logic, have you tried anything similar?

pastel zodiac
#

yes I have tried to implement something I can share here if possible

#

how do I run python in this chat window?

random stump
#

I think this would be better if we moved to a help channel, I am little busy as of now, @tender hill can assist you and other might join in a new help channel, try claiming one, instructions to claim a help channel are in #❓|how-to-get-help

tender hill
#

you !e and write your python code

pastel zodiac
#

!e

keen onyxBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code
block. Code can be re-evaluated by editing the original message within 10 seconds and
clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an
issue with it!*

random stump
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

tender hill
#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

common = list(set(b) & set(a))
print(common)
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

[1, 2, 5, 6, 8, 9, 10]
#

@pastel zodiac :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 | NameError: name 'c' is not defined
#

@pastel zodiac :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 20, in <module>
003 | NameError: name 'range_list' is not defined
#

@pastel zodiac :warning: Your eval job has completed with return code 0.

[No output]
random stump
#

try wrapping your code around back ticks

#

like this

pastel zodiac
#

!e ```python
a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

#expected output is 1-2, 5-6, 8-10

the lists need to be srings, so

a = [str(i) for i in a]
b = [str(i) for i in b]

#get first instance on b in a
a_start = a.index(b[0])
a_stop = a.index(b[-1])

#list to keep ranges

range_list = []
for i,v in enumerate(a[a_start:a_stop+1]):
if v not in b:
range_add = "{} - {}".format(a[a_start],a[a_start+i-1])
range_list.append(range_add)
a_start = a.index(v)

print(range_list)

keen onyxBOT
#

@pastel zodiac :white_check_mark: Your eval job has completed with return code 0.

['1 - 2', '3 - 5', '4 - 9']
pastel zodiac
#

any ideas what could be going wrong here?

tender hill
#

umm you can try doing your thing with this output

[1, 2, 5, 6, 8, 9, 10]
pastel zodiac
#

it has to be ranges unfortunately

#

@tender hill I think we're not far off a solution with some tweaks here and there. I think the issue is partly with a_start = a.index(v)

tender hill
#

alright let me try to understand our code

#

your*

pastel zodiac
#

thanks for looking

tender hill
#

umm you are like changing the value of a_start in the for loop which is running on the basis of that so dont do that

pastel zodiac
#

okay will change that

#

shouldn't be a problem though e.g !e ```python
x=10
for i in range(x):
x=9
print(x)

#

!e ```python
x=10
for i in range(x):
x=9
print(x)

keen onyxBOT
#

@pastel zodiac :white_check_mark: Your eval job has completed with return code 0.

001 | 9
002 | 9
003 | 9
004 | 9
005 | 9
006 | 9
007 | 9
008 | 9
009 | 9
010 | 9
pastel zodiac
#

still prints 10 times

tender hill
#

you see it ran it 10 times

#

instead of 99

#

9*

pastel zodiac
#

yeah exactly, so declaring a different x doesn't change the for loop

#

which is what we want in our example

tender hill
#

like remove this line a_start = a.index(v)

pastel zodiac
#
a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

#expected output is 1-2, 5-6, 8-10

# the lists need to be srings, so 

a = [str(i) for i in a]
b = [str(i) for i in b]

#get first instance of b in a
a_start = a.index(b[0])
a_stop = a.index(b[-1])

#list to keep ranges 

range_list = []
for index,value in enumerate(a[a_start:a_stop+1]):
  if value not in b:
    range_add = "{} - {}".format(a[a_start],a[a_start+index-1])
    range_list.append(range_add)
    a_start = a.index(value)

print(range_list)

#

in this example we want a_start in the for loop to stay the same

tender hill
#

okay then remove this line a_start = a.index(v)

#

as it does nothing

pastel zodiac
#

but we want to change a_start, so we can update the range values

#

python range_add = "{} - {}".format(a[a_start],a[a_start+index-1])

#

!e ```python
a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

#expected output is 1-2, 5-6, 8-10

the lists need to be srings, so

a = [str(i) for i in a]
b = [str(i) for i in b]

#get first instance of b in a
a_start = a.index(b[0])
a_stop = a.index(b[-1])

#list to keep ranges

range_list = []
for index,value in enumerate(a[a_start:a_stop+1]):
if value not in b:
range_add = "{} - {}".format(a[a_start],a[a_start+index-1])
range_list.append(range_add)

print(range_list)

keen onyxBOT
#

@pastel zodiac :white_check_mark: Your eval job has completed with return code 0.

['1 - 2', '1 - 3', '1 - 6']
tender hill
#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

#expected output is 1-2, 5-6, 8-10

# the lists need to be srings, so 

a = [str(i) for i in a]
b = [str(i) for i in b]

#get first instance of b in a
a_start = a.index(b[0])
a_stop = a.index(b[-1])
print("a:",a_start, a_stop)
#list to keep ranges 

range_list = []
for index,value in enumerate(a[a_start:a_stop+1]):
  if value not in b:
    range_add = "{} - {}".format(a[a_start],a[a_start+index-1])
    range_list.append(range_add)
    a_start = a.index(value)
    print("a:",a_start, a_stop)
print(range_list)
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

001 | a: 1 10
002 | a: 3 10
003 | a: 4 10
004 | a: 7 10
005 | ['1 - 2', '3 - 5', '4 - 9']
pastel zodiac
#

removing it keep the 1st range value as 1 each time

tender hill
#

you see what happened?

pastel zodiac
#

no please elaborate 🙂

tender hill
#

okay first it takes like 1,2 then it comes to the loop as 3 is not in b so

range_add = "1-2"
a_start = 3
pastel zodiac
#

yep - I'm with you

tender hill
#

now 4 is not in b so it runs the logic once again

range_add = "3-5"
a_start = 5
#

now it sees 7 is not in the list

range_add = "4-9"
a_start = 8
#

the problem is in a[a_start+index-1] this part

pastel zodiac
#

oh okay - how should we change this?

tender hill
#

just use index instead

#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

#expected output is 1-2, 5-6, 8-10

# the lists need to be srings, so 

a = [str(i) for i in a]
b = [str(i) for i in b]

#get first instance of b in a
a_start = a.index(b[0])
a_stop = a.index(b[-1])
print("a:",a_start, a_stop)
#list to keep ranges 

range_list = []
for index,value in enumerate(a[a_start:a_stop+1]):
  if value not in b:
    range_add = "{} - {}".format(a[a_start],a[index])
    range_list.append(range_add)
    a_start = a.index(value)
    print("a:",a_start, a_stop)
print(range_list)
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

001 | a: 1 10
002 | a: 3 10
003 | a: 4 10
004 | a: 7 10
005 | ['1 - 2', '3 - 3', '4 - 6']
tender hill
#

the problem is also now a_start = a.index(value)

#

!e

#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

#expected output is 1-2, 5-6, 8-10

# the lists need to be srings, so 

a = [str(i) for i in a]
b = [str(i) for i in b]

#get first instance of b in a
a_start = a.index(b[0])
a_stop = a.index(b[-1])
print("a:",a_start, a_stop)
#list to keep ranges 

range_list = []
for index,value in enumerate(a[a_start:a_stop+1]):
  if value not in b:
    range_add = "{} - {}".format(a[a_start],a[index])
    range_list.append(range_add)
    a_start = a.index(value)+1
    print("a:",a_start, a_stop)
print(range_list)
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

001 | a: 1 10
002 | a: 4 10
003 | a: 5 10
004 | a: 8 10
005 | ['1 - 2', '4 - 3', '5 - 6']
pastel zodiac
#

@tender hill do you think this a good approach or is there a better way to do this?

tender hill
#

do you want me to show them or shall i debug this

pastel zodiac
#

yes please share a more elegant solution if you have one

tender hill
#

okay in a min

#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

common = list(set(b) & set(a))
f_term = b[0]
for index,n in enumerate(common):
  if common[index-1] + 1 != n:
     ret.append(f"{str(f_term)} - {str(common[index-1])}")
     f_term = n
print(ret)
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

['1 - 1026']
tender hill
#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

common = list(set(b) & set(a))
f_term = b[0]
ret = []
for index,n in enumerate(common):
  if common[index-1] + 1 != n:
     ret.append(f"{str(f_term)} - {str(common[index-1])}")
     f_term = n
print(ret)
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

['1 - 10', '1 - 2', '5 - 6']
tender hill
#

wait

#

@pastel zodiac

#

!e

a = [0,1,2,3,4,5,6,7,8,9,10,11]
b = [1,2,5,6,8,9,10]

common = list(set(b) & set(a))
f_term = b[0]
ret = []
for index,n in enumerate(common):
  if common[index-1] + 1 != n:
     ret.append(f"{str(f_term)} - {str(common[index-1])}")
     f_term = n
  elif index == len(common)-1:
     ret.append(f"{str(f_term)} - {str(common[index])}")

ret.pop(0)
print(ret)
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

['1 - 2', '5 - 6', '8 - 10']
pastel zodiac
#

you got it

tender hill
#

sorry i was doing my class

pastel zodiac
#

nice solution !

#

thanks a bunch!

tender hill
#

lol bunch

pastel zodiac
#

loool

little imp
main solar
#

does anyone know gpt2

#

hugging face transformers its gpt2

#

could anyone know how to code this

#

?

#

@limpid glade

keen onyxBOT
#

@main solar :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 | SyntaxError: can't use starred expression here
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code
block. Code can be re-evaluated by editing the original message within 10 seconds and
clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an
issue with it!*

#

@main solar :white_check_mark: Your eval job has completed with return code 0.

1
main solar
#
return self.api_client.call_api(
            '/crm/v3/extensions/accounting/invoice/{invoiceId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InvoiceReadResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
vital sinew
strong vigil
zinc quartz
#

y tf r u using an iso to start up a vm

blazing estuary
#

@little imp try using break

steady saddle
#

anyone 1 who is good at python can help me out , I am not new at programming and have idea what to do have few questions and nuances to ask

#

but have few questions

elfin olive
#

Hi cant help with that not very familiar

elfin olive
steady saddle
#

@elfin olive I mean can I screen share and show you

#

I have everything pulled up

#

I just havent worked with GUI

faint hinge
#

What's your question?

steady saddle
#

yes

#

@faint hinge I wish i can screen share , and show what i already did

#

I am not new I have idea what to do i just need nuances to ask have to show and ask

faint hinge
#

Sure, but I'm still trying to understand like... even generally what you're needing to know

steady saddle
#

its more like few questions nothing specific , I am learning this , and I wanna be efficient I dont wanna take your time so much

#

would you mine to move me let me screen share ill show you

faint hinge
#

!stream 217965029050417153

keen onyxBOT
#

✅ @steady saddle can now stream until <t:1628085377:f>.

faint hinge
#
Text('This is some text', font='Courier 12', text_color='blue', background_color='green')
#

!stream 217965029050417153 1h

keen onyxBOT
#

✅ @steady saddle can now stream until <t:1628089041:f>.

faint hinge
#

tkinter

#
import tkinter as tk

class Application(tk.Frame):
    def __init__(self, master=None):
        super().__init__(master)
        self.master = master
        self.pack()
        self.create_widgets()

    def create_widgets(self):
        self.hi_there = tk.Button(self)
        self.hi_there["text"] = "Hello World\n(click me)"
        self.hi_there["command"] = self.say_hi
        self.hi_there.pack(side="top")

        self.quit = tk.Button(self, text="QUIT", fg="red",
                              command=self.master.destroy)
        self.quit.pack(side="bottom")

    def say_hi(self):
        print("hi there, everyone!")

root = tk.Tk()
app = Application(master=root)
app.mainloop()
faint hinge
faint hinge
#

!stream 217965029050417153

keen onyxBOT
#

✅ @steady saddle can now stream until <t:1628090040:f>.

tender hill
#

@arctic creek do you need help?

spiral crane
#

hi Guys . what is the most common thing to publish a Python script like py2exe for example? Most time i have some issues with that tool for example with pandas=

bright moth
#

I have this issue too

#

and with extensions

#

and if I should learn PHP too

#

or understand the layers better

#

or how google search engine works

#

or any engine works

foggy helm
#

def Find_highest_bidder(bidding_record):
highest_bid = 0
winner=""
for bidder in bidding_record:
big_amount=bidding_record[bidder]
if bid_amount>highest_bid:
highest_bid=bid_amount
winner=bidder
print(f"The winner is {winner} with a bid of $ \n {highest_bid} ")

#

??

#

????????

#

error in (_ for bidder in bidding_record:_)

steady saddle
#

Who is good with python could you please help me out

#

I am not new just need few things to ask

orchid rampart
#

does anyone know how to run python script as adminstrator?

rapid gorge
#

by the way can someone help me out with it?.....I have made a software in python but I want to know that how can can I make a standalone exe file for it. I know pyinstaller thing but exe made with it... actually needs the rest of the files in place to run without any issue and so i need to send a zip file containing everything ...to the user.

rapid gorge
little imp
#
#/bin/python3
print("hello")
#
chmod +x ./script
#

./script

rapid gorge
#

Okay...

#

but if i want to make deb package type of thing?

little imp
rapid gorge
#

Okay thanks @little imp

main solar
#

!print("hello")

#

...

faint hinge
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

faint hinge
#

@bitter compass

faint hinge
#
'''Select playerID, batOrder, firstName, lastName, position, atBats, hits
            as playerID from Player'''
bitter compass
#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
get_player(playerName)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 55, in get_player
g.execute(get)
TypeError: argument 1 must be str, not tuple\

faint hinge
#
g.execute(*get)
bitter compass
#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
get_player(playerName)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 54, in get_player
with closing(conn.cursor()) as g:
AttributeError: 'NoneType' object has no attribute 'cursor'

#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
get_player(playerName)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 56, in get_player
g.execute(*get)
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2 supplied.

#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
get_player(playerName)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 56, in get_player
g.execute(*get,playerID)
TypeError: function takes at most 2 arguments (40 given)

faint hinge
#
with closing(conn.cursor()) as g:
  g.execute('''Select * from Player where playerID = ?''',(playerID))
bitter compass
#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
get_player(playerName)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 56, in get_player
g.execute('''Select * from Player where playerID = ?''',(playerID))
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2 supplied

unkempt delta
#

(playerID,)

#

you need to make it a tuple

faint hinge
#

Look at you doing double duty

bitter compass
#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
get_player(playerName)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 56, in get_player
g.execute('''Select * from Player where playerID = ?''',(playerID,))
sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.

faint hinge
#
CREATE TABLE Player(
    playerID    INTEGER PRIMARY KEY     NOT NULL,
    batOrder    INTEGER                 NOT NULL,
    firstName   TEXT                    NOT NULL,
    lastName    TEXT                    NOT NULL,
    position    TEXT                    NOT NULL,
    atBats      INTEGER                 NULL,
    hits        INTEGER                 NULL
);
toxic granite
#

why can't you use &?

#

ah

faint hinge
#

!stream 169911616672890881

keen onyxBOT
#

✅ @bitter compass can now stream until <t:1628186356:f>.

faint hinge
#
CREATE TABLE "Player" (
    "PlayerID"    INTEGER NOT NULL,
    "batOrder"    INTEGER NOT NULL,
    "firstName"    TEXT NOT NULL,
    "lastName"    TEXT NOT NULL,
    "position"    TEXT NOT NULL,
    "atBats"    INTEGER,
    "hits"    INTEGER,
    PRIMARY KEY("PlayerID" AUTOINCREMENT)
);
icy gazelle
#

I don't have my mic approved yet...how do I comment on specific voice-chat-0 discussions?

faint hinge
#

@icy gazelle Typically you'll type in the #voice-chat-text-0 channel. Whichever one is paired with the one you're listening to

icy gazelle
#

@faint hinge thx, I overlooked the channel, found it now.

toxic granite
#

I gotta go now. See you around!

bitter compass
#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
add_player(first_name,last_name)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 110, in add_player
g.execute(*add)
sqlite3.OperationalError: near "'?'": syntax error

#

Traceback (most recent call last):
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 51, in <module>
main()
File "C:/Users/paini/Desktop/part4Ma/Projectpart4MA.py", line 48, in main
add_player(first_name,last_name)
File "C:\Users/paini/Desktop/part4Ma\db_commentss.py", line 110, in add_player
g.execute(*add)
sqlite3.OperationalError: incomplete input

faint hinge
#
import sqlite3

con = sqlite3.connect('players_db.sqlite')
cur = con.cursor()

cur.execute('''
    CREATE TABLE "Player" (
    "PlayerID"  INTEGER NOT NULL,
    "batOrder"  INTEGER NOT NULL,
    "firstName" TEXT NOT NULL,
    "lastName"  TEXT NOT NULL,
    "position"  TEXT NOT NULL,
    "atBats"    INTEGER,
    "hits"  INTEGER,
    PRIMARY KEY("PlayerID")
);''')

keen onyxBOT
#

Hey @bitter compass!

It looks like you tried to attach file type(s) that we do not allow (.sqlite). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.

Feel free to ask in #community-meta if you think this is a mistake.

#

Hey @dark copper!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

faint hinge
#
import sqlite3

con = sqlite3.connect('players_db.sqlite')
cur = con.cursor()

cur.execute('''
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "Player" (
    "playerID"    INTEGER NOT NULL UNIQUE,
    "batOrder"    INTEGER NOT NULL,
    "firstName"    TEXT NOT NULL,
    "lastName"    TEXT NOT NULL,
    "position"    TEXT NOT NULL,
    "atBats"    INTEGER,
    "hits"    INTEGER,
    PRIMARY KEY("playerID" AUTOINCREMENT)
);
INSERT INTO "Player" VALUES (1,1,'Dominick','Gilbert','1B',537,170);
INSERT INTO "Player" VALUES (2,2,'Craig','Mitchell','CF',396,125);
INSERT INTO "Player" VALUES (3,3,'Jack','Quinn','RF',345,99);
INSERT INTO "Player" VALUES (4,4,'Simon','Harris','C',450,135);
INSERT INTO "Player" VALUES (5,5,'Darryl','Moss','3B',501,120);
INSERT INTO "Player" VALUES (6,6,'Grady','Guzman','SS',463,114);
INSERT INTO "Player" VALUES (7,7,'Wallace','Cruz','LF',443,131);
INSERT INTO "Player" VALUES (8,8,'Cedric','Cooper','2B',165,54);
INSERT INTO "Player" VALUES (9,9,'Alberto','Gomez','P',72,19);
COMMIT;
''')
cur.commit()
fallen blaze
main solar
#

Can I speak in the voice chat

#

I have something important to say

#

Damn im being ignored😔😔😔

frank hollow
main solar
#

Damn are yall talking about roblix studio or some shit

unkempt delta
#

('123', ('something', 'other', 'idk these values')) @bitter compass

faint hinge
unkempt delta
#
with closing(self._conn.cursor()) as g:
    g.execute(
        '''insert into Player (batOrder, firstName, lastName, position, atBats, hits)
        values (?,?,?,?,?,?);
        ''',
        (player.batOrder, player.firstName, player.lastName,
         player.position, player.atBats, player.hits)
    )
unkempt delta
#

player.playerID instead of player['playerID']

#

player.firstName instead of player['firstName']

knotty holly
#

Hmm, is self.players an iterat_or_?

bright moth
#

kate

knotty holly
#

Ah right yeah, I was just being a smart arse 😄

#

And pointing out the error.

little badger
#

LX the smart arse

bright moth
#

parsing a lot

knotty holly
#

Sorry sad_cat

unkempt delta
#

lol

knotty holly
#

Like, once.

#

Nahh, that was Laundmo maybe?

#

Ohh, LP?

#

KJ?

#

Someone with a two letter name 😄

#

If we're pointing out things on their desktop....

#

Don't rope me into this 👀

gloomy plover
#
def handle_movement(key_pressed, player):
    if key_pressed[pygame.K_a] and player.x > 0:
        player.x -= MOVE_VEL
    if key_pressed[pygame.K_d] and player.x < 1495:
        player.x += MOVE_VEL
    if key_pressed[pygame.K_SPACE] and player.y > 550:
        player.y -= JUMP_VEL


def handle_gravity(player):
    if player.y > GROUND_LEVEL:
        player.y += FALL_VEL
knotty holly
#

Right now, it looks as if pressing space moves the character up once by 2 (pixels?).

#

I've not used pygame in a while.

#

Do you want to screen share?

gloomy plover
#

I can if you want to

knotty holly
#

I think Rapture may be winding you up 😄

gloomy plover
#

well actually i cant

#

lol

knotty holly
#

!stream 669303240503984130

keen onyxBOT
#

✅ @gloomy plover can now stream until <t:1628209719:f>.

gloomy plover
knotty holly
#

👍

#

Oh right nice.

#

The trick to gravity is to have a position and velocity.

#

Each timestep you increment the velocity downwards.

#

Ah yes. Simulate a black hole 😄

#

Cya 👋

#

Server muted them.

#

Write the message using letters cut from newspapers 😄

#

You're voice-verified aren't you?

#

!tempvoiceban 307977455292121089 "1 week" Playing a moaning sound in voice-chat repeatedly.

keen onyxBOT
#

:incoming_envelope: :ok_hand: applied voice ban to @terse cypress until <t:1628814951:f> (6 days and 23 hours).

knotty holly
#

Just random ¯_(ツ)_/¯

terse cypress
#

my soundboard aint workin right

#

im trying to fix it

knotty holly
#

Cya @bitter compass

bitter compass
#

bye lx

#

dont server mute me 😉

#

xd already am

#

ik i was jk

#

fck you im out

#

jk

unkempt delta
bitter compass
#

cant for 2 more days smile

knotty holly
#

Nah, they've only been a server member fo 24 hours.

#

No we do not 😄

#

!role helper

keen onyxBOT
#
Helpers info
ID

267630620367257601

Colour (RGB)

#eecd36

Colour (HSV)

0.14 0.77 238

Member count

122

Position

23

Permission code

6546640448

knotty holly
#

Ohh, @spare ingot, Griff thinks it was PyCharm he was showing you before.

unkempt delta
#

    @flag
    def create_instant_invite():
        return 1 << 0

    @flag
    def kick_members():
        return 1 << 1

    @flag
    def ban_members():
        return 1 << 2

    @flag
    def administrator():
        return 1 << 3

    @flag
    def manage_channels():
        return 1 << 4

    @flag
    def manage_guild():
        return 1 << 5

    @flag
    def add_reactions():
        return 1 << 6

    @flag
    def view_audit_log():
        return 1 << 7

    @flag
    def priority_speaker():
        return 1 << 8

    @flag
    def stream():
        return 1 << 9

    @flag
    def view_channel():
        return 1 << 10

    @flag
    def send_messages():
        return 1 << 11

    @flag
    def send_tts_messages():
        return 1 << 12

    @flag
    def manage_messages():
        return 1 << 13

    @flag
    def embed_links():
        return 1 << 14

    @flag
    def attach_files():
        return 1 << 15

    @flag
    def read_message_history():
        return 1 << 16

    @flag
    def mention_everyone():
        return 1 << 17

    @flag
    def use_external_emojis():
        return 1 << 18

    @flag
    def view_guild_insights():
        return 1 << 19

    @flag
    def connect():
        return 1 << 20

    @flag
    def speak():
        return 1 << 21

    @flag
    def mute_members():
        return 1 << 22

    @flag
    def deafen_members():
        return 1 << 23

    @flag
    def move_members():
        return 1 << 24

    @flag
    def use_vad():
        return 1 << 25

    @flag
    def change_nickname():
        return 1 << 26

    @flag
    def manage_nicknames():
        return 1 << 27

    @flag
    def manage_roles():
        return 1 << 28

    @flag
    def manage_webhooks():
        return 1 << 29

    @flag
    def manage_emojis_and_stickers():
        return 1 << 30

    @flag
    def use_slash_commands():
        return 1 << 31
    ... # Truncated because it's literally that long
#

2 screens!

#

Dear God help me hahahah

knotty holly
#

Wait, so what is this Bluenix?

#

Oh

#

Would enum.IntFlag help here?

unkempt delta
#
>>> t = Test(123)  # 1111011
>>> t.test
True
>>> 
#
>>> class Test(enum.IntFlag):
...     test = 1 << 1
... 
>>> t = Test(123)
>>> t.test
<Test.test: 2>
>>> 
knotty holly
#

Oh right, hmm 🤔

unkempt delta
#

Yeah exactly

knotty holly
#

Can you write a program that generates the program? 😄

#

Metaprogramming

#

Erm, we have a thingy...

#

FAQ is the word I was looking for 😄

#

Erm, can you paste that here?

unkempt delta
#
    @cython.cfunc
    def _get_overwrite(self, attr: str) -> Optional[cython.bint]:
        # allow: bool = getattr(self.allow, attr)
        #if allow: return True

        # deny: bool = getattr(self.deny, attr)
        # if deny: return False

        # return None

        return getattr(self.allow, attr) or not getattr(self.deny, attr) if getattr(self.deny, attr) else None
#

I need to return True if getattr(self.allow, attr) is True

I need to return False if getattr(self.deny, attr) is True

I need to return None if both of those are False

knotty holly
#

Erm, I'm thinking if there is a clearer way to express it...

#

Why not just ```py
if getattr(self.allow, attr):
return True
elif getattr(self.deny, attr):
return False
else:
return None

#

Maybe trying to do too much on one line.

unkempt delta
#

Yeah exactly, and the commented out bit was terrible haha

knotty holly
#

I'm kind of dumb enough that I can only understand simple solutions to problems 😄

#

Like I literally can't mentally parse the one-liner.

#

Simulating a black-hole is way above my head tbh.

#

Wait what? 😄

#

I'm still using a macbook air from 7 years ago sad_cat

spare ingot
knotty holly
#

Ooo fancy wow

#

Have you seen this Rapture? https://www.youtube.com/watch?v=V7e-1bRpweo

Using relativistic raytracing I created 360 videos of what it looks like to travel through wormholes. We've seen wormholes in TV Shows, Movies and Video games but very few get this right. There are many formulations for wormhole geometry, and I use two, the Ellis wormhole (also known as Morris-Thorne) and the DNEG wormhole used for the movie 'In...

▶ Play video
#

It's a 360 video yep 😄

#

Scott Manley is great.

#

Mhm

#

With a telescope the size of the Earth!

#

Oh yeah. Pale blue dot.

#

Well there are certainly many habitable planets.

#

Like billions and billions.

#

But the tricky part is estimating the probability of life existing on a given planet.

#

I would argue it's much less likely than people think.

#

Because of the anthropic principle.

unkempt delta
#

gtg cya

knotty holly
#

I should probably be heading to bed tbh 👋

#

Cya

keen onyxBOT
#

@stoic pollen Please don't try to ping @everyone or @here. Your message has been removed. If you believe this was a mistake, please let staff know!

#

:incoming_envelope: :ok_hand: applied mute to @main solar until <t:1628214804:f> (9 minutes and 58 seconds) (reason: newlines rule: sent 137 newlines in 10s).

foggy helm
#

dude how to upgrade pip

abstract quest
lilac hatch
#

Trying to understand this piece of code
def genPrimes(l=[]):
return l.clear() or (l.append(p) or p for p,_ in enumerate(iter(int,1),2) if all(p%i for i in l))
Can anyone help?

vestal dawn
#

can any1 help me learn to code cuz m 13 ik some bit of python and i have a great interest in software development

#

i have downloaded visual studio code and pip verion is also download

#

version*

vestal pine
faint hinge
#
def run_password_manager():
        
    password = backend.load_password()
    choice=menu_choice()
    while(choice!="4"):
        sys.stdout.write("\n")
        if (choice=="1"):
            website_name = get_str("Enter website name: ")
            website_address = get_str("Enter website address: ")
            website_username = get_str("Enter username: ")
            website_password = get_str("Enter password (Make sure no one is looking): ")
            password.append([website_name,website_address,website_username,website_password])
            
        elif (choice=="2"):
            sys.stdout.write("Listing all passwords...\n")
            sys.stdout.write("Website\tURL Address\t\tUsername\tPassword\n")
            summary = backend.get_password_summary(password)

            sys.stdout.write(summary)

        elif (choice=="3"):
            sys.stdout.write("Saving passwords\n")
            backend.save_password(password)
            
        elif choice=="":
            sys.stdout.write("Input cannot be blank. Re-enter: ")
        choice=menu_choice()
vestal pine
storm aspen
#

woah

#

this looks complicated

#

i can do print(a)

faint hinge
#

It's what the professor requires

#

I've already had my rant about it

#
def load_password():
    password = []
    with open("Passwordlist.csv","r") as file_obj:
        for line in file_obj:
            fields=line.strip().split(",")
            website_name=fields[0]
            website_address=fields[1]
            website_username=fields[2]
            website_password=fields[3]
            password.append([website_name,website_address,website_username,website_password])
    return password
#
def save_password(password):
    file_obj=open("Passwordlist.csv","w")
    i=0
    while(i<len(password)):
        file_obj.write(password[i][0]+","+password[i][1]+","+password[i][2]+","+password[i][3]+"\n")
        i+=1
    file_obj.close()
#

!stream 234366216393850880

keen onyxBOT
#

✅ @vestal pine can now stream until <t:1628264691:f>.

toxic hawk
fallen yoke
#

Can anyone help me with this question.

sage granite
#

Hello, i'm new to coding. How do i call the function "weather check"

keen onyxBOT
#

:incoming_envelope: :ok_hand: applied mute to @serene barn until <t:1628407190:f> (9 minutes and 59 seconds) (reason: burst rule: sent 10 messages in 10s).

dark copper
#

Hi <@&831776746206265384> , can I get screen share permission please, thanks

knotty holly
#

One sec

#

Hello 😄

#

!stream 311739984094953472

keen onyxBOT
#

✅ @dark copper can now stream until <t:1628437970:f>.

knotty holly
#

What did you want to stream sorry?

#

Oh right

#

Sorry @amber epoch wrong channel.

amber epoch
#

@dark copper I'm seeing a lot of references back to the Python module for logging.

#

So I suspect that looking through the mentioned tutorials ought to get you oriented.

dark copper
#

I see

#

Why is everything connected, hahaha

main solar
#

Hello all, may someone help with an issue i have by running my new blog with Heroku host, this is django app i did but i'm newbie, so my site is deployed but the post and comments of my blog not showing and canno't access the django interface so i'm stuck here ... https://we-are-back-to-madagascar.herokuapp.com/

zealous slate
#

How do I get better at coding? Where can I practice? Does anyone have any advice

plain wave
#

{

// Inversion counting method, slides window of [start,
// end] across array
static int inversion_count(int n, int k, int[] a)
{
    int count = 0;
    for (int start = 0; start < n - k + 1; start++) {
        int end = start + k;
        count += bubble_count(a, start, end);
    }
    return count;
}

// Helper function, counts number of inversions via
// bubble sort loop
public static int bubble_count(int[] arr, int start, int end)
{
    int count = 0;
    for (int i = start; i < end; i++) {
        for (int j = i + 1; j < end; j++) {
            if (arr[i] > arr[j]) {
                count++;
            }
        }
    }
    return count;
}

public static void main(String[] args)
{
    Scanner sc= new Scanner(System.in);
    int n= sc.nextInt();
    int k = sc.nextInt();
    int [] arr = new int[n];
    for(int i=0; i<n; i++ ) {
        arr[i] = sc.nextInt();
    }
    

    long result = inversion_count(n, k, arr);
    System.out.println(result);
}

}

plain wave
dark copper
#

mr hemlock, can you help me for a bit?

#

if anyone can help me that would be great
and screen sharing permission would be nice too

indigo vortex
#

can someone teach me on how to use the queue functions in python
i want to learn it for my music player but im stuck

still lagoon
#

so good

finite grove
#

@pulsar basin

#

@pulsar basin

pulsar basin
#

hello

#

okay

#

btw I am running the free license, not the paid one. Should work the same maybe

#

@finite grove got it

#

hold on

#

yes

#

I can hear and see you

#

yes