#voice-chat-text-0
1 messages · Page 799 of 1
Ik its easy.
You can do this today itself the basic part till dictionaries is enough
I made a chrome automation program i look it up at utube but i really understand it.
Then start learning c
first message: #bot-commands message
How much time did it take for y'all to learn python
I'd argue I'm still learning it
But it took me a year or two to get really confident in it
i only know batch
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
I more like drop the motivation to learn after few program.
lol legit me when I first started
I've only been doing python for about 2-3 months
oops not pythong
Us bro , i got exam on Mon and i literally got serious about it since 3 days.
I wish you luck on it!
Can't. Stop. Yawning
just stop
Currently I'm learning how to create list xd.
Chicken fries. Childhood. So very sad
veggie burger
Angus burger from BK definetly!
God damn it, you guys are not making it easy to stick with my joke pledge
std::fridge
Im back
No but eventually I would be able to get it
Ah right, I'm joking 😄
"Hard drives full... buy another computer."
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 👌
Mr Beast be like 😛
Normally I'd agree, but we have 77 roles
For the guy asking about lists. C lists look like this:
isn't that an array
Python lists look like this:
I like the one off on the left just going wheeeeeeeeeeeeeeeeeeeeeeeeeee off screen
i think that's the reference to the list
I demand a tomato duck. https://www.reddit.com/r/mildlyinteresting/comments/mgdzn5/this_tomato_looks_like_a_rubber_duckie/
all speaky english?
Yep, it's an English server
in a nutshell
Add in server
fisher is super nice
excuse me?
Yeah not really down with that being in the server
Nazi and Hitler references aren't really something that mesh with us here
hi all
hi!
Deafened for a moment while I go grab some checks from the printer
what repository is this?
thanks
@sick dew #voice-chat-text-0 message
rewriting history like there's no yesterday
What are Scalable Vector Graphics 🤏? How are vector images different than raster images? Learn the fundamentals of SVG in 100 seconds!
Learn more about web design, SVG, and CSS in this tutorial: https://fireship.io/lessons/css-cards-animated/
References:
Star Wars Animation https://codepen.io/nerdmanship/pen/ZLoyPG
Path Docs https://develope...
man teaches like nobody else
see you might know mad css but can you do README ui development? 👀
...yes.
css is legit the most complicated programming I have ever done and probably will ever do
same ITS TOO HARD
hmm thats impossible, so i dont really believe you
¯_(ツ)_/¯
helloo guys
kutie :3
lol
<_<
oooo you're pushin' your luck, buddeh


<.< throw out the whole professor
hemlock be giving away free food trump cards
wow! 👀 😱 😲 🤯
Yes. I know I'm a monster. Go ahead and judge me, blah blah
Just let me eat in peace
-le gasp-
eat in hell maybe
LMAO
DAMN
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 ?
@honest pier have you watched dating class?
yeah
wanna re watch it with me
not particularly lol
it is good
cool cool, I think I will do all 16 today
i-
that's why i'm on mute. lol <.<
@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
I use pycharm
@whole bear I like visual studio code. It's nice
Give it some time, someone will respond.
_>
@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.
I'm working on a tool that gets the auction data from the api. To minimize requests but optimize speed, I'm running a scheduler that waits variable amount of time after the lastUpdated key in the auctions api before checking to see if the auctions have changed.
After doing a bit of testing, I...
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'
take your time. voice verification takes a mimum of 3 days anyway. don't spam and you'll be good
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
Grafana
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
@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"]
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"]```
:dd
waitpls
aight i am back
so what are you working on?
y
yes
what happend?
eya
yea
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.
brb
x = "hello"
y = "world"
print(f'{x}{Y}')
///\\
"///"
/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
________________________________
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
_________________________________
yet using computer
Hello World
I didn't had this on, 🤔 , now it might be better
I just joined this server today.
@slate pier what're ya playin'?
Join the challenge or watch the game here.
🤔
hello can you guys help me how to equal the force between 2 objects on unity
mass_x * acceleration _x = mass_y * acceleration_y (?)
or you can use Legendre polinomials if you try to replicate quantum physics
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...
A hiccup (also spelled hiccough) is an involuntary contraction (myoclonic jerk) of the diaphragm that may repeat several times per minute. The hiccup is an involuntary action involving a reflex arc. Once triggered, the reflex causes a strong contraction of the diaphragm followed about a quarter of a second later by closure of the vocal cords, wh...
@muted phoenix hi?
hey
sry not accepting friend requests
hi 😮
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...
lmao
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)
@crystal fox https://youtu.be/uZpMmP5EUEI
try this for hiccups, full volume
yeah @vivid palm i fucking ruined it somehow.
no i had a meeting i forgot about
bye laundmo!
elo
!voiceverify
if anybody could come help me out with a django question in Code Help 0 that would be legendary
it's now 12:50am here in my country.. happy april fool's day!
oooooooooooooh 4/1
int e-it up
meow
!ban 292824612113219584 Racism is absolutely not tolerated here.
:incoming_envelope: :ok_hand: applied ban to @stuck walrus permanently.
Car is due for the scrap heap so I figured I'd have a bash at picking the lock. First attempt took 3-5 minutes, second attempt only took about 2, third attempt was about 45 seconds. When I recorded best I could do was 1 minute.
Quite scary really...
In front, top up, single locked.
Personal best: 6.79 sec
logging off for now - take care all
lol
if anyone has any experience with Django and wants to come help me out jump into Code/Help0
Thunder Bird like
brrr
lmao
Mozzila its like yeah sure and the VPN its cool too
does anybody know what color theme this is
YO INDRA
whats up?
how are you?
havent seen you in a while
!projects
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.
!kindling
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.
Well, Yeah Microsoft its pretty cool sure
Please don't make my life difficult
sorry for that bud, didn't realise it'd be that big a thing.
Rust its yeah
Low-level + the type system is a proper combo
LIke the cobol fortan thing
Thanks
Languages that just refuse to die because they're too powerful
Although to be fair, once you start thinking in terms of types, the intuition just starts to flow
FastAPI framework, high performance, easy to learn, fast to code, ready for production
yeah, but its to expansive to change
""""expensive""""
FastAPI framework, high performance, easy to learn, fast to code, ready for production
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
I like Phy for AI dev, but it's so danse
I'm just going to use it for posts from Jira webhook to shove Json in my kafka quorum
jeje
compiled python is nice when you make your own tools for like pen testing
you can compile it
Oh, i heard this before, like a deja vu
I'll send you some compiled malware I made if you want
!d dis
if you stuff gets encrypted don't blame me
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)
Literally unplayable 
!e
import dis
def func():
x = 10
x *= 3
return x
dis.dis(func)
@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
XDD
@amber raptor ^
pls russian
and the TypeScript
Yea, but CPython at it's core is interperted
it's a standardized format
pls russian speak
yeah, i'm not disagreeing. i'm just saying it's a bit more complicated than just "interpreted vs compiled"
TypeScript's type system is eh
you probably think non-functional pl type systems are eh 😔
!e python import dis import time def func(): x = 10 x *= 3 return x print(time.time()) dis.dis(func) print(time.time())
@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
Like the rule 4
the compiler can't really optimize because of the dynamicism
I mean, so is Python Typing Module, bolting Static Typing onto non statically typed language is difficult
It would be best to compile a language to work for a specific instruction set if there's a need.
For sure, although I mostly don't find it all that interesting because it isn't really as novel
Don't find what as interesting or novel?
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
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
just pulse talk pls
one of the greatest books I've found on compilers
async comes with problems of it's own
and Sendgrid probably figures if wait time of requests is issue, your problem is bigger then async/sync
Yeah, well Microsoft its gonna put money... LIke... I see the msn :^)
noisetorch
can you highlight some?
NIce
Pertaining to mainstream type systems, as useful as they are, they're not really as powerful
just a git clone
like i know for a fact async is really good in some cases like frontend programming
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
if you are sending a ton of emails, you probably have messaging system for that, we do
i think the code thing is not much of a flaw since you can just wrap your code in an async function and use the await keyword. So, it'll syntactically look like you're waiting for that async operation to finish
and your code will actually run in that order when you call the asynchronous function
If you're not using Docker now, you're wrong lol
yeah jhon cage
i was just using sendgrid as one example, there are multiple other python client libraries which solely support sync requests and calls
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
The existence of any kinda lessens my confidence in the "if it compiles it probably works" mantra
lol
what about stuff like the rust unsafe keyword then?
does that also put you off?
i've never had to use unsafe
I love it and i Hate
funny tip of the day, you cannot name any file in windows PRN without an extension....
Well, Mephistopheles its whispering in my ear
My stocks scraping stuff choked when it tried to create the folder lol
Sure, Windows has really old backwards compatibility layer stuff littered in it
Yeah, it's a reserved word...funny stuff
yeah, but i was trying to compare it to what @ pure said about the existence of any in typescript. You never have to use it, but just because it exists, that puts you(pure) off?
true
Just have more confidence, the pollish mind set
I don't think gradual typing is evil, just that the effort put towards going fully-typed is about the same as gradual typing + tests
thanks git
yeah, how are u @rugged root , here like the pillar of this moment in this conversation?
!voice @edgy thunder
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
wouldnt async be more scalable though?
in terms of handling requests and stuff
Yeah, teleports behind u
Eh
srry
I don't
:x: According to my records, this user already has a mute infraction. See infraction #30818.
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.
: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).
We have a few older TS projects with Any, sometimes bad code choices can make it very difficult to remove it without significant refactoring and business concerns can make that impossible
aah right
The .ts
esp when you are pushing JS code into TS
yeah refactoring that can take some time
ugh, the woes of writing good code
;-;
I'm just stating the realities of coding at any company, generally "Fuck it, it compiles" is strong with business people
that sucks
Yaeh, banking system in a nutshell
sorry to rain on your parade, on positive note, you will be able to afford decent alcohol to forget it
Today coming at you with the least efficient cake factory ever made.
Create is a Minecraft mod for Forge 1.14.4, with 1.15 to follow. It adds a variety of very useful building tools, as well as technology based on kinetics and rotational power. It is a free-time open-source project by a bunch of Minecraft players who love the creative aspect of ...
!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.
:incoming_envelope: :ok_hand: applied ban to @edgy thunder permanently.
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.
just wondering if anyone here is versed in cuda python? working on trying to avoid warp divergence atm and its proving to be difficult
i clear all discord notifications but email is always several thousands
with open("expresii.txt", "r") as input_txt:
line = input_txt.readline()
print(line)
linie
print(line)
why you calling us out dudebro
DAMN
smh
!e import tempfile
@honest pier :warning: Your eval job has completed with return code 0.
[No output]
@rugged root do you know if tempfile works on snekbox?
you are all so helpful 🙂
readlines()
wholesome!
I always love hearing that. Makes doing all this worth while
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.
with open("file.txt") as file:
raw_data = [line.strip() for line in file]
also mad respect if you're typing out code from your phone
wait are you actually 👀
you can never have too much caffeine
i’ve had too little 😞
Caffeine + ADHD meds = severe jitters and accelerated heart rate
the day just started 
It's 1:13 pm here
regex 😍
regex is awesome
it probably is, its just such a pain to learn and remember
no hate towards the technology itself
shunting yard go brrr
read each line, split on the symbol, strip the numbers and evaluate
python should have a eval() function
hmm?
I mean it does, but the homework prompt states that they need to parse it
expression ='12+3'
if '+' in expression:
...
elif '-' in expression:
... ``` To reiterate, I don't like doing things this way.
senpy
!otn s notice-me
• notice-me-sympy
hehehe
lol
😂
'Apple+pear'.split('+') == ['Apple', 'pear']```
The eval function I was talking about was the one that js has
something like this eval('8 + 2') = 10
Oops, an unsanitised input file.
hi fisherrrrRRRR!
it doesn't explicitly say it should parse it
5 interview stages for grads here in the uk is standard for some god forsaken reason
Yes, Python has that
But it's considered bad practice
are vm's safe
ast.literal_eval() would be better
Much safer
!d re.split
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)
!e py func = {'P':print} func['P']('Hello, world.')
@somber heath :white_check_mark: Your eval job has completed with return code 0.
Hello, world.
this looks alien
!d ast.literal_eval
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()'`.
Oooo, I didn't know that last bit about set
I love sets
that's not a set literal 😔
oh
I love regex
!e
print({*()})
@honest pier :white_check_mark: Your eval job has completed with return code 0.
set()
:)
I love validation
cue intense dream running music
🙂
always perform validation and keep it away from execution space
print() is None```
,=
have you ever failed an interview
!e
a = "5+5"
ops = a.split(sep="+")
result = int(ops[0]) + int(ops[1])
print(result)
!e
x ,= [1]
print(x)
@swift valley :white_check_mark: Your eval job has completed with return code 0.
1
a, = [0]
Bang
pistol, walrus what next
@mortal burrow :white_check_mark: Your eval job has completed with return code 0.
10
!e
(x,) = [1]
print(x)
@swift valley :white_check_mark: Your eval job has completed with return code 0.
1
I never had a python interview...but all I do is code for my job now lol
Pretty much
@olive hedge https://www.edureka.co/blog/interview-questions/python-interview-questions/ gotta practice these or else you'll fail
i miss my mouth all the time
=;
cups, spoons..
Q14. Is indentation required in python?
Where did it go?
x, = [1] This makes sense now
yes lolll
say no to tabs
wow
turn tabs into spaces
somewhere good
wow
Pain
Docstrings.
lol
operators are functions?
lol
where's this from?
Are these interview questions?
i guess
shit ones
is compares identity. == compares equality.
Algorithms maybe
a = [1,2,3]
b = [1,2,3]
a == b #True
a is b #False
c = a
a is c #True```
questions seem stupid when gauging an applicant...having them do a project and reviewing it seems better
is compares memory location
the problem is time, projects take a long time. questions are much shorter and faster
^
cpython implementation detail 😔
Yeah, it will cost you more in the long run though
Not necessarily
not really
never sacrifice later for a better now
"Invert a binary tree"
😔
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. ...
-draws tree-
-turns paper upside down-
I mean I guess if you're trimming your list of applicants
oh yeah
what are you so desolate
it is what it is
what do you do for a living?
I just answer interviews
def swap(root):
if not root:return
root.left, root.right = root.right, root.left
swap(root.left)
swap(root.right)
I'll do it in type-level PureScript then lol
can you run a 64 bit vm on a 32 bit pc
lol
!otn a the fence incident
:ok_hand: Added the-fence-incident to the names list.
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```
What is DUck Baiting?
isnt that just longer
I like it
but also radd and iadd 😔
Emojis in commits exist

🙊
🤢 🤮
you pay 💸 at the end of the 🗓️ and you get a 🏠
signed 🧑🦲
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])))
you pay flying money at the end of the calendar and you get a doll house
signed child
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
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])))
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.
whats that
Do a with open of mode 'w', then write. You may wish to have a preprepared list that you turn into a string like py '\n'.join(my_list_of_completed_lines)
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.
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")
```😃
You know, I don't hate that
Agreed
!e py my_list = ['apples', 'pears'] my_list.append('chairs') print('\n'.join(my_list))
@somber heath :white_check_mark: Your eval job has completed with return code 0.
001 | apples
002 | pears
003 | chairs

@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.
is that buffered? @somber heath
counts = df["labels"].value_counts()
why does one use '\n'
If it's in a with, does it matter?
I don't know.
As to \n, it's a one byte character expressed visually to and by us as two characters.
Indicating a newline
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
print has a default flush of false
what is the time complexity to read and write into a file?
just a space
what do you think
It's a newline. Like pressing enter.
oh thanks
I don't know how the open function works
its above and below
!e py print('Hello,\nworld.')
@somber heath :white_check_mark: Your eval job has completed with return code 0.
001 | Hello,
002 | world.
probably O(n) or more
!e
!eval [code]
Can also use: e
*Run Python code and get the results.
This command supports multiple lines of code, including code wrapped inside a formatted code
block. Code can be re-evaluated by editing the original message within 10 seconds and
clicking the reaction that subsequently appears.
We've done our best to make this sandboxed, but do let us know if you manage to find an
issue with it!*
lol
@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.
Google Groups allows you to create and participate in online forums and email-based groups with a rich experience for community conversations.
what would be its time complexity
O(1)
yeah?!
Are you funning, @humble geyser?
In either event, time complexities aren't a thing I know a lot about.
;0
what does funning mean lol
Up your microphone volume Tomas
tooling
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")
whats with used for
Optional
You'll end up with a trailing '\n'.
!range
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.
!with
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.
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
in this case you don't need enumerate
oma ye wa mou shinde iru
It is, indeed, not needed. Nevertheless, it can give your code more readability.
same
looks harder
no u have to roll the R like cardi b
!enumerate
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.
rawr
i is the indexes, v is the elements of thing in turn
LMAO
Once I understood it, I fell a little in love with it.
Which is like range, but so much better.
and enumerate and linspace together is a marriage made in heaven
oops
omfg. i can't: https://www.ringostarrart.com/product/the-band/
jesus. i've been spending too much time on this site. i need to work hemlock D:<
ringo is obviously broke
or living his best life. i wanna be able to sell MSPaint art for a grand each.
!server
🤓
we also lost a sprite somehow
it's not that we can't take sarcasm. you just have to be respectful of other cultures
!user

Created: 5 years, 6 months and 2 days ago
Profile: @rugged root
ID: 98195144192331776
Joined: 2 years, 10 months and 28 days ago
Roles: <@&542431903886606399>, <@&463658397560995840>, <@&764802720779337729>, <@&295488872404484098>, <@&267630620367257601>, <@&797891034906099752>, <@&587606783669829632>, <@&277914926603829249>, <@&267629731250176001>, <@&807415650778742785>, <@&267628507062992896>
Total: 18
Active: 2
there are other senses...
😔
lol
¯_(ツ)_/¯
at least they let you know LOL
it’s just a question mark iirc
don’t worry though turns out I actually didn’t mess it up :3 (I think...)
only griff does that, thankfully
lol
I may have read that as "I think I messed up the rabies"
i-
I think I messed up the rabbis
i-
stahp
please add a commit body so we know why this commit was needed
that's a pr
^ smh
please add a pr body....
i did >:(
“thanks griff”
please add a pr, buddy
😔
The spread of it is spreading
Opalmist, 31-03-31
Can't all be winners
micky mouse clubhouse?
oh yeah, new feature
!e ```py
class NewDict(dict):
def list(self):
return list(self)
builtins.dict['dict'] = NewDict
print({'one':'1', 'two':'2'}.list())
@honest pier what is discord calling it do you know?
cc @rugged root ^
class MyDict(dict):
pass
my_dictionary = MyDict({'a':1, 'b':5})```
its all objects 🔫
the incident wasn't a joke to me 😭
!otn a fisher's friday incident
:ok_hand: Added fisher’s-friday-incident to the names list.
i'll never be the same
walk Dog
!otn a psvm's eternal disapproval
:ok_hand: Added psvm’s-eternal-disapproval to the names list.
lol or just eternal sadness
😮 it's my birthday month. shout out to all the april babies
ew
are you ewing me?
ew, ma'am
||ew||
that's riiiight
hi
that was my jam
it was so good
i have it on my boss b*** playlist on spotify lmao
share 
i have not been productive today. whelp.
mee2222222
bye
I hope you're all happy 
Flexin them leash skills
so cute her little nosie 
hi my only friends
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
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?
Stop spamming dude, there's a protocol
@whole bear If you want to contact the moderation team, please DM @rapid crown
I DID A MISTAKE, I WANT RESOLVE IT
check their infs
.
#helpers haha
my English sucks because i'm a little italian
I haven't shitagram
it's the worst app existing
Sorry, what?
Instagram is the worst app ever
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
:/
When did I mention anything about instagram?
to err is human to forgive is divine
not you
so can Mr heslock forgive me🥺
it's the best person I ever met
I really like his codes
!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.
:incoming_envelope: :ok_hand: applied mute to @whole bear until 2021-04-07 21:28 (6 days and 23 hours).
schewpid
chewsday
choo-choosday
🚆
going out byeeeee
have a good one.
here @uncut meteor
proj1/lib == proj2/lib
Hey guys
Hello Pynoob I am also a noob
what up dude
nothing much seeing who all were on
!voicecerify
You are not allowed to use that command.
!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
This is good to know, I have been watching some vids on MIT open courseware 🙂
!e python import pyfish
@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'
Nice! MIT 600.1X or something like that?
Pyduck time!
hello guys
not a bug, check #announcements
hiya
hi
Today we are talking about the partnership we are doing with Microsoft.
Stay tuned for more in infos in the next weeks.
You wouldn't get this from any other guy.
Read more here: https://www.youtube.com/watch?v=BjDebmqFRuc
I have some Python code which I don't understand. Does anyone have a moment to help me understand it?
@boreal spear have you tried claiming a help channel?
Is the idea you just jump into a help channel and somone sees you're in there and then follows you in?
claim one of the available help channels
@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
i'll take a look if i can help ^^
@restive geyser Thanks, I'm in Code/Help 0
Sorry Mr. Quacklots... were you saying that I should start at the bottom, i.e, should I actually be in Code/Help 1?
he's referring to the help channels above the voice channels
Yeah using the help system. See #❓|how-to-get-help for more details on that
oooh Boy!
Anybody want some "Quackers"?
That usually quacks me up!
Remember that epic one liner: "Quaster labeesta, baby!"
we're in voicechat 1. lol
Imma copy and paste then
plz don't spam
You consider that spam?
I won't then lol
Also I'm afraid to gif
so yeah
I have a gif-o-phobia now
you can contribute to the conversation <.<
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
those anyone have any these apps
https://cdn.discordapp.com/attachments/799647045886541885/827211697630216192/unknown.png
@gentle flint send me a duck logo pls?
have you looked at #sir-lancebot-playground @hushed elm
thank
yeh what the duck is up with these ducks
hi
@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.
Everyone is a duck now
!tvban 767920553755279382 1w Abusing video privileges
:incoming_envelope: :ok_hand: applied voice ban to @fierce salmon until 2021-04-08 19:34 (6 days and 23 hours).
I believe in duck supermacy
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!source
@gentle flint i cant seem to send you a picture of a duck :(
nope, I've disabled DMs
https://drive.google.com/drive/u/0/folders/1540GflbUBaVALGjwLMlHRmcYaBrg1Wwc here is my duck google drive folder
but you can post it here
i respect that
nice
i just saw your pfp and wanted ot send a duck :)
my entire pc setup is duck themed @fast umbra
they're fun, lol
i love ducks
my hit sound in games is duck sounds
https://imgur.com/gallery/SP9SdX7 my new desk
i have a basket with over 150 rubber ducks next to me
https://imgur.com/gallery/IOkSwVj my old setup
i have so many ducks
i got bedbound and durring that time i became obsessed with ducks lol
apparently so, lol
i am sad i can not talk yet :(
Listen to accents and dialects of England for free from IDEA, the world's leading archive of accents and dialects.




49252
120898
🤔

