#code-help-voice-text

5 messages · Page 5 of 1

wet flint
#

yes, that is the purpose of seq

#

and you can do seq on any number

#

e.g. echo "enter a number :"; read number; seq $number

quartz ridge
#

dude what the hell

wet flint
#

ok

#

so

#

tr needs an argument

quartz ridge
#

ok so do i need to make a file

wet flint
#

and "this is a test" is not valid

wet flint
#

look at my example

#

what you wanted is probably echo "this is a test"

#

then a pipe (the | ) can be used

#

this allows you to take the output of a command and to put it in the input of another

quartz ridge
#

and enter?

wet flint
quartz ridge
#

ok it dropped don with a new arrow pointer

#

i think it took me out of my root access, not sure whats going on

wet flint
#

because you did not closed the quote

#

just press ^C to stop

#

and restart

#

echo "this is a test"

#

then echo "this is a test" | tr "i" "1" here each "i" is TRansformed in a "1"

#

so try it to see what you get

#

also, try cat hello_world , that prints the file contents.

quartz ridge
#

it says -comes back...test 1s a test

wet flint
#

then, cat hello_world | tr "l" "L"

quartz ridge
#

🤣

#

problem is, i dont know how we just did that

#

and im doing this for my own learning

wet flint
#

yes

quartz ridge
#

so if i cant talk about it, its worthless

wet flint
#

so the idea is that tr takes to arguments and one input

quartz ridge
#

why is echo this is a test and tr, what does tr actually do in this?

wet flint
#

and it replaces every [1st argument] with [2nd] argument, and pushed this as an output

quartz ridge
#

so this was all done when doing this before, or did we put this here before when we typed it in previously

wet flint
#

so tr "i" "1" replaces each "i" with a "1"

quartz ridge
#

so tr kind of replaces?

#

why is this useful?

wet flint
wet flint
wet flint
quartz ridge
#

ok i have two now, grep and tr , actually three (seq) but sequence didnt feel that complex

#

you think you can get 2 more out of me before you go

#

what next?

wet flint
#
for a in $(echo "this is a test" | tr " " "\n")
do
echo $a
done
#

that shows the use of a for loop

#

here you are looping in the worlds of "this is a test"

#

and tr helps converting spaces into newlines

#

so the for can go word by word. if you don't do that, it will just read the whole "this is a test"

#

while it knows how to split

this
is
a
test
#

because there are multiple lines

#

but you really just should read a tutorial

#

just google for one, there are several good ones

#

also, bye, i'm gonna eat !

#

see you !

quartz ridge
#

Thanks man

main solar
#

how is it called to change your own custom voice in speech recognition @faint hinge

#

using wav file

#

@echo urchin can you help pls

muted sandal
#

How to fix this

muted sandal
#

Or function

#

Function

#

How to fix this?

sly merlin
keen onyxBOT
#

@sly merlin :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     "hello" = "..."
003 |     ^^^^^^^
004 | SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
sly merlin
#

your error

#

right here

muted sandal
#

Ooh

sly merlin
#

you're doing variable_name = "hello" = ...

#

that's not valid syntax xD

muted sandal
#

Thx

#

It worked

#

!close

#

!close

#

Why can’t close

#

!clpse

#

Yes

#

!close

#

!close

#

?

#

ModMail

#

Here pls help

#

<@&831776746206265384>

#

I can’t close

#

!close

solid thorn
#

this is a permanent channel, these dont get closed.

misty rover
#

Hello

#

I need help

sweet glen
#

need help with a bot

#

im creating a twitter bot in which i have to scrape latest tweets of a user

#

i use a function which extracts top latest 15 tweets

#

but i want the tweets that are new that ive not scrapped till now

#

i get a list of tweets , how can i check which tweets i have scraped

#

so i can scrape only those tweets which i didnt scraped

#

@vocal mica

#

@main solar

cyan moon
#

anybody can help on displaying overlay text vewrbose for a bot script im running
will pay 5$ if it works

pastel valley
#

seconds = int(input("Enter the number of seconds: "))

#

i have it

#

and i need this

#

days 6 hours 51 minutes 20 seconds 0

vital sinew
#

!e

import datetime
ourseconds = 69696969
time_converted = datetime.timedelta(seconds=ourseconds)
print(time_converted)
keen onyxBOT
#

@vital sinew :white_check_mark: Your eval job has completed with return code 0.

806 days, 16:16:09
fringe flax
#

!e

from datetime import timedelta
td = timedelta(seconds=256852)
print(td)
print(td.days)
keen onyxBOT
#

@fringe flax :white_check_mark: Your eval job has completed with return code 0.

001 | 15:45:15
002 | 0
pastel valley
#

import datetime

#

from datetime import datetime

fringe flax
#

What did I break?

#

Oh
Whoops

#

!e

from datetime import timedelta
td = timedelta(seconds=256852)
print(td)
print(td.days)
keen onyxBOT
#

@fringe flax :white_check_mark: Your eval job has completed with return code 0.

001 | 2 days, 23:20:52
002 | 2
main solar
#

How do i run a python file?

pastel valley
#

hey

#

im sure that this address is valid as a socket
wss://streamer.cryptocompare.com/v2

#
import socket
# Standard loopback interface address (localhost)
HOST = 'wss://streamer.cryptocompare.com/v2'
PORT = 80        # Port to listen on (non-privileged ports are > 1023)

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.bind((HOST, PORT))
    s.listen()
    conn, addr = s.accept()
    with conn:
        print('Connected by', addr)
        while True:
            data = conn.recv(1024)
            if not data:
                break
            conn.sendall(data)
#

but this code says: socket.gaierror: [Errno 11001] getaddrinfo failed

main solar
#

how can i download file via url using cmd

grand ridge
#

@glossy salmon we can type here

main solar
#

@faint hinge

grand ridge
#

we're building screen share n video share part of an web-app but it seems django wont handle these me n @glossy salmon r trying from last 3-4 hours + we have used WebRTC also but seems it wont help

grand ridge
#

we somehow done the screen share n video for public but we cant do that for dm/pvt

rapid wedge
high sparrow
#

@hazy lantern your input is a bit too low

high sparrow
#

Hey @faint hinge , got some issues with the microphone today

fallow lichen
#

f = open ('C:/Users/PC/Downloads/17.txt')
a = [int (i) for i in f]
f.close ()
max = -100000
k = 0
for i in range (len(a)-1):
if (a[i]*a[i+1]) % 3 == 0:
k+=1
if a[i] + a[i+1] > max:
max = a[i] + a[i + 1]
print(k, max)
#HELP PLS

hazy lantern
harsh anvil
#

i am not voice verified yet

#

sorry dude

light junco
#

guys i need to check if in a list between 2 place there is at least one "1" how do i get it

#

@vale dagger @solemn talon @hidden mountain @faint hinge

faint hinge
#

You can use a slice to get the specific portion you need, if you know the two places

light junco
#

yes i know the the place for example

a=[1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
b=[1, 0, 0, 0, 1, 0, 1, 0, 1, 0]

have to check if in position 5 in b list there is a "1" than if it is true, have to do that position - tau and check if there is at least a "1" between 5 and 5 - tau in list a (tau is a given namber, ex 2) @faint hinge

#

@faint hinge

faint hinge
#

Sorry, bouncing around

#

Could do something like.....

#
a = [1, 0, 1, 0, 1, 0, 1, 0, 1, 0] 
b = [1, 0, 0, 0, 1, 0, 1, 0, 1, 0]
tau = 2

if b[5]:  # If the value is 1 (which evaluates to True, it'll continue into the if
  print(1 in a[5-tau:6])  # We do 6 so that it will include index 5.  The end is not inclusive, so it goes up to but not including that number
hot quiver
light junco
#
def clear_mat(list_of_lists):                       # clears everything
    list_prepared = []
    for i, li in enumerate(list_of_lists):
        
        if li:

            temp = list()
        
            for j, word in enumerate(li):
                word_prepared = word.translate(word.maketrans({",":"",".": "", "(":"",")": "", "!":"","?": "",":":"",";": "", "[": "","]":"", "\"":"", "\"":""}))
            
                if "'" in word_prepared:
                    word_list = word_prepared.split("'")
                    temp.extend(word_list.copy())
                    if "'" in word_prepared[:1]:
                        word_prepared = word_prepared[1:]
                    if "'" in word_prepared[-1]:
                        word_prepared = word_prepared[:-1]
                elif "—" in word_prepared:                  # doesn't divide the words properly here
                    word_list = word_prepared.split("—")
                    temp.extend(word_list.copy())
                    
                elif "-" in word_prepared:
                    word_list = word_prepared.split("-")
                    temp.extend(word_list.copy())
                else:
                    temp.append(word_prepared)

            list_prepared.append(temp)
    return list_prepared



print(clear_mat([['Are', 'these,', 'by', 'the', 'black', 'air', 'so', 'scourg\'d?"—"The', 'first']]))
#

is there anyone who can help me, im trying to remove all non letters from the words and when i meet ' and - and — i should split them, this code seems right but it doesn't work only with — character :/

hard ibex
light epoch
#

Do we have any helpers available right now?

#

For discord bot

#
@slash.slash(name="archive-channel",
             description="Allows moving interactions channels in to the archive category",
             guild_ids=[GUILD_ID])
async def _archive_channel(ctx: SlashContext):
    archive_category = discord.utils.get(ctx.guild.channels, name="Archive")
    channel_name = str(ctx.channel.name)
    await ctx.channel.edit(category=archive_category, name=channel_name)```
#

Does what I want but says interaction failed

#

What would I do here?

burnt birch
#

Is anyone available to help me with some coding?

main solar
#

why is it in yellow

#

heres the doc

thick gate
#

lsb_release -a for Ubuntu version

#

sudo apt-get install neofetch -y

tidal bronze
#

grep "$1" meresek.txt | cut -c 27-36 | sort -u | wc -l

#

(47.6498634, 19.1404118), 2021.09.10, 12:35, 26
(47.6498634, 19.1404118), 2021.09.12, 15:55, 24
(47.6498634, 19.1404118), 2021.09.14, 18:05, 20
(57.6498634, 29.1404118), 2021.09.06, 11:05, 31
(47.6498634, 19.1404118), 2021.09.12, 14:00, 30
(17.6498634, 15.1404118), 2021.09.25, 09:05, 24
(47.6498634, 19.1404118), 2021.09.30, 20:05, 21

#

.sh

tender hill
#
declare -A dataHashMap
dataHashMap=( ["47.6498634, 19.1404118"]=( [1]="2021.09.10" [2]="12:35" [3]="26") )
#
echo ${dataHashMap[$1, $2][3]}
#
$ cat test.sh
function kill(){
    echo $2
}
ibrahim@ibrahim-desktop:~$ kill hi hi2
hi2
ibrahim@ibrahim-desktop:~$ 
gusty bridge
#

Sure!

#

Other than the other stuff I said it says that for the sorting a-z part I just need to use dunder lt and dunder st

#

Sure

#

Okay and yes I can see

#

Can we use as much of the current as possible?

#

What stuff would you get rid of?

#

Oh that makes sense

#

Did you learn python in school or for fun? I'm in college but I'm finding it difficult!

#

That's cool! I just started in Sept and I like it but it's the most challenging stuff I've ever learned

#

Yeah the trouble I'm having is working with the list

#

Its weird because appending was easy but trying to find and delete isn't working the same

#

hmmm

#

omg i think i have supers = [] in there twice too 😩

#

i didnt code line 112 yet lol

#

Nope if its blank its like they changed their mind

#

so they choose not to delete anything and continue

#

yeah exactly

#

oh yeah i always forget f string

#

so much easier

#

haha wow!

#

i understand everything except enumerate - we havent used that yet

keen onyxBOT
#

Ever find yourself in need of the current iteration number of your for loop? You should use enumerate! Using enumerate, you can turn code that looks like this:

index = 0
for item in my_list:
    print(f"{index}: {item}")
    index += 1

into beautiful, pythonic code:

for index, item in enumerate(my_list):
    print(f"{index}: {item}")

For more information, check out the official docs, or PEP 279.

gusty bridge
#

ohhh i get it

last spire
gusty bridge
#

thank you so much!!

last spire
#

In this beginner object oriented programming tutorial I will be covering everything you need to know about classes, objects and OOP in python. This tutorial is designed for beginner python programmers and will give you a strong foundation in object oriented principles.

◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
https://tech-wi...

▶ Play video
gusty bridge
#

oh yes thank you, i need all the help i can get haha

#

thank youuu

last spire
gusty bridge
#

oh okay sure! i'll watch both just in case

#

that's okay haha

#

i'll check out his channel

last spire
#

In this Python Object-Oriented Tutorial, we will begin our series by learning how to create and use classes within Python. Classes allow us to logically group our data and functions in a way that is easy to reuse and also easy to build upon if need be. Let's get started.

Python OOP 1 - Classes and Instances - https://youtu.be/ZDa-Z5JzLYM
Python...

▶ Play video
gusty bridge
#

oh perfect

#

definitely

#

sounds great

#

i haven't even looked at the lt part yet haha

#

less than

#

i havent used it yet i was going to start googling it

#

yeah i threw return in there as a placeholder lol

#

yeah the teacher wants me to use lt to alphabetize the records

#

only because i entered them in that way lol

#

XD

#

i am tempted

#

tbh i feel these assignments are trickier than they need to be

#

exactly

#

we learned all these oop examples and then i had to do this but this is nothing like the examples we went over lol

#

XD i wouldnt stop you because id learn the "right" way LOL

#

already it makes way more sense

#

haha

#

sorry my connection is acting up one sec

#

back

#

haha my dog does the same

#

all the time

#

always when im on the phone and its important too

#

whoops sorry!

#

i am just watching you type haha

#

yeah i understand most of it and i think it looks great!

#

if i "drop out" a few times its because my internet is weak af

#

oh thats fine! we're having outages the past month while they work on the lines so it just gets twitchy

#

lol

#

"where does the superhero live: lol"

#

i thought it was funny

#

i will never get the 1.5 seconds back XD

#

i think it looks really cool

#

yeah it works really well!

#

oh yea

#

niiiice

#

ohhh okay

#

i know a little but i think we're learning that in class in a few weeks actually

#

on the syllabus theres like sorting methods and stuff

#

that makes sense

#

🙌

#

oh yeah it looks amazing! i honestly learned a lot from the example

#

oh yeah haha they always want to find a way to break out of it

last spire
gusty bridge
#

haha if you cant find one then i definitely wouldnt be able to, i didnt even think of keyboard interrupt and youre advanced compared to me haha

#

hahaha

#

noidea lmao

#

the teacher chose the letters i prefer numbers

#

you will run out of letters eventually!

#

oh yeah

#

ahhhh i have to go and make dinner, i didnt realize it was so late here : X thank you so much for the homework help i feel like i understand way better now!

#

hahahaha yes

#

i think hes showing us like the tiniest basics before hes letting us learn the real stuf??? i think??

#

thank you again!!

#

bye!

icy gale
#

i need help. Can anyone give me a hand about this code i can access the "mycodes.db" and verify the variable code is equal to result_code. The problem is when the code cant find the string , the program breaks and does not trigger the else statement.

#
def gotoreg(self):
        code = self.regcode.text()
        if len(code) == 0:
            self.error.setText("The field is empty.")
        else:
            conn = sqlite3.connect("mycodes.db")
            cur = conn.cursor()
            query = 'SELECT Codes FROM pass_codes WHERE Codes = \''+code+"\'"
            cur.execute(query)
            result_code = cur.fetchone()[0]
        if code == result_code:
            reg = RegScreen()
            widget.addWidget(reg)
            widget.setCurrentIndex(widget.currentIndex() +1)
        else:
            print("false")
            self.error.setText("Invalid code.")```
icy gale
#

cant talk im muted

grim heron
#

is anyone around to offer me some help ❤️

raw prawn
#

yuup

heavy magnet
#

PocketSphinx for SpeechRecognition Module

heavy magnet
amber epoch
#

!pypi PocketSphinx

keen onyxBOT
heavy magnet
# amber epoch !pypi PocketSphinx

I am trying it install it. But it says disutils are missing. But, I don't understand how to install disutils on a Windows PC. It is simple on Linux but not on windows

amber epoch
#

I'm a Linuxer.

#

Windows is outside of what I know much about.

heavy magnet
amber epoch
#

Hm. Python module. Should be pip installable, but setuptools seems to supersede it.

#

So pip install setuptools maybe.

main solar
#

hello

#

can you help me

#

@quartz bluff @vital sinew HAHAHA

barren jolt
#

could csomeone please help me I have 1 hour left

#

it is with AI

#

lol pleaseee i will literarly do naything for it

#

pleassseeee

twilit sage
#

why can't I watch the live?
it doesn't open for me

pale turtle
#

!code

keen onyxBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

faint hinge
icy gale
#

Traceback (most recent call last):
File "C:\Users\USER\PycharmProjects\FaceRecog\faces-train.py", line 46, in <module>
recognizer.train(x_train, np.array(y_labels))
cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'

#

i have this error

light epoch
#

Any god tier bot devs that can help me figure out something will be highgly apreciated

faint hinge
#

What's your question

icy gale
#

Any help from gods ??

distant edge
#

guys , do you know how i can disconnect from wifi in python3 for linux ? i am making a small script to use it on my laptop

plush fox
#
fileExists = os.path.exists('images/folder1')
icy gale
#

yes

#

i have no idea about time stamps

#

infinite

#

or something like that

#

new create folders can be named in unique folders by the persons name

#

im gonna put this in a gui

plush fox
#
filename = input("Enter a folder name: ")


icy gale
#

yes

#

i dont understand

#

right

#

@plush fox u still there ?

unkempt delta
#

We have a system for getting help - such that you have the best possibility of getting help.

#

But you're not using this system..........

sly merlin
#

@main solar send screenshot here

#
@age.error
async def age_error(self, ctx, error):
    if isinstance(error, nextcord.ext.commands.errors.CommandInvokeError):
        await ctx.reply("Please type numbers only.")
#

!e

foo = "1234 "
print(foo.strip().isdigit())
keen onyxBOT
#

@sly merlin :white_check_mark: Your eval job has completed with return code 0.

True
raw prawn
#

anyone here ?

raw prawn
#

holaa

#

can

#

you

raw prawn
#

Uu

little badger
keen onyxBOT
#

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

upper bobcat
#

idk if this is gonna help but you should probably put ctx parameter before the error parameter.

#

oh lo

#

use datetime module, read python docs on datetime module

#

ill simplify this

#

i dont support spoonfeeding

#

but ill simplify this

#

get the time in utc

#

;-;

#

wdym specify

#

elaborate what you are trying to make me help you

#

typing animation?

#

oh you wanna know how to make the bot type for a few seconds

#

then send the message

#

here

#

that's called the datetime modul

#

it's in a spoiler

#

so

#

theres no thing

#

such as

#

"hovering over and showing"

#

no

#

can you show me

#

like

#

a screenshot

#

oh

#

well

#

that confuses me

sweet glen
#

hey can you help me plz

#

we have a django based telegram bot which send messages to given group after some intervals

#

so i want to schedule the function but to the time given

#

but also don't want my django server to sleep

#

because i am using sleep to sleep the code for the given time

#

@shy matrix

#

@tender hill

tender hill
#

use asyncio.sleep

sweet glen
#

ya but async function require a event loop

upper bobcat
#

guys

#

how do i make the bot check

#

if the person whos trying to use the command

#

has a specific

#

perm

#

they are allowed to use

#

the command

#

and people who don't have it can't run the command

pastel valley
#

hey

#

i want to connect to this wss://streamer.cryptocompare.com/v2 in python
and it connects in postman
but when i write my code it says getaddrinfo failed

HOST = 'wss://streamer.cryptocompare.com/v2
socket_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_client.connect((HOST, 80))
ebon hearth
#

heyy

#

does anyone know how to web scrape using Python and BeautifulSoup?

raw prawn
#

;

strange vine
#

guys i need in a help a little

#

do you know how to once get roles, like on_ready, and save them somewhere to use from different cogs

velvet shuttle
#

how do I declare a variable?

icy gale
#

any gods here?

#

Traceback (most recent call last):
File "C:/Users/USER/PycharmProjects/FaceRecog/train-scan.py", line 40, in <module>
recognize.train(x_train, np.array(y_labels))
cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv_contrib\modules\face\src\lbph_faces.cpp:362: error: (-210:Unsupported format or combination of formats) Empty training data was given. You'll need more than one sample to learn a model. in function 'cv::face::LBPH::train'

#

i keep getting this error

#

this is the code

small spoke
flat pollen
#

Hi, can someone help me with importing from a sibling package?

#

Its been driving me crazy since yesterday

wheat ingot
#

send a pic

flat pollen
#

Here is my relative import in FeedCreateTable:
from ..constants import dynamodb
And here is the error:
ImportError: attempted relative import with no known parent package

ripe silo
#

hey

topaz oriole
#

I have a syntax error I cannot figure out, any help would be greatly appreciated.

wind coyote
topaz oriole
icy gale
#

@twilit sage can u help me
?

twilit sage
icy gale
#

in a code

#

apparantley im having problems in training the code it seems it only detects one person instead of multiple

#

its a facial recognition thin

twilit sage
icy gale
#

oh sory

storm belfry
#

Hey guys! Do any of you have the time to help me with a school project?
I am working on a neural network

quartz ridge
#

@echo urchin is the best person I know at report writing

#

of Mice and Men

main solar
#

The conversations in this voice channel are so interesting

#

hey

#

is anyone willing to help

restive tapir
#

hello

#

i dont have perms anymore

#

no, i got voice banned

#

bc i wasn't actually talking

#

more like, streaming unnecessary audio

echo urchin
icy gale
#
     if n[0]!='.' ]+[0])[-1] + 1``` can anyone explain this to me?
icy gale
#

bruh in the philippines emulating an accent is some kind of a joke

versed tusk
#

what does \ mean?

#

example response = \

tacit harbor
#

|| @humble yacht ||
run = True
while run:
if event.type == pygame.QUIT:
run = False

pygame.quit()

why does it say name event was not defined?

PS: pygame has been imported

somber ore
#
if not antiCollision.collidepoint(pygame.mouse.get_pos()):
                        mouse_pos = pygame.mouse.get_pos()
                        x, y = mouse_pos
                        antiCollision = pygame.Rect(x, y, 128, 128)
                        platform = pygame.Rect(x, y, 64, 64)
                        platform.center = (x, y)
                        antiCollision.center = (x, y)
                        pygame.draw.rect(screen, (255, 255, 255), (platform))
                        pygame.draw.rect(screen, (255, 111, 111, 255), (antiCollision), 5)
                    else: return print('e')```

antiCollision isnt defined
i know i should define it
but if i define it it just prints e when i do that and doesnt work even when its not touching that
since it spawns on x or y
#

@restive tapir r u here to help or for help

primal falcon
#

Hi people. I need help. I have a dataframe with several attributes and some of them are combined keys. I need to created a histogram chart based on number of countries in 'production_countries' attribute.

#

and this is my table

#

as you can see most of rows have more than one name

#

and cell structure is dict-like

main solar
#
import http.server
import socketserver

class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler):
    def do_GET(self):
        self.path = '/html and css/gui.html'
        return http.server.SimpleHTTPRequestHandler.do_GET(self)

# Create an object of the above class
handler_object = MyHttpRequestHandler

PORT = 8000
my_server = socketserver.TCPServer(("", PORT), handler_object)

# Star the server
my_server.serve_forever()```
main solar
sly merlin
#

python3 -m http.server 8000

#

python3 -m http.server --directory web 8000

#

@main solar can you type here for now?

main solar
sly merlin
#

since your audio iss having issues

main solar
#

this is my html with css

sly merlin
#

so try this

main solar
#

i'm here

sly merlin
#

cd to where your file is
python3 -m http.server 8000
^ run this
rename your html file to index.html
and goto localhost:8000 in your browser

#

and it should serve that file + your css and javascript on the homoe page

main solar
#

WOW

#

MR NOODLE YOU ARE THE TOP

#

be rght back!

#

i bought phone on black friday, it comes today if i'm lucky

#

i'll use it for comm

#

but

#

i said

#

i like those beans too, and pizza is good, i get the cups of precooked rice, and then sometimes i eat ramen

#

but the prepackaged ramen is pure sodiums and makes me sick

#

so im learning to make my own noodles

#

but cooking is hard and my food taste bad

#

after i run the python3 -m http.server

#

it does not allow me to type in the same terminal

#

or do commands there

sly merlin
#

there's 2 ways to deal with that

#

1 open another terminal / split

#

or 2
run it asynchronously by adding a & at the end

#

and then later use kill -SIGTERM <pid> to kill it with its process id (it tells you it when ran with &)

echo urchin
#
measurements = open('input.txt', 'r')
depth_measurement = measurements.read().splitlines()
first_measurement = depth_measurement[0] 
for i, item in enumerate(depth_measurement):
    f"index, {i}, item: {item}"
    if first_measurement < depth_measurement[first_measurement]:
        Count = Count + 1
        print(Count)
sly merlin
main solar
#

i changed the file to index.html and now it loads my html file straight to the page when I access localhost:8000

#

it does not load the css and it produces this server

#

error

#

i solved it

#

i fixed it

#

ill tell u solution

#
  1. You can see in my terminal, I am typing this command from that directory
#

so from my cd, I launch the server

#

no let me tell you

#
  1. so I rename my html file to index.html. it works. It did not load the css file, but I look in the error and it mentions "server.py" but I ask myself why is it even bringing that up ? i found that I had a custom server.py file in one directory down, so when http.server went up the directory, it tried to use the content of the server.py file because my file is overwriting the actual server.py file the module is using
#

i deleted the server.py file and now everything works perfectly.

#

YES

#

YES

#

yes

#

but i look at beginning of error

#

and it says

#

i think, why is it doing that?

#

so i delete

#

now it's perfect

#

together, we reached the solution

#

mr noodle I dont know how to thank you

#

i wish I had smething to give you

#

please if you ever need anything just ask me

#

i am not that good at python yet

#

but i just want you to know anything i can help with i will try

#

thank you

#

thank you thank you thank you

#

this has been stressing me for so many days

sly merlin
#

!code

keen onyxBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

main solar
#

PEMDAS

echo urchin
main solar
#

haha i cant get in

#

its ok my voice is bad anyway

wind stag
#

hey do python errors count as a false statement

main solar
#

there are many classifications of errors

#

run time error, logical error, syntax error

#

false statement is syntax error

#

this means the syntax (the way you wrote it) is incorrect

rustic stream
wind stag
#
li = ["hello" , "there"]
if int(li(0)) == False
  return "uwu"
main solar
#

I think he means "incorrect syntax"

rustic stream
#

When an error occurs, Python raises the exception, which means that you won't be able to compare it like that

main solar
#

jpiz

rustic stream
#

Basically, if you don't handle the exception, the execution of the application will stop

#

and Python will print a traceback

main solar
#

first of all, you are doing a return, except when you return, it must assign to a variable

rustic stream
#

!e

li = ["hello" , "there"]
if int(li[0]) == False:
  print("uwu")
main solar
#

you cannot do return if there is not a variable or function to which the equation is returning to

keen onyxBOT
#

@rustic stream :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | ValueError: invalid literal for int() with base 10: 'hello'
rustic stream
#

As you can see, you get a ValueError exception, and it will interrupt the normal flow of the application

main solar
#

@wind stag your getting the error because you must assign your return value to a function or a variable

rustic stream
#

If you're looking to handle the exception, you can use a try-except block

main solar
#

this python error is a syntax error

wind stag
#

okay, let me explain what I'm trying to do

rustic stream
#

!e

try:
    int("foo")
except ValueError:
    print("Not a number!")
keen onyxBOT
#

@rustic stream :white_check_mark: Your eval job has completed with return code 0.

Not a number!
wind stag
#

aaaaahhhh

#

nvm I think you got it

#

so what if we put in something valid

#
li = ["1","2","3"]
try:
  int(li(0))
except ValueError:
  print("Not a number!")
#

would that just continue the program?

#

okay so it's saying list item not callable?

#

I'm dumb I got my syntax messed up

#

!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!*

wind stag
#

!e

li = ["1","2","3"]
try:
  int(li[1])
except ValueError:
  print("Not a number!")
keen onyxBOT
#

@wind stag :warning: Your eval job has completed with return code 0.

[No output]
wind stag
#

okay I get it now

zenith patio
#

Hi

haughty spear
#

Hey

#

Join the voice channel?

zenith patio
#

oh right

#

yep

#

sorry i cant talk rn

#

yes

#

from sklearn.linear_model import LinearRegression

Splitting dataset

X1_train, X1_test, X2_train, X2_test, X3_train, X3_test, X4_train, X4_test,

#

this is what i did so far

haughty spear
#
from sklearn.linear_model import LinearRegression
zenith patio
#

yepp

haughty spear
#
from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X, y)
zenith patio
#

ohhhh okay let me copy that

#

yes

haughty spear
#
from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
zenith patio
#

Ahhh i see

#

okay, thank you so much

haughty spear
#
model = LinearRegression()
model.fit(X_train, y_train)
prediction = model.predict(X_test)
zenith patio
#

okk

haughty spear
#

I'm sorry, there's some noise in the background.

zenith patio
#

no probb i cant really hear it

#

btw i also need to add a constant 😅

haughty spear
#

A constant?

zenith patio
#

X = sm.add_constant(X)

#

like this?

#

constant for the intercept 😬

#

sorry i dont know much 💀

haughty spear
#

Not really aware of it. It's probably in statsmodel, yeah?

zenith patio
#

ahh yes

haughty spear
#

Are you looking to program a Linear Regression from scratch?

zenith patio
zenith patio
#

like i need to fit linear regression to the data and then i need to print the R^2

haughty spear
haughty spear
zenith patio
#

yepp

#

yes

zenith patio
#

Ohhhh I understand now

#

yes

#

ohhh

#

so i need to find the p value?.... 😬

haughty spear
#

I don't really follow the question here

zenith patio
#

hmmm i think liek first i need to fit it to linear regresssion

#

which youve already showed me

haughty spear
#

I've typed out the code on how to do that. But if you need to use statsmodels or something, I can't help with that

zenith patio
#

yes i just printed our the r2 and i think ill be able to do the rest

#

Thank you soooo much for your help.

haughty spear
#

Cool, no problem.

zenith patio
#

You dont know how much it means to me :salute:

haughty spear
#

Glad I could help

zenith patio
#

👍 thank you

small kettle
#

hi

small kettle
unborn barn
#
def create_world():
    def create_map():
        return {
            'house': {
                'car': ['garage, outside'],
                'about': "All the stuff you'll need is in the garage. Your car is itching to get cleaned.",
                'stuff': [],
            },
            'start the car': {
                'car': ['house'],
                'about': "Hmm you shouln't leave yet you still got a car to finish.",
                'stuff': ['key']
            },
            'garage': {
                'car': ['exterior', 'interior','house'],
                'about': "Now we are in the garage, what should we work on first?",
                'stuff': []
            },
            'exterior': {
                'car': ['garage'],
                'about': "The body of your car is very dirty, lets wash it up.",
                'stuff': ['hose', 'soap', 'sponge']
            },
            'interior': {
                'car': ['garage'],
                'about': "The inside of your car is in need of a good touch up. Get to cleaning.",
                'stuff': ['vaccum','all_purpose_cleaner']
            },
        }


    def create_player():
        return {
          'location': 'house',
          'inventory': [],
      }
    return {
        'map': create_map(),
        'player': create_player(),
        'status': 'playing'
    }
#
def create_world():
    world_map = {
            'house': {
                'car': ['garage, outside'],
                'about': "All the stuff you'll need is in the garage. Your car is itching to get cleaned.",
                'stuff': [],
            },
            'start the car': {
                'car': ['house'],
                'about': "Hmm you shouln't leave yet you still got a car to finish.",
                'stuff': ['key']
            },
            'garage': {
                'car': ['exterior', 'interior','house'],
                'about': "Now we are in the garage, what should we work on first?",
                'stuff': []
            },
            'exterior': {
                'car': ['garage'],
                'about': "The body of your car is very dirty, lets wash it up.",
                'stuff': ['hose', 'soap', 'sponge']
            },
            'interior': {
                'car': ['garage'],
                'about': "The inside of your car is in need of a good touch up. Get to cleaning.",
                'stuff': ['vaccum','all_purpose_cleaner']
            },
        }


    world_player = {
          'location': 'house',
          'inventory': [],
      }
    return {
        'map': world_map,
        'player': world_player,
        'status': 'playing'
    }
small kettle
#
def checklist():
        vaccum = 'use vaccum and cleaner'
        if vaccum is True:
            return 'exterior'
pliant estuary
#

is is like comparing identity.

small kettle
fading holly
#

is there anyone here who knows pgzero?

main solar
#

3 days before i can talk

frank roost
#
x = lambda a: a + 10
print(x(5))
#

15

#

lambda arguments : expression

main solar
#

a would be 1

frank roost
#
Example

inp_list = ['t','u','t','o','r','i','a','l']
result = list(filter(lambda x: x!='t' , inp_list))

print(result)

Output

['u', 'o', 'r', 'i', 'a', 'l']
main solar
#

Is it a bad idea to start learning coding with Python, when you literally know nothing about it?

#

I don't even know a lot of the basic terminology related to computers and coding.

#

Which is gonna make learning a bit more complicated perhaps.

ebon cairn
#

And with python it's really easy to learn programming as u can find a ton lot of resources and documentation online for the same 🙂

restive tapir
#

@tranquil fulcrum helo again

#

seriously what are you typing?

#

i can just hear your keyboard

#

what stuff exactly?

#

yes

#

coding?

#

sorry no idea

#

new concept for me

#

in what lang you're doing it?

#

ok then idk

winged scroll
#

But I'm getting an error if the right number is guessed

amber lichen
#

anyone wanna help me make the main of my function... I am quite confused on how to call the previous functions made into the main

main oak
#

Why can't we talk

#

In vc

main solar
#

yeah i cant 2

#

@vital sinew @abstract path why cant i talk and u guys can

keen onyxBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

vital sinew
#

@main solar see the embed

celest rover
#

i need help in something selenium related , so i am trying to go a website and upload a photo and keep doing that in a while loop but every iteration its focused on the running window , i need to prevent the running chrome from receiving the focus
cuz i need to run the bot and leave it running for hours and work on something else+(i cant use headless mode)

cobalt ginkgo
#
/home/farzan/Desktop/ai/spammer.py:16: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  driver = webdriver.Chrome(executable_path = driver_address)
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "/home/farzan/Desktop/ai/spammer.py", line 16, in <module>
    driver = webdriver.Chrome(executable_path = driver_address)
  File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 93, in __init__
    RemoteWebDriver.__init__(
  File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 268, in __init__
    self.start_session(capabilities, browser_profile)
  File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 359, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
  File "/home/farzan/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
Stacktrace:
#0 0x5613b126bee3 <unknown>

#
import os
import time
from selenium import webdriver
from colorama import init
init()
from selenium.webdriver.common.keys import Keys
import colorama
from colorama import Fore



#...chromedriver path
file_path = os.path.abspath(__file__)
directory = os.path.dirname(file_path)
driver_address = os.path.join(directory , "chromedriver.deb")
driver = webdriver.Chrome(executable_path = driver_address)

#...code meli

message = input("enter message")
number = int(input("enter number you wanna text"))
name = input("enter a name").split('-')
driver.get("https://web.whatsapp.com/")
time.sleep(25)
#...site address
for i in name:
    koskhol1 = driver.find_element_by_xpath(f'//span[@title="{i}"]').click()
    koskhol = driver.find_element_by_xpath(f'//span[@title="{i}"]')
    time.sleep(2)
    k = driver.find_element_by_xpath('//*[@id="main"]/footer/div[1]/div/div/div[2]/div[1]/div/div[2]')
    for j in range(number):
        k.send_keys(message + Keys.ENTER)
# goh = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[1]/div[4]/div[1]/footer/div[1]/div/div/div[2]/div[1]/div/div[2]')
# goh.send_keys('kos kesh kos amat . ba god kal nakon .i am the king')```
#

@faint hinge

echo mountain
drifting rock
#

what happened to the stream

dusk kayak
#
def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
            colors=[]
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    colors.append(image[row+row_delta][col+col_delta])
            final=[]
            for values in zip(*colors):
                final.append(sum(values)/len(colors))
            final=tuple(final)
    return final
#
image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
        [(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
        [(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
        [(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]
amber epoch
#

!e py my_list = [1, 2, 3] my_tuple = tuple(my_list) print(my_tuple)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

(1, 2, 3)
dusk kayak
#
def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
            colors=[]
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    colors.append(image[row+row_delta][col+col_delta])
            final=[]
            for values in zip(*colors):
                final.append(sum(values)/len(colors))
            final=final.tuple(final)
            for row_delta in range(square_size):
                for col_delta in range(square_size):
    return final
amber epoch
#

!e py for i in range(5): ... ... # This dedent from the above signals that for loop codeblock is done. for i in range(5): #Indent without preceding/above colon : signifying an indent/codeblock to follow ...

keen onyxBOT
#

@amber epoch :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 4
002 |     for i in range(5):
003 | IndentationError: unexpected indent
amber epoch
#

obj[a][b] = c

#

!e py a = [0, 5, 9] a[2] = 86 print(a)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

[0, 5, 86]
dusk kayak
#
def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
            colors=[]
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    colors.append(image[row+row_delta][col+col_delta])
            final=[]
            for values in zip(*colors):
                final.append(sum(values)/len(colors))
            final=final.tuple(final)
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    image[row+row_delta][col+col_delta]=final
amber epoch
#

!e py a = [10, 20, 30] print(a[2]) print(a[3])

keen onyxBOT
#

@amber epoch :x: Your eval job has completed with return code 1.

001 | 30
002 | Traceback (most recent call last):
003 |   File "<string>", line 3, in <module>
004 | IndexError: list index out of range
amber epoch
#

!e py a = [10, 20, 30] try: a[3] except IndexError: print("Ta-da!") print("Fin.")

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | Ta-da!
002 | Fin.
dusk kayak
#
def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
            colors=[]
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    try:
                        colors.append(image[row+row_delta][col+col_delta])
                    except IndexError:
                        pass
            final=[]
            for values in zip(*colors):
                final.append(sum(values)/len(colors))
            final=final.tuple(final)
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    try:
                        image[row+row_delta][col+col_delta]=final
                    except IndexError:
                        pass
#
import matplotlib.pyplot as plt

image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
        [(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
        [(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
        [(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]

def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
            colors=[]
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    try:
                        colors.append(image[row+row_delta][col+col_delta])
                    except IndexError:
                        pass
            final=[]
            for values in zip(*colors):
                final.append(sum(values)/len(colors))
            final=tuple(final)
            print(final)
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    try:
                        image[row+row_delta][col+col_delta]=final
                    except IndexError:
                        pass

pixelization(image, 2)
plt.imshow(image)
plt.show()
dusk kayak
#
(40.0, 40.0, 125.0)
(40.0, 200.0, 105.0)
(200.0, 40.0, 45.0)
(200.0, 200.0, 25.0)
amber epoch
#

!e py a = [v for v in range(5)] print(a)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

[0, 1, 2, 3, 4]
amber epoch
#
for v in range(5): #<- Right of the leftmost
    v #<-- Leftmost v in the conprehension```
#

!e py m = [(a,b) for a in range(3) for b in "abc"] print(m)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

[(0, 'a'), (0, 'b'), (0, 'c'), (1, 'a'), (1, 'b'), (1, 'c'), (2, 'a'), (2, 'b'), (2, 'c')]
amber epoch
#
for a in range(3):
    for b in "abc":
        (a,b)```
amber epoch
#

!e py m = [1.0, 4.5, 2] k = [int(v) for v in m] print(k)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

[1, 4, 2]
amber epoch
#

tuple(...)

#
tuple(int(v) for v in m)```
dusk kayak
#
import matplotlib.pyplot as plt

image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
        [(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
        [(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
        [(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]

def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
            colors=[]
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    colors.append(image[row+row_delta][col+col_delta])
            final=[]
            for values in zip(*colors):
                final.append(sum(values)/len(colors))
            final=tuple(int(v) for v in final)
            print(final)
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    try:
                        image[row+row_delta][col+col_delta]=final
                    except IndexError:
                        pass

pixelization(image, 2)
plt.imshow(image)
plt.show()
amber epoch
#

!e py a = (v for v in range(5)) b = tuple(v for v in range(5)) c = [v for v in range(5)] print(a) print(b) print(c)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | <generator object <genexpr> at 0x7fbffe1e7df0>
002 | (0, 1, 2, 3, 4)
003 | [0, 1, 2, 3, 4]
dusk kayak
#

(0, 1, 2, 3, 4)(a, b, c, d, e)

#

(0,a)(1,b)(2,c)(3,d)(4,e)

amber epoch
#

!e py print([*zip( [1,2,3], "abc" )])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

[(1, 'a'), (2, 'b'), (3, 'c')]
amber epoch
#

!e py for v in [(1, 'a'), (2, 'b'), (3, 'c')]: print(v)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | (1, 'a')
002 | (2, 'b')
003 | (3, 'c')
amber epoch
#

!e py for v in zip([1, 2, 3], "abc"): print(v)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | (1, 'a')
002 | (2, 'b')
003 | (3, 'c')
dusk kayak
amber epoch
#

@dusk kayak Acknowledged. As am I, but I'm feeling a little sleepy.

#

!e print(5//2)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

2
amber epoch
#

!e print(5/2)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

2.5
dusk kayak
#
import matplotlib.pyplot as plt

image =[[(0, 0, 150), (0, 80, 140), (0, 160, 130), (0, 240, 120)],
        [(80, 0, 110), (80, 80, 100), (80, 160, 90), (80, 240, 80)],
        [(160, 0, 70), (160, 80, 60), (160, 160, 50), (160, 240, 40)],
        [(240, 0, 30), (240, 80, 20), (240, 160, 10), (240, 240, 0)]]

def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
            colors=[]
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    try:
                        colors.append(image[row+row_delta][col+col_delta])
                    except IndexError:
                        pass
            final=[]
            for values in zip(*colors):
                final.append(sum(values)//len(colors))
            final=tuple(final)
            for row_delta in range(square_size):
                for col_delta in range(square_size):
                    try:
                        image[row+row_delta][col+col_delta]=final
                    except IndexError:
                        pass

pixelization(image, 2)
plt.imshow(image)
plt.show()
amber epoch
#

!e py a = [(1, 2, 3), (4,5,6)] print((1, 2, 3), (4, 5, 6)) print(*a)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | (1, 2, 3) (4, 5, 6)
002 | (1, 2, 3) (4, 5, 6)
amber epoch
#

!e py print(*"abc")

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

a b c
amber epoch
#
print("a", "b", "c")```
dusk kayak
#
def pixelization(image, square_size, column_percentage)
#
import matplotlib.pyplot as plt

image=load_img('sample.png')

def pixelization(image, column_percentage):
    for row in range(0,len(image)): 
        for col in reversed(range(len(image[0])-int((column_percentage/100)*len(image[0])), len(image[0]))):
            image[row][col]=(0,0,0)
    return image

pixelization(image, 60)

plt.imshow(image)
plt.show()
#
from CSE8AImage import *
import matplotlib.pyplot as plt

image=load_img('sample.png')

def pixelization(image, column_percentage):
    for row in range(0,len(image)): 
        for col in range(int((1-column_percentage/100)*len(image[0])), len(image[0])):
            image[row][col]=(0,0,0)
    return image

pixelization(image, 60)

plt.imshow(image)
plt.show()
#
for col in reversed(range(len(image[0])-int((column_percentage/100)*len(image[0]))
for col in range(int((1-column_percentage/100)*len(image[0])), len(image[0]))
amber epoch
#
v = 3 // 6 * 3 // 8 % 2
for i in range(v, 32, 2):
    ...```
vs
```py
for i in range(3 // 6 * 3 // 8 % 2, 32, 2):
    ...```
dusk kayak
#
from CSE8AImage import *
import matplotlib.pyplot as plt

image=load_img('sample.png')

def pixelization(image, column_percentage):
    starting_col=int((1-column_percentage/100)*len(image[0]))
    for row in range(0,len(image)): 
        for col in range(starting_col, len(image[0])):
            image[row][col]=(0,0,0)
    return image

pixelization(image, 60)

plt.imshow(image)
plt.show()
amber epoch
#
def thing(image):
    height = len(image)
    width = len(image[0])
    ...```
dusk kayak
#
def pixelization(image, square_size):
    for row in range(0, len(image), square_size):
        for col in range(0,len(image[0]), square_size):
#
def pixelization(image, column_percentage):
    starting_col=int((1-column_percentage/100)*len(image[0]))
    for row in range(0,len(image)): 
        for col in range(starting_col, len(image[0])):
#
def pixelization(image, square_size, column_percentage):
    starting_col=int((1-column_percentage/100)*len(image[0]))
    for row in range(0,len(image), square_size): 
        for col in range(starting_col, len(image[0]), square_size):
amber epoch
#

@main solar 👋

main solar
untold birch
#

hi

main solar
#

what do u wanna get help with

grizzled stirrup
#

@main solar are you still available

main solar
#

@grizzled stirrup ya

#

i am in vc

grizzled stirrup
#

i do not yet have permission

main solar
#

oh

grizzled stirrup
#

i am cleaning up a csv file

faint hinge
#

!yt-dl Unfortunately, that library isn't really one we can assist with

keen onyxBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
faint hinge
#

Sorry I only just saw this

lusty anchor
#

I am trying to make a list of dates from this dataframe

#

and date=df['Date'] returns key error

amber epoch
#

dir(df) if you're in interactive mode. print(dir(df)) if you're not.

#

There might be a keys method or something you can call.

#

Yeah, try looking at df.keys()

lusty anchor
#

thank you for the advice!

#

that returns

#

Index(['Open', 'High', 'Low', 'Close', 'Adj Close', 'Volume'], dtype='object')

#

it seems like this date is a datetimeobject I managed to in another thread get where I wanted in regards to the script output but I would be interested in seeing how to get the list

fair flame
#

hey guys could one of yall help me on this lab

#

i need to find the amount of occurrences of each number in a list using ifs and loops

little badger
lusty anchor
#

spyder 3

#

@little badger spyder 3

little badger
#

ah thanks. and did you figure out your issue?

#

I'm not familiar with that UI but it perhaps looks like Date was your dataframe's index

#

or maybe the color coding is just based on data type..

lusty anchor
#

@little badger sorry I missed this, I ended up finding a work around overall. I still dont know how to yank this index out as when you do something like list=df.index(0) you get a datetimeobject error. I think the API I used to get this df has the index as a datetimeobject which I have zero familiarity working with

little badger
#

!d pandas.Index.tolist I would think that this works

keen onyxBOT
#

Index.tolist()```
Return a list of the values.

These are each a scalar type, which is a Python scalar (for str, int, float) or a pandas scalar (for Timestamp/Timedelta/Interval/Period)
little badger
lusty anchor
#

@little badger sure thing thank you vm

little badger
#

!remind 12h ^

keen onyxBOT
#
Aye aye, cap'n!

Your reminder will arrive on <t:1639243324:F>!

keen onyxBOT
little badger
lusty anchor
#

@little badger I make a call to the yfinance API to get that df

#

`import yfinance as yf
import matplotlib.pyplot as plt

df = yf.download('VOO')
ar= df['Close'].to_numpy()`

#

so I would have liked to have done something like ar2= df['Date'] but that doesn't work, neither does ar2=df.key('Date') or ar2=df.index('Date')

#

so its an interesting problem that highlights my limited knowledge on dfs

little badger
#

mk let me try

#

you're trying to get a list of all the date values?

#

that's what you want ar2 to be?

#
df = yf.download('VOO') 
dates = df.index.tolist()```
#

<class 'pandas._libs.tslibs.timestamps.Timestamp'> this is the type

#
>>> dates
[Timestamp('2010-09-07 00:00:00'), Timestamp('2010-09-08 00:00:00'), ...]```
#

if you need a regular python datetime object i can help with that too. not sure what the end goal is

#

@lusty anchor

lusty anchor
#

@little badger The original end goal was to simply get a timeplot out of the df which was achieved in avacado chat with a friend telling me to df.plot(y="Close")

#

Now in terms of the way I originally was going to get my plot, it would have been plt.plot(ar2,ar) so it leaves me curious how to get ar2 out of the df

#

let me see

little badger
#

hm i've not explored any plotting yet but if you just need a list of the dates then what i wrote above should work. let me know!

lusty anchor
#

yes

#

it works perfectly

little badger
lusty anchor
#

Thank you very much

little badger
#

i really need to explore graphs

lusty anchor
#

I am slowly transitioning from VB for my graphs, and in the corporate world I think half of my work is making visualizations and half is actual data analysis haha

little badger
#

cool! i kind of do that at work but on a very small scale. check out #data-science-and-ml if you haven't already

elfin walrus
#

Hey guys I am not able to load my image in html file

sage void
#

@full lodgear i am hear now

#

i join the call for fun

#

now i need no help sorry for disturbing :((((

#

i am sorry :(( @twilit sage

#

how do i chage my name here

#

to real name

#

ok thanks

#

now i know how to change name :))

#

i am python beginner

#

i know a bit of html

main solar
#

anyone willing to help by voice??

arctic niche
#

Anyone able to help via voice?

olive zealot
#

hey can anyone explain me the pickle dump and load function

#

please

tender hill
#
from PySide6 import QtWidgets, QtCore, QtGui

class Settings(QtWidgets.QWidget):
  def __init__(self):
    super(Settings, self).__init__()

class WindowWhichWillContainTheProgram(QtWidgets.Qwidget):
  def __init__(self):
    super(WindowWhichWillContainTheProgram, self).__init__()
    self.setStyleSheet('background-color:black;')

class Main(QtWidgets.QMainWindow):
    def __init__(self):
        super(Main, self).__init__()
        
        self.central_widget = QtGui.QStackedWidget()        
        self.setCentralWidget(self.central_widget)

        self.settings = None
        self.main_window = None
        
        self.initialise()

        self.central_widget.addWidget(self.settings)
        self.central_widget.addWidget(self.main_window)        
        current = 1
        self.central_widget.setCurrentWidget(self.settings)
        timer = QtCore.QTimer(1000)
        timer.start()

    def initialise():
      self.settings = Settings()
      self.main_window = WindowWhichWillContainTheProgram()
    
    def timerEvent(event):
      if current == 1:
        self.central_widget.setCurrentWidget(self.main_window)
        current = 0
      else:
        self.central_widget.setCurrentWidget(self.settings)
        current = 1
    
if __name__ == "__main__":
    app = QtWidgets.QApplication([])

    app.setApplicationName("Test")
    window = Main()
    window.show()
    app.exec()
tender hill
#
from PySide6 import QtWidgets, QtCore, QtGui
        

class Settings(QtWidgets.QWidget):
  def __init__(self, central_widget, main_window):
    super(Settings, self).__init__()
    self.central_widget = central_widget
    self.main_window = main_window

    button = QtWidgets.QPushButton("Confirm")
    button.clicked.connect(self.on_click)
    self.layout = QtWidgets.QVBoxLayout()
    self.setLayout(self.layout)
    self.layout.addWidget(button)

  def on_click(self):
    self.central_widget.setCurrentWidget(self.main_window)

class WindowWhichWillContainTheProgram(QtWidgets.QWidget):
  def __init__(self):
    super(WindowWhichWillContainTheProgram, self).__init__()
    self.setStyleSheet('background-color:black;')

class Main(QtWidgets.QMainWindow):
    def __init__(self):
        super(Main, self).__init__()
        
        self.central_widget = QtWidgets.QStackedWidget()        
        self.setCentralWidget(self.central_widget)

        self.settings = None
        self.main_window = None
        
        self.initialise()

        self.central_widget.addWidget(self.settings)
        self.central_widget.addWidget(self.main_window)        
        current = 1
        self.central_widget.setCurrentWidget(self.settings)

    def initialise(self):
      self.main_window = WindowWhichWillContainTheProgram()
      self.settings = Settings(self.central_widget, self.main_window)

    
if __name__ == "__main__":
    app = QtWidgets.QApplication([])

    app.setApplicationName("Test")
    window = Main()
    window.show()
    app.exec()


restive lintel
#

i don't have permission to speak ;3

main solar
#

i need help

faint hinge
#

With what?

bleak minnow
#

Hello all, anyone available to help me ?

#

I want to couple 2 task for example If i press my key to go left, it's shoot to the left

#

If i press my right key It's shoot to the right

little badger
#

!stream 717983911824588862 10M

keen onyxBOT
#

✅ @fair niche can now stream until <t:1639758635:f>.

fair niche
#

i don't use my microphone btw

#

parents

little badger
#

bot#2015

wintry bridgeBOT
fair niche
#

I may have already implemented it

solemn talon
#

....................................................................................................................
write a new function called
“generate output(path to python program, path to input file)”. This function
takes a path to a python program as an input, runs it based off the input file,
and redirects the output to a new file called actual output file.txt, and returns
the path to this file. You can assume this program reads from standard input
and writes to standard output.
.............................................................................
i did not understand this question

fair niche
#

yeah

stoic wolf
#

hii?

fair niche
#

oh! I'm not sure I caught that bug

stoic wolf
#

m new...

fair niche
#

yeah

stoic wolf
#

i could get a hi ?

#

or should i say "could i get a hi?"

#

haha

#

ok

#

byee

fair niche
#

bot#2017

wintry bridgeBOT
fair niche
#

yep

#

what did I even show? 👀

#

I have to check my assigned issues...

hot pier
#

yo

fair niche
#

ah, I have a polls command for the gurkult in my assigned

solemn talon
fair niche
#

also github command enhancements but I can't work on them until sir-lancebot#778 is merged 😭

wintry bridgeBOT
hot pier
#

bot#2017 ready for review arl?

wintry bridgeBOT
hot pier
#

can do one quick

fair niche
#

the config which may require the change would be in config-default.yaml

#

so the filters work differently, I haven't looked too much into how they work 😅

hot pier
#

filters will be going through a big rewrite sometime soon, atleast zig has a issue specifying that

#

nope, its a extension iirc

keen onyxBOT
#

bot/exts/filters/antispam.py line 186

rule_function = RULE_FUNCTION_MAPPING[rule_name]```
fair niche
#

its an extension, yeah

#

it doesn't copy it from the repo as far as I know, uses hacks\™️

hot pier
#

what does github actions to arl

#

like run them on gihtub?

#

or lcoally?

fair niche
#

uses the current head, and the remote configuration, to make one, but doesn't actually check if its been pushed which is annoying

#

although that'd be a lot of work to implement so i'm fine with it

#

I think its this extension

little badger
#

github pull requests and issues

fair niche
fair niche
little badger
#

installed ty~

hot pier
fair niche
#

so for the new lines, it seems possible that the config could just be boosted, or we could also calculate a percentage of whitespace/newlines for a message

fair niche
hot pier
#

oh nice

fair niche
#

super helpful when trying to write workflows

hot pier
#

trying lol, thanks, gonna add it

fair niche
#

wait wrong config

hot pier
#

you missed something

coarse yew
#

ayo what's poppin

hot pier
#

442

keen onyxBOT
#

config-default.yml line 439

newlines:```
fair niche
#

hello joe

hot pier
#

sup

keen onyxBOT
#

config-default.yml lines 439 to 442

newlines:
    interval: 10
    max: 100
    max_consecutive: 10```
fair niche
#

okay finally

hot pier
#

god those pings lol

fair niche
#

we could probably add a new way to configure it, with newlines.max_percentage

hot pier
#

they don't discard it after testing negative?

fair niche
#

@coarse yew my hospital has my dna and samples from some testing 10 years ago lmfao

#

they kept a blood sample frozen

#

👀

#

@little badger I didn't check the tests on that last mention pr so I have to go back to it ;-;

#

change the yaml & add some more logic to the filter

#

my ideas are percentage of a message, threshold of a certain number of characters in the message, etc

hot pier
#

arl, you are using get_partial_messageable cuz the msg isn't resolved right? or there is some other reason

#

2017 pr

fair niche
#

and since that can be done with get_partial_messageable, I don't need to use get_channel and rely on the cache

hot pier
#

what different does it actually do under the hood

fair niche
#

(yeah my computer is running slow, need to kill a process)

fair niche
#

well no

#

under the hood it just constructs the api routes

hot pier
#

no like why it doesn't ened the full channel object

#

also ashes, england 2 down 🙃

fair niche
#

since all i need are the api routes, which partialmessageable implements

hot pier
#

ah ok much clear by looking into the source, cool thanks

fair niche
#

... why are these tests passing strings to where a Member object should be

#

how does that test even pass

hot pier
#

witchcraft

#

also bot#2001 to make modpings actuallly usable

wintry bridgeBOT
faint hinge
fading thicket
#

grim

hot pier
#

aren't all pancakes like that

fading thicket
fair niche
#

/docs

#

aw

#

!docs discord.Member

keen onyxBOT
#

class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").

This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").

x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

hash(x) Returns the member’s hash.

str(x) Returns the member’s name with the discriminator.
fair niche
#

x == y Checks if two members are equal. Note that this works with User instances too

#

why is this test failing ;-;

#

yeah

#

oh

keen onyxBOT
#

bot/rules/mentions.py line 26

total_recent_mentions = 0```
fair niche
#

deleted that line, and tests succeed

#

since that line was invalidating all of the logic above, as it was setting the variable to 0

little badger
#

oops i missed it

#

which line?

#

26?

fair niche
#

just pushed again, bot#2017

wintry bridgeBOT
fair niche
#

tests should pass now too

little badger
#

cool cool

fair niche
#

shall we take a look at the newlines filter too?

little badger
#

i'm not sure i understand your idea/proposal though

fair niche
#

I'm proposing a few changes to add a bit more configuration options (and code them, as well) to have minimum threshold for character count and a percentage of the message being newlines

#

(definitely able to tinker this, but here's an example)
user sends a message with 20 newlines as the entire message, but since its 99% percent of the message, the filter triggers
user sends a message with 50 new lines, but there's a bunch of code, so it ends up being around 30 of the message, so the filter doesn't trigger

coarse yew
little badger
#

@still turtle accused

fair niche
#

i'm 5'2 😔

little badger
#

5'4~

fading thicket
#

i'm 4'2

fair niche
#

could someone maybe approve bot#1924?

wintry bridgeBOT
faint hinge
#

@still turtle Joe is calling you out saying you're like 5'10 or 5'11

fair niche
faint hinge
#

I'm about ~182 cm

fair niche
little badger
#

sry reading

fair niche
#

smh y'all distracted by joe

little badger
#

lolol i read it but i'm parsing it

#

but since its 99% percent of the message

#

what is 99% of the message?

fair niche
#

20 newlines with a start and end character in the message would be >=99%

#

although that may be a bad example given that duplicates exists

little badger
#

are you talking about blank lines..?

#

i'm not understanding

#

need example lol

coarse yew
little badger
#

arl but we do want to delete even if it's 100 lines of pure code

#

also blank line != new line.. no? lemon_thinking

fair niche
little badger
#

yeh yeh i'm looking

fair niche
#

well nvm I guess it would rely on the filter rewrite then

little badger
#

mm yeah

#

i just made the issue bc zig said to do it so that Eventually™️ it would be looked at

fair niche
#

at that point we would be able to hook into the code detection

little badger
#

arl thoughts on meta#155 ?

fair niche
#

well actually

#

nah

coarse yew
fair niche
#

i've never seen a false positive from codeblock but i've seen places where there should be a positive and there isn't i think

fair niche
#

i fairly frequently toggle my DMs on and off for this server. was it an intentional decision for !helpdm on to have to be re-run every time i turn my DMs back on?
👀

little badger
#

yeah

coarse yew
little badger
fair niche
#

i'll be honest i'm not really a fan with how fast some of the bot commands delete themselves

#

.help

coarse yew
fair niche
#

or how inconsistently they delete

little badger
#

especially if it's.. not enough time for me to notice & navigate to the channel to see why i was pung

fair niche
#

ikr

little badger
#

is using !e in pygen similar?

fair niche
#

lance deletes all of its errors basically

#

after like 7 seconds

#

(not what is set but what it feels like)

#

but not the invokes

#

then some of the trashcans delete the user's message and the reply, some just the reply, some only delete the reply on timeout, some don't delete the reply on timeout, some delete the user message on timeout, etc etc

little badger
#

something like !d i think it deletes your message if it can't be found

fair niche
little badger
#

#bot-commands

fair niche
little badger
#

feel like it's fine to leave it

fair niche
#

i've actually reimplemented the frontend of the docs command on my own bot

#

slash commands

#

was fun to implement too lol

faint hinge
#

Neat

little badger
#

what do you have it do if it's not found?

fair niche
#

ephermals.

little badger
#

aha very nice!!

fair niche
#

huh... i left an alias of the previous command, so now i wonder what happens

#

oh it doesn't say anything, very nice! /s

little badger
fair niche
little badger
#

mm

fair niche
#

the other way is to just change that delete after period i guess

little badger
#

yeah i'd be down for extending it

#

but if i choose not to turn dms back on for some reason, would also be annoying to get pings in bot-commands for every help channel i participate in

#

so my non-solution solution for now is to just keep DMs open

fair niche
#

because like... if you're helping in help channels, you tend to be in several, which would be a good amount of direct messages, aka guaranteed 403s

little badger
#

especially now that i'm moderating more in help channels than helping

fair niche
#

aaa

little badger
#

maybe i should just run helpdms off lol

fair niche
#

given you're a mod, I think you can get around it in a way

#

iirc there's a test server and/or an emoji server for the bots here

#

so you can join that and turn on dms for that server

little badger
#

oh wait

fair niche
#

which would allow @keen onyx to be able to dm you but not members

little badger
#

i don't see the bot on the test server..

#

that would be a good idea hmm

#

yeah it's not on the test server

still turtle
little badger
#

i got in, thank you!

stable grove
#

`def get_content(file):
f = open('lyrics.txt', 'r')
lines = f.read()
f.close()
return lines

lyrics = get_content('lyrics.txt')
print(lyrics)
` This is a challenge that I have in my class and the only thing I am getting wrong that my hint says is "Does the function get_content work correctly? Does it open a file, read its contents and then close the file? Does it use the return keyword" can someone help?

coarse glacier
#

hey guys, I've been trying to learn how to do matrix-vector multiplication (both row-variant and column-variant methods) when given a Matrix and a vector, WITHOUT using the numpy methods (dot method and the matmul method), can anyone help me out?

main solar
#

.

rain horizon
#

What's going on in voice chat 0?

#

In the text... of voice chat

amber epoch
#

@foggy mica I said "ciao ciao"

foggy mica
#

Oh ciao