#voice-chat-text-0

1 messages · Page 799 of 1

honest pier
#

lists are nice

cedar sage
sacred lichen
#

You can do this today itself the basic part till dictionaries is enough

cedar sage
#

I made a chrome automation program i look it up at utube but i really understand it.

sacred lichen
#

Then start learning c

rugged root
#

Yep yep

#

Long long time ago

#

Sorry, co-worker is talking

whole bear
#

first message: #bot-commands message

cedar sage
#

How much time did it take for y'all to learn python

rugged root
#

I'd argue I'm still learning it

#

But it took me a year or two to get really confident in it

whole bear
#

i only know batch

dense ibex
#

Yeah but I don't think anyone really knows everything about it there is always new things to learn

#

its more of like expanding your knowledge of it

cedar sage
#

I more like drop the motivation to learn after few program.

dense ibex
#

lol legit me when I first started

#

I've only been doing python for about 2-3 months

#

oops not pythong

cedar sage
rugged root
#

Can't. Stop. Yawning

honest pier
#

just stop

cedar sage
#

Currently I'm learning how to create list xd.

rugged root
#

Chicken fries. Childhood. So very sad

severe lotus
#

veggie burger

boreal spear
#

Angus burger from BK definetly!

rugged root
#

God damn it, you guys are not making it easy to stick with my joke pledge

severe lotus
faint ermine
severe lotus
#

std::fridge

dense ibex
#

Im back

stuck furnace
#

Ahem...

#

Arch

#

JK

#

Are you made of money?

dense ibex
stuck furnace
#

"Hard drives full... buy another computer."

severe pulsar
#

Any of you who has written a documentation website before, what framework/tool do you use?

#

docusaurus is working pretty great for me

#

ui is really nice 👌

dense ibex
rugged root
#

Normally I'd agree, but we have 77 roles

stuck furnace
#

For the guy asking about lists. C lists look like this:

honest pier
#

isn't that an array

stuck furnace
#

Python lists look like this:

honest pier
#

l m f a o

#

i n d i r e c t i o n

hollow haven
#

I like the one off on the left just going wheeeeeeeeeeeeeeeeeeeeeeeeeee off screen

honest pier
#

i think that's the reference to the list

stuck furnace
whole bear
#

all speaky english?

rugged root
#

Yep, it's an English server

tough panther
#

in a nutshell

whole bear
#

Add in server

severe pulsar
#

fisher is super nice

tough panther
#

excuse me?

rugged root
#

Yeah not really down with that being in the server

#

Nazi and Hitler references aren't really something that mesh with us here

honest pier
snow trout
#

hi all

severe pulsar
#

hi!

rugged root
#

Deafened for a moment while I go grab some checks from the printer

severe pulsar
honest pier
severe pulsar
#

thanks

hollow haven
stuck furnace
honest pier
#

rewriting history like there's no yesterday

severe pulsar
#

man teaches like nobody else

#

see you might know mad css but can you do README ui development? 👀

restive geyser
#

...yes.

hollow haven
#

css is legit the most complicated programming I have ever done and probably will ever do

honest pier
#

yeah i have a phd in css

#

centering buttons

severe pulsar
#

¯_(ツ)_/¯

frank topaz
#

helloo guys

honest pier
#

kutie :3

restive geyser
#

lol

severe pulsar
#

i like how he was upfront and straight about it

#

lol

hollow haven
restive geyser
#

<.< ban

#

lol

honest pier
#

D:

#

🥺

restive geyser
#

oooo you're pushin' your luck, buddeh

honest pier
restive geyser
#

xD

#

LMAO i was about to say that!

sick dew
restive geyser
#

<.< throw out the whole professor

severe pulsar
#

damn firebase pricing is generous

#

@ Mr. Hemlock what soda?

restive geyser
#

WHAT

#

do you also microwave thick cut bacon? o.O

severe pulsar
#

hemlock be giving away free food trump cards

honest pier
severe pulsar
#

wow! 👀 😱 😲 🤯

rugged root
#

Just let me eat in peace

restive geyser
#

-le gasp-

honest pier
#

eat in hell maybe

restive geyser
#

LMAO

severe pulsar
#

i really dislike how discord pings people in replies when you edit the reply message

#

like i want to be able to reply to what somebody says and edit it without PINGING THEM PLEASE(what if they're someone important like a mod lmao)

#

discord please

#

hi rabbit!

#

wait whats the context for that devops/software design issue conversation @ Rabbit ?

restive geyser
#

wait which ginger ale?

#

oooo

restive geyser
#

it's the monster that's slurring your speech. loljk

#

xD

frigid panther
#

@honest pier have you watched dating class?

honest pier
#

hm?

#

a kdrama?

frigid panther
#

the one where chuu is in

#

yes

honest pier
#

yeah

frigid panther
#

wanna re watch it with me

honest pier
#

not particularly lol

frigid panther
#

lol okay

#

I am watching it now

honest pier
#

it is good

frigid panther
#

cool cool, I think I will do all 16 today

honest pier
#

i-

restive geyser
#

that's why i'm on mute. lol <.<

iron fable
#

@dense ibex I joined the stream a little bit ago whatchu doing with the API?

#

do you have something working?

#

visual studio code is my fav

dense ibex
#

I use pycharm

iron fable
#

@whole bear I like visual studio code. It's nice

#

Give it some time, someone will respond.

vivid palm
#

_>

iron fable
#

@dense ibex API Data Update Time

#

@dense ibex well if it's not on the API info page the average moderator probably won't know what the answer is.

#

Just go check that page again and see if the info is there

#

@dense ibex link me that site?

#

Yeah "How often does the API update its data?"

#

@whole bear it just takes time, write down ones you want to remember so you don't have to look them up everytime.

strange plank
#
gentle flint
dense ibex
gentle flint
vivid palm
#

hi hi

#

LOL

#

well

#

the owner

#

sooooooooooooooooooooooooooo

#

yeah i just found out

#

i mean he's not needed for day to day functions

#

he's still the owner he's just not in the office

#

yeah

#

i just saw his daughter

#

twas awkward

#

yeah my age

#

i didn't know this was a feature

#

the green circles work and everything

#

right click where it says voice chat 0 / python

#

checkbox 'show voice users'

coral crater
#

I NEED

#

to verify

#

my voice

#

🥲

#

I know, its kinda ausbabwgbawbg

vivid palm
#

take your time. voice verification takes a mimum of 3 days anyway. don't spam and you'll be good

strong arch
#
class Entry:
  def __init__(self, obj):
    self.time = time.time()
    self.obj = obj

class API:
  def __init__(self):
    self.cache = {}
  def request(self, url):
    if url in self.cache and time.time() < self.cache[url].time + 15*u.min:
      return self.cache[url].obj
    req = request(url)
    self.cache[url] = Entry(req)
    return req
#

collections.namedtuple

mighty torrent
#

Grafana

warped saffron
#

How much heat does it usually take to damage an average GPU?

#

@amber raptor How much practice did it take to code so fast?

#

Damn tho

noble copper
#

@amber raptor

#
FROM python:3.8

RUN mkdir /wct-api
COPY . /wct-api
COPY pyproject.toml /wct-api
WORKDIR /wct-api
ENV PYTHONPATH=${PYTHONPATH}:${PWD}
RUN pip3 install poetry
RUN poetry config virtualenvs.create false
RUN poetry install --no-dev
CMD ["python manage.py start-server"]
amber raptor
#

WORKDIR /app

#
FROM python:3.7-slim-buster
WORKDIR /app
COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt

COPY Modules/ Modules/
COPY parameters/parameters.json parameters/
COPY discord_listener.py .


CMD ["python3", "./discord_listener.py"]```
whole bear
#

:dd

#

waitpls

#

aight i am back

#

so what are you working on?

#

y

#

yes

#

what happend?

#

eya

#

yea

stuck furnace
#

Hello! 😄

#

I'm a helper MEGA 😄

#

I just don't talk on mic.

#

!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.pydis.com/

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

solar heron
stuck furnace
#

brb

solar heron
plain mica
#
x = "hello"
y = "world"
print(f'{x}{Y}')
plain mica
#

///\\

solar heron
#

"///"

plain mica
#

/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\

#
________________________________
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
_________________________________
whole bear
#

yet using computer

whole bear
#

coding

#

lol

#

I’m in notepad

#

overspinned number

#

55 = u7u7
10 = —>o

low grotto
#

Hello World

wise glade
#

I didn't had this on, 🤔 , now it might be better

low grotto
#

@slate pier what're ya playin'?

slate pier
slate pier
honest pier
#

🤔

whole bear
#

hello can you guys help me how to equal the force between 2 objects on unity

honest pier
#

can you give a bit more detail

#

😔

plain dagger
#

mass_x * acceleration _x = mass_y * acceleration_y (?)

#

or you can use Legendre polinomials if you try to replicate quantum physics lemon_fingerguns_shades https://en.wikipedia.org/wiki/Legendre_polynomials

In physical science and mathematics, Legendre polynomials (named after Adrien-Marie Legendre, who discovered them in 1782) are a system of complete and orthogonal polynomials, with a vast number of mathematical properties, and numerous applications. They can be defined in many ways, and the various definitions highlight different aspects as well...

vivid palm
#

@muted phoenix hi?

muted phoenix
#

hey

vivid palm
#

sry not accepting friend requests

restive geyser
#

hi 😮

stuck furnace
#

Ohh, I made a desmos graph for this 😄

#

Pretty cool, right? 😄

vivid palm
#

complicated T^ T

#

i wish there were 1 for US lol

stuck furnace
#

I mad it because I had to explain marginal tax rates to someone.

#

Not sure if the numbers are still accurate.

#

Same, I can't imagine vacationing in London.

#

Does anyone watch Bon Appetite's YouTube channel?

#

Their offices/kitchen are in one world trade center.

#

It's more Goodyear level...

vivid palm
#

lmao

stuck furnace
#

It was meant to be like a travel-guide for foodies.

#

1 star : "A very good restaurant in its category" (Une très bonne table dans sa catégorie)
2 stars : "Excellent cooking, worth a detour" (Table excellente, mérite un détour)
3 stars : "Exceptional cuisine, worth a special journey" (Une des meilleures tables, vaut le voyage)

vivid palm
wise glade
crystal fox
#

yeah @vivid palm i fucking ruined it somehow.

crystal fox
#

i am sorry, @vivid palm.

gentle flint
vivid palm
severe pulsar
#

bye laundmo!

swift valley
#

elo

mint moat
#

!voiceverify

gentle flint
analog plaza
#

if anybody could come help me out with a django question in Code Help 0 that would be legendary

swift valley
#

That reminds me

gentle flint
swift valley
#

Ergh, the server for the gacha I'm playing is chugging

#

Can't even login lemon_pensive

azure oasis
# swift valley

it's now 12:50am here in my country.. happy april fool's day!

vivid palm
#

oooooooooooooh 4/1

swift valley
#

int e-it up

azure oasis
#

meow

swift valley
#

!ban 292824612113219584 Racism is absolutely not tolerated here.

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied ban to @stuck walrus permanently.

timber vale
swift valley
#

That setup's so scuffed

#

wth

crystal fox
timber vale
#

logging off for now - take care all

azure oasis
#

lol

analog plaza
#

if anyone has any experience with Django and wants to come help me out jump into Code/Help0

lament blaze
#

sound like fun, but srry

#

if is not

normal hinge
#

Any ideas for major project?

#

Please suggest me

#

Some ideas

lament blaze
#

Thunder Bird like

#

brrr

#

lmao

#

Mozzila its like yeah sure and the VPN its cool too

severe pulsar
#

does anybody know what color theme this is

#

YO INDRA

#

whats up?

#

how are you?

#

havent seen you in a while

rugged root
#

!projects

wise cargoBOT
#

Kindling Projects

The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

amber raptor
#

!kindling

wise cargoBOT
#

Kindling Projects

The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

lament blaze
#

Just chill

#

uwu

#

I like the slight British accent

#

Awww

crystal fox
#

love you @rugged root

#

:D

#

time to make a sandwich.

lament blaze
#

Well, Yeah Microsoft its pretty cool sure

rugged root
#

Please don't make my life difficult

crystal fox
#

sorry for that bud, didn't realise it'd be that big a thing.

lament blaze
#

Rust its yeah

swift valley
#

Low-level + the type system is a proper combo

lament blaze
#

LIke the cobol fortan thing

normal hinge
rugged root
swift valley
#

Although to be fair, once you start thinking in terms of types, the intuition just starts to flow

honest pier
#

yeah on your way to haskell land

#

mutable state who

mighty torrent
lament blaze
#

""""expensive""""

worldly falcon
rugged root
#

Very very expensive to change

#

And only gets more so with each passing year

worldly falcon
#

rabbit is a FastAPI cheerleader

#

I didn't say that

#

it wasn't

#

I'm looking into using it now instead of flask...

#

It looks like flask

lament blaze
#

I like Phy for AI dev, but it's so danse

worldly falcon
#

I'm just going to use it for posts from Jira webhook to shove Json in my kafka quorum

lament blaze
#

jeje

worldly falcon
#

compiled python is nice when you make your own tools for like pen testing

#

you can compile it

lament blaze
#

Oh, i heard this before, like a deja vu

worldly falcon
#

I'll send you some compiled malware I made if you want

honest pier
#

!d dis

worldly falcon
#

if you stuff gets encrypted don't blame me

wise cargoBOT
#

Source code: Lib/dis.py

The dis module supports the analysis of CPython bytecode by disassembling it. The CPython bytecode which this module takes as an input is defined in the file Include/opcode.h and used by the compiler and the interpreter.

CPython implementation detail: Bytecode is an implementation detail of the CPython interpreter. No guarantees are made that bytecode will not be added, removed, or changed between versions of Python. Use of this module should not be considered to work across Python VMs or Python releases.

Changed in version 3.6: Use 2 bytes for each instruction. Previously the number of bytes varied by instruction.

Example: Given the function myfunc():

def myfunc(alist):
    return len(alist)
```  the following command can be used to display the disassembly of `myfunc()`:... [read more](https://docs.python.org/3/library/dis.html#module-dis)
swift valley
honest pier
#

!e

import dis
def func():
  x = 10
  x *= 3
  return x
dis.dis(func)
wise cargoBOT
#

@honest pier :white_check_mark: Your eval job has completed with return code 0.

001 |   3           0 LOAD_CONST               1 (10)
002 |               2 STORE_FAST               0 (x)
003 | 
004 |   4           4 LOAD_FAST                0 (x)
005 |               6 LOAD_CONST               2 (3)
006 |               8 INPLACE_MULTIPLY
007 |              10 STORE_FAST               0 (x)
008 | 
009 |   5          12 LOAD_FAST                0 (x)
010 |              14 RETURN_VALUE
lament blaze
honest pier
#

@amber raptor ^

inner lava
#

pls russian

lament blaze
#

and the TypeScript

amber raptor
#

Yea, but CPython at it's core is interperted

worldly falcon
#

it's a standardized format

inner lava
#

pls russian speak

honest pier
swift valley
#

TypeScript's type system is eh

honest pier
#

you probably think non-functional pl type systems are eh 😔

amber raptor
#

!e python import dis import time def func(): x = 10 x *= 3 return x print(time.time()) dis.dis(func) print(time.time())

wise cargoBOT
#

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

001 | 1617211834.6527872
002 |   4           0 LOAD_CONST               1 (10)
003 |               2 STORE_FAST               0 (x)
004 | 
005 |   5           4 LOAD_FAST                0 (x)
006 |               6 LOAD_CONST               2 (3)
007 |               8 INPLACE_MULTIPLY
008 |              10 STORE_FAST               0 (x)
009 | 
010 |   6          12 LOAD_FAST                0 (x)
011 |              14 RETURN_VALUE
... (truncated - too many lines)

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

lament blaze
honest pier
#

the compiler can't really optimize because of the dynamicism

amber raptor
worldly falcon
#

It would be best to compile a language to work for a specific instruction set if there's a need.

swift valley
#

For sure, although I mostly don't find it all that interesting because it isn't really as novel

amber raptor
worldly falcon
#

You could make a compiler to do that for python if you wanted to compile for a specific architecture...maybe for something like cyrptocurrency calculations etc when shaving off speed is of utmost importance

severe pulsar
#

i feel like FastAPI itself is a great, fast python web framework library, but i feel that since python doesnt have great async support in terms of libraries and third party code, I would still go with node. Example: sendgrid's python email api is synchronous

lament blaze
#

just pulse talk pls

worldly falcon
#

one of the greatest books I've found on compilers

amber raptor
#

and Sendgrid probably figures if wait time of requests is issue, your problem is bigger then async/sync

lament blaze
#

Yeah, well Microsoft its gonna put money... LIke... I see the msn :^)

mighty torrent
#

noisetorch

severe pulsar
lament blaze
#

NIce

swift valley
lament blaze
#

just a git clone

severe pulsar
#

like i know for a fact async is really good in some cases like frontend programming

amber raptor
# severe pulsar can you highlight some?

too many async requests can be problematic as system is constantly running around checking, and if you want to wait for async code to finish, you have to write additional code where you are like just wait

severe pulsar
#

but i dont know about much of the cons

#

thanks

lament blaze
#

MInt

#

oh

#

mmm

amber raptor
#

if you are sending a ton of emails, you probably have messaging system for that, we do

severe pulsar
#

and your code will actually run in that order when you call the asynchronous function

worldly falcon
#

If you're not using Docker now, you're wrong lol

lament blaze
#

yeah jhon cage

severe pulsar
lament blaze
#

Wish Harder

#

aww

amber raptor
#

because again, async comes with requirement of planning around that

#

like database calls, most programs are fine stopping execution while it waits for DB to get data

swift valley
honest pier
#

the point is gradual typing though

#

are you just against that in general

rugged root
lament blaze
#

lol

severe pulsar
#

does that also put you off?

lament blaze
#

ada

#

wow

honest pier
#

i've never had to use unsafe

lament blaze
#

I love it and i Hate

worldly falcon
#

funny tip of the day, you cannot name any file in windows PRN without an extension....

lament blaze
#

Well, Mephistopheles its whispering in my ear

worldly falcon
#

My stocks scraping stuff choked when it tried to create the folder lol

amber raptor
#

Sure, Windows has really old backwards compatibility layer stuff littered in it

worldly falcon
#

Yeah, it's a reserved word...funny stuff

severe pulsar
lament blaze
#

Just have more confidence, the pollish mind set

swift valley
honest pier
#

thanks git

lament blaze
#

yeah, how are u @rugged root , here like the pillar of this moment in this conversation?

rugged root
#

!voice @edgy thunder

wise cargoBOT
#

Voice verification

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

severe pulsar
#

in terms of handling requests and stuff

lament blaze
#

Yeah, teleports behind u

lament blaze
#

srry

rugged root
#

Just eh

#

No worries

#

Just no strong feelings one way or the other

lament blaze
#

I don't

wise cargoBOT
#

:x: According to my records, this user already has a mute infraction. See infraction #30818.

swift valley
# severe pulsar does that also put you off?

It doesn't put me off, if you use unsafe, you have full responsibility to ensure that the compiler should trust you instead of the inverse. Escape hatches exist in FP all the time, although they're still used in such a way that they're both meaningful and safe.

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied mute to @edgy thunder until 2021-03-31 17:58 (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).

amber raptor
lament blaze
#

The .ts

amber raptor
#

esp when you are pushing JS code into TS

severe pulsar
#

yeah refactoring that can take some time

honest pier
#

ugh, the woes of writing good code

severe pulsar
#

;-;

amber raptor
honest pier
#

that sucks

lament blaze
amber raptor
#

sorry to rain on your parade, on positive note, you will be able to afford decent alcohol to forget it

mighty torrent
rugged root
#

!ban 799196653307035678 Continuing to harass staff via DM after being told not to is unacceptable. You seem to only be here to troll. I hope you mature and learn from this experience.

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied ban to @edgy thunder permanently.

hushed frost
#

The program must be loaded with the expression.txt file. The structure of the file is such that each line represents an expression of an elementary operation (addition, subtraction, multiplication or division), such as:

4 + 1
12-3
2 * 182
8/2
So the format is:

<number> <operator> <number>
A program must be written that will read the file, line by line, that will apply the given operation and that will write the result, together with the corresponding expression, in the output.txt file. Pay attention to the newline character and the opening and closing of files, respectively.

night spade
#

just wondering if anyone here is versed in cuda python? working on trying to avoid warp divergence atm and its proving to be difficult

vivid palm
#

i clear all discord notifications but email is always several thousands

hushed frost
#
with open("expresii.txt", "r") as input_txt:
    line = input_txt.readline()
    print(line)
    linie
    print(line)
steep flax
#

why you calling us out dudebro

severe pulsar
#

DAMN

steep flax
#

smh

severe pulsar
#

how how

honest pier
#

!e import tempfile

wise cargoBOT
#

@honest pier :warning: Your eval job has completed with return code 0.

[No output]
honest pier
#

@rugged root do you know if tempfile works on snekbox?

rugged root
#

That's a really good question

#

It might?

honest pier
#

time to test 😔

#

!e

import tempfile
tempfile.TemporaryFile()
#

ah

#

ah

severe pulsar
#

you could use linecache

#

@ OpalMist

#

its in the standard library

steep flax
#

you are all so helpful 🙂

severe pulsar
#
linecache.getline(1)
#

im fairly sure thats how the api is

rugged root
#

readlines()

severe pulsar
rugged root
somber heath
#
with open('file.txt', 'r') as file:
    data = file.read().strip().split('\n')``` It's slightly verbose, but I use this all the time for a lot of things and it works really nicely.
severe pulsar
#

why not readlines?

#

isnt that basically readlines?

#

@ OpalMist

rugged root
#
with open("file.txt") as file:
  raw_data = [line.strip() for line in file]
severe pulsar
#

wait are you actually 👀

steep flax
#

you can never have too much caffeine

vivid palm
#

i’ve had too little 😞

rugged root
#

Caffeine + ADHD meds = severe jitters and accelerated heart rate

severe pulsar
#

yay!

#

oh wait...

steep flax
#

the day just started 0dizzy

rugged root
honest pier
#

regex 😍

severe pulsar
#

pleeeaase

honest pier
#

regex is awesome

severe pulsar
#

it probably is, its just such a pain to learn and remember

#

no hate towards the technology itself

honest pier
#

shunting yard go brrr

humble geyser
#

read each line, split on the symbol, strip the numbers and evaluate

#

python should have a eval() function

hushed frost
severe pulsar
rugged root
somber heath
#
expression ='12+3'
if '+' in expression:
   ...
elif '-' in expression:
    ... ``` To reiterate, I don't like doing things this way.
honest pier
#

senpy

swift valley
#

!otn s notice-me

wise cargoBOT
#
Query results

• notice-me-sympy

swift valley
#

hehehe

honest pier
#

lol

vivid palm
#

😂

somber heath
#
'Apple+pear'.split('+') == ['Apple', 'pear']```
humble geyser
somber heath
#

Oops, an unsanitised input file.

severe pulsar
#

hi fisherrrrRRRR!

honest pier
#

it doesn't explicitly say it should parse it

night spade
#

5 interview stages for grads here in the uk is standard for some god forsaken reason

rugged root
#

But it's considered bad practice

lucid mountain
#

are vm's safe

gentle flint
rugged root
#

Much safer

honest pier
#

!d re.split

wise cargoBOT
#
re.split(pattern, string, maxsplit=0, flags=0)```
Split *string* by the occurrences of *pattern*. If capturing parentheses are used in *pattern*, then the text of all groups in the pattern are also returned as part of the resulting list. If *maxsplit* is nonzero, at most *maxsplit* splits occur, and the remainder of the string is returned as the final element of the list.

```py
>>> re.split(r'\W+', 'Words, words, words.')
['Words', 'words', 'words', '']
>>> re.split(r'(\W+)', 'Words, words, words.')
['Words', ', ', 'words', ', ', 'words', '.', '']
>>> re.split(r'\W+', 'Words, words, words.', 1)
['Words', 'words, words.']
>>> re.split('[a-f]+', '0a3B9', flags=re.IGNORECASE)
['0', '3', '9']
```  If there are capturing groups in the separator and it matches at the start of the string, the result will start with an empty string. The same holds for the end of the string:... [read more](https://docs.python.org/3/library/re.html#re.split)
somber heath
#

!e py func = {'P':print} func['P']('Hello, world.')

wise cargoBOT
#

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

Hello, world.
lucid mountain
gentle flint
#

!d ast.literal_eval

wise cargoBOT
#
ast.literal_eval(node_or_string)```
Safely evaluate an expression node or a string containing a Python literal or container display. The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and `None`.

This can be used for safely evaluating strings containing Python values from untrusted sources without the need to parse the values oneself. It is not capable of evaluating arbitrarily complex expressions, for example involving operators or indexing.

Warning

It is possible to crash the Python interpreter with a sufficiently large/complex string due to stack depth limitations in Python’s AST compiler.

Changed in version 3.2: Now allows bytes and set literals.

Changed in version 3.9: Now supports creating empty sets with `'set()'`.
rugged root
#

Oooo, I didn't know that last bit about set

worldly falcon
#

I love sets

honest pier
#

that's not a set literal 😔

lucid mountain
#

oh

worldly falcon
#

I love regex

honest pier
#

!e

print({*()})
wise cargoBOT
#

@honest pier :white_check_mark: Your eval job has completed with return code 0.

set()
honest pier
#

:)

worldly falcon
#

I love validation

severe pulsar
lucid mountain
#

🙂

worldly falcon
#

always perform validation and keep it away from execution space

somber heath
honest pier
#

,=

lucid mountain
#

have you ever failed an interview

mortal burrow
#

!e
a = "5+5"
ops = a.split(sep="+")
result = int(ops[0]) + int(ops[1])
print(result)

swift valley
#

!e

x ,= [1]
print(x)
wise cargoBOT
#

@swift valley :white_check_mark: Your eval job has completed with return code 0.

1
honest pier
#

a, = [0]

swift valley
#

Bang

humble geyser
#

pistol, walrus what next

wise cargoBOT
#

@mortal burrow :white_check_mark: Your eval job has completed with return code 0.

10
swift valley
#

!e

(x,) = [1]
print(x)
wise cargoBOT
#

@swift valley :white_check_mark: Your eval job has completed with return code 0.

1
worldly falcon
#

I never had a python interview...but all I do is code for my job now lol

swift valley
#

Pretty much

honest pier
vivid palm
#

i miss my mouth all the time

gentle flint
vivid palm
#

cups, spoons..

honest pier
#

Q14. Is indentation required in python?

somber heath
humble geyser
#

x, = [1] This makes sense now

vivid palm
#

yes lolll

worldly falcon
#

say no to tabs

lucid mountain
#

wow

worldly falcon
#

turn tabs into spaces

lucid mountain
#

this changes everything

#

(x,) = [1]

gentle flint
neon sleet
#

using //

#

bam

honest pier
humble geyser
#

wow

swift valley
#

Pain

somber heath
#

Docstrings.

honest pier
neon sleet
#

operators are functions?

swift valley
#

Special functions

#

Heresy

honest pier
#

lol

gentle flint
#

where's this from?

humble geyser
#

Are these interview questions?

lucid mountain
#

i guess

honest pier
#

shit ones

somber heath
#

is compares identity. == compares equality.

humble geyser
#

Algorithms maybe

neon sleet
#

well, I think, operators are functions in lisp

#

but lisp is a weirdo

somber heath
#
a = [1,2,3]
b = [1,2,3]
a == b #True
a is b #False
c = a
a is c #True```
worldly falcon
#

questions seem stupid when gauging an applicant...having them do a project and reviewing it seems better

humble geyser
#

is compares memory location

honest pier
gentle flint
#

^

honest pier
worldly falcon
#

Yeah, it will cost you more in the long run though

rugged root
#

Not necessarily

honest pier
#

not really

worldly falcon
#

never sacrifice later for a better now

swift valley
#

"Invert a binary tree"

honest pier
#

😔

molten pewter
#

In linguistics, declension is the changing of the form of a word, generally to express its syntactic function in the sentence, by way of some inflection. The inflectional change of verbs is called conjugation.
Declensions may apply to nouns, pronouns, adjectives, adverbs, and articles to indicate number (e.g. singular, dual, plural), case (e.g. ...

rugged root
worldly falcon
#

I mean I guess if you're trimming your list of applicants

molten pewter
#

I found the term.

#

for "conjugating" nouns

honest pier
#

oh yeah

neon sleet
#

what are you so desolate

honest pier
#

it is what it is

humble geyser
#

what do you do for a living?

I just answer interviews

honest pier
swift valley
#

I'll do it in type-level PureScript then lol

honest pier
#

@swift valley how do you even do such a thing in haskell 🤔

#

or purescript

swift valley
#

Give me a sec

#

NDA hyperlemon

lucid mountain
#

can you run a 64 bit vm on a 32 bit pc

worldly falcon
#

lol

olive hedge
#

!otn a the fence incident

wise cargoBOT
#

:ok_hand: Added the-fence-incident to the names list.

honest pier
#

lmfao

#

credit me 😔

#

:D

somber heath
#

Fun fact regarding operators and other python syntax symbols. It's all calling dunder/magic/special methods of the lefthand with the righthand as its parameter behind the scenes.

>>>a = 1
>>>a + 1
2
>>>a.__add__(1)
2```
molten pewter
#

What is DUck Baiting?

lucid mountain
#

isnt that just longer

molten pewter
#

I like it

olive hedge
vivid palm
humble geyser
#

Emojis in commits exist

olive hedge
olive hedge
honest pier
#

🤢 🤮

olive hedge
#

you pay 💸 at the end of the 🗓️ and you get a 🏠

signed 🧑‍🦲

hushed frost
#
with open("expresii.txt", "r") as input_txt:
    data = input_txt.read()
    datastrip = data.split('\n')
for i in range(len(datastrip)):
    output_txt = open("iesire.txt", "w")
    output_txt.write(str(datastrip[i]) + " = " + str(eval(datastrip[i])))
humble geyser
honest pier
#

hmm, you don't need to open the file each iteration, that's just a waste. do the loop inside of a with statement @hushed frost

rugged root
hushed frost
#
with open("expresii.txt", "r") as input_txt:
    data = input_txt.read()
    datastrip = data.split('\n')
for i in range(len(datastrip)):
    output_txt = open("iesire.txt", "w")
    output_txt.write(str(datastrip[i]) + " = " + str(eval(datastrip[i])))
honest pier
#

you should also loop pythonically

#

!range

wise cargoBOT
#

Iterating over range(len(...)) is a common approach to accessing each item in an ordered collection.

for i in range(len(my_list)):
    do_something(my_list[i])

The pythonic syntax is much simpler, and is guaranteed to produce elements in the same order:

for item in my_list:
    do_something(item)

Python has other solutions for cases when the index itself might be needed. To get the element at the same index from two or more lists, use zip. To get both the index and the element at that index, use enumerate.

lucid mountain
#

whats that

humble geyser
#

RecursionError

#

something

somber heath
#

Then write that to file.

#

str.join taking a list and joining each element of that list as one big string, using the given characters in the string (\n) as glue.

honest pier
#
import operator
ops = {
  "+": operator.add,
  "-": operator.sub,
  "*": operator.mul,
  "/": operator.truediv,
}
pat = re.compile(r"(\d+)([-+*/])(\d+)")
with open("input.txt"), open("output.txt", "w") as In, out:
  for L, op, R in pat.findall(In.read()):
    out.write(f"{ops[op](L, R)}\n")
```😃
rugged root
#

You know, I don't hate that

honest pier
#

it's ok, actually

#

it's like "eh, why would you do that", but also not that bad

rugged root
#

Agreed

somber heath
#

!e py my_list = ['apples', 'pears'] my_list.append('chairs') print('\n'.join(my_list))

wise cargoBOT
#

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

001 | apples
002 | pears
003 | chairs
olive hedge
mortal burrow
honest pier
#

collections.Counter go brrrr

#

select names,counts order by counts brainmon

lucid mountain
#

'\n'

#

use:

somber heath
#

@hushed frost Also, fun fact, you can use print's file parameter to specify an open file object to write the output of the print to that file object.

honest pier
#

is that buffered? @somber heath

mortal burrow
#

counts = df["labels"].value_counts()

lucid mountain
#

why does one use '\n'

somber heath
#

I don't know.

honest pier
#

yeah?

#

buffered doesn't have to do with what with does

somber heath
#

As to \n, it's a one byte character expressed visually to and by us as two characters.

#

Indicating a newline

honest pier
#

lol, there was an advent of code problem, like in 2015 that explored that idea

#

characters to represent something in text vs characters in memory

#

e.g., \n is one byte, but two characters to represent on a screen

somber heath
#

print has a default flush of false

humble geyser
#

what is the time complexity to read and write into a file?

lucid mountain
honest pier
somber heath
#

It's a newline. Like pressing enter.

lucid mountain
#

oh thanks

humble geyser
#

I don't know how the open function works

lucid mountain
#

its above and below

somber heath
#

!e py print('Hello,\nworld.')

wise cargoBOT
#

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

001 | Hello,
002 | world.
humble geyser
#

probably O(n) or more

mortal burrow
#

Look at that

lucid mountain
#

!e

wise cargoBOT
#
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!*

honest pier
#

lol

lucid mountain
#

step.map

#

i think

somber heath
#

@humble geyser open returns a file object interface you can interact with using python. So opening of files and reading them. Writing new files. Appending to files. Etc.

molten pewter
humble geyser
honest pier
#

O(1)

humble geyser
#

yeah?!

somber heath
honest pier
#

huh?

#

yeah it's O(1)

somber heath
#

In either event, time complexities aren't a thing I know a lot about.

lucid mountain
#

;0

honest pier
humble geyser
#

Up your microphone volume Tomas

somber heath
#

tooling

honest pier
#

huh?

#

what does tooling mean

somber heath
#

Trolling.

#

But it's a much nicer way of putting it. Like joking.

hushed frost
#
with open("expresii.txt", "r") as input_txt:
    data = input_txt.read()
    datastrip = data.split('\n')
with open("iesire.txt","w") as output_txt:
    for i in range(len(datastrip)):
        output_txt.write(str(datastrip[i]) + " = " + str(eval(datastrip[i])) + "\n")
olive hedge
lucid mountain
#

whats with used for

honest pier
somber heath
wise cargoBOT
#

Iterating over range(len(...)) is a common approach to accessing each item in an ordered collection.

for i in range(len(my_list)):
    do_something(my_list[i])

The pythonic syntax is much simpler, and is guaranteed to produce elements in the same order:

for item in my_list:
    do_something(item)

Python has other solutions for cases when the index itself might be needed. To get the element at the same index from two or more lists, use zip. To get both the index and the element at that index, use enumerate.

somber heath
#

@hushed frost Which isn't a disaster.

#

@hushed frost Take s look at this example.

lucid mountain
#

!with

wise cargoBOT
#

The with keyword triggers a context manager. Context managers automatically set up and take down data connections, or any other kind of object that implements the magic methods __enter__ and __exit__.

with open("test.txt", "r") as file:
    do_things(file)

The above code automatically closes file when the with block exits, so you never have to manually do a file.close(). Most connection types, including file readers and database connections, support this.

For more information, read the official docs, watch Corey Schafer's context manager video, or see PEP 343.

somber heath
#

Also, whenever you find yourself doing something that looks like ...

for i in range(len(thing)):```
Consider instead
```py
for i, v in enumerate(thing):```
#

@hushed frost

honest pier
#

in this case you don't need enumerate

humble geyser
#

oma ye wa mou shinde iru

somber heath
#

It is, indeed, not needed. Nevertheless, it can give your code more readability.

lucid mountain
#

same

restive geyser
#

no u have to roll the R like cardi b

lucid mountain
#

!enumerate

wise cargoBOT
#

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.

olive hedge
#

rawr

somber heath
#

i is the indexes, v is the elements of thing in turn

restive geyser
#

LMAO

somber heath
somber heath
#

It's so useful.

#

Not as much in love as I am with numpy.linspace

somber heath
#

Which is like range, but so much better.

#

and enumerate and linspace together is a marriage made in heaven

honest pier
humble geyser
#

Did anyone know about the 5th beetle?

rugged root
restive geyser
#

jesus. i've been spending too much time on this site. i need to work hemlock D:<

olive hedge
#

ringo is obviously broke

restive geyser
#

or living his best life. i wanna be able to sell MSPaint art for a grand each.

rugged root
#

!server

wise cargoBOT
#
Server Information

Created: 4 years, 2 months and 23 days ago
Voice region: europe
Roles: 77
Member status: status_online 49252 status_offline 120898

Members: 170150

Helpers: 94
Moderators: 28
Admins: 13
Owners: 3
Contributors: 36

Channels: 210

Category: 27
News: 11
Staff: 60
Text: 101
Voice: 11

restive geyser
#

🤓

honest pier
#

we also lost a sprite somehow

restive geyser
#

it's not that we can't take sarcasm. you just have to be respectful of other cultures

rugged root
#

!user

wise cargoBOT
#
Mr. Hemlock#2740

hypesquad_balance early_supporter

User information

Created: 5 years, 6 months and 2 days ago
Profile: @rugged root
ID: 98195144192331776

Member information

Joined: 2 years, 10 months and 28 days ago
Roles: <@&542431903886606399>, <@&463658397560995840>, <@&764802720779337729>, <@&295488872404484098>, <@&267630620367257601>, <@&797891034906099752>, <@&587606783669829632>, <@&277914926603829249>, <@&267629731250176001>, <@&807415650778742785>, <@&267628507062992896>

Infractions

Total: 18
Active: 2

restive geyser
#

there are other senses...

dire oriole
restive geyser
#

lol

honest pier
#

yeah

#

you forgot the ...

dire oriole
#

¯_(ツ)_/¯

olive hedge
#

at least they let you know LOL

dire oriole
#

it’s just a question mark iirc

olive hedge
#

o wait

#

you forgot to add an emoji for that

dire oriole
#

don’t worry though turns out I actually didn’t mess it up :3 (I think...)

honest pier
#

only griff does that, thankfully

dire oriole
#

lol

rugged root
dire oriole
#

i-

olive hedge
#

I think I messed up the rabbis

honest pier
#

i-

restive geyser
#

stahp

honest pier
#

solved the problem :)

olive hedge
honest pier
#

that's a pr

dire oriole
#

^ smh

olive hedge
#

please add a pr body....

honest pier
#

i did >:(

dire oriole
#

“thanks griff”

rugged root
honest pier
#

😔

gentle flint
#

The spread of it is spreading
Opalmist, 31-03-31

honest pier
#

pycharm 👍

#

hey, if you don't have linting, you can't have linting problems

rugged root
#

Can't all be winners

vivid palm
#

does anyone use clubhouse?

#

i just saw a server doing clubhouse-like features

honest pier
#

micky mouse clubhouse?

vivid palm
honest pier
#

oh yeah, new feature

molten tinsel
#

No. cuz im not apple

#

Interesting though

vivid palm
zealous wave
#

!e ```py
class NewDict(dict):
def list(self):
return list(self)

builtins.dict['dict'] = NewDict

print({'one':'1', 'two':'2'}.list())

vivid palm
#

@honest pier what is discord calling it do you know?

honest pier
#

cc @rugged root ^

somber heath
#
class MyDict(dict):
    pass
my_dictionary = MyDict({'a':1, 'b':5})```
olive hedge
#

its all objects 🔫

restive geyser
#

the incident wasn't a joke to me 😭

olive hedge
#

!otn a fisher's friday incident

wise cargoBOT
#

:ok_hand: Added fisher’s-friday-incident to the names list.

restive geyser
#

i'll never be the same

molten pewter
#

walk Dog

olive hedge
#

!otn a psvm's eternal disapproval

wise cargoBOT
#

:ok_hand: Added psvm’s-eternal-disapproval to the names list.

restive geyser
#

lol or just eternal sadness

#

😮 it's my birthday month. shout out to all the april babies

honest pier
#

ew

restive geyser
#

are you ewing me?

honest pier
#

april

#

👎

restive geyser
#

you better put some respect on that ew

#

u do it

#

lol

honest pier
#

ew, ma'am

humble geyser
#

||ew||

restive geyser
#

that's riiiight

honest pier
#

🤔 🤔 🤔

#

:godmode:

restive geyser
#

LMFAO

#

oh my god

alpine nimbus
#

hi

vivid palm
#

oh stage

#

it's called discord stage

restive geyser
#

that was my jam

vivid palm
#

it was so good

restive geyser
#

i have it on my boss b*** playlist on spotify lmao

vivid palm
#

share pewpew

restive geyser
#

i have not been productive today. whelp.

rugged root
vivid palm
#

mee2222222

honest pier
restive geyser
#

it was magical

#

yes.

humble geyser
#

bye

olive hedge
#

I hope you're all happy lemon_warpaint

honest pier
#

tf you mean

#

you think we hated you so much we made you go on a walk

#

🤔 pithink 🤔

olive hedge
#

Just you lemon_sentimental

#

Jk, I just wanted to send a pic of my dog

honest pier
#

😔

#

flexin

olive hedge
#

Flexin them leash skills

vivid palm
whole bear
#

hi my only friends

whole bear
#

i want talk with y'all

#

PLSSSSSSS

#

i'm praying to MR SHERLOCK

#

PLEASE

#

I did a mistake and i want improve myself for resolve it

mighty torrent
#

Guys, if I'm currently on /libs/a.py and I'm trying to import a class from /src/b.py, how should I use execute the import?

whole bear
#

@rugged root

#

@rugged root

#

PLEASE

honest pier
#

<@&267629731250176001>

#

cya

mighty torrent
#

Stop spamming dude, there's a protocol

cobalt fractal
#

@whole bear If you want to contact the moderation team, please DM @rapid crown

whole bear
#

I DID A MISTAKE, I WANT RESOLVE IT

olive hedge
whole bear
#

my English sucks because i'm a little italian

whole bear
#

it's the worst app existing

cobalt fractal
#

Sorry, what?

whole bear
#

Instagram is the worst app ever

vivid palm
#

chris if you go thru his chat history you will see a lot of spam. he already has a 2 week temp voice ban and just keeps complaining about it

cobalt fractal
whole bear
#

to err is human to forgive is divine

whole bear
whole bear
#

it's the best person I ever met

#

I really like his codes

cobalt fractal
#

!mute 481965351559757844 7d Looking through your chat history, you seem to be here just to troll and spam. Please read both our #rules and #code-of-conduct for when you return.

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied mute to @whole bear until 2021-04-07 21:28 (6 days and 23 hours).

honest pier
#

schewpid

vivid palm
#

chewsday

uncut meteor
vivid palm
#

choo-choosday

uncut meteor
#

gravytrain🚆

vivid palm
#

going out byeeeee

graceful grail
#

have a good one.

mighty torrent
#

proj1/lib == proj2/lib

vestal mason
#

Hey guys

steep flax
#

Hello Pynoob I am also a noob

prisma flower
vestal mason
pallid sigil
#

!voicecerify

wise cargoBOT
#

You are not allowed to use that command.

pallid sigil
#

!voiceverify

#

!verifyvoice

#

👁️

#

Mans on me

#

how do i verify

#

voice, i sound like corpse

#

can't you just say it i know its just one step

vestal mason
amber raptor
#

!e python import pyfish

wise cargoBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'pyfish'
steep flax
humble geyser
#

Pyduck time!

alpine nimbus
#

hello guys

digital jackal
#

ayo

#

is there a bug in the python logo or what😂 ?

#

Ah nvm its 2 birds or whtever

wise glade
errant pumice
#

hiya

fast pumice
#

hi

flat sentinel
warped saffron
#

Is this Elon Musk's comment?

#

oh scuba diver controversy

boreal spear
#

I have some Python code which I don't understand. Does anyone have a moment to help me understand it?

restive geyser
#

@boreal spear have you tried claiming a help channel?

boreal spear
#

Is the idea you just jump into a help channel and somone sees you're in there and then follows you in?

restive geyser
#

claim one of the available help channels

rugged root
#

@boreal spear Essentially you claim one and people will assist as they can

#

The new channels start at the bottom and then scoot up as older ones are solved

restive geyser
#

i'll take a look if i can help ^^

boreal spear
#

@restive geyser Thanks, I'm in Code/Help 0

boreal spear
restive geyser
#

he's referring to the help channels above the voice channels

rugged root
warped saffron
#

oooh Boy!

#

Anybody want some "Quackers"?

#

That usually quacks me up!

#

Remember that epic one liner: "Quaster labeesta, baby!"

restive geyser
#

we're in voicechat 1. lol

warped saffron
#

Imma copy and paste then

restive geyser
#

plz don't spam

warped saffron
#

You consider that spam?

#

I won't then lol

#

Also I'm afraid to gif

#

so yeah

#

I have a gif-o-phobia now

restive geyser
#

you can contribute to the conversation <.<

whole bear
#

smh

#

i cant talk

#

in vc

#

SMH

vivid palm
wise cargoBOT
#

Voice verification

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

flat sentinel
hushed elm
#

@gentle flint send me a duck logo pls?

gentle flint
hushed elm
#

thank

steep flax
#

What’s up with all the quacks

#

And ducks

tawdry oyster
#

yeh what the duck is up with these ducks

whole bear
#

hi

rugged root
#

@steep flax @tawdry oyster It's our April Fools thing this year. If you look at the Python banner at the top of the channel list, you'll see that we're actually Pyquack Duckbill.

neon sleet
#

Everyone is a duck now

rugged root
whole rover
#

!tvban 767920553755279382 1w Abusing video privileges

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied voice ban to @fierce salmon until 2021-04-08 19:34 (6 days and 23 hours).

subtle orchid
#

I believe in duck supermacy

flat sentinel
#

well yes you are the right

#

we have a lot a power

wild sable
#

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

amber raptor
#

!source

wise cargoBOT
cosmic lake
#

@gentle flint i cant seem to send you a picture of a duck :(

gentle flint
#

nope, I've disabled DMs

cosmic lake
gentle flint
#

but you can post it here

cosmic lake
#

i respect that

gentle flint
#

nice

cosmic lake
#

i just saw your pfp and wanted ot send a duck :)

#

my entire pc setup is duck themed @fast umbra

gentle flint
#

they're fun, lol

cosmic lake
#

i love ducks

#

my hit sound in games is duck sounds

#

i have a basket with over 150 rubber ducks next to me

lucid pine
#

why is everything here ducks

#

is that because of aaaaaAAA

cosmic lake
gentle flint
#

I have but one

#

it's my pfp, too

cosmic lake
#

i have so many ducks

#

i got bedbound and durring that time i became obsessed with ducks lol

gentle flint
#

apparently so, lol

cosmic lake
#

i am sad i can not talk yet :(

gentle flint
opal hill
#

omg i love your accent guys :D

#

when... you where talking ....

#

:(

#

everyone is leaving

#

please talk