#code-help-voice-text
5 messages · Page 1 of 1 (latest)
@finite grove, is a self promo of youtube playlists allowed in Python Discord?
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
@finite grove nice badges
ll
Please react with ✅ to upload your file(s) to our paste bin, which is more accessible for some users.
hello
@__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
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):
you cant post link
aah i would recommend you to make separate commands for specific arg1
and any messages
sorry how i can do that
ok let me show you
!paste
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.
!d discord.ext.commands.group
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.
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
what that code do?
it is a converter for binary to any other data tpye like ascii, decimal, hex
like you can group it like this
i am showing it in your code
i see but idk how i can use in my code
i starter in discord py
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)))
@fallen blaze Read the voice verification again, it says that if you have any issues with your mic you should contact ModMail.
Thx
Baidu
f ctx.invoked_subcommand is None:
await ctx.send('Invalid sub command passed'
'')
what is it?
@pale turtle client.voice_clients.channel
!stream 471958767735537664 15min
Could not convert "duration" into Duration or ISODateTime.
15min is not a valid ISO-8601 datetime string
!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.*
!stream 471958767735537664 15M
!stream 471958767735537664 15M
@pale turtle
✅ @pale turtle can now stream.
❌ @pale turtle can already stream.
@keen cobalt https://en.wikipedia.org/wiki/Database_normalization
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...
@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
Thanks again 😄
incredible
!voiceverify
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
ThaneKarnataka;
Mangalore
Belagavi
Shivamogga
HubiTamilNadu :
Tiruchirapalli
Salem
Tirunelveli
PuducherryOdisha:
Cuttack
Rourkela
Sambalpur
Balasore**
Please help me with the code.
What will be its code ?
where do you want to scrape the data from
?
you mean
where do you want to get data from ?
i have a doubt on pytorch
i cant seem to understand the input shate of a conv2d
shape*
you mean from which website
yes
randomly. I mean it takes input a website from the user and scrap it
scrap means what ?
I want the code
you want us to give code?
you wont get such a specific code to do what you want you need to write it
get details from a website in a pdf or doc
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
i dont understand it that much either
what is it and what to pass in it
might find something explaining on youtube
okay
Ayone can help me for this error?
@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?
mmkay
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
@proven otter i want to deploy this model from jupyter to flask, so i have this code
but in flask didn't works with same code
this on flask @proven otter
two nested circle braces is that the right syntax though ?
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" ?
while installing a virtual env i think you need to set something that gives it permission to allow access global versions
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
!stream 710999172597284884
@long robin
✅ @long robin can now stream.
Go for it
Thanks
sorry i'am beginer
@faint hinge @amber epoch
That's really good actually
Thank you
Next time I'll draw an Inkling learning Python
@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
@little badger I'll be right back, have to talk to mah boss
sure. the rest of us don't miss you at all 😢
In fairness I'm working on helping her with all this
need help with this game i am "trying" to make
can someone vc who has experience
i started coding yesterday
hi!
@patent cliff hi!
i just wanna learn python
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)
it's
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)
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
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)
Russian version: я делаю верификацию с помощью ролей. То есть когда человек заходит ему дают роль и доступ к каналу верефикация где он нажимает на кнопку и ему в личные сообшение отсылают текст (Введите логин) он пишет и потом (Введите пароль) и он пишет пароль и псоле этого он вводит в базу даных но на даное время для теста я сделал чтобы просто выводило
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?")
!!!!!
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
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)
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)
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
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)
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
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)
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
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
()
@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 , 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)
await channel_verify.send(embed=discord.Embed(title="Зарегистрироваться на сервере"), components=[Button(style=ButtonStyle.green, label="Принять", emoji=""),Button(style=ButtonStyle.blue, label="Почему?")])
()
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)
@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 , try the code i send you last. it will work
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'
this is discord bot
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)
abds = await client.wait_for('message')
dm me if you want and we can talk
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
hey how can i access the voice chat
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
iiiing aslamalaicum
@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!
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!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
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:
anyone here very knowledgeable about "Pyenv" ?
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
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
hi guys can someone please help me in debug
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.
I am interested in learning Python...I know some part of beginners but i want to gradually learn the advanced through Jupyter notebook
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?
@covert sail https://vcokltfre.dev
A tutorial on how to use discord.py to create your own Discord bot in Python, written to fix the flaws of many other popular tutorials.
Thank You Bro
!stream 411031233364099072
@trail spoke
✅ @trail spoke can now stream.
@turbid lion ?
@turbid lion ?
@toxic walrus Dude, new nickname if you ever make a lot of money: Investergurkan
Not sure why you thought of that, but I had a 64% increase in value of my funds last year
I’ll wear that name with pride
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"
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
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]
so ma mb etc stuff here is just an address right ?
a b c
c d e
!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() = }")
@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]
!e
while True:
print("Lets go!")
@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
What's typestr in array interface
But if you're going to, #bot-commands
!e
curl -v 'https://api.ipify.org?format=json'
@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
!e
from requests import get
print(get("https://api.ipify.org?format=json").json()))
@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 ')'
!e
from requests import get
print(get("https://api.ipify.org?format=json").json())
@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'
!e
!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!*
!e [while True: print("Noice")]
@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
!e while True:
print("Noice")
@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
Could anyone demo for me how to make a linked list from a list?
!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")
!e print('hello world')
<@&267628507062992896> be carefully with this .!e that can run codes python, is possible to find some exploit in this easily....
We encourage you to try and break it.
okay
It's a sandboxed environment. It's fine.
nice
You can't override inner functions in a method right?
This bot is only available in this server right? Or have some form to use it in another server?
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```
The code for snekbox is opensource. https://github.com/python-discord/snekbox So it could be used elsewhere
To test and find some exploits
Oh, thank you
If i find something i will talk with you admins as well
Wait, is it possible to define them like that?
Like the def bar._formatter
nah
just needed a shorthand for it
since i can't do it anyway i just made it up haha
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.
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
Lib/json/encoder.py line 223
def floatstr(o, allow_nan=self.allow_nan,```
heey can someone help me with a thing
like i cant plot a list and i've tried some stuff but doesnt work
Gotta give more information
i have to plot "previsao" = predictions
i tried to turn "previsao' into a df, but i cant set the index (?)
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
!Rule 4 @split topaz Maybe this is not english, you should try your best to use english!
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
sorry bro
😉
😁
@main solar
cats = ["Meowie", "Poato", "Pickle"]
cats.append("Lolo")
cats = cats.append("Lolo")
@main solar
wtf i have a bot
dw lol
catnames = ["meowieee", "potato", "pickle"]
random.choice(catnames)
name_dict = [
"Alysa": 1,
"Jeff": 2,
"Aiden": 3
]
print([name_dict(Alysa)])```
print(name_dict[Alysa])
can someone help me and my friend with a code in a vc
what is the problem
I figured it out
@unique plank you want help?
Does anyone have a lot of experience using the matplotlib backend for Tkinter?
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?
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'```
!voiceverify
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
Arch Kansas
yo, someone wanna help me gettin started?
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
@small storm you can ask here
@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
\
wap to enter the number and limit at runtime and display the multiples in pytho
can anyone help me to find the output
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()
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:
What should i do for learning python very fast
learn very fast ... how much did you complete till now
Im doin some beginner exercises! but they are so hard! 😩
what have you tried
do you have experience with programming ?
Find the sum of elements arr = “10,20,30,40,50,60,70” like this type
nope
learn variables ..data types ..then data structures ...later learn loops then start solving this
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)
bye have a grate time
@tame fulcrum
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
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
with open("test.txt", "r") as my_file:
print(my_file.read())
I mean yeah, I've googled it
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
[*open("test.txt", "r")][0]
Yes, that's what I was searching for
with open('myfile.txt') as f:
first_line = f.readline()
can anyone help me solve 4 queen using pysat gulucose3 ? thanks very much
Hey @main solar!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
come someone help me with Tkinter?
من وين
yep
i cant run tkinter from vs code can someone help me?
can some one help to learn
!paste
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.
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>```
ul#nav{
width: 96%;
height : 10%;
background-color : rgb(255,255,255);
position:fixed;
top: 0;
margin: 0;
}
sry man
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']]
Thanks @night barn 🙏 Appreciated 👍
no problem! you might need to take some time to read about word embeddings
@boreal comet thanks , yea i will do that
?whoami
nvm not that
.whois @shadow schooner
!whois @shadow schooner
ok i give up
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.
!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)
@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
!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)
@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
brb]
My sisters are being quite loud
@stone breach , Sorry to bother you, but what VS-Code theme do you have?
- wrong chat, #voice-chat-text-0
- monokai-charcoal high contrast, font is victor-mono, i have a lot of custom syntax highlighting rules
oops
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
?
i am new to python so i want a guy who helps me and chill
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
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:
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
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
so i just wont [Uhrzeit] to Index. it works also . but now he dons strange thing with the data
hi
@slender flume come to #code-help-voice-text
https://cscircles.cemc.uwaterloo.ca/ this is a good course for learning python
thx
ill see
need help @pastel zodiac ?
Hi yes need help please
what is it about?
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
do you want a voice chat for this or will text do as well?
e.g the expected output would be: 1-2, 5-6, 8-10
voice chat would be great thanks!
am I audible ?
what you can do is convert a, b in sets then intersect it
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 ?
thanks for the suggestion - I have done that already, I'm having trouble defining the ranges for the expected output
yes I have used them before
!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))
@tender hill :white_check_mark: Your eval job has completed with return code 0.
8
what do you exactly mean by defining ranges?
is that the expected output?
the expected output would be: 1-2, 5-6, 8-10
do you want them to be range() objects?
but 4 is present in both of them
why did you exclude it?
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?
yes I have tried to implement something I can share here if possible
how do I run python in this chat window?
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
you !e and write your python code
!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!*
!paste
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.
!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)
@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]
!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)
@pastel zodiac :white_check_mark: Your eval job has completed with return code 0.
['1 - 2', '3 - 5', '4 - 9']
any ideas what could be going wrong here?
umm you can try doing your thing with this output
[1, 2, 5, 6, 8, 9, 10]
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)
i mean like you can iterate through the list and checkif the previous number +1 = current number
alright let me try to understand our code
your*
thanks for looking
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
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)
@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
still prints 10 times
yeah exactly, so declaring a different x doesn't change the for loop
which is what we want in our example
so why even changed the x if it dosent affects your expectations
like remove this line a_start = a.index(v)
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
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)
@pastel zodiac :white_check_mark: Your eval job has completed with return code 0.
['1 - 2', '1 - 3', '1 - 6']
!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)
@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']
removing it keep the 1st range value as 1 each time
you see what happened?
no please elaborate 🙂
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
yep - I'm with you
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
oh okay - how should we change this?
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)
@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']
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)
@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']
@tender hill do you think this a good approach or is there a better way to do this?
theres a lot better way do it
do you want me to show them or shall i debug this
yes please share a more elegant solution if you have one
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)
@tender hill :white_check_mark: Your eval job has completed with return code 0.
['1 - 1026']
!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)
@tender hill :white_check_mark: Your eval job has completed with return code 0.
['1 - 10', '1 - 2', '5 - 6']
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)
@tender hill :white_check_mark: Your eval job has completed with return code 0.
['1 - 2', '5 - 6', '8 - 10']
you got it
sorry i was doing my class
lol bunch
loool
does anyone know gpt2
hugging face transformers its gpt2
could anyone know how to code this
?
@limpid glade
@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
!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
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)
A partition editor to graphically manage disk partitions
y tf r u using an iso to start up a vm
@little imp try using break
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
working on learning https://pysimplegui.readthedocs.io/en/latest/#android-version
None
but have few questions
Hi cant help with that not very familiar
why dont you post the questions here im sure someone will be able to help
@elfin olive I mean can I screen share and show you
I have everything pulled up
I just havent worked with GUI
What's your question?
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
Sure, but I'm still trying to understand like... even generally what you're needing to know
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
!stream 217965029050417153
✅ @steady saddle can now stream until <t:1628085377:f>.
Text('This is some text', font='Courier 12', text_color='blue', background_color='green')
!stream 217965029050417153 1h
✅ @steady saddle can now stream until <t:1628089041:f>.
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()
Modern Tk Tutorial for Python, Tcl, Ruby, and Perl
!stream 217965029050417153
✅ @steady saddle can now stream until <t:1628090040:f>.
@arctic creek do you need help?
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=
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
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:_)
Who is good with python could you please help me out
I am not new just need few things to ask
does anyone know how to run python script as adminstrator?
On linux or windows or any other?
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.
Hey @little imp ....can you help me with it?
Okay thanks @little imp
!paste
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.
@bitter compass
'''Select playerID, batOrder, firstName, lastName, position, atBats, hits
as playerID from Player'''
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\
g.execute(*get)
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)
with closing(conn.cursor()) as g:
g.execute('''Select * from Player where playerID = ?''',(playerID))
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
Look at you doing double duty
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.
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
);
!stream 169911616672890881
✅ @bitter compass can now stream until <t:1628186356:f>.
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)
);
I don't have my mic approved yet...how do I comment on specific voice-chat-0 discussions?
@icy gazelle Typically you'll type in the #voice-chat-text-0 channel. Whichever one is paired with the one you're listening to
@faint hinge thx, I overlooked the channel, found it now.
I gotta go now. See you around!
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
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")
);''')
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:
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()
you forgot the con.close() after finishing insert. 🙂
Can I speak in the voice chat
I have something important to say
Damn im being ignored😔😔😔
took you a few seconds to come to that conclusion
Damn are yall talking about roblix studio or some shit
Oh he's making a batman game
('123', ('something', 'other', 'idk these values')) @bitter compass
Does that do anything if the script is finished anyway?
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)
)
player.playerID instead of player['playerID']
player.firstName instead of player['firstName']
Hmm, is self.players an iterat_or_?
kate
LX the smart arse
parsing a lot
Sorry 
lol
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 👀
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
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?
I can if you want to
I think Rapture may be winding you up 😄
!stream 669303240503984130
✅ @gloomy plover can now stream until <t:1628209719:f>.
oh thanks
👍
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.
:incoming_envelope: :ok_hand: applied voice ban to @terse cypress until <t:1628814951:f> (6 days and 23 hours).
Just random ¯_(ツ)_/¯
Cya @bitter compass
!voiceverify in #voice-verification
cant for 2 more days smile
267630620367257601
#eecd36
0.14 0.77 238
122
23
6546640448
Ohh, @spare ingot, Griff thinks it was PyCharm he was showing you before.
@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
>>> t = Test(123) # 1111011
>>> t.test
True
>>>
>>> class Test(enum.IntFlag):
... test = 1 << 1
...
>>> t = Test(123)
>>> t.test
<Test.test: 2>
>>>
Oh right, hmm 🤔
Yeah exactly
Can you write a program that generates the program? 😄
Metaprogramming
Erm, we have a thingy...
The Python Discord FAQ.
FAQ is the word I was looking for 😄
Erm, can you paste that here?
@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
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.
Yeah exactly, and the commented out bit was terrible haha
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 
Ooo fancy 
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...
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.
gtg cya
@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).
dude how to upgrade pip
py -m pip install --upgrade pip . u need to put this command in the command prompt
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?
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*
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()
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
✅ @vestal pine can now stream until <t:1628264691:f>.
Can anyone help me with this question.
Hello, i'm new to coding. How do i call the function "weather check"
: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).
Hi <@&831776746206265384> , can I get screen share permission please, thanks
✅ @dark copper can now stream until <t:1628437970:f>.
@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.
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/
How do I get better at coding? Where can I practice? Does anyone have any advice
{
// 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);
}
}
by resolving compilation error in this
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
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
so good


