#voice-chat-text-0

1 messages Β· Page 908 of 1

fierce summit
#

A harry potter themed game

#

And I made it very complicated for myself

#

The game itself is not complicated

#

You just have to not hit the stalactites

#

and use the spells at the right time (one when is a fire in the way, one when is a big waterball in the way)

#

But because the size of the stalactites are random, the x and y coordinates have to be changed too and there is no consistent pattern to just make a function for it

#

So I'm doing the coordinates manually right now

#

It's a very boring

#

@rugged root

rugged root
#

Oh dude very cool

fierce summit
#

Yeah, but there are so many combinations

#

Because the fire has 3 sizes

#

and the stalagtites have 3 sizes

#

and the waterballs have 3 sizes

rugged root
#

You might talk about it in #game-development. There may be things that they come up with that you may be over complicating

fierce summit
#

no thanks, I can do this by myself, it's just takes a very long time to do it πŸ˜…

#

Oh, other good news: You know I had that text based harry potter game. Well one of my classmates liked it, and he was looking for a challenge, so we started to rewrite that program, so I can make a discord bot out of it

#

MagyarorszΓ‘g

#

s

#

sz = s

#

s = ssh

jaunty pendant
#

hello

gentle flint
#

hai

jaunty pendant
#

e

fierce summit
#

szia

molten pewter
jaunty pendant
wind raptor
#

Looks like turkey

#

but maybe not

jaunty pendant
#

hmm

rugged root
#

You're totally fine asking questions here, but the folks in #career-advice might be able to elaborate on some of this stuff as well

#

Not at all trying to discourage you from asking here

rugged root
#

Oh huh

#

Rider actually gave me a suggestion where it sees it could reduce nesting a bit

#

I never would have expected it'd pick up on something like that

woeful salmon
#

yeah visual studio does that too if i remember correcly

#

atleast its done it to me a couple times

rugged root
#

Neat

#

I guess I didn't expect Rider to do it

woeful salmon
#

πŸ‘€ i use sourcery in vs code so even vs code does that for me in python

rugged root
#

Dope

woeful salmon
#

its again an ai based tool tho so always taking ur data

#

idc really tho

#

i've just accepted the reality of ai taking over humanity just a matter of time

#

btw i just noticed freecodecamp just made an intermediate git tutorial so anyone who had just learnt git basics in this server's stream can follow that to learn more
https://www.youtube.com/watch?v=Uszj_k0DGsg

Git has the power to make you a better software developer. But you'll have to go beyond the basic "commit, push, pull" to use it effectively! In this course, we'll look at some of the more advanced concepts and tools to make you more productive and confident with Git.

This course focuses on using Git with the command line.

✏️ This course was c...

β–Ά Play video
tiny socket
zenith radish
whole bear
#

hello there

#

can't talk yet 'cause I'm pretty new to the server.

gentle flint
tiny socket
#

I'll add it to my personal server (in my about me) if you wanna try it

gentle flint
#

pls do

tiny socket
#

done

stuck furnace
#

How does the what do what now?

brave steppe
#

πŸ€·β€β™‚οΈ

haughty pier
#

I can hear people - you can't hear me?

#

@whole bear you trolling me or what? πŸ˜›

#

Any special requests for Python packages to test with Python 3.10?

#

ipython, black, flask, and scipy are fails - pytest, coverage, numpy, and requests work

whole bear
#

It's not only from his end

#

Just refreshed the Discord, now it's showing alright

terse needle
#

are people talking or is my client broken

haughty pier
#

sometimes I mute myself and walk away and I need to remember to deafen so people know I can't hear them

stuck furnace
#

What you working on @mortal burrow?

mortal burrow
#

I'm planning on writing a script to automate the backup of my bookmarks.

#

So a little bit of data munging/data forensics lol

#

I'm having fun, just wrote a query to see my browser history in real time.

whole bear
#

i don't have

#

iu don't have permission to speak

#

in voice chat πŸ€·β€β™‚οΈ

wind raptor
#

!voice

wise cargoBOT
#

Voice verification

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

whole bear
#

darn thanks

#

i'm new

daring orbit
queen folio
wind raptor
whole bear
whole bear
#

im trying to help this guy but we cant seem to get it

zealous wave
#

Opal

#

What the fuck was that

somber heath
#

Space Odyssey 2001

#

The black thing is one of the "monoliths".

queen folio
#
    result["network_visit_id"] = network_visit_id
    result["network_visit_id_approx"] = approximate_id(network_visit_id)
    pageview_id = build_page_view_id(record)
    result["page_view_id"] = pageview_id
    result["page_view_id_approx"] = approximate_id(pageview_id)
    visitor_id = get_visitor_id(record)
    result["visitor_id"] = visitor_id
    result["visitor_id_approx"] = approximate_id(visitor_id)
    family_visit_id = build_family_visit_id(record)
    result["family_visit_id"] = family_visit_id
    result["family_visit_id_approx"] = approximate_id(family_visit_id)
    job_view_id = build_job_view_id(record)
    result["job_view_id"] = job_view_id
    result["job_view_id_approx"] = approximate_id(job_view_id)
    site_visit_id = build_site_visit_id(record)
    result["site_visit_id"] = site_visit_id
    result["site_visit_id_approx"] = approximate_id(site_visit_id)

^ Imagine this, but it's a monolithic codebase

#

^ & you're not allowed to touch it

somber heath
#

Boop.

opaque coral
#

hello

#

what r u talking about @daring orbit

#

@wind raptor

wind raptor
#

There's lot's of ppl in here @opaque coral. Talking about replit atm

opaque coral
#

@wind raptor check my about i want review of my yt channel

#

@wind raptor any content suggestion...?

zealous wave
#

Give me a few minutes

#

I'll be back

daring orbit
#

REPLICATOR BUG

dense ibex
#

!u

wise cargoBOT
#
jake (\_jake#0169)

hypesquad_bravery

User information

Created: <t:1580002257:R>
Profile: @dense ibex
ID: 670802831678373908

Member information

Joined: <t:1609774606:R>
Roles: <@&267630620367257601>, <@&585529568383860737>, <@&764245844798079016>, <@&764802720779337729>, <@&463658397560995840>, <@&542431903886606399>

Infractions

Total: 4
Active: 0

zealous wave
#

!u

wise cargoBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

zealous wave
#

:(

#

@rugged root it's crazy, the vc is active without you in it!

#

flag_transgender vs πŸ³οΈβ€βš§οΈ

dense ibex
rugged root
#

That makes me happy

#

Legitimately

tiny socket
somber heath
#

"The internet is a really trustworthy place." Oh boy. That's adorable.

dim quartz
#

Almost every day

tiny socket
strong arch
#
scene one
  load "main.mp4"
  after 0:01 layer 1 load "file.png"
    visible for 0:05
    x animate from 7 to 4 over 0:03 starting now
after one scene two
  load "aux.mp4"
sinful igloo
#

Hi

#

!eval```
if choice == '2':

print ("1.Make an New List")
print ("2.Check your Lists")

print ("3.Edit your lists")
print ("Close")```

#

!e

if choice == '2':

    print ("1.Make an New List")
    print ("2.Check your Lists")
  print ("3.Edit your lists")
  print ("Close")```
#

!e

if choice == '2':

    print ("1.Make an New List")
    print ("2.Check your Lists")
  print ("3.Edit your lists")
  print ("Close")```
wise cargoBOT
#

@sinful igloo :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     print ("3.Edit your lists")
003 |                                ^
004 | IndentationError: unindent does not match any outer indentation level
strong arch
robust quiver
pliant slate
#

hi guys

whole bear
#

hlo

pliant slate
#

how to get verification?

whole bear
#

just stay in the server for 3 days

pliant slate
#

Π»

#

ok

whole bear
#

along with 50 non spam messages

vale meteor
#

Hi @vast pebble

vast pebble
#

hi

vale meteor
#

I have been doing python for 3 months but I have programmed for 4 years

#

Mostly C in university but I made a project in JS

#

Thats cool! Any idea for the game or are you still coming up with ideas

#

ok sure

pliant slate
#

its nice man

neon wagon
#

yo

#

why can't i talk? is there like a certain quota i have to reach to have access to use my mic in vc?

#

because if so that sucks. but hey i understand why

#

well gl with what ever you code

zenith radish
#

@neon wagon

#

!voice

wise cargoBOT
#

Voice verification

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

neon wagon
#

thanks

ivory dagger
#

hi

#

hello

#

cloud?

#

LEAVE ME ALONE CAT!!

coarse cape
#

sup @zenith radish πŸ‘‹

#

wait how many people are in this vc?

#

i heard 2 voices

#

mate

#

im restarting my discord

#

sup Lizzie πŸ‘‹

#

i can see you in the vc now in my client xD

#

macOs goes brr

#

is using rust for backend and python for frontend in datascience a good option?

#

:0

#

like not backend backend

#

i dont mean server side

#

i mean library side like how tensorflow was built with c++?

#

is go good for server side or node js with express kinda lib?

#

i wanna give go a go

#

xD

#

seriously tho, is go good for serverside backend?

#

cool beans

neon wagon
#

so what you coding?

coarse cape
#

does go have good integration with nodejs?

neon wagon
#

cool

coarse cape
#

why 😦

neon wagon
#

would be nice if there was like a scratch style coding but for python

coarse cape
#

@whole bear share it 😦

neon wagon
#

MLP FAN DETECTED

#

GET THE JAR

coarse cape
#

connect it alreadyyyy

whole bear
#

OH NO

coarse cape
#

can i make a PR to the readme?

#

@whole bear ^

#

yeah

#

ahhhh nsfw detected

neon wagon
#

MY BACK

coarse cape
#

im not running this mate

#

xD

#

its cool tho

#

yeah

#

@zenith radish , im installing your configs πŸ™‚ do i have permission to ping you if something screws up mate?

#

yay xD

#

yup

#

gitautus?

#

that must be you right>

#

i screw links all the time

zenith radish
#

That's a play on my name

#

Gintautas is my name

#

Gitautas is my git repo

#

Geddit

coarse cape
#

oh haha

hollow relic
#

boys, let's go to pm

#

w are you try to code?

coarse cape
#

what do i do?

zenith radish
#

Either change the font or install the font I use

#

This is the font

coarse cape
#

im new to emacs hehe, would that be located in config.el?

zenith radish
#

Or you can change it in config.el

#

Yee

coarse cape
zenith radish
#

doom-font (font-spec :family "SauceCodePro NF" :size 18)

#

This line

coarse cape
#

which is your leader btw?

zenith radish
#

SPC

coarse cape
#

huh

#

the menu doesnt pop up for me :/

#

@whole bear how do i play that on discord?

whole bear
#

!goto mines

wise cargoBOT
#

When checking if something is equal to one thing or another, you might think that this is possible:

if favorite_fruit == 'grapefruit' or 'lemon':
    print("That's a weird favorite fruit to have.")

While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.

So, if you want to check if something is equal to one thing or another, there are two common ways:

# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
    print("That's a weird favorite fruit to have.")

# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
    print("That's a weird favorite fruit to have.")
coarse cape
woeful salmon
#

just my opinion but at the point where someone's trying to make a game to work in discord instead of just making a separate proper game in my mine he's already a 12-13 year old and i expect worst looking code already

#

again just my opinion

hollow relic
#

how i can use mic

#

hell no

zenith radish
#

!voice

wise cargoBOT
#

Voice verification

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

coarse cape
#

send it

#

@whole bear

#

hehe ty

hollow relic
#

that weird

hollow relic
#

let's go fight C++ oohhhh

coarse cape
#

@zenith radish how do i get the menu to pop up when i press on SPC?

zenith radish
#

it should work for ya

#

you can mv ~/.doom.d ~/.doom.old && git clone myconfig.git

#

and try again

zenith radish
#

ohh

#

run doom sync

coarse cape
#

i get this

zenith radish
#

~/.emacs.d/bin/doom sync

#

run this

coarse cape
#

still the same

zenith radish
#

what the heck

woeful salmon
#
func F() <-chan int {}

@zenith radish i just got confused because i thought you're assigning a read only channel ^

#
var myChannel chan int
<-myChannel

replaces
the <-myChannel with the next value gotten through the channel

<-chan int

^ while this is a read-only channel type need to remember this :x
i think this is the 4th time i've forgotten it

zenith radish
#

!resources

wise cargoBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

zenith radish
#

@whole bear

whole bear
#

hey @zenith radish

#

thank you

zenith radish
#

❀️

somber heath
#
class MyClass:
    def __init__(self, a, b, c, *e):
        ...
bag = ["candy" for _ in range(30)]
MyClass(*bag)```
whole bear
#

i heard opal where he is

somber heath
#

...Are you hiding in my ceiling?

whole bear
#

opal where are u

somber heath
#

Come down out of my ceiling and see for yourself.

woeful salmon
#

all this data (from multiple pages) took 1.2 seconds without goroutines even o-o
golang fast even without go routines man

#

lol

whole bear
somber heath
#

Ahhh. Discord's servers have been misbehaving.

whole bear
#

hey@rugged root

somber heath
#

Cache update issues maybe.

whole bear
#

oh isee

frosty star
#

😦 Sorry to hear that Hemlock. Hope things get better for you.

somber heath
#

FaceFolder

#

It folds your face.

frosty star
#

Face... face.... I'm trying so hard rn

somber heath
#

?

frosty star
#

trying to be punny 😦

somber heath
#

Ah.

frosty star
#

*fail miserably

somber heath
#

At least you've faced up to your failure.

#

Which you could have got away with if you hadn't said anything, so it wasn't that bad. 😁

frosty star
#

Thanks opal πŸ₯²

woeful salmon
#

πŸ‘€ i used to have friends and party but ever since i started actually trying to get good at programming i've lost all friends

#

not lost just don't hang out with em

cobalt magnet
#

monke

frosty star
#

oh my gosyh\

somber heath
#

@rugged root 😬

woeful salmon
#

πŸ‘€ i've spent majority of my school days playing soccer yet for me the only major physical injury i've had is playing cricket the one time i played it i literally did a front flip and landed on my right hand and it cracked... and then i kept playing soccer for next 3 days without noticing it xD

frosty star
#

I remember this scene from house of wax where the bad guy cut one of the character's achilles tendon. That's how I learned the word "achilles tendon".

somber heath
#

Joshua Jacksonville.

woeful salmon
#

meanwhile me: gets freaked out by ants

somber heath
#

Tankles.

woeful salmon
#

only me cuz i hate all insects xD

frosty star
#

i can't even with butterflies

woeful salmon
#

sem

somber heath
woeful salmon
#

i am weird in that regard i'm dehydrated half the day and drink too much water the other half

frosty star
#

I mean they're pretty.... a metre away...but when they're in front of ur face u can see all the details and the legs

woeful salmon
somber heath
#

I think they're lovely.

woeful salmon
#

when you look at them from far yeah

frosty star
#

They are tho I agree 😦

#

maybe I'll muster some courage to touch one someday

woeful salmon
#

i only have useless skills other than programming myself

frosty star
#

I have dreams of becoming an illustrator but coding is all I do these days

#

it's not bad tho. I like coding too.

somber heath
#

Your feelings about yourself do not hold authority over the feelings other people have about you.

frosty star
#

brb

woeful salmon
#

list of useless skills i have
soccer: haven't played in years and i'm a bit fat now
speedcubing: i don't even find it fun anymore
gaming: i rarely play games now and its mostly rocket league
roller skating: no space for it around
sewing: again touched haven't in years probably suck at it now

somber heath
#

Years ago, I went into a butterfly enclosure at a zoo. It was wonderful.

frosty star
#

ah I haven't been to a zoo in a while

#

dexter

woeful salmon
#

i would say which os you like is really just preference now. windows used to suck but i'd say with wsl and windows terminal and powershell core i like it more than mac personally
linux > windows > mac for me

somber heath
#

Bitcoin cosmetics. Accentuate your natural beauty with the latest in crypto mining technologies.

frosty star
#

I did theater too πŸ˜„

somber heath
#

Romeo, Romeo...Row me, oh, like a paddleboat, ho.

frosty star
#

πŸ˜‚ oh my gosh

whole bear
#

:p

#

p:

somber heath
#

"I hope you find happiness like Rabbit did."
"You are a terrible person. That's what it says right here. 'A terrible person.' We weren't even testing for that."

gentle flint
frosty star
#

I think I'm gonna be here alll night ... 😦 I was being stupid all week and procrastinated now I have 40 assignments to mark due TOMARRAW

gentle flint
#

i need to do loads of work
but can't concentrate cuz the neighbours are drilling

somber heath
gentle flint
woeful salmon
#

@whole bear when covid has died down a bit attend conferences for your preferred language
you learn + you get to meet real life friends with similar intrests its a win-win

frosty star
woeful salmon
#

i know alooot of ppl who wanna live in like country-side or just closer to nature

#

i myself don't get the appeal i would much rather stay in the polluted convenient city i already am in

somber heath
#

The whole lack of FDA approval excuse is/was such a fucking fig leaf.

frosty star
#

My sister got a fever, I just feel numb on my right arm

#

or was it the left arm

coarse cape
#

sup hemlock, lp and lizzie πŸ‘‹

#

sup all πŸ‘‹

gentle flint
#

unfortunately

frosty star
#

Oh my gosh

#

brb

#

what a time to be alive

sweet lodge
#

Example of setting the user agent using requests, stolen from a work project:

# K-ERP forces you to use Firefox
HEADERS: typing.Final[dict[str, str]] = {
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0',
}

response = requests.post(BULK_SEARCH_URL, headers=HEADERS, params=params, data=data)
swift valley
#

Good evening

#

Just continuing my research from last night

#

So I'm kind of just, synthesizing three different sources into a single product

#

I think I really should take a break

vivid palm
#

@brittle mangoguess what

#

i use groupby() all the time now

#

so ty praise

brittle mango
zenith radish
#

!paste

wise cargoBOT
#

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.pythondiscord.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.

zenith radish
#

!code

wise cargoBOT
#

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.

woeful salmon
#

i'mma go join the workshop cuz free knowledge maybe i'd find something i don't know yet xD

cobalt owl
#

!code

frosty star
#

yup

swift valley
#

I'm a zoomer lemon_swag

frosty star
#

millenial too

swift valley
#

It really just means I have a crippling, pessimistic world view because I probably won't live to see the future because of global warming

frosty star
#

I tried fate recently a wee bit different than dnd

#

anyhow good night guys

#

or have a nice day

#

wherever u are

bronze quest
#

hi

swift valley
#

Got to get going

#

See you folks around

brittle mango
whole bear
#

cat

vivid palm
#

aww

mystic lily
#
import datetime, asyncio, websocket, json, numpy
import pandas as pd
import pandas_ta as ta
from binance.client import Client
import websocket, json
binance_api_key = 'xxx'
binance_api_secret = 'xxx'
client = Client(api_key=binance_api_key, api_secret=binance_api_secret)
from multiprocessing.pool import ThreadPool as Pool
daysneeded = 200
pool_size = 10
symbols = ['ADAUSDT', 'ATOMUSDT', 'BATUSDT', 'BTTUSDT', 'DASHUSDT', 'DOGEUSDT', 'EOSUSDT', 'ETCUSDT', 'ICXUSDT', 'IOTAUSDT', 'NEOUSDT', 'OMGUSDT', 'ONTUSDT', 'QTUMUSDT', 'TRXUSDT', 'VETUSDT', 'XLMUSDT', 'XMRUSDT' ]
def num_to_month(*args, **kwargs):
    num = kwargs.get("num", None)
    if int(num) <= 12 and int(num) > 0:
        list_of_months = {'01': 'Jan', '02': 'Feb', '03': 'Mar',
                          '04': 'Apr', '05': 'May', '06': 'Jun', '07': 'Jul',
                          '08': 'Aug', '09': 'Sep', '10': 'Oct',
                          '11': 'Nov', '12': 'Dec'}
        return list_of_months[num]
def from_date():
    global fromdate
    fromdate = str(datetime.datetime.now() - datetime.timedelta(days=daysneeded))
    fromdate = fromdate.split()
    fromdate = fromdate[0].split("-")
    month = num_to_month(num=str(f'{fromdate[1]}'))
    fromdate = f'{fromdate[2]} {month}, {fromdate[0]}'
def to_date():
    global todate
    todate = str(datetime.datetime.now() - datetime.timedelta(days=daysneeded))
    todate = todate.split()
    todate = todate[0].split("-")
    month = num_to_month(num=str(f'{todate[1]}'))
    todate = f'{todate[2]} {month}, {todate[0]}'
from_date()
to_date()
org_columns = ['open',
               'high', 'low', 'close', 'volume', 'close_time', 'quote_av',
               'trades', 'tb_base_av', 'tb_quote_av', 'ignore']
#
def worker(symbol):
    try:
        klines = client.get_historical_klines((symbol), Client.KLINE_INTERVAL_5MINUTE, fromdate, todate )
        klines_len = len(klines)
        if klines_len == 0:
            print('Failed to download data for ', (symbol))
        new_columns = [item for item in org_columns]
        new_columns.insert(0, 'timestamp')
        DF = pd.DataFrame(klines,
                        columns=new_columns)
        DF['timestamp'] = pd.to_datetime(DF['timestamp'], unit='ms')
        DF.set_index('timestamp', inplace=True)
        DF.to_csv(symbol)
    except:
        print('*** Invaled symbol:', (symbol), '! ***')
pool = Pool(pool_size)
async def testLoop():
    for symbol in symbols:
        pool.apply_async(worker, (symbol,))
    pool.close()
    pool.join()
loop = asyncio.get_event_loop()
loop.run_until_complete(testLoop())
vivid palm
#

what's pandas_ta?

#

'technical analysis' hm

mystic lily
#

is there anyway to make this multi processing instead of threading essay

#

and yes

brittle mango
#

there is great module called futures and it has process/thread pool executors

#

great stuff

molten hound
zenith radish
#

@molten hound

#

Nier

whole bear
#

What is everyone eating for lunch

#

I really need ideas

restive geyser
#

You should get pizza

#

Lol

vivid palm
#

i had a bagel and am too full :(

zenith radish
slim arch
#

I'm doing this mini challenge, and have this code so far, but am unsure what to do, could someone explain what I should - in vc/chat

snow rivet
#

don't randomly ping people, I don't even use voice chat

slim arch
#

srry

strong arch
zenith radish
#

ΠŸΠ΅Ρ€Π΅Π·Π°Π»ΠΈΠ² Π²ΠΈΠ΄Π΅ΠΎ ΠΈΠ· ΠΌΠΎΠ΅Π³ΠΎ инстаграма Π² HD качСствС.
На Π²ΠΈΠ΄Π΅ΠΎ Ρ‚Π°ΠΊ ΠΆΠ΅ ΠΏΡ€ΠΈΡΡƒΡ‚ΡΡ‚Π²ΡƒΡŽΡ‚:
https://www.instagram.com/johngradei
https://www.instagram.com/tim_tkachenko_c

КУПИВЬ Π’Π Π•Πš ΠœΠžΠ–ΠΠž Π—Π”Π•Π‘Π¬:
https://satanenko.bandcamp.com/album/-

ΠŸΠžΠ‘Π›Π£Π¨ΠΠ’Π¬ ΠœΠžΠ™ Π Π•ΠœΠ˜ΠšΠ‘ ΠœΠžΠ–ΠΠž Π—Π”Π•Π‘Π¬:
https://soundcloud.com/repenie/animal-religion-gospod-iisus-khristos

Мой инстаграм/My...

β–Ά Play video
mystic lily
#

@slim arch i donno if u got it yet but

flattern = ([[1, 2], [3, 4]])
flattern = str(flattern)
flattern = flattern.replace("[","").replace("]","").replace(" ","").split(',')
print(flattern)
honest pier
#

that's horrible

vivid palm
#

oh no

mystic lily
#

i donno how els to do it 😦

honest pier
#

it also doesn't work if you have strings with spaces or "[" or "]"

#

or commas

#

for two levels of nesting the easiest way is itertools.chain.from_iterable

#

oh, and the most egregious error, you now have to convert all you data back to what it was, and that's not necessarily possible

zenith radish
slim arch
#

thanks for trying though lmao

#

thats just going to make me 10000x more confused

woeful salmon
#

for me if it functions i don't need new
mobile if i can call with it then it works
car if it can drive and is road legal it works
laptop its barely holding on but it meets my programing needs so it works

honest pier
#

@rugged root πŸ‘‹

honest pier
slim arch
#
def flatten(numbers):
    result = []
    for sets in numbers:
        set1 = numbers[1]
        set2 = numbers[2]
            for numbers in set1:
                number1 = set1[1]
                number2 = set1[2]
                    for numbers in set2:
                        number3 = set2[3]
                        number4 = set2[4]
    result.append(number1)
    result.append(number2)
    result.append(number3)
    result.append(number4)
        
    print(result)
    return result
    
flatten([[1,2],[3,4]])
#

i got super confused

#

most of it is crap

honest pier
#

you can just do a nested loop

#

outer to loop over the lists, and inner to loop over the elements in the list

woeful salmon
#

vim

" exit without save
ZQ
:q!

" exit with save
ZZ
:wq

" how to navigate

h " left by 1 char
j " down by 1 line
k " up by 1 char
l " right by 1 char

w " go to the start of the next word
e " go to end of the current or next word
b " go to the start of a previous or current word

2j " adding numbers to normal mode commands like this makes them repeat so this goes down 2 lines

:<line-no> " just need a line number to jump to specific line number

x " delete 1 character
dw " delete till start of the next word
de " delete till end of the current word
dd " delete line

zz " center current line on screen
zt " take current line to the top
zb " take current line to bottom

i give up trying to explain vimscript (i use em but idk how to explain) and norm commands so here's the basics

#

:%norm dd
^ delete all lines for example

zealous wave
#

Hey!

woeful salmon
#

ikr that's the cutest voice i've heard in a while

zealous wave
#

What's up hemlock, it's been a while

woeful salmon
#

@zenith radish i'm actually just gonna straightup try emacs with evil mode rn so... what lsp do you use again?

zenith radish
#

brew install tesseract

#

whereis tesseract

#

@whole bear

#

sudo add-apt-repository ppa:kelleyk/emacs

#

sudo apt update

#

sudo apt install emacs27

zealous wave
#

@dire folio why do you need 3tb of SSD space?

#

Or really any of your specs?

#

How many tabs do you currently have open...

dire folio
#

204

zealous wave
#

Having more than three bothers me haha

strong arch
dire folio
#

sn3k'; DROP TABLE jakes_data; --

zealous wave
#

What if Jake isn't really jake and we are all being fooled?

strong arch
vivid palm
#

discord taking forever to connect lol

dense ibex
#

@vivid palm I dig the piss colour role

zealous wave
zealous wave
#

I've been in the vc for like an hour and I don't think hemlock knows I'm here lol

vivid palm
#

aw lol

dense ibex
#

:p

vivid palm
#

he is doing house mega clean

#

probably not looking at his phone

zealous wave
#

Yeah it's fine im muted anyways

#

Don't feel like talking so

vivid palm
dense ibex
#

lol yeah

#

Brb

zenith radish
#

@dire folio

zealous wave
#

Hey where did the exploding pandas go Mina?

vivid palm
#

oh was just temporary lol

#

pandas explode is an actual pandas method tho

zealous wave
#

Ahh

zenith radish
zealous wave
#

Anyways I'm going to go, I'll be back later

wintry pier
#

good bye nakama

cosmic lark
#
from datetime import datetime, timedelta
from collections import OrderedDict
dates = ["2000-1-1", "2020-12-31"]
start, end = [datetime.strptime(_, "%Y-%m-%d") for _ in dates]
dates = OrderedDict(((start + timedelta(_)).strftime(r"%b-%d-%y"), None) for _ in range((end - start).days)).keys()
for i in dates:
    print(i)

prints in format

Sept-30-20

i want it to print something like

september-3-2020

how would i do that?

odd kraken
#
from scipy import signal
import matplotlib.pyplot as plot
import numpy as np

def binary_counter(switch, rangeSize, invert = True, prefix = ''):
    arr = []
    on = True
    for i in range(rangeSize):
        if(i % switch == 0):
            on = not on
            
        if invert:
            if on: arr.append(0)
            else: arr.append(1)
        else:
            if on: arr.append(1)
            else: arr.append(0)
    print(prefix, arr)
    return arr

a = binary_counter(8, 16, False, prefix='a :')
b = binary_counter(4, 16, False, prefix='b :')
c = binary_counter(2, 16, False, prefix='c :')
d = binary_counter(1, 16, False, prefix='d :')

F = [0 for i in range(len(a))]

for i in range(len(a)):
    F[i] = b[i] & ~c[i] | c[i] & d[i] & a[i]

print(f"F : {F}")

t = [i + 1 for i in range(16)]

plot.plot(t, a)
plot.title('F = bc\' + acd')
plot.xlabel('t')
plot.ylabel('a')
plot.axhline(y=0, color='k')
plot.grid(True, which='both')
plot.show()
brave steppe
#

@rocky kiln I thought they wanted the graph flipped some way πŸ˜…

odd kraken
#

plot.plot(t, b, draw_style="step")

odd kraken
rocky kiln
brave steppe
#

πŸ‘‹

stuck furnace
#

Hello πŸ‘‹

#

What are you working on?

#

Oh right nice. So you're running some automated tests/linting?

#

Right πŸ˜„

#

Ah right

#

Sounds like you've got it figured out

#

Oh yeah right.

#

The logs are definitely a nice feature. And I like how we're able to have internal conversations.

#

Although sometimes I do accidentally send internal messages to the recipient πŸ˜„

#

Erm, I think you can do that Β―_(ツ)_/Β―

#

Fair enough

#

Hello

#

Erm, post the question here @loud raptor

#

Oh, hello @somber heath. I didn't see you were in here πŸ˜„

loud raptor
#
#Reads songs added so it saves to the program
def ReadSongsFromFile():
    with open('songs.json') as json_songs_file:
        json_songs = json.load(json_songs_file)
    return json_songs

#Add songs to Json file to be read and checks if file or path aready exists so it doesn't duplicate
def AddSongtoFile(song:dict):
    if song.get('name') and song.get('path'):
        with open('songs.json') as json_songs_file:
            json_songs = json.load(json_songs_file)
        for json_song in json_songs:
            if song.get('name') == json_song.get('name') or song.get('path') == json_song.get('path'):
                return False
        with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)
        return True

#adds songs to program from Json file
def AddSongsFromJson():
    AllSongs = ReadSongsFromFile()
    for song in AllSongs:
        songname = mp3file(song['name'], song['path'])
        mp3list.append(songname)
        songBox.insert(END, songname.mp3filename)```
stuck furnace
#

What does the file look like?

loud raptor
#
def DeleteSong():
    Stop()
    if songBox.delete(ANCHOR) == True:
       pygame.mixer.music.stop()
    with open('songs.json') as json_songs_file:
        json_songs = json.load(json_songs_file)
        for i in range(len(json_songs)):
            with open("songs.json", "w") as outfile:
                json.dump(json_songs, outfile,indent=4)
            if json_songs['name'] == songBox.delete(ANCHOR):
                del json_songs[i]```
#
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__    
    return self.func(*args)
  File "c:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program\SAT project.py", line 225, in DeleteSong
    if json_songs['name'] == songBox.delete(ANCHOR):
TypeError: list indices must be integers or slices, not str```
stuck furnace
#

Hmm, you do have the same file open for reading and writing at the same time.

#

It's generally best to load the whole file, make the desired changes to the data, then save the entire file back to disk.

dense ibex
#
if json_songs[1] == songBox.delete(ANCHOR):
  pass
somber heath
#

I think there's an argument for sql.

stuck furnace
#

Can you post a section of the json file so we can better understand?

loud raptor
somber heath
#
with open("data.json", "r") as file:
    data = json.load(file)

#operate on data

with open("data.json", "w") as file:
    json.dump(data, file)```
loud raptor
#

@stuck furnace thats my code

stuck furnace
#

Alright, so the json file is a list of songs (each song being an object/dict with a name attribute), and you have the name of a song which you want to delete?

loud raptor
#

yea on my program

stuck furnace
#

Once you load the json file, you have a list. You need to remove the named song from that list, then write the list back to the file.

loud raptor
#

yea but idk how i would do that

stuck furnace
#

It might actually be easier to create a new list sans the song.

loud raptor
#

what?

stuck furnace
#

data is the list.

loud raptor
#

yea

stuck furnace
#

So you want to do something like ```py
data_sans_song = []
for song in data:
if song['name'] == target_name:
continue # Skip songs with matching names.
data_sans_song.append(song)

loud raptor
#

in the deletesong() function?

stuck furnace
loud raptor
#

ok

stuck furnace
#

Do you feel you understand what this code is doing?

loud raptor
#

its appending a song name to the list if it matches whatever the target is

stuck furnace
loud raptor
#

i never really used it

#

before

#

what am i using for the target name tho? im a bit confused

stuck furnace
#

If the name of the song matches, we skip that song (don't append it to the new list).

#

continue just skips to the beginning of the next iteration of the loop.

loud raptor
#

so like this

#
    Stop()
    SongData = []
    with open('songs.json', 'r') as json_songs_file:
        json_songs = json.load(json_songs_file)
    with open("songs.json", "w") as outfile:
        json.dump(json_songs, outfile,indent=4)
    for song in json_songs:
        if song.name == json_songs['name']:
            continue
        SongData.append(song)```
stuck furnace
#

When I wrote song.name, I meant song['name']. Sorry if that caused confusion.

loud raptor
#

now for some reason nothing appended to the Json file when i import mp3 files to my program

stuck furnace
loud raptor
#

i didnt change anything

stuck furnace
#

The logic of the function would be:

  1. Load the json file.
  2. Create a new list with all the songs except the song you want to delete.
  3. Write the new list back to the json file.
loud raptor
#

ohh ok

#

wait i think someone edited my code on github

#

that i added a friend

#

give me one sec

stuck furnace
#

Where are you getting the name of the song to be deleted from?

loud raptor
#

from my program

stuck furnace
#

There should be a "blame" button somewhere.

#

@loud raptor If you open a file on GitHub, you can view its history:

loud raptor
left plume
#

@haughty pier good nickname

loud raptor
#

idk why when it was working during the week

left plume
#

what's the killer feature of NixOS, current or future

loud raptor
#

i didnt change anything with the functions tho

#

now for some reason importing mp3 files is not working properly

#

@stuck furnace

stuck furnace
#

Is this a group project?

loud raptor
#

no but the i had a guy help me append stuff to the JSON file from this discord

#

he helped with all the JSON management i have at the moment but for some reason, the functions dont work now when i didnt touch them

#

like nothing is being appended to the JSON file at all

stuck furnace
#

After changing the DeleteSong function?

loud raptor
#

let me see

#

nah i reset eveything and still not working

#

wtf is happening now

#

idk what is happening now

stuck furnace
#

Are you able to ask your teacher for help/feedback?

loud raptor
#

nah the teacher can't help with this project

#

im calling this function

#
#adds songs to program from Json file
def AddSongsFromJson():
    AllSongs = ReadSongsFromFile()
    for song in AllSongs:
        songname = mp3file(song['name'], song['path'])
        mp3list.append(songname)
        songBox.insert(END, songname.mp3filename)```
cobalt magnet
#

what are you making a music bot?

loud raptor
#

no

#

a music player @cobalt magnet

cobalt magnet
#

mhm nice

loud raptor
#

and it's pissing me off as it stopped working properly with no changes to functions

#
AddSongsFromJson()
# Run the Main Loop
root.config(bg = "cadetblue2")
root.mainloop()```
#
def AddSongtoFile(song:dict):
    if song.get('name') and song.get('path'):
        with open('songs.json') as json_songs_file:
            json_songs = json.load(json_songs_file)
        for json_song in json_songs:
            if song.get('name') == json_song.get('name') or song.get('path') == json_song.get('path'):
                return False
        with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)
        return True```
#

@stuck furnace this is correct right?

stuck furnace
#

Somewhere in there you need the line json_songs.append(song)

loud raptor
loud raptor
#
with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)```
#

because i dont want to add duplicates in my Json file

#

its checking also for duplicate names

stuck furnace
loud raptor
#

oh ok

#

but why was it working before

stuck furnace
loud raptor
#

ill try that

stuck furnace
#

I also have to go to bed.

loud raptor
stuck furnace
#

Erm, I would really recommend talking to your instructor, as I feel like you're tying yourself into knots a bit with this.

#

Could you ask to simplify the requirements of the project?

loud raptor
#

well im trying to get the most basic functions of a music player to work

#

at the very least

#

so deleting, skipping, playing, shuffling, and fast fowarding

#

i did have other stuff i wanted to add but ill do it after i finish school

#

like trying to make graphs and stuff depending how much you listen to in a week

#

something like that

stuck furnace
#

Alright. The key thing is to understand what you're doing at each step. If you can't write out the steps of the function in pseudocode, you are going to have issues writing the actual code.

chilly dragon
#

I was trying to use voice chat

loud raptor
chilly dragon
#

Having issues with permission

stuck furnace
#

You should meet the requirements to verify.

stuck furnace
loud raptor
#
def AddSongtoFile(song:dict):
    if song.get('name') and song.get('path'):
        with open('songs.json') as json_songs_file:
            json_songs = json.load(json_songs_file)
        for json_song in json_songs:
            if song.get('name') == json_song.get('name') or song.get('path') == json_song.get('path'):
                return False
            else:
                json_songs.append(song)
        with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)
        return True```
#

@stuck furnace

stuck furnace
#

Gtg πŸ‘‹

loud raptor
#
    if song['name'] == json_songs['name']:
TypeError: list indices must be integers or slices, not str```
#
#Delete a song function
def DeleteSong():
    Stop()
    with open('songs.json', 'r') as json_songs_file:
        json_songs = json.load(json_songs_file)```
frosty star
#

What is everybody's time zones?

loud raptor
#

AEST

frosty star
#

Ah that explains it

willow light
#

EDT

loud raptor
#
class mp3file:
    def __init__(self, mp3filename, mp3dir):
        self.mp3filename = mp3filename  #Object that gets just the file name
        self.mp3dir = mp3dir #object that gets just the file directory```
#
def AddManySongs():
    songs = filedialog.askopenfilenames(title = "Choose an MP3 file", filetypes = (("mp3 Files", "*.mp3"), ))
    #Loop through song list and replace directory and mp3
    for song in songs:
        song_dict = {}
        song_dict['name'] = os.path.basename(song)
        song_dict['path'] = os.path.abspath(song)
        if AddSongtoFile(song_dict):
            songname = mp3file(song_dict['name'], song_dict['path'])
            mp3list.append(songname)
            songBox.insert(END, songname.mp3filename)```
frosty star
# willow light EDT

I'm reminded of how huge the americas are. Where I'm from it's the same timezone anywhere in the country πŸ˜…

loud raptor
#
#Add songs to Json file to be read and checks if file or path aready exists so it doesn't duplicate
def AddSongtoFile(song:dict):
    if song.get('name') and song.get('path'):
        with open('songs.json') as json_songs_file:
            json_songs = json.load(json_songs_file)
        for json_song in json_songs:
            if song.get('name') == json_song.get('name') or song.get('path') == json_song.get('path'):
                return False
        json_songs.append(song)
        with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)
        return True```
chilly dragon
#

mp3list.append(songname)

frosty star
#

😳

chilly dragon
#

sorry @frosty star

frosty star
#

i was silently giggling behind the screen

#

so it's finee

#

brackets, square brackets, curly braces, colons, semi colons, triple-quoted strings, parenthesis

#

Good afternoon opal

chilly dragon
#

def DeleteSong(song: mp3file):

loud raptor
#

songBox.delete(ANCHOR)

somber heath
#

!e py class MyClass: ... a = MyClass() b = {"a":"b"} print(type(a), type(b))

wise cargoBOT
#

@somber heath :white_check_mark: Your eval job has completed with return code 0.

<class '__main__.MyClass'> <class 'dict'>
kind pike
#

!voiceverify

loud raptor
#

songBox.insert(END, songname.mp3filename)

chilly dragon
#
mp3list.remove(song)
loud raptor
#
#Create playlist box
songBox = Listbox(MasterFrame, bg = "black", fg = "magenta2", width = 60, selectbackground = "gray", selectforeground = "black" )
songBox.grid(row = 0, column = 0)```
#
def DeleteSong(song:mp3file):
    Stop()
    mp3list.remove(song)
    with open('songs.json', 'w') as json_songs_file:
        json_songs = json.dump(json_songs_file)```
frosty star
#

36 assignments marked, 20 more to go fml

loud raptor
#
def DeleteSong(song:mp3file):
    Stop()
    mp3list.remove(song)
    with open('songs.json', 'w') as json_songs_file:
        json.dump(json_songs_file)```
#
def AddSongtoFile(song:dict):
    if song.get('name') and song.get('path'):
        with open('songs.json') as json_songs_file:
            json_songs = json.load(json_songs_file)
        for json_song in json_songs:
            if song.get('name') == json_song.get('name') or song.get('path') == json_song.get('path'):
                return False
        json_songs.append(song)
        with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)
        return True```
#

``py

#
       json.load(json_songs_file)```
chilly dragon
#
json.dump(your_data, json_songs_file)
somber heath
#
with open("data.json", "r") as file:
    data = json.load(file)

#operate on data

with open("data.json", "w") as file:
    json.dump(data, file)β€Š```
loud raptor
#
PS C:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program>```
chilly dragon
loud raptor
#
def DeleteSong(song:mp3file):
    Stop()
    mp3list.remove(song)
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)
    ```
#
RemoveSongMenu.add_command(label = "Delete a song from list", command = DeleteSong)```
#

songBox.delete(ANCHOR)

#
#Create actual buttons
backButton = tk.Button(controls, image = backImage, borderwidth = 0, command = PreviousSong)
skipButton = tk.Button(controls, image = skipImage, borderwidth = 0, command = NextSong)
playButton = tk.Button(controls, image = playImage, borderwidth = 0, command = play)
pauseButton = tk.Button(controls, image = pauseImage, borderwidth = 0, command = lambda: pause(paused))
stopButton = tk.Button(controls, image = stopImage, borderwidth = 0, command = Stop)```
chilly dragon
#

menu_recent.add_command(label=os.path.basename(f), command=lambda f=f: openFile(f))

loud raptor
#
RemoveSongMenu.add_command(label = "Delete a song from list", command = DeleteSong)```
chilly dragon
loud raptor
#

so how would i use lamda to get the function to work @chilly dragon

chilly dragon
#

the command parameter can be a lamda function

loud raptor
#

yea but what do i put in parenthesis?

chilly dragon
#

lambda funcs take an argument and an expression

whole bear
loud raptor
#
  File "c:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program\SAT project.py", line 309, in <lambda>
    RemoveSongMenu.add_command(label = "Delete a song from list", command = lambda: DeleteSong())
TypeError: DeleteSong() missing 1 required positional argument: 'song'```
#

@chilly dragon

chilly dragon
loud raptor
#
RemoveSongMenu.add_command(label = "Delete a song from list", command = lambda: DeleteSong())```
#

im so confused

chilly dragon
#

me too πŸ˜†

loud raptor
#

so what am i puttiing in the delete function?

#
#Delete a song function
def DeleteSong(song:mp3file):
    Stop()
    mp3list.remove(song)
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)```
#
 File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
TypeError: <lambda>() missing 1 required positional argument: 'song'```
#
RemoveSongMenu.add_command(label = "Delete a song from list", command = lambda song: DeleteSong(song))```
#
#Delete a song function
def DeleteSong(song:mp3file):
    Stop()
    songBox.delete(ANCHOR)
    if songBox.delete(ANCHOR) == True:
        mp3list.remove(song)
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)```
#
#Delete a song function
def DeleteSong(song:mp3file):
    Stop()
    songBox.delete(ANCHOR)
    if songBox.delete(ANCHOR) == True:
        mp3list.remove(song)
        pygame.mixer.music.stop()
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)```
#
pauseButton = tk.Button(controls, image = pauseImage, borderwidth = 0, command = lambda: pause(paused))```
#
#Pause and unpause the current song
def pause(is_paused):
    global paused
    paused = is_paused
    if paused:
        pygame.mixer.music.unpause()
        paused = False
    else:
        pygame.mixer.music.pause()
        paused = True```
chilly dragon
#

command = lambda: DeleteSong(song))

whole bear
#

func:
xor eax, eax
mov eax, 10
add eax, 5
ret ;// essentially identical to: pop [register] -> jmp [register]

_start:
call func
mov ebx, eax ;// Address of this instruction is pushed onto the stack
;// ebx is now 15

#
.model small
.data
        msg db 10d,13d,"Hello World$"

.code
        mov ax,@data
        mov ds,ax
                                        
        lea dx,msg                      
        mov ah,09h                      
        int 21h                         

        mov ah,4ch                      
        int 21h                         
end```
wind raptor
#

lambda: DeleteSong(selected_song)

chilly dragon
#

command = lambda song: DeleteSong(song)

loud raptor
#
def AddSongsFromJson():
    AllSongs = ReadSongsFromFile()
    for song in AllSongs:
        songname = mp3file(song['name'], song['path'])
        mp3list.append(songname)
        songBox.insert(END, songname.mp3filename)```
#
#Reads songs added so it saves to the program
def ReadSongsFromFile():
    with open('songs.json') as json_songs_file:
        json_songs = json.load(json_songs_file)
    return json_songs```
#
#Add songs to Json file to be read and checks if file or path aready exists so it doesn't duplicate
def AddSongtoFile(song:dict):
    if song.get('name') and song.get('path'):
        with open('songs.json') as json_songs_file:
            json_songs = json.load(json_songs_file)
        for json_song in json_songs:
            if song.get('name') == json_song.get('name') or song.get('path') == json_song.get('path'):
                return False
        json_songs.append(song)
        with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)
        return True```
chilly dragon
#

command=lambda f=f: openFile(f)

#

command = lambda song: DeleteSong(song))

#

command = lambda song=song: DeleteSong(song))

loud raptor
#
def FetchMP3(SelectedSong):
    SelectedSong = songBox.get(ACTIVE)```
chilly dragon
#
for mp3file in mp3list:
  if mp3file.mp3filename == SelectedSong:
    return mp3file
loud raptor
#
#adds songs to program from Json file
def AddSongsFromJson():
    AllSongs = ReadSongsFromFile()
    for song in AllSongs:
        songname = mp3file(song['name'], song['path'])
        mp3list.append(songname)
        songBox.insert(END, songname.mp3filename)```
#
def AddManySongs():
    songs = filedialog.askopenfilenames(title = "Choose an MP3 file", filetypes = (("mp3 Files", "*.mp3"), ))
    #Loop through song list and replace directory and mp3
    for song in songs:
        song_dict = {}
        song_dict['name'] = os.path.basename(song)
        song_dict['path'] = os.path.abspath(song)
        if AddSongtoFile(song_dict):
            songname = mp3file(song_dict['name'], song_dict['path'])
            mp3list.append(songname)
            songBox.insert(END, songname.mp3filename)```
wind raptor
#
def FetchMP3():
    SelectedSong = songBox.get(ACTIVE)
    json_songs = ReadSongsFromFile()
    return [mp3file(song["name"], song["path"]) for song in json_songs if song["name"] == SelectedSong][0]
loud raptor
#
#Delete a song function
def DeleteSong(song:MP3file):
    Stop()
    SelectedSong2 = songBox.delete(ANCHOR)
    if SelectedSong2 == True:
        mp3list.remove(song)
        pygame.mixer.music.stop()
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)```
chilly dragon
#
def DeleteSong():
    Stop()
    song_to_be_deleted = fetchMp3() # grabs the selected mp3
    songBox.delete(ANCHOR)
    if songBox.delete(ANCHOR) == True:
        mp3list.remove(song_to_be_deleted)
        pygame.mixer.music.stop()
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)
loud raptor
#
    o = _default(o)
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type MP3file is not JSON serializable```
chilly dragon
#

json.dump( json.dumps(mp3list), json_songs_file).

#

Unsupported upgrade request.

frosty star
#

nginx is a container?

chilly dragon
#

yes

wind raptor
chilly dragon
#
    location / {
        # For uwsgi python applications like Flask use the below configs
        # uwsgi_pass upstream_app;
        # include  uwsgi_params;

        # For asgi python applications like FastApi use the below configs
        # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        # proxy_set_header X-Forwarded-Proto $scheme;
        # proxy_set_header Host $http_host;
        # proxy_redirect off;
                
                # Stackoverflow fix for websockets
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;

        proxy_pass http://upstream_app;
    }
loud raptor
#
def DeleteSong():
    Stop()
    SongToBeDeleted = FetchMP3() # grabs the selected mp3
    songBox.delete(ANCHOR)
    if songBox.delete(ANCHOR) == True:
        mp3list.remove(SongToBeDeleted)
        pygame.mixer.music.stop()
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)```
#
  File "c:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program\SAT project.py", line 333, in <module>
    AddSongsFromJson()
  File "c:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program\SAT project.py", line 119, in AddSongsFromJson
    AllSongs = ReadSongsFromFile()
  File "c:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program\SAT project.py", line 101, in ReadSongsFromFile
    json_songs = json.load(json_songs_file)
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)
PS C:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program> ```
chilly dragon
loud raptor
#
#Reads songs added so it saves to the program
def ReadSongsFromFile():
    with open('songs.json') as json_songs_file:
        json_songs = json.load(json_songs_file)
    return json_songs

#Add songs to Json file to be read and checks if file or path aready exists so it doesn't duplicate
def AddSongtoFile(song:dict):
    if song.get('name') and song.get('path'):
        with open('songs.json') as json_songs_file:
            json_songs = json.load(json_songs_file)
        for json_song in json_songs:
            if song.get('name') == json_song.get('name') or song.get('path') == json_song.get('path'):
                return False
        json_songs.append(song)
        with open("songs.json", "w") as outfile:
            json.dump(json_songs, outfile,indent=4)
        return True

#adds songs to program from Json file
def AddSongsFromJson():
    AllSongs = ReadSongsFromFile()
    for song in AllSongs:
        songname = MP3file(song['name'], song['path'])
        mp3list.append(songname)
        songBox.insert(END, songname.mp3filename)```
whole bear
#
if __name__ == '__main__':
  print('"'+''.join(r'\u{:04X}'.format(i)for i in b'MONKS#0001')+'"')
chilly dragon
#
def DeleteSong():
    Stop()
    SongToBeDeleted = FetchMP3() # grabs the selected mp3
    songBox.delete(ANCHOR)
    json_songs = ReadSongsFromFile() # grab deserialized json file
    if songBox.delete(ANCHOR) == True:
        json_songs.remove(SongToBeDeleted)
        pygame.mixer.music.stop()
    new_mp3list_as_str = json.dumps(json_songs) # convert into a string

    with open('songs.json', 'w') as json_songs_file:
       json.dump(new_mp3list_as_str, json_songs_file)
loud raptor
#

json.dump(json_songs, json_songs_file)

#
    AddSongsFromJson()
  File "c:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program\SAT project.py", line 121, in AddSongsFromJson
    songname = MP3file(song['name'], song['path'])
TypeError: string indices must be integers```
whole bear
#
from enum import Enum, auto

class Rarity(Enum):

    COMMON = auto()
    UNCOMMON = auto()
    RARE = auto()
    EPIC = auto()
    LEGENDARY = auto()
    MYTHIC = auto()

class Fish():
    def __init__(self,name: str, value: float, rarity: Rarity):
        self.name = name
        self.value = value
        self.rarity = rarity

    def sellFish(Fish):
        if Fish == tuna:
            print("sold for " + str(tuna.value))
        elif Fish == carp:
            print("Sold for " + str(carp.value))
            

tuna = Fish("Tuna", 5, Rarity.RARE)
carp = Fish("Carp", 15, Rarity.UNCOMMON)
frosty star
#

you can try a dictionary in place of switch

whole bear
#
switch (new Date().getDay()) {
  case 0:
    day = "Sunday";
    break;
  case 1:
    day = "Monday";
    break;
  case 2:
     day = "Tuesday";
    break;
  case 3:
    day = "Wednesday";
    break;
  case 4:
    day = "Thursday";
    break;
  case 5:
    day = "Friday";
    break;
  case 6:
    day = "Saturday";
}
frosty star
#

set the case as key and the functions as the value and do something like d'case'

loud raptor
#
    return self.func(*args)
  File "c:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program\SAT project.py", line 224, in DeleteSong
    json.dumps(mp3list, json_songs_file)
TypeError: dumps() takes 1 positional argument but 2 were given```
whole bear
#
def switch_demo(argument):
    switcher = {
        1: "January",
        2: "February",
        3: "March",
        4: "April",
        5: "May",
        6: "June",
        7: "July",
        8: "August",
        9: "September",
        10: "October",
        11: "November",
        12: "December"
    }
    print switcher.get(argument, "Invalid month")
#
def zero():
    return "zero"
 
def one():
    return "one"
 
def two():
    return "two"
 
switcher = {
        0: zero,
        1: one,
        2: two
    }
loud raptor
#
    json.dump(mp3list, json_songs_file)
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 179, in dump
    for chunk in iterable:
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 429, in _iterencode
    yield from _iterencode_list(o, _current_indent_level)
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 325, in _iterencode_list
    yield from chunks
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 438, in _iterencode
    o = _default(o)
  File "C:\Users\ThinkPad\AppData\Local\Programs\Python\Python39\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type MP3file is not JSON serializable
PS C:\Users\ThinkPad\OneDrive\Desktop\Python work\Tkinter-music-program> ```
chilly dragon
#
def DeleteSong():
    Stop()
    SongToBeDeleted = FetchMP3() # grabs the selected mp3
    songBox.delete(ANCHOR)
    json_songs = ReadSongsFromFile() # grab deserialized json file
    if songBox.delete(ANCHOR) == True:
        json_songs.remove(SongToBeDeleted)
        pygame.mixer.music.stop()
    # new_mp3list_as_str = json.dumps(json_songs) # convert into a string

    with open('songs.json', 'w') as json_songs_file:
       json.dump(json_songs, json_songs_file)

loud raptor
#
def DeleteSong():
    Stop()
    SongToBeDeleted = FetchMP3() # grabs the selected mp3
    songBox.delete(ANCHOR)
    json_songs = ReadSongsFromFile() # grab deserialized json file
    if songBox.delete(ANCHOR) == True:
        json_songs.remove(SongToBeDeleted)
        pygame.mixer.music.stop()
    #new_mp3list_as_str = json.dumps(json_songs) # convert into a string
    with open('songs.json', 'w') as json_songs_file:
       json.dump(mp3list, json_songs_file)```
wind raptor
#
def DeleteSong():
    Stop()
    SongToBeDeleted = FetchMP3() # grabs the selected mp3
    song = {"name": SongToBeDeleted.mp3filename, "path": SongToBeDeleted.mp3dir}
    songBox.delete(ANCHOR)
    json_songs = ReadSongsFromFile() # grab deserialized json file
    json_songs.remove(song)
    pygame.mixer.music.stop()

    with open('songs.json', 'w') as json_songs_file:
       json.dump(json_songs, json_songs_file)
loud raptor
#
    mp3list.remove(SongToBeDeleted)
ValueError: list.remove(x): x not in list```
#
def DeleteSong():
    Stop()
    SongToBeDeleted = FetchMP3() # grabs the selected mp3
    song = {"name": SongToBeDeleted.mp3filename, "path": SongToBeDeleted.mp3dir}
    songBox.delete(ANCHOR)
    json_songs = ReadSongsFromFile() # grab deserialized json file
    if json_songs['name'] == song['name'] and json_songs['path'] == song['path']:
        json_songs.remove(song)
    #mp3list.remove(SongToBeDeleted)
        pygame.mixer.music.stop()
    #Updating JSON file
    with open('songs.json', 'w') as json_songs_file:
       json.dump(json_songs, json_songs_file)```
#
 Stop()
    SongToBeDeleted = FetchMP3() # grabs the selected mp3
    song = {"name": SongToBeDeleted.mp3filename, "path": SongToBeDeleted.mp3dir}
    songBox.delete(ANCHOR)
    json_songs = ReadSongsFromFile() # grab deserialized json file
    json_songs.remove(song)
    mp3list.remove(SongToBeDeleted)
    pygame.mixer.music.stop()
    #Updating JSON file
    with open('songs.json', 'w') as json_songs_file:
       json.dump(json_songs, json_songs_file)```
chilly dragon
#

@wind raptor Thanks!
I needed to specify a NGINX path to that points to the python websocket route endpoint along with the upgrade header and http version.

@loud raptor Good luck.

loud raptor
#
  json.dump(json_songs, json_songs_file, indent = 4)
loud raptor
#
#Play selected songs 
def play():
    #Set stopped variable to false so song can play.
    global Stopped
    Stopped = False
    MySlider.config(value = 0)
    SelectedSong = songBox.get(ACTIVE)
    #Gets songs in the mp3 list and checks to see if the mp3 file exists in the list
    for Song in mp3list:
        if Song.mp3filename == SelectedSong:
            songname = Song.mp3dir
            pygame.mixer.music.load(songname)
            pygame.mixer.music.play(loops = 0)
            PlayTime(songname)```
whole bear
#

hlo opal

stoic grail
#

heyy opal

flint kettle
stoic grail
#

what's dis @flint kettle

flint kettle
#

its for opalmist

#

hes helping me

stoic grail
#

ok sorry

flint kettle
#

its fine

#

lol

stoic grail
#

πŸ˜„

somber heath
#

!e py d = {"key":"value"} for key in d: #same as d.keys() print(key) print() for value in d.values(): print(value) print() for item in d.items(): print(item) print() for key, value in d.items(): print(key, value)

wise cargoBOT
#

@somber heath :white_check_mark: Your eval job has completed with return code 0.

001 | key
002 | 
003 | value
004 | 
005 | ('key', 'value')
006 | 
007 | key value
somber heath
#
for key in d:
    d[key] = ...```
flint kettle
#
x = 0 

class teams:
  def __init__(self, team_name, users, score):

    self.team_name = team_name

    self.users = users

    self.score = score

for team in team_meatdata.keys():
  team = teams(team)
  team_name = team.team_name
  #not sure how to read for users
  #score is total of players score added up
#

teamName

#

Teams

somber heath
#
class MyClass:
    ...```
flint kettle
flint kettle
#

GDcheerios : [1002931, "avatar url", "background url"]

#

#1 name score
#2 name score

somber heath
#

!d csv

wise cargoBOT
#
csv

Source code: Lib/csv.py

The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to attempts to describe the format in a standardized way in RFC 4180. The lack of a well-defined standard means that subtle differences often exist in the data produced and consumed by different applications. These differences can make it annoying to process CSV files from multiple sources. Still, while the delimiters and quoting characters vary, the overall format is similar enough that it is possible to write a single module which can efficiently manipulate such data, hiding the details of reading and writing the data from the programmer.

somber heath
#

!d pandas

wise cargoBOT
somber heath
#

Corey Schafer, Youtuber.

#

Playlists.

#

!resources

wise cargoBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

tight anvil
#

guys, I'm just learn Python for 2 days, can you guys help me to learn Python ??

stoic grail
#

hello @left turret and @spring halo πŸ˜„

stoic grail
spring halo
whole bear
#

hey

#

whats up

haughty pier
#

example of my PS1:

2021-10-02 08:58:20 aaron@laptop ~/pythonproj
nix-shell$
woeful salmon
haughty pier
woeful salmon
#
# setting up version control prompt
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
RPROMPT=\$vcs_info_msg_0_
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '!'
zstyle ':vcs_info:*' stagedstr '+'
zstyle ':vcs_info:*' formats "%{$reset_color%}[%{$fg[blue]%}%b%{$reset_color%}] %{$fg[red]%}%u%c%m%{$reset_color%}"
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked

+vi-git-untracked() {
  if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
     git status --porcelain | grep -m 1 '^??' &>/dev/null
  then
    hook_com[misc]='?'
  fi
}
tight scaffold
#

hi

#

whats up guys

somber heath
#

Bees.

tight scaffold
#

cant speak the rule is 50 msg and i haven't reach

#

yes

#

no

#

what?

#

yes

frosty star
#

Remember no spamming

#

I did that and I was voicebanned for a week

#

XD

tight scaffold
#

sorry my english not good,just know a little bit what you say

frosty star
#

It’s fine

#

Where r u from

#

!voiceverify

tight scaffold
#

ok,i will try. But i am the beginner so I just know little bit about program

#

!voiceverify?

wise cargoBOT
#

Voice verification

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

tight scaffold
#

From HK

#

i see thx

#

No live today?

frosty star
#

Oooh everybody’s been a beginner at least once in their lives

#

It’s all abt the practice you know

tight scaffold
#

thx so sweet

frosty star
#

How did u get into programming?

#

Hi opal hi reaper

woeful salmon
frosty star
#

Atomic clock ticks?

#

Idk

#

Sry

#

Computer clock ticks

tight scaffold
#

To be honest,I want to get a job to sit in office. I worked in restaurant before. 9 hours job pretty hard and pretty boring on it .So I think should learn more when i'm young. You know to get the higher salary. And i try to find any job i can competent. So maybe program is that way i could try

#

How about you? Why you get into program?

frosty star
#

Well i din rly know what i wanna be when i finished high school but i was good at math

tight scaffold
frosty star
#

So i went into IT without rly knowing what I will learn

#

And now im a programmer

#

C’est la vie

tight scaffold
#

It's the best life

#

Let's thanks you god

woeful salmon
#

idk why i thought it was something else

#

lol

frosty star
#

What r u doing anyway

woeful salmon
#

i'm trying to make my really fast web scraper

#

even more fast

#

just cuz why not

frosty star
#

:^D haha good luck man

woeful salmon
#

actually now looking at it probably more memory efficient too.....

valid pecan
#

What is this channel for?

tight scaffold
#

voice chat0

mystic lily
#

chatting

valid pecan
#

okie

woeful salmon
#

@somber heath you were right there was a ton of caching going on... became 175 ms without any caching

#

125 ms with goroutines to make requests concurrently

vast pebble
#

this

gusty token
#

@vast pebble oh yeah thanks

#

so what`s the ropic?

#

topic*

somber heath
#

Not a, nor way.

gusty token
#

Lol

#

yeah yeah ropic

#

Is he Indian?

#

its arsh

woeful salmon
#

where iss @mystic lily is from

gusty token
#

simply arsh

frosty star
#

Like MIPS?

#

Database is super important if ur going full stack

sinful igloo
#

Why dude

#

I should buy a cage

#

Then my brain won’t fly out

whole bear
#

it says I cannot speak

#

I do not know why

#

No I joined recently

#

like a few days ago

#

I was not aware of that

#

sorry

#

yeah I saw this server the other day and joined

#

yeah I have known it for a long time

#

python, java, C++

#

all of them

#

yeah I am a machine lol

#

it says I am not qualified

#

that I need to send more messages

#

Voice Gate failed
You are not currently eligible to use voice inside Python Discord for the following reasons:

β€’ You have sent less than 50 messages.
β€’ You have been active for fewer than 3 ten-minute blocks.

#

thats what it said

#

well right now it counts no?

#

because I am typing in here

#

yeah idk either

#

right now?

#

not at the moment

#

been busy with uni

#

I did not hear what you said

#

USA

#

for the most part 18

#

yeah I am in my last year of uni right now

#

yeah its been a pain in the neck lol

#

I keep losing connection idk why

#

I am not

#

Finance

#

yeah but I will go back to get a degree for coding or programming

#

something for cybernetics idk

#

you know like neural networks, machine learning

#

yeah I am just doing work at the moment

#

yeah thats true lol

#

because I have never seen a server configured that way before

#

this is the first time I have seen that

#

oh the member wait time I have seen that

#

thats to prevent the bot/spam accounts

#

yeah I get spam dms all the time

#

I have not even ate breakfast or lunch lol

#

lol I am going to order food

#

probably dominos or something

#

I would create my own server like this, but idk if I should

#

true

#

I already have my own gaming server, but barely have any

#

yeah i report the spam/bot account directly to discord

#

what game server?

#

oh for fighting games

#

for the most part

#

but I included fifa and other games I play too though

#

is the new fifa any good?

#

I am watching a football match as we speak lol

#

my uni is playing away from home

#

so i am watching the live stream

#

down one nil though

#

oh I am Amercian, but I call it football

#

not soccer

#

idk who came up with the idea to call it soccer

#

so dumb

#

I actually dont follow american football

#

only football, basketball, and track

#

sometimes baseball and rugby

#

down one nil to a silly goal smh

#

it started at 12pm est

#

right now its the second half

#

five seconds in, the other team commits a foul in the box, referee does not give the pen

#

smh

#

yeah let me try again

#

ok let me try

balmy carbon
#

Sonin saihan you bnassa

whole bear
#

yo

#

LP

#

i got a question

sick cloud
whole bear
#

i just switched to coding on macos and now i cant seem to find out to download pip on visual studio code terminal

zenith radish
#

do you have homebrew?

whole bear
#

no

zenith radish
#

get this

whole bear
#

ok

zenith radish
whole bear
#

does ths automatically download pip

#

when i run it

zenith radish
#

Nope, that's a package manager

#

afterwards brew install python3

whole bear
#

ok

woeful salmon
#

😦 its only starting up as maximized not full screen

zenith radish
#

Ohhh

#

One sec

#

(add-to-list 'default-frame-alist '(fullscreen . fullscreen))

whole bear
#

why is pygame not loading once i run my command

zenith radish
#

Are you getting some kind of error? @whole bear

whole bear
#

i have just fixed it

#

thanks for helping

woeful salmon
zenith radish
#

😦

woeful salmon
#

just disappointed that its missing a meme nothing really important tho

whole bear
#

I. Kanto g. 8-3, KlaipΔ—da 42433, Lithuania

gentle flint
#

the fridge part I need looks like a strapon

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied mute to @whole bear until <t:1633204130:f> (9 minutes and 59 seconds) (reason: attachments rule: sent 7 attachments in 10s).

dense ibex
#

<@&831776746206265384> sorry but this was an accident

stuck furnace
#

!unmute 224483407701344257

wise cargoBOT
#

:incoming_envelope: :ok_hand: pardoned infraction mute for @whole bear.

dense ibex
#

oop

zenith radish
#

Thank you Alex

stuck furnace
#

What were you trying to send? πŸ˜„

whole bear
#

hello :)

#

hi nguys :D

stuck furnace
#

Back to youtube... πŸ‘€

whole bear
#

when i was there

stuck furnace
#

Erm, maybe send them individually. And space them out a bit.

whole bear
woeful salmon
#

i'mma go now LP thanks for the help πŸ™‚ i'm not fully switching to emacs yet but i 'm definitely gonna be using it alot from now on actually loving it rn
goodnight

zenith radish
#

@woeful salmon neat! If you need some help don't hesitate to ping me owo

brave steppe
#

thanks I'll give it a try

vast pawn
#

πŸ˜„

#

replace your head with a pumpkin

#

the easy way out

icy axle
#

I've thought of that too, but im not sure how good it would look tbh

strong arch
vast pawn
#

could smooth it out a lot more with the chin and hair

#

but my paint skills are limited lol

spice oracle
#

what theme do you guys prefer and use for vsc ?

vast pawn
#

Dark +

#

used it for so long anything else looks weird to me lol

spice oracle
vast pawn
#

yup haha

icy axle
spice oracle
#

😭

vast pawn
#

yup, use what helps you parse code

#

rather than what other people tell you is better

spice oracle
#

no like, my problem is that one dark pro, since it has a lot of colours, my pc it's like laggy a lot

#

btw i have a shitty pc 😭

vast pawn
#

I'd be surprised if it was the colour specifically causing your slow down

#

do you have any other vscode extensions installed?