#voice-chat-text-0

1 messages ยท Page 133 of 1

vocal basin
#

oh

whole bear
#

window 12 will be released next year

vocal basin
#

time to go back to XP

whole bear
#

lol if i just plan to code & run linux, no gaming nothing else

#

a 2015 windows laptop will suffice right

#

what about this one?

import os
  def longestCommonPrefix(strs):
        prefix=os.path.commonprefix(strs)
        if prefix==None:
            prefix=''
        return prefix
names = ["flower","flow","flight"]
print(longestcommonprefix(names))
gentle flint
frigid dove
#

As a beginner which is best to learn programming windows or Linux ?

gentle flint
#

Android app development on that would be a bit of a pain

vocal basin
#

!e

import os
def longestcommonprefix(strs) -> str:
        prefix=os.path.commonprefix(strs)
        if prefix==None:
            prefix=''
        return prefix
names = ["/usr/lib", "/usr/local/lib"]
print(longestcommonprefix(names))
whole bear
#

nothing too serious

gentle flint
whole bear
#

indendation wrong

whole bear
whole bear
#
import os
def longestCommonPrefix(strs):
    prefix=os.path.commonprefix(strs)
    if prefix==None:
        prefix=''
    return prefix
names = ["flower","flow","flight"]

print(longestCommonPrefix(names))
#

how to run?

#

!e

import os
def longestCommonPrefix(strs):
    prefix=os.path.commonprefix(strs)
    if prefix==None:
        prefix=''
    return prefix
names = ["flower","flow","flight"]

print(longestCommonPrefix(names))
wise cargoBOT
#

@whole bear :white_check_mark: Your 3.11 eval job has completed with return code 0.

fl
gentle flint
#

many laptops were made in 2015

#

good ones, bad ones

whole bear
vocal basin
whole bear
whole bear
frigid dove
#

By guys.. See you later.. ๐Ÿ‘‹๐Ÿผ

whole bear
#

i havent used any windows laptops since 2015 so im clueless

#

gaming laptops be too heavy imo

vocal basin
#

!e

import functools
import itertools
import operator

def all_equal(chars):
    return all(itertools.starmap(operator.eq, itertools.pairwise(chars)))

def longestcommonprefix(strs):
    return "".join(map(operator.itemgetter(0), itertools.takewhile(all_equal, zip(*strs))))

names = ["flower","flow","flight"]
print(longestcommonprefix(names))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

fl
whole bear
whole bear
#

its hard to get off apple once you get used to it

whole bear
whole bear
#

not worth the price

#

but the experience is the selling point

whole bear
vocal basin
whole bear
#

not really the OS is really great

#

i'd buy apple even if it looked bad

whole bear
#

its just not price-smart

somber heath
#

@whole bear ๐Ÿ‘‹

whole bear
#

Yo

#

Can anyone help me

#

My pong game is not working

vocal basin
#

!e

import functools
import itertools
import operator

def compose(*funcs):
    def wrap(x):
        for func in reversed(funcs):
            x = func(x)
        return x
    return wrap

all_equal = compose(
    all,
    functools.partial(itertools.starmap, operator.eq),
    itertools.pairwise,
)

longestcommonprefix = compose(
    "".join,
    functools.partial(map, operator.itemgetter(0)),
    functools.partial(itertools.takewhile, all_equal),
    lambda strs: zip(*strs),
)

names = ["flower","flow","flight"]
print(longestcommonprefix(names))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

fl
vocal basin
#

ugly but works

vocal basin
whole bear
#

I am new

#

In coding

vocal basin
whole bear
whole bear
vocal basin
#

```plaintext
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
```

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
#

^like that

#

@red peak binary trees?

whole bear
somber heath
#

!code

wise cargoBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

whole bear
somber heath
#

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

vocal basin
whole bear
vocal basin
whole bear
#

send the code not the ss

#

with output ss

vocal basin
somber heath
#

@gaunt flint ๐Ÿ‘‹

gaunt flint
#

oh yeh tnx

vocal basin
whole bear
#

Ok

gaunt flint
#

bro i am from iran XD i dont isis

#

who have a code for me pls?

#

I am very weak in English

whole bear
gaunt flint
#

okay say

somber heath
#

!e py 'abc123'.ycor

wise cargoBOT
#

@somber heath :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     'abc123'.ycor
004 | AttributeError: 'str' object has no attribute 'ycor'
gaunt flint
#

!e

wise cargoBOT
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

Run Python code and get the results.

This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.

By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!

whole bear
gaunt flint
gaunt flint
gaunt flint
whole bear
#

Wait

gaunt flint
gaunt flint
somber heath
whole bear
#

anaconda's python is the best optimum version

vocal basin
#

no it's not

whole bear
vocal basin
#

but not the full conda

whole bear
gaunt flint
whole bear
#

for example the openAi whisper module only works with 3,10

gaunt flint
#

3.1.5 is good?

vocal basin
#

you'll have to install a separate python for that anyway

whole bear
vocal basin
gaunt flint
whole bear
gaunt flint
vocal basin
#

it's basically non-existent now

gaunt flint
#

3.5.1 is good?

whole bear
vocal basin
#

before 3.8 -- probably avoid it

gaunt flint
whole bear
vocal basin
#

I did the weird compose-only common prefix
#bot-commands message

gaunt flint
#

3.8.2 is good? @somber heath

red peak
#

!e

names = ["flower","flow","flight"]
common_prefix = ""
for values in zip(*names):
    if len(set(values)) == 1:
        common_prefix += values[0]
    else:
        break
print(common_prefix)
gaunt flint
#

i cant get it

vocal basin
whole bear
#

It ask for nitro

vocal basin
#

because O(NlogN)

somber heath
whole bear
#

Yooooooooooo

red peak
#

Trie

vocal basin
gaunt flint
whole bear
#

Yooooooooooo

vocal basin
gaunt flint
#

i need a python old for pycharm it just have 3.11.3

#

oh yeh

#

oh yehhhhhhhh

#

oh my God

whole bear
# gaunt flint i dont know how to donload it not have donwload

Hello Everyone! Today in this video I am going to step-by-step guide you on How to install Python 3.11.1 on Windows 10/11. Windows (64-bit).

Geeky Script (
@GeekyScript) is Computer Science - Educational Videos Creator ๐ŸŽ‰
You can support by buying a coffee โ˜•๏ธ here โ€”
https://www.buymeacoffee.com/geekyscript

โœป I really hope you find this video u...

โ–ถ Play video
gaunt flint
#

oh yehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

Godddddddddddddddddddddddddddddd

#

yehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhi now get it

vocal basin
gaunt flint
#

yes yes yesssssssssss

whole bear
#

Yoooooooo

gaunt flint
#

Godddddddddddddddddddddd yooooooooooooo yessssssss oh my God

whole bear
#

My code is not going

gaunt flint
#

now just i need install

#

oh my God

somber heath
#

Actual text vs images of text is preferred.

gaunt flint
gaunt flint
vocal basin
#

trees have O(NlogN) cost of construction if you do it elemement-by-element

#

hashsets -- maybe O(N)

whole bear
#

what about this one?

vocal basin
whole bear
#

and this

def longestcommonprefix(strs):
    if not strs:
        return ""

    prefix = strs[0]
    total_word = len(strs)

    for i in strs[1:]:
        while i.find(prefix) != 0:
            prefix = prefix[:-1]
            if not prefix:
                return ""

    return prefix


name = ["flower", "flow", "flight"]
print(longestcommonprefix(name))
vocal basin
#

find is long

#

time-wise

whole bear
#

ohhh

#

and the os?

#

Broooooooooooooo help me

vocal basin
whole bear
vocal basin
whole bear
vocal basin
#

your variable is named rigthpaddle

whole bear
#

How

#

Traceback (most recent call last):

ong 0.1.py", line 96, in <module>

File "C:\Users\alio rodrigues\Pictures\Saved Pictures austin game New folder p if (ball.xcor ()>340) and (ball.xcor() <350) and (ball. ycor) () <rightpaddle. ycor()+4

0 and ball.ycor ()>'rightpaddle'.ycor ()-40: NameError: name 'rightpaddle is not defined. Did you mean: "rigthpaddle?

vocal basin
whole bear
#

They are same

vocal basin
#

rigthpaddle
rightpaddle

whole bear
#

Ok

red peak
#

Haha

whole bear
#

Broooooooooooooo

#

Help

vocal basin
#

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

whole bear
# vocal basin !resources

any video lectures to learn python data structure in detail with programe implementation using python?

vocal basin
#

I'd suggest using some other language to learn data structures

red peak
#

I don't think data structures need to be python specific.

whole bear
#

pen.write("player A:{} player B:".format(playerAscore, playerBscore), ali

gn='center', fnot= ('Arial', 24, 'normal')) TypeError: RawTurtle.write() got an unexpected keyword argument 'fnot'

whole bear
vocal basin
vocal basin
whole bear
vocal basin
#

for me it's easier to learn data structures when I have a specific task to solve with them

whole bear
vocal basin
#

"constants file"?

whole bear
#

Broooooooooooooo

#

yes brooooooooo XD

#

This time my paddles are not working

vocal basin
whole bear
vocal basin
#

I forgot what the arrows are supposed to mean

#

@red peak refactor, refactor, refactor

#

write tests to make sure nor you nor them break something

whole bear
#

well thnx for help gues gonna buy some course from codingninjas site

vocal basin
whole bear
somber heath
#

!zen

wise cargoBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

somber heath
#

!pep8

wise cargoBOT
#
PEP 8

PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.

More information:
โ€ข PEP 8 document
โ€ข Our PEP 8 song! :notes:

vocal basin
#

though that also posed some higher readability/understandability standards for me
(in cases when I myself was unable to make sure I write simple enough code)

whole bear
#

Exception in Tkinter callback

Traceback (most recent call last):

File "C:\Users\alio rodrigues\AppData\Local\Programs\Python\Python311-32\Lib\tkinter_init py", line 1945, in all return self.func(*args)

File "C:\Users\alio rodrigues\AppData\Local\Programs\Python\Python311-32\Libirurtle.py", line 700, in eventfu fun ()

TypeError: 'str' object is not callable

Traceback (most recent call last):

File "C:\Users\alio rodrigues Pictures Saved Pictures austin game New folder\pong 0.1.py", line 77, in <module> ball.seux (ball.xcor () +ballxdirection)

File "C:\Users\alio rodrigues \AppData\Local\Programs\Python\Python311-32\Lib\curele py", line 1809, in retx self. goto (Vec2D (x, self._position[1]))

File "C:\Users\alio rodrigues\AppData\Local\Programs\Python\Python311-32\Lib\turtle.py", line 3175, in goto

screen._point list (self, currentLineItem).

File "C:\Users\alio rodrigues\AppData\Local\Programs\Python\Python311-32\Lib\turtle.py", line 754, in point1ST

el self.cv.coords (item)

File "<string>", line 1, in coorda

File "C:\Users\alio rodrigues\AppData\Local\Programs\Python\Python311-32\Lib\rkinter_init_py", line 2022, in or args))]

self.tk.call(laelf. w, coord tkinter.TelError: invalid command name "canvas"

#

Wtf to do now

vocal basin
whole bear
#

What

vocal basin
#
                            |
                            |
                            V
line 77, in <module> ball.seux (ball.xcor () +ballxdirection)
                            ฮ›
                            |
                            |
whole bear
#

How to fix

vocal basin
#

just change ball.seux to ball.setx

#

what an interesting question

#

> barred lambda ฦ›, also called running man

#

(was searching for lambda to mirror the "V")

proper urchin
#

Hi

vocal basin
#

refactoring is almost never a one-line change

proper urchin
#

suppressed yert

vocal basin
#

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

vocal basin
#

even though it's one-thing-at-a-time, quite a lot of both refactoring actions and reasons to refactor correlate with more-than-one-line changes

#

example of first: method renaming
example of second: the method needs to be simplified (which often involves reducing the number of lines)

#

it's also important to recognise the difference between refactoring and rewriting

#

refactoring shouldn't change the observed behaviour

whole bear
#

File "C:\Users\alio rodrigues\AppData\Local\Programs\Python\Python311-32\Libirkanter init py", line 1948, in return self.func(*args) call

File "C:\Users\alie rodrigues\AppData\Local\Programs\Python\Python311-32\Labyturtle.py", line 709, in event fun

fun ()

TypeError: atr' object 13 not callable

vocal basin
#

is this the full traceback?

whole bear
#

Yes

#

My paddles are not working

#

Wait

vocal basin
#
window.onkeypress(leftpaddleup, 'w')
whole bear
#

It's coming blank

vocal basin
#

rewrite the code from scratch and make sure you can display at least one paddle
then make it move

#

only after that, add a second paddle

#

only after they both work, add the ball

whole bear
#

What scratch

vocal basin
#

from nothing

#

just rewrite it but less messy

#

each time you add a couple of lines, verify that they work

#

don't assume the code is working until you tested it

whole bear
#

Ok

vocal basin
#

this way you will catch simple errors like typos sooner

red peak
#

How about using a better IDE?

vocal basin
#

IDE will catch some errors

red peak
#

But using a good IDE helps catch errors a lot.

vocal basin
whole bear
red peak
#

Ya. But being able to understand errors is Step 1

vocal basin
#

stylistic and others

#

difference being:
for a beginner, it's easier to catch errors rather than something subtle

#

(manually)

whole bear
#

Broo

#

Is pip important

vocal basin
#

pep8?

#

or pip?

whole bear
#

Pip

vocal basin
#

pip is necessary to install packages

#

(for python)

whole bear
#

How to install

#

Pip

red peak
#

IDEs can teach a lot. Like style guide lines and stuff.
Something like doing if variable = 0: instead of ==
OR something like this one

vocal basin
vocal basin
whole bear
#

I don't know

red peak
#

pip -V

whole bear
#

I saw how to install it on YouTube

vocal basin
#

first check whether you have it

whole bear
#

How to check

vocal basin
#

run this in the terminal

pip
#

or this if you're using linux

pip3
whole bear
#

What is terminal

vocal basin
#

are you using Windows?

#

if yes, then use powershell

whole bear
#

Yes

vocal basin
whole bear
#

I got it

vocal basin
#

what are you trying to install with pip?

red peak
#

what if pip is installed in their venv

vocal basin
#

idk if there's an adequate way to have it venv-only

red peak
#

Yes, but python isn't accessible directly unless they have it in their path

vocal basin
vocal basin
whole bear
#

Ok

red peak
#

When installing python on windows the installer actually recommends to not put it in the path.
I don't have it either.

vocal basin
#

!e

from sys import executable
from subprocess import run
run([executable, "-m", "pip"])
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 
002 | Usage:   
003 |   /usr/local/bin/python -m pip <command> [options]
004 | 
005 | Commands:
006 |   install                     Install packages.
007 |   download                    Download packages.
008 |   uninstall                   Uninstall packages.
009 |   freeze                      Output installed packages in requirements format.
010 |   inspect                     Inspect the python environment.
011 |   list                        List installed packages.
... (truncated - too many lines)

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

vocal basin
vocal basin
whole bear
#

Ok

red peak
#

It would be so much easier if they could share their screen

vocal basin
#

why the hell is my file explorer at 7GB reserved memory

red peak
#

Maybe it loaded indexes because you were searching something?

vocal basin
#

I think it's video thumbnail stuff

red peak
#

Okay. That makes sense

vocal basin
#

it doesn't give up the memory for some reason

karmic obsidian
#

hey can anyone help me with creating a download button for downloading csv file , I am trying to make an api in python

#

I can share the code

#

??

vocal basin
karmic obsidian
whole bear
#

Yo

whole bear
vocal basin
karmic obsidian
#

!e
from flask import Flask, render_template, make_response
import SiteScraper
import csv
import io

app = Flask(name)

@app.route('/site', methods=['GET'])
def some_endpoint():
result = SiteScraper.yt_vedio()
scraped_data = result.yt_vedio_comment('https://www.youtube.com/watch?v=xxxxxxx')

# Create a CSV file in memory
csv_data = io.StringIO()
csv_writer = csv.writer(csv_data)
csv_writer.writerows(scraped_data)

# Create a response with the CSV file data
response = make_response(csv_data.getvalue())
response.headers['Content-Disposition'] = 'attachment; filename=youtube_comments.csv'
response.headers['Content-type'] = 'text/csv'

# Render the template with the download button
return render_template('download.html', download_url='/site', filename='youtube_comments.csv')

if name == 'main':
app.run()

#

here is the coded

vocal basin
karmic obsidian
#

SiteScraper

vocal basin
#

do you have the permission to do that?

karmic obsidian
vocal basin
#

!rule 5

wise cargoBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

karmic obsidian
#

Oh wait my bad I added that url

#

that should have been dummy

#

yeah done)

karmic obsidian
#

I know about this

#

I just want to build a button on my local host so that I can download a csv file , how to do that ?

red peak
#

Also you should have different endpoint to download the file and to view the download page.

karmic obsidian
red peak
#

your download endpoint should just return the response
return response
and your download page endpoint should render the html
return render_template('download.html')

karmic obsidian
#

Ohh didn't think of it I'll try it now thanks @red peak

somber heath
#

@humble dagger ๐Ÿ‘‹

#

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

somber heath
#

@obtuse rapids ๐Ÿ‘‹

obtuse rapids
#

thats quite difficult conditions๐Ÿ˜†

somber heath
#

@hybrid flax ๐Ÿ‘‹

hybrid flax
slate light
#

bye

fierce stratus
#

Alright, I will join later

somber heath
#

@patent slate ๐Ÿ‘‹

patent slate
#

hi

somber heath
#

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

patent slate
#

thanks

#

i k basic python

#

what to learn after that

somber heath
patent slate
#

gud๐Ÿ˜…

somber heath
#

Third party libraries, etc.

patent slate
#

ok

somber heath
#

Standard library modules

patent slate
#

ok will start there

#

i wanna learn electronics too do u know place where i can start

somber heath
#

#microcontrollers would be the closest to that subject here, but I'm going to say probably a different Discord server or other place.

patent slate
#

thanks

#

do u know any servers that help to learn the foundations of electronics

somber heath
#

No.

patent slate
#

k thanks anyways man/woman

#

I am not great at coding yet and want to do lot of code and learn more

#

what do u suggest i do

somber heath
#

Read documentation. Watch tutorial videos. Network with people.

#

Practice. Rest. Look after yourself.

patent slate
#

network with people?

somber heath
#

Talk.

patent slate
#

ok

#

where do i read documentation from

somber heath
patent slate
#

ok thanks

#

any tutorials that u will recommend

#

i do

karmic obsidian
sharp urchin
#

hello

#

its going pretty good

#

wby?

karmic obsidian
#

hey @somber heath can you help me with creating an api in python

#

yeah

#

exactlyyyy

#

There is a python module , which I just have to create an endpoint to download csv file scrapped from youtube

#

api (application programming interface ) it is a level of abstraction which programmers hide away the complexity of a given method

#

This is what Ik of api

#

maybe I am wrong

#

!e
`from flask import Flask, render_template, make_response
import SiteScraper
import csv
import io

app = Flask(name)

@app.route('/site', methods=['GET'])
def some_endpoint():
result = SiteScraper.yt_vedio()
scraped_data = result.yt_vedio_comment('https://www.youtube.com/watch?v=xxxxx')

# Create a CSV file in memory
csv_data = io.StringIO()
csv_writer = csv.writer(csv_data)
csv_writer.writerows(scraped_data)

# Create a response with the CSV file data
response = make_response(csv_data.getvalue())
response.headers['Content-Disposition'] = 'attachment; filename=youtube_comments.csv'
response.headers['Content-type'] = 'text/csv'

# Render the template with the download button
return render_template('download.html', download_url='/site', filename='youtube_comments.csv')

@app.route('/download', methods=['GET'])
def download_endpoint():
result = SiteScraper.yt_vedio()
scraped_data = result.yt_vedio_comment('https://www.youtube.com/watch?v=xxxxxxx')

# Create a CSV file in memory
csv_data = io.StringIO()
csv_writer = csv.writer(csv_data)
csv_writer.writerows(scraped_data)

# Create a response with the CSV file data
response = make_response(csv_data.getvalue())
response.headers['Content-Disposition'] = 'attachment; filename=youtube_comments.csv'
response.headers['Content-type'] = 'text/csv'

return response

if name == 'main':
app.run()`
here is the code I am trying to create two endpoints where /site is for actaully scrapping the data and /download is for downloading that scrapped data as csv

#

I get internal server error when I get to /site endpoint

#

idk and I can't figure it out why

#

@somber heath do you have suggestions or any tutorial on how to resolve this issue ?

wind raptor
#

!rule 5

wise cargoBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

karmic obsidian
#

I am doing to just for a personal project so that I can analyse the comment section

#

btw is it illegal to scrap publically available data from yt?

wind raptor
#

Yeah, I recommend going through their API

karmic obsidian
#

I am talking of actuall legallity

wind raptor
#

It's against their Terms Of Service

karmic obsidian
wind raptor
#

So by rule 5, we can't help

karmic obsidian
wind raptor
#

Correct

karmic obsidian
#

got it

#

classic leetcode question

#

all possibel what ?

#

is 987 good ?

#

8765 is good right ?

zenith radish
#

1,2,3,4,2

vocal basin
#

listening

#

non-overlapping?
or all sequences?

vocal basin
#

@midnight agate
something like that?
(as far as I understood what the task was about)
allowed/total can be changed to alter the behaviour as necessary

def allowed(delta):
    return delta in [-1, 1]

def total(sequence):
    return sum(y * (i+1) * (len(sequence)-i) for i, y in enumerate(sequence))

def sequence_sums(arr):
    arr = iter(arr)
    last = next(arr)
    sequence = [last]
    last_delta = None
    for x in arr:
        delta = x - last
        if last_delta is None or delta == last_delta and allowed(last_delta):
            sequence.append(x)
        else:
            yield total(sequence)
            sequence = [last, x] if allowed(delta) else [x]
        last = x
        last_delta = delta
    yield total(sequence)

def solution(arr):
    return sum(sequence_sums(arr))
dense ibex
#

!e
print("opal deez nuts"

wise cargoBOT
#

@dense ibex :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 1
002 |     print("opal deez nuts"
003 |          ^
004 | SyntaxError: '(' was never closed
dense ibex
#

10x developer

rugged root
#

LP's new employees

#

@willow lynx Yo

#

That's.... a good question

#

I'm not sure if we have something listed on our resources page

#

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

rugged root
#

HA, that sounds like most courses I've had

slate light
red peak
#

Can I access the function parameter in the decorator?

import structlog
logger = structlog.get_logger(__name__)

@structlog.contextvars.bound_contextvars(a=a)
def foo(a):
  logger.error("hello")
  return a

foo(5)
#
@structlog.contextvars.bound_contextvars(a=b)

NameError: name 'b' is not defined

rugged root
#

You can't directly

#

Wait

#

Wait is structlog a built-in?

red peak
#

Nope

rugged root
#

Yeah, I legit didn't realize that it was a .org

#

Hmm

lucid blade
#

@rugged root @wind raptor @zenith radish ^

#

great article / read

red peak
#

Is it possible to create a list from the values of a literal type?

from typing import Literal
FooType = Literal["foo", "bar", "baz"]

values = list(FooType)
#

Or the other way around?

rugged root
#

Good question...

red peak
#
list(FooType.__args__)
#

I think I figured it out though

rugged root
#

That feels dirty

#

But probably

wind raptor
rugged root
#

So when you say literal types

#

I guess I'm confused what you mean

#

Oh right, looking now

#

Just found it

dense ibex
wind raptor
#

Same. I can never remember what uses Python, let alone the different libraries

rugged root
#

Now it should be taken with a grain of salt, though

#

They could be used in smaller bits by one or two teams in the entire company

dense ibex
#

Im honestly surprised instagram still uses it

#

since they were acquired by meta

rugged root
#

Eh, if it works it works

dense ibex
#

true

rugged root
#

"If it ain't broke don't fix it"

dense ibex
#

was just about to say that KEKW

rugged root
#

Chris

red peak
#

How can you get optimized database queries using django?

rugged root
#
from typing import Literal

NewType = list[Literal["a", "b", "c"]]
#

I think

wind raptor
rugged root
#

In regards to the thing above

rugged root
#

@red peak Realized just now that you were the one asking about it.

red peak
rugged root
#

Fair point

slate light
lucid blade
#

AND ARDUINO ETC *caps

rugged root
#

@amber raptor Yo

somber heath
#

S'mores' law.

rocky dome
rugged root
#

Cross-classes as a bard

wind raptor
slate light
rocky dome
wind raptor
#

I almost become a monk at one point though. I was pretty close haha.

rocky dome
#

uh

lucid blade
#

i bet that kali distro is slow n klunky ๐Ÿ˜„

rugged root
#

I genuinely didn't know that

lucid blade
#

lol

wind raptor
rugged root
lucid blade
#

lol

#

if u need kali stickers holla ๐Ÿ˜›

#

๐Ÿ˜‰

wind raptor
#

I seriously considered it

lucid blade
#

its liberating

rocky dome
lucid blade
#

nooooooooooooooooooooooooo

rocky dome
#

is it really a*s

lucid blade
#

lol

#

kali is cool

#

but learn to use debian and build shit from source etc

rugged root
lucid blade
#

drivers / locations

rugged root
#

If at all

lucid blade
#

every newb installs kali

rocky dome
#

lmao isnt it werid when no one agrees with ur opinions in a voice call ๐Ÿคฃ

rocky dome
lucid blade
#

every pro haxor ik doesnt run kali

#

๐Ÿ˜„

#

nor unbuntu ๐Ÿ˜

#

lol

#

๐Ÿ˜„

rugged root
rocky dome
lucid blade
#

ahh cool

#

mine was mandrake?

#

(debian)

rocky dome
#

ohh

wind raptor
rugged root
#

@slate light Moved you because your mic was open and didn't think you'd want home conversation getting broadcast

lucid blade
#

i didnt have a clue what i was doing

#

had to spend 3 days rebuilding my windows install lol

rugged root
rocky dome
#

i have some sort of partitions issue despite i have extra 80gb for kali so icant install it : |

lucid blade
#

ubuntu was good up to 11.04

rugged root
#

All good all good

wind raptor
lucid blade
#

then i used crunchbang linux for a while

rugged root
rocky dome
#

@rugged root u are good at multitasking ๐Ÿ˜… mans talk and chats at the same time

#

man talks*

lucid blade
#

chrunch bang was awesome

#

learn loads using that

lucid blade
#

#!

#

CrunchBang Linux (abbreviated #!) was a Linux distribution derived from Debian by Philip Newborough (who is more commonly known by his username, corenominal).
CrunchBang was designed to use comparatively few system resources. Instead of a desktop environment it used a customized implementation of the Openbox window manager. Many of its preinstal...

wind raptor
whole bear
#

yes i use one ๐Ÿ˜ญ

somber heath
#

Be sure to check the pins.

amber raptor
rugged root
#

I was saying hello

gentle flint
#

hello

rugged root
#

It's so weird, my google-fu is failing me

#

I can't find the Windows ISO

#

Yo, oof

rugged root
#

That sends me directly to the .exe

rugged root
#

Oh my god it redirects

gentle flint
#

this should send you to the iso

rugged root
#

That would be why I can't get it

gentle flint
#

yes

#

lol

rugged root
#

Well at least I'm not crazy

gentle flint
#

on my android and linux it redirects to the iso

rugged root
#

I guess that makes sense

slate light
rugged root
somber heath
#

@zenith radish

#

@rugged root

#

It's got Mark Hamill.

rugged root
#

Love that man

#

Yeah, this would be a USB condom:

slate light
#

Level up your desk game! Check out the Secretlab Magnus Desk Pro: https://lmg.gg/kdg6f

Play Crusader Kings 3 this weekend starting May 11th: https://lmg.gg/CK3CS

The Rubber Ducky? Basic. The Flipper Zero? Childโ€™s play. This is the O.MG Cable, a stealthy, powerful hacking tool that allows the attacker to log your keystrokes, access your device,...

โ–ถ Play video
zenith radish
rugged root
#

!pip requests

wise cargoBOT
rugged root
#

Good ol' asdf films

lucid blade
#

i like trains

slate light
rugged root
frail jetty
#

@somber heath hey there

rugged root
#

"Legal interventions"

#

Interesting way to put it

#

Neat

red peak
#

Is there a better way to do this?

if int(value) == float(value):
  value = int(value)
rugged root
#

@tidal shard You had a weird buzzing coming from your mic so I scooted you down

rugged root
#

Oh actually

#

Eh, that seems like the most reasonable way to do it

#

Was thinking you could change it with a ternary or walrus operator

#

Oh oh oh oh

red peak
#

Actually just looked into it. It is being done that way because it is being used both for comparison and for displaying it in the view.

rugged root
#

Makes sense

limpid umbra
#

its the information age ................................wheeeeee

somber heath
#

Maybe?

rugged root
#

I..... have never thought of that

#

Wait that doesn't work

somber heath
#

No?

rugged root
#

Wait

#

No no no you're right

#

I was thinking incorrectly

somber heath
#

Precedence?

red peak
#

Maybe we could always store it as float. And for displaying, use some string formatting?
What's the formatting that automatically omits decimal if it's all 0
like 1.00 prints as 1
and 1.21 prints as 1.21

ivory flower
#

equality check with int and float ?

rugged root
#

That's what was done originally

opaque scroll
rugged root
#

That was my original thought

somber heath
#
value = (value if value % 1 else int(value))```
rugged root
#

I just wasn't sure what the condition was if they weren't equal

#

Like do we know what type the value is going to be coming in?

red peak
#

It's always float

rugged root
#

Then casting to float is redundant

#

But yeah, you can always just do string formatting

red peak
#

Oh yes.

ivory flower
#

if precision loss is acceptable, string formatting is ok.

rugged root
#

Converting to int would drop everything after the decimal anyway

red peak
#

We have logic in place to reduce to precision to only 2 floating points. So, 1.0001 gets converted to 1.00

rugged root
#

I'm wrong, f-strings will round

ivory flower
#

2 digits remained in fractional part, ok

rugged root
#

!e

ham = 1.4
pork = 1.5
print(f"{ham:.0f}")
print(f"{pork:.0f}")
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 1
002 | 2
rugged root
#

I did not realize that

limpid umbra
#

nicotine addiction - ruin duck meat

#

tobacco + peanuts = insecticide , belly ache , ohhh no peanut allergies

red peak
#

!e

print(f"{1.00:1g}")
print(f"{1.02:1g}")
wise cargoBOT
#

@red peak :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 1
002 | 1.02
red peak
#

This works

rugged root
#

Wait what's g?

lucid blade
red peak
#

https://docs.python.org/3/library/string.html#format-specification-mini-language

General format. For a given precision p >= 1, this rounds the number to p significant digits and then formats the result in either fixed-point format or in scientific notation, depending on its magnitude. A precision of 0 is treated as equivalent to a precision of 1.

The precise rules are as follows: suppose that the result formatted with presentation type 'e' and precision p-1 would have exponent exp. Then, if m <= exp < p, where m is -4 for floats and -6 for Decimals, the number is formatted with presentation type 'f' and precision p-1-exp. Otherwise, the number is formatted with presentation type 'e' and precision p-1. In both cases insignificant trailing zeros are removed from the significand, and the decimal point is also removed if there are no remaining digits following it, unless the '#' option is used.

With no precision given, uses a precision of 6 significant digits for float. For Decimal, the coefficient of the result is formed from the coefficient digits of the value; scientific notation is used for values smaller than 1e-6 in absolute value and values where the place value of the least significant digit is larger than 1, and fixed-point notation is used otherwise.

Positive and negative infinity, positive and negative zero, and nans, are formatted as inf, -inf, 0, -0 and nan respectively, regardless of the precision.

rugged root
#

Huh, I'll be damned

limpid umbra
#

my uncle was dying of stage 4 bone cancer , his wife didnt seem to notice --- while he was in final stage in a hospice , she was playing bingo --- he spent his last hours asking where his wife was --- he spent a lifetime paying for everything , she spent her money on fun -- this reflects old and new age females

rugged root
#

I think it reflects on the person, not the gender or era

#

My wife had sepsis before I really knew her. Her boyfriend at the time rarely ever visited, still racked up debt, etc.

limpid umbra
#

its more common than you think - go talk to a divorce lawyer - he / she sees the remains on the battle field

rugged root
#

I think it's unfair to generalize it like that

#

And narrow minded to do so

limpid umbra
#

its not general - it just exists - there are some little gems out there -

rugged root
#

There are gems about both

#

The vibe you're giving off with claiming this is incredibly sexist

lucid blade
rich mist
#

lol

limpid umbra
#

doesnt stackoverflow ban AI ?

thorn wharf
#

ai generated responses yes i think

#

how about now

#

no typing sound

rugged root
#

Perfect

#

Yeah you're golden

#

The difference is night and day

thorn wharf
#

and no chip crunch

rugged root
#

Bingo

red peak
#

Also found this in the source code

if digits == 1: # converts values `1.0000001` to 1
  result = round(result * 10 ** (3 - digits)) / (10 ** (3 - digits))

which is basically.

if digits == 1: # converts values `1.0000001` to 1
  result = round(result * 100) / 100
limpid umbra
#

i cant see how you can have a stand alone box in the corner - running a AI - i keep thinking you need a super machine

rugged root
#

!e

print(round(1.5))
print(round(2.5))
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 2
002 | 2
stuck furnace
#

Banker's rounding?

#

Round .5 to the nearest even number.

#

So that it's not as biased positively or negatively.

lucid blade
stuck furnace
#

No worries ๐Ÿ˜„

lucid blade
#

Extremely well-preserved mosaics of a Roman villa discovered under a vineyard in Negrar, Italy.
Photo by Comune di Negrar di Valpolicella

red peak
#

How do you write doc tests for class methods?

class Foo:
  def bar(self, x):
  """
  >>> bar(1)
  1
  """
    return x
lucid blade
stuck furnace
lucid blade
stuck furnace
#

Yeah it's snappy

rugged root
#

I'm so surprised

stuck furnace
#

My very educated mother just served us nine pancakes

gentle flint
#

my very early morning just started under nancy's pancake

#

@rugged root My very educated mother just served us nachos

stuck furnace
#

๐Ÿ˜”

gentle flint
rugged root
#

Mike's Vulgar Easter Morning Jubilee Scared Uncle's Nuns

somber heath
#

Most velociraptors eat meat jerky...

red peak
#

!e

from itertools import cycle
list(cycle([1]))
whole bear
#

Yooooo

somber heath
#

itertools.repeat

lucid blade
keen ingot
#

help me get to 50 msg

#

so

#

what came first egg or chicken

red peak
#

I think it needs to 50 different message blocks? Or is it 50 different messages?

lucid blade
red peak
#

You can use !user to see how many messages you have so far

rugged root
#

During the transition, all Discord users will be asked to choose a new username, and access will roll out slowly over the course of several months. We want to be particularly considerate of longtime Discord users who have had their usernames for quite awhile, so we will be assigning priority to choose your new username based on when you registered for Discord. In terms of rollout, weโ€™re starting with access to owners of partner and verified servers, then to all users based on the age of their account in the coming months, starting with 2015. Current Nitro subscribers paying for the ability to customize their discriminator that registered for Nitro on or before March 1, 2023 will also be given early access.

gentle flint
gentle flint
lucid blade
rugged root
lucid blade
rugged root
#

Welcome to english hell

somber heath
#

Shaun Patrick Micallef (; born 18 July 1962) is an Australian comedian, actor, writer and television presenter. He is currently the host of the satirical news comedy series Shaun Micallef's Mad as Hell on the ABC. He also hosted the game show Talkin' 'Bout Your Generation on Channel 10.
Micallef first gained recognition as a cast member of the s...

lucid blade
verbal zenith
terse needle
amber raptor
verbal zenith
terse needle
rugged root
#

@little citrus What's your questions?

stuck furnace
#

"Protected" bike lanes on the new 6th street viaduct in LA ๐Ÿ˜”

#

They also double as a hard shoulder!

#

They could have put the concrete barrier on the other side of the bike lane ๐Ÿ˜”

molten pewter
#

brb

gentle flint
stuck furnace
#

Tram tracks are also pretty dangerous for cyclists ๐Ÿ˜„

gentle flint
#

true

#

unless you have terrain tyres or smth

molten pewter
#

???

stuck furnace
#

Like clockwork orange pithink

#

What version of linux is your coffee machine running?

slate light
gentle flint
#

that depends how hard you hit

stuck furnace
#

Did you know the first use of a webcam was to monitor a coffee pot?

gentle flint
#

yes

stuck furnace
#

Fair enough ๐Ÿ˜„

molten pewter
stuck furnace
#

Wdym?

#

Ah right. What's your major?

gentle flint
#

northern italy rn

terse needle
gentle flint
#

yeah no shit

rugged tundra
red peak
#

So, I need to write a description for this function.

>>> round_value(1234)
1200
>>> round_value(1264)
1250
>>> round_value(128)
125

round_value rounds the number to the closest multiple of 5 less than the number?

trail sluice
#

Hello Iโ€™m new here how does this place work?

rugged tundra
#

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

gentle flint
molten pewter
rugged root
#

!d collections.Counter

wise cargoBOT
#

class collections.Counter([iterable-or-mapping])```
A [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter") is a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "dict") subclass for counting [hashable](https://docs.python.org/3/glossary.html#term-hashable) objects. It is a collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter "collections.Counter") class is similar to bags or multisets in other languages.

Elements are counted from an *iterable* or initialized from another *mapping* (or counter):

```py
>>> c = Counter()                           # a new, empty counter
>>> c = Counter('gallahad')                 # a new counter from an iterable
>>> c = Counter({'red': 4, 'blue': 2})      # a new counter from a mapping
>>> c = Counter(cats=4, dogs=8)             # a new counter from keyword args
verbal zenith
rugged root
terse needle
molten pewter
fierce stratus
#

btw, when we install any pip libs, and if 'x' lib is built on top of 'y' lib and you install 'z' lib and it also built in on top of 'y' lib. does pip install 'y' lib two times for 'x' own and for 'z' its own?

rugged root
#

Just the once

molten pewter
rugged root
#

So let's say spam and pork import ham. So long as the version that spam and pork need of ham are within the same ranges, then you're good

#

If that makes sense

#

Like spam needs ham to be version >= 4.0 but pork needs ham to be version <= 3.9 then you'll have an issue

#

Because it won't download both

#

You'd have to manage that conflict in a different way

molten pewter
rugged root
#

I feel like you'd get a hand cramp from that after a while as well

rugged root
zenith radish
#

Pants

rugged root
#

@mild quartz @rugged tundra was wondering who you consider (or if you consider there to be one) the father/mother or godfather/godmother of machine learning

#

I argue it's not folks from the current millennia

zenith radish
#

Fuckin resident evil jacket

#

Lesgoo

rugged root
#

Love it

#

I'd wear that

fierce stratus
rugged root
#

Although you could probably get those patches and sew them on for way less

rugged root
#

If memory serves

zenith radish
#

It was like 20 bucks which like yeah fair

rugged root
#

Oh yeah at that price

zenith radish
zenith radish
#

Cool pants

molten pewter
zenith radish
molten pewter
#

๐Ÿ•Š๏ธ โ˜ฎ๏ธ out

zenith radish
terse needle
zenith radish
terse needle
#
user=> (html [:ul
               (for [x (range 1 4)]
                 [:li x])])
"<ul><li>1</li><li>2</li><li>3</li></ul>"
zenith radish
frail jetty
frail jetty
#

@zenith radish are you an artist

zenith radish
#

I wouldn't say so

frail jetty
#

did you make those clothes designs

rugged root
#

They did not, no

frail jetty
#

@zenith radish you work at microsoft?

rugged root
#

Random people that then decided to sell them on some online thrift shop thing

frail jetty
#

i am an aspiring software engineer for a front end role. i am working very hard to become like you guys

#

is there any advice that you guys have for a junior

#

/ beginner

#

I am based in South Africa

rugged root
frail jetty
#

i am willing to sell my soul lol

zenith radish
limpid umbra
#

yes i hear the accent - yes Germans can be funny

ember knot
#

meep

exotic vigil
#

Hi

#

What is going on here?

#

walkabout?

#

@somber heath @elder knot What is going on here guys?

#

oh

#

XD

#

I mean I have nothing to do with this conversation.๐Ÿ˜• I have never been out of my country

somber heath
#

@trail wadi ๐Ÿ‘‹

trail wadi
#

hello

#

im a beginner in coding, and wanted to try Python

somber heath
#

@elder knot

elder knot
#

yessir

exotic vigil
#

welcome!

somber heath
#

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

elder knot
somber heath
#

@fervent plaza ๐Ÿ‘‹

fervent plaza
#

hello

#

thank you

exotic vigil
#

@fervent plaza hi!

fervent plaza
#

ok imi do that now

#

not eligible have not posted 50 times

#

yeah i get it hopefully i will get it eventually

#

ya me nether

#

can i share some code i wrote here for review

exotic vigil
#

sure

somber heath
#

!code

wise cargoBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

fervent plaza
#
import time
import json  
import random 
from pyfiglet import Figlet # http://www.figlet.org/figlet-man.html
import os

# print welcome message to my amazing game
f = Figlet(font='slant')
os.system("color 0a") # color change 
print(f.renderText("Speed Speller))
time.sleep(2)
os.system('cls' if os.name == 'nt' else 'clear') # clear screen



# open json file and load it into a variable
with open("easy.json", "r") as words_dictionary:
    data = json.load(words_dictionary)

# score counting 
correct = 0 
wrong = 0
total = 0

# Create a text to speech engine
engine = pyttsx3.init()

# Convert the text to speech and play it through the computer speakers # Select a random key from the JSON object and say it 
# http://www.gwicks.net/justwords.htm
# configs 
engine.setProperty("rate", 110) # speed of computer recomended 90 - 110

while True:
    total += 1
    # Select a random key from the JSON object and say it
    random_word = random.choice(list(data["commonWords"])) # list(data.keys()) for json file with keys
    # say the word
    engine.say(random_word) 
    engine.runAndWait() 
    # starting timer not here yet 
    
    # ask user to type the word if correct add 1 to correct if wrong add 1 to wrong
    if str(input()) == random_word:
        # timer end print time taken
         # timer end
        correct += 1
        print('Correct!')
        os.system("color 0a") #changes color 
    else:
         # timer end
        wrong += 1 
        print('Wrong! The correct spelling is: ' + random_word)
        os.system("color 0c") #changes color 
    if total == 25: # if total is met end game 
        break

# print score and thank user for playing 
os.system("color 07") #changes color back to defult 
print('Thanks for playing!')
print('You got ' + str(correct) + ' correct out of ' + str(total) + ' words! thats ' + str(correct/total*100) + '%')

    



#

right if there using Linux then it wont work

somber heath
#

ANSI escape sequences

#

Colorama

fervent plaza
#

ya colorama looks like a winner for me i will implement it thanks

#

bless you

#

yeah thanks a lot

#

ok

#
  "a": 1,
  "aa": 1,
  "aaa": 1,
  "aah": 1,
  "aahed": 1,
  "aahing": 1,
  "aahs": 1,
  "aal": 1,```
#

this is what the other file looks like where i used the commented code

#

ok wont str() it

#

oh ya i should do that

#

ya it would be better

#

i made the while true before the break existed

somber heath
#

!e py name = 'Peter' age = 17 print('Hello, ' + name + '. You are ' + str(age) + ' years old.')

wise cargoBOT
#

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

Hello, Peter. You are 17 years old.
somber heath
#

!e py print('abc', 123, 'def', 678)

fervent plaza
#

ok

wise cargoBOT
#

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

abc 123 def 678
somber heath
#

!e py print('abc', 123, 'def', 678, sep='***')

wise cargoBOT
#

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

abc***123***def***678
fervent plaza
#

oh thats cool

somber heath
#

!e py print('abc', 123, end='&&&')

wise cargoBOT
#

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

abc 123&&&
fervent plaza
#

ok but i can add my own /n

somber heath
#

!e py print('abc', end='') print('def')

wise cargoBOT
#

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

abcdef
fervent plaza
#

\n

#

right

somber heath
#

!e py name = 'Peter' age = 17 print(f'Hello {name}. You are {age} years old.')

wise cargoBOT
#

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

Hello Peter. You are 17 years old.
fervent plaza
#

yeah

#

going to make it a formatted print

somber heath
#

!e py print('abc {} def {}.'.format(123, 'ABC'))

wise cargoBOT
#

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

abc 123 def ABC.
fervent plaza
#

looks a lot better now

#

what is that

somber heath
#

!d import

wise cargoBOT
#

7.11. The import statement


import_stmt     ::=  "import" module ["as" identifier] ("," module ["as" identifier])*
                     | "from" relative_module "import" identifier ["as" identifier]
                     ("," identifier ["as" identifier])*
                     | "from" relative_module "import" "(" identifier ["as" identifier]
                     ("," identifier ["as" identifier])* [","] ")"
                     | "from" relative_module "import" "*"
module          ::=  (identifier ".")* identifier
relative_module ::=  "."* module | "."+
```...
vocal basin
#

depends on what you use headers for

#

!e

import math
print(math.sqrt(4))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

2.0
somber heath
#

!e py import random print(random.randint(1, 6))

wise cargoBOT
#

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

3
fervent plaza
#

if i wanted to to a keypress while in the loop always is there a libs for that

somber heath
#

keyboard or pynput

vocal basin
#

you'd have to read it instead of including it

vocal basin
fervent plaza
#

std::cout << std::sqrt(4) << endl; what does this do

#

think im going to use keyboard lib

vocal basin
#

std::cout << generally does what print does

fervent plaza
#

ok

vocal basin
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

2.0
vocal basin
#
stdout.write(str(math.sqrt(4)))
```equivalent of 
```c++
std::cout << std::sqrt(4)
fervent plaza
#

looks like print

vocal basin
#
stdout.write("\n")
stdout.flush()
```equivalent of 
```c++
std::cout << std::endl
fervent plaza
#

equivalent of print?

vocal basin
#

mostly

#

print in Python by default does quite a lot of stuff

fervent plaza
#

ok so like print but with less futures

somber heath
#

!d print

wise cargoBOT
#

print(*objects, sep=' ', end='\n', file=None, flush=False)```
Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments.

All non-keyword arguments are converted to strings like [`str()`](https://docs.python.org/3/library/stdtypes.html#str "str") does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be `None`, which means to use the default values. If no *objects* are given, [`print()`](https://docs.python.org/3/library/functions.html#print "print") will just write *end*.

The *file* argument must be an object with a `write(string)` method; if it is not present or `None`, [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout "sys.stdout") will be used. Since printed arguments are converted to text strings, [`print()`](https://docs.python.org/3/library/functions.html#print "print") cannot be used with binary mode file objects. For these, use `file.write(...)` instead.
fervent plaza
#

what happened to the audio

vocal basin
#

as far as I understand how it works

import sys

def print(*objects, sep=' ', end='\n', file=None, flush=False):
    if file is None:
        file = sys.stdout
    file.write(sep.join(map(str, objects)))
    file.write(end)
    if flush:
        file.flush()
#

not sure how many writes it actually does

fervent plaza
#

ok just making sure its not my side

vocal basin
#

!e

class FakeFile:
    def write(self, *args):
        print('writing', repr(args))

print(1, 2, 3, file=FakeFile())
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | writing ('1',)
002 | writing (' ',)
003 | writing ('2',)
004 | writing (' ',)
005 | writing ('3',)
006 | writing ('\n',)
vocal basin
#

oh

#

!e

import sys

def print(*objects, sep=' ', end='\n', file=None, flush=False):
    if file is None:
        file = sys.stdout
    started = False
    for object_ in objects:
        if started:
            file.write(sep)
        file.write(str(object_))
        started = True
    file.write(end)
    if flush:
        file.flush()

class FakeFile:
    def write(self, *args):
        print('writing', repr(args))

print(1, 2, 3, file=FakeFile())
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | writing ('1',)
002 | writing (' ',)
003 | writing ('2',)
004 | writing (' ',)
005 | writing ('3',)
006 | writing ('\n',)
vocal basin
#

"social values"

#

eh, probably the domain would have it worded differently

elder knot
#

What do you guys think?

fervent plaza
#

i heard about .zip Doman names

vocal basin
#

I only know .lnk as a file format (not .ink)

#

and I know it only as far as "please take it away from me, it's awful, I hate Windows"

fervent plaza
#

ya as a shortcut

vocal basin
#

there are different types of mathematics

#

the institution-level certification is not only about knowing a specific domain

#

Fortran is still okay for maths

#

with its bindings to Python now especially

#

vim is just an easy-to-use cli-based editor, as far as I see it

#

just learn Rust and suffer in adequate ways rather than segfaulting

#

manual memory management is a valuable experience but it's not something you'd want to use on a regular basis

#

even OSes have layers of indirection between what they commonly do and actual memory management

#

don't forget Unix

#

heard Arch mentioned, but idk if it's ever used server-side

#

my ignorance of "how Arch" and "what Arch" is surprising even to me

#

I have two separate computers for Windows and Linux

#

(latter being accessed from the former by ssh)

#

I try to avoid most of the distribution-specific stuff

#

(by moving the workflow into docker as much as possible)

#

I can't use ChatGPT
which is a benefit

fervent plaza
vocal basin
#

they're on the same local network

#

but I can use a VPN

#

I have a self-deployed one

fervent plaza
#

cool rasberry pi

#

?

vocal basin
#

it's not ARM, it's x86-64

#

Odroid H2 specifically

#

that one is no longer sold

#

+connecting SSDs to it is a nightmare

elder knot
#

Thanks Alisa.

fervent plaza
#

i wanted an odroid very cool

vocal basin
fervent plaza
#

does it have an m.2

vocal basin
#

yes

vocal basin
#

note the very unusual (for sata power) connector

fervent plaza
#

ya that is a very weird sata power cord never saw one of those

#

you could power it externally mb

vocal basin
#

this is not what SATA drives are usually powered from
because it's normally only for fans/other relatively low-power devices

fervent plaza
#

ya i would just get an external power for it

whole bear
#

I can't speak

#

waiting for speaking privileges

#

@fervent plaza

#

@elder knot

#

@vocal basin Totally different guy then Farzin

#

i'm a different person

#

yeah, that guy got banned

#

i think

elder knot
#

SATA cords.. why do you need them?

whole bear
#

SATA cords, what are they good for, absolutely nothing, say it again ๐ŸŽต

vocal basin
whole bear
#

@elder knot

#

Hey guys, I'm a funny guy, therefore do you want to be my friend?

#

spotify is for normies

fervent plaza
whole bear
#

fully based people use torrents