#voice-chat-text-0

1 messages · Page 896 of 1

rocky kiln
#

@vivid palm nice new colour

wary magnet
#

@molten pewter I started learning python. In your opinion, do you think it is an easy coding language to learn?

frigid shard
#

@muted belfry

class Solution(object):
    def intToRoman(self, num):
        i = ''
        if num // 1000 != 0:
            i += 'M' * (num // 1000)
            num %= 1000
        if num // 100 == 9:
            i += 'CM'
            num %= 100
        elif num // 500 != 0:
            i += 'D' * (num // 500)
            num %= 500
        if num // 100 != 0:
            if num // 100 == 4:
                i += 'CD'
            else:
                i += 'C' * (num // 100)
            num %= 100
        if num // 10 == 9:
            i += 'XC'
            num %= 10
        elif num // 50 != 0:
            i += 'L' * (num // 50)
            num %= 50
        if num // 10 != 0:
            if num // 10 == 4:
                i += 'XL'
            else:
                i += 'X' * (num // 10)
            num %= 10
        if num == 9:
            i += 'IX'
            num %= 1
        elif num // 5 != 0:
            i += 'V' * (num // 5)
            num %= 5
        if num // 1 != 0:
            if num // 1 == 4:
                i += 'IV'
            else:
                i += 'I' * num
            
        return i
gloomy vigil
#

@muted belfry check dms

haughty pier
#
class Solution:
    def intToRoman(self, num: int) -> str:
        return mapping(num)
    
    
def mapping(n):
    p = partition(n)
    return assemble(p)
    
def partition(n):
    places = []
    while n:
        places.append(n % 10)
        n //= 10
    return places

def assemble(p):
    s = ''
    for place, (i, v, ix) in zip(p, IVIXs):
        if not place:
            continue
        elif 0 < place < 4:
            s = place*i + s
        elif place == 4:
            s = i+v + s
        elif place == 5:
            s = v + s
        elif 5 < place < 9:
            s = v + i * (place%5) + s
        elif place == 9:
            s = ix + s
    return s

IVIXs = [
    "I V IX".split(),
    "X L XC".split(),
    "C D CM".split(),
    "M _ _".split()
]
#

@frigid shard what do you think? ^^^

haughty pier
muted belfry
molten pewter
muted belfry
#

seems like brute force

haughty pier
lilac vector
#

Hello everyone, guys, please tell me normal colleges for programmers, otherwise I'm already 15 and I think just go to college after the 9th grade.

minor crow
#

is it a good idea to mess around with selenium to make an auto clicker with logic

#

or is it illegal?

burnt plaza
rugged root
#

Like if it's for Cookie Clicker probably fine

#

But if you're doing it to automate purchasing on a store site or generating a bunch of user accounts yeah

#

That's going to be against the Terms of Service of those sites

lilac vector
#

This is bad

#

More precisely sorry

rugged root
#

?

wise cargoBOT
#

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

burnt plaza
#

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

pale yoke
#

!unmute 383609115722907650

wise cargoBOT
#

:incoming_envelope: :ok_hand: pardoned infraction mute for @frank verge.

pale yoke
#

Please don't type broken messages, it spams the chat.

lilac vector
# rugged root ?

I meant it would be great if the clicker could be used everywhere

burnt plaza
pale yoke
rugged root
#

Sure. And in theory you could, but you have to abide by the ToS or risk your account being revoked or whatever other things they mention in it

#

And we will not assist with things that break the ToS of other services

#

!rule 5

wise cargoBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

lilac vector
#

And I'm sorry, it was just interesting

rugged root
#

I'm not upset, just letting you know

lilac vector
#

All bye bye

burnt plaza
#

guys

#

is there a book with only exercises in python?

opal crater
#

ok

wintry pier
#

🥳

flat sentinel
wintry pier
#

👀 👍

past pawn
#

hello snow

past pawn
#

```py
print("hello world!")
```

loud raptor
#

thats my code @past pawn

past pawn
#

@mild pulsar i think this one's a bit out of my league

#

!d tkinter

wise cargoBOT
#

Source code: Lib/tkinter/__init__.py

The tkinter package (“Tk interface”) is the standard Python interface to the Tcl/Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, including macOS, as well as on Windows systems.

Running python -m tkinter from the command line should open a window demonstrating a simple Tk interface, letting you know that tkinter is properly installed on your system, and also showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific to that version.

chilly pond
#

hello every one

past pawn
#

hi

chilly pond
#

does any one know how to fix brain.exe has stopped responding?

past pawn
#

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

past pawn
#

@loud raptor if you need to comment every single line thats probably why you're struggling to debug it.

chilly pond
loud raptor
#

Its not that

chilly pond
#

voice serification

#

why can't i talk

#

i need to know why

#

voiceverifacation

loud raptor
past pawn
#

🤔 ```py
def PlayTime(songdir):
if Stopped:return
CurrentTime = pygame.mixer.music.get_pos() / 1000
ConvertedTime = time.strftime("%H:%M:%S", time.gmtime(CurrentTime))
CurrentSong = songBox.curselection()
songBox.get(CurrentSong)
SongMutagen = MP3(songdir)
global SongLength
SongLength = SongMutagen.info.length
ConvertedSongLength = time.strftime("%H:%M:%S", time.gmtime(SongLength))
CurrentTime += 1
TimeCounter = 1
SliderPos = int(SongLength)
if int(MySlider.get()) == int(SongLength):
StatusBar.config(text = f"Time Elapsed: {ConvertedSongLength} / {ConvertedSongLength} ")
NextOne = songBox.curselection()
NextOne = NextOne[0] + 1 # <--
if NextOne < len(mp3list):
songBox.selection_clear(0, END)
songBox.selection_set(NextOne, last = None)
songBox.activate(NextOne)
StatusBar.after_cancel(StatusID.get())
play()
else: Stop()
elif paused: pass
elif int(MySlider.get()) == int(CurrentTime):
MySlider.config(to = SliderPos, value = int(SliderPos))
else:
MySlider.config(to = SliderPos, value = int(MySlider.get()))
ConvertedTime = time.strftime("%H:%M:%S", time.gmtime(int(MySlider.get())))
StatusBar.config(text = f"Time Elapsed: {ConvertedTime} / {ConvertedSongLength} ")
NextTime = int(MySlider.get()) + TimeCounter
MySlider.config(value = NextTime)
StatusID.set(StatusBar.after(1000, PlayTime, songdir))

chilly pond
#

╰(艹皿艹 ) (╯°□°)╯︵ ┻━┻

past pawn
wise cargoBOT
#

Voice verification

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

chilly pond
#

!voice

past pawn
#

@chilly pond

chilly pond
#

ha ha I'm dumb

past pawn
#

why not just do NextOne = songBox.curselection()[0] + 1 there? smh

#

!pep 8

wise cargoBOT
#
**PEP 8 - Style Guide for Python Code**
Status

Active

Created

05-Jul-2001

Type

Process

loud raptor
#
def PlayTime(songdir):
    #Check to see if slider goes faster
    if Stopped == True:
        return
    CurrentTime = pygame.mixer.music.get_pos() / 1000
    #Convert current time
    ConvertedTime = time.strftime("%H:%M:%S", time.gmtime(CurrentTime))
    #Get currently playing song
    CurrentSong = songBox.curselection()
    #Grab song title from list
    songBox.get(CurrentSong)
    #load song with mutagen
    SongMutagen = MP3(songdir)
    #Get song length
    global SongLength
    SongLength =  SongMutagen.info.length
    #Convert to time format
    ConvertedSongLength = time.strftime("%H:%M:%S", time.gmtime(SongLength))
    #Increases current time by 1 second
    CurrentTime += 1
    TimeCounter = 1
    if int(MySlider.get()) == int(SongLength):
        #Reset Slider and Status Bar
        StatusBar.config(text = f"Time Elapsed: {ConvertedSongLength} / {ConvertedSongLength} ")
        StatusBar.config(text = "")
        NextOne = songBox.curselection()
        NextOne = NextOne[0] + 1
        #If statement to check if NextOne can be added
        if NextOne < len(mp3list):
            #Reset Slider and Status Bar
            MySlider.config(value = 0)
            StatusBar.config(text = f"Time Elapsed: {ConvertedSongLength} / {ConvertedSongLength} " )
            #Move active bar in list
            songBox.selection_clear(0, END)
            #Set active bar to next song
            songBox.selection_set(NextOne, last = None)
            #Activates next song in the list
            songBox.activate(NextOne)
            #Cancels  the id of the previous song and gets the next song's ID
            StatusBar.after_cancel(StatusID.get())
            play()
        else:
            Stop()
#

@past pawn

wispy light
#

Hello gys

#

I need help in flow chart

#

I have code of Python project but I am struggling to make a better flowchart

#

Yeah, I made the code and now I am having problem mapping it to the flowchart

unborn spruce
#

hi

wispy light
#

is it like algorithm in structured way ?

wise cargoBOT
#

Hey @wispy light!

It looks like you tried to attach file type(s) that we do not allow (.zip). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.

Feel free to ask in #community-meta if you think this is a mistake.

wispy light
#

Thankyou gys,

#

It's library management system

#

brain storm web ?

wind raptor
wispy light
#

wow, thanks

#

I will try

wind raptor
#

np

whole bear
#

lol

wind raptor
daring orbit
stoic grail
#

@wind raptor Lol see the guy named with thier or someone number 🤣

wind raptor
#

I see that. Maybe not a phone number

daring orbit
wind raptor
#
dice_pattern = r'\[((?:\d*?[dgprb]\d+)[^]]*?(?:\d*?[dgprb]\d+)?)?([+-]\d*)?\s=\s(\-?\d*)]'
dense apex
plush willow
#

hey

#

can someone help me real quick

#

def addem(x,y,z):
print(x+y+z)
def prod(x,y,z):
return xyz
a = addem(6,16,26)
b = prod(2,3,6)
print(a,b)

#

in this my teacher says the output is
None 36

#

I say it is
48
None 36

#

he argues that a = addem.... wont work like print

#

who tf is right?

somber heath
plush willow
somber heath
#

The code will, if I'm reading it correctly, cause a NameError to be raised.

#

Ah.

#

But it will print.

#

One moment.

plush willow
#

Oh dude it's x times y times z in prod

#

Discord removed it idk why

somber heath
#

That's why...

#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

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

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

plush willow
#

Ya now i remember this

stoic grail
#

Does anyone knows html here?

somber heath
#

@plush willow Okay. Accounting for that, you are correct.

#

I mean...you're printing in the function and you're calling the function. That you're also assigning is irrelevant.

whole bear
#

hi

frosty star
stoic grail
#

Opalmist sighs

#

opalmist ignores me

#

sad

#

@somber heath hewwo:P

#

@somber heath left :<

somber heath
#

I wasn't looking at the screen.

stoic grail
#

oki

minor crow
#

Hello

stoic grail
#

hewwo:p

plush willow
#

but still my teacher says he is correct

cobalt magnet
stoic grail
#

hewwo:p @frosty star

frosty star
#

hi der

somber heath
#

!e ```py
def addem(x,y,z):
print(x+y+z)

def prod(x,y,z):
return xyz

a = addem(6,16,26)
b = prod(2,3,6)

print(a,b) ```

wise cargoBOT
#

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

001 | 48
002 | None 36
somber heath
#

@plush willow

past pawn
#

is mic working?

#

i dont see green circle

#

i see it now

#

but then im too loud

#

it's that time of night again

#

i can tell the server got a raid

#

aight i deleted the evidence:
"mark as read"

sonic cloak
#

Hey what's up!

#

Can't talk

somber heath
#

!e ```py
def func():
try:
func()
except RecursionError:
func()

func()```

wise cargoBOT
#

@somber heath :x: Your eval job has completed with return code 139 (SIGSEGV).

001 | Fatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow.
002 | Python runtime state: initialized
003 | 
004 | Current thread 0x00007fef32f2a740 (most recent call first):
005 |   File "<string>", line 3 in func
006 |   File "<string>", line 3 in func
007 |   File "<string>", line 3 in func
008 |   File "<string>", line 3 in func
009 |   File "<string>", line 3 in func
010 |   File "<string>", line 3 in func
011 |   File "<string>", line 3 in func
... (truncated - too many lines)

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

sonic cloak
#

!e

import numpy as np
from random import randint

def matrix_generator(rows, columns, max_number, min_number):
    area = rows * columns
    value_list = []

    for _ in range(area):
        value_list.append(randint(min_number, max_number))
    
    return np.array(value_list).reshape(rows, columns)


print(matrix_generator(4,4,1,0))
#

!e

print(type(_))
#

!e

import numpy as np
from random import randint

def matrix_generator(rows, columns, max_number, min_number):
    area = rows * columns
    value_list = []

    for _ in range(area):
        value_list.append(randint(min_number, max_number))
        print(_)
    return np.array(value_list).reshape(rows, columns)


print(matrix_generator(4,4,1,0))
somber heath
#

!e py for each_letter in "Apple": print(each_letter)

wise cargoBOT
#

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

001 | A
002 | p
003 | p
004 | l
005 | e
somber heath
#
def main():
    pass

if __name__ == "__main__":
    main()```
#
file = open("file.txt", "w")
file.write("Hello, world.")
file.close()```

```py
with open("file.txt", "w") as file:
    file.write("Hello, world.")```
cobalt magnet
#

are you teaching someone file writing?

somber heath
#

!e py my_list = [(0,9), (8,5), (3,7)] my_list.sort(key=lambda a: a[0]) print(my_list) my_list.sort(key=lambda a: a[1]) print(my_list)

wise cargoBOT
#

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

001 | [(0, 9), (3, 7), (8, 5)]
002 | [(8, 5), (3, 7), (0, 9)]
somber heath
#

!e ```py
def func():
return 5

func = lambda: 5```

#

None

#
def func(a):
    return 5
func = lambda a: 5```
#

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

somber heath
#

Corey Schafer

whole bear
#

hlo

#

have some mic poblem so cant talk

stoic grail
#

oh

#

okay

whole bear
#

hey Op

stoic grail
#

hello

whole bear
#

semms ur name has been influenced by opalmist

stoic grail
#

how?

whole bear
#

Op

stoic grail
#

?

#

@somber heath I'm gonna learn "IF" statements rn :)>

#

yea ik

#

Can you explain the bool function?

#

okay

#

Oki thanks

primal yacht
#
if "False":
    print("This outputs as it is NOT empty")
#

bool is a subclass of int

stoic grail
#

idk what is subclass sorry me dumb

somber heath
#
class MyList(list):
    pass```
stoic grail
#

ohhh

#

thenks

primal yacht
#
>>> x = ['zero', 'one']
>>> (x[False], x[True])
('zero', 'one')
#

object.__dir__() @somber heath

#

And cls.mro() (__mro__() ?)

#

I guess method resolution order

#

!e print(list.mro())

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

[<class 'list'>, <class 'object'>]
stoic grail
#

what you guys doin?

#

@primal yacht your voice coming so heavy

fleet island
#

!e [i**2 for i in range(10)]

wise cargoBOT
#

@fleet island :warning: Your eval job has completed with return code 0.

[No output]
primal yacht
#

@fleet island please use #bot-commands if you are not going to be in the VC

stoic grail
#

okay

primal yacht
#

!e ```py
class MyList(list):
pass
print(MyList.mro())

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

[<class '__main__.MyList'>, <class 'list'>, <class 'object'>]
primal yacht
#

!e ```py
print(object.dir(list))

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

['__repr__', '__call__', '__getattribute__', '__setattr__', '__delattr__', '__init__', '__new__', 'mro', '__subclasses__', '__prepare__', '__instancecheck__', '__subclasscheck__', '__dir__', '__sizeof__', '__basicsize__', '__itemsize__', '__flags__', '__weakrefoffset__', '__base__', '__dictoffset__', '__mro__', '__name__', '__qualname__', '__bases__', '__module__', '__abstractmethods__', '__dict__', '__doc__', '__text_signature__', '__hash__', '__str__', '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__reduce_ex__', '__reduce__', '__subclasshook__', '__init_subclass__', '__format__', '__class__']
primal yacht
#

!e ```py
print(dir(list))

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

['__add__', '__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
primal yacht
#

list.__dir__

stoic grail
#

Can i leave now to learn "if" statements or you guys still teaching me (i appritiate the teaching a lot).

#

lol

whole bear
#

Which of the programming languages bring more money

primal yacht
#

@whole bear you're not in the VC so why are you asking here?

stoic grail
primal yacht
#

Sorry if it sounds blunt

muted belfry
stoic grail
primal yacht
#

Python and java [....... to be honest] it [actually] depends.

somber heath
stoic grail
#

ima try this code

primal yacht
#

!e ```py
if 'False':
print('This is truthy')

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

This is truthy
somber heath
#

!e py result = 3 * 3 == 9 print(result)

wise cargoBOT
#

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

True
stoic grail
somber heath
#

Empty strings are falsy. Strings with things in them are truthy.

primal yacht
#
False # bool
"False" # str
stoic grail
#

Oh

#

i think something is false sorry

primal yacht
#

!e print(divmod(100, 6))

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

(16, 4)
stoic grail
primal yacht
#

division, modulus (remainder)

stoic grail
#

okay thanks :).

somber heath
#

// % Floor division and modulus, respectively.

stoic grail
#

when opal says bool i always hear booo

stoic grail
primal yacht
#
# comment
somber heath
#

Nonzero numerical values are truthy. Zero is falsy. Negatives are truthy.

stoic grail
#

opal falsy means false right?

#

oh

#

oki

primal yacht
#
bool( something_truthy ) # True
#
if 12345: # if bool(12345):
    print('12345 is a bad password')
stoic grail
#

oki

#

booo

#

hehe

primal yacht
#
result = A and B
if A:
    result = B
else:
    result = A

result = A or B
if A:
    result = A
else:
    result = B
stoic grail
#

fades away

#

bai will join after some time and when ill come ill know if 🙂

#

boooo

primal yacht
#
(currentObj or defaultObj).doSomething()
muted belfry
#
result = 'a' and 'b'
print(result)
#

!e

wise cargoBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

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

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

primal yacht
#

!e ```py
result = 'a' and 'b'
print(result)

#
bool('a') # True
#

!e ```py

code here

```

muted belfry
#

!e ```py
print(2 and 3)

primal yacht
#

!e print(type({}))

#

set()

#

@azure flare

azure flare
#

how can i verify myself

primal yacht
#

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

azure flare
#

Imma need to wait for the other 2 days

#

and chat

#

import verification as vf

#

vf.user['Cincuenta']

#

just kidding

#

u guys python masters?

#

im new yess

#

my only specialty in python is dataframes

#

data science things

#

yess

#

with numpy and pandas

#

sin kuenta

#

^

#

yes

primal yacht
azure flare
#

katie what specialty are u in

primal yacht
azure flare
#

ah developers?

#

just wondering where r u bois from

#

sorry

#

Sorry, I often mistakenly give people pronouns

#

Indonesia bro

#

i take data science for gettin jobs in the us

#

lmao

#

Hi Kendal

#

and Gaming Buddhist

#

Guys id like to ask

#

what is help-things?

#

help avocado/ pancakes/ candy?

primal yacht
azure flare
#

ah thanks man, u seem like the admin

primal yacht
azure flare
#

ahh

#

Its for the room claim

#

thanks man

#

Hey @somber heath !

#

sending regards

primal yacht
#

Please don't randomly ping people

azure flare
#

ah noted sorry

#

he was typing

primal yacht
#

... oh

#

^w^;

azure flare
#

so i thought maybe a good waming would be great

#

welcoming*

azure flare
primal yacht
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

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

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

azure flare
#

aahh the mark just like in Rstudio

#
print('Hello world!')
somber heath
# stoic grail bai will join after some time and when ill come ill know if 🙂

An if stanza.

if condition: #Exactly one if
    ...
elif some_other_condition: #Zero or more elifs. Else, if. If the above conditions in the stanza (if/elif) are falsy this this one's is truthy, do this.
    ...
else: #Zero or one else. If none of the above are triggered, run this block.
    ...```
One or zero of the blocks in the stanza will be run. A new if at the same indentation will start a new stanza.
stoic grail
#

i was just doing elif statement:).

azure flare
#
import numpy as np
import pandas as pd

pd.DataFrame(array([a, b, c]))
somber heath
#

I exist outside this server. Occasionally, I engage in that existence.

azure flare
#

aahh

#

inconspicously terrific

primal yacht
#

Luau ?

#

@ ROBLOX

#

.jar.jar Sphinx

#

my weird self in the past -.-'

stoic grail
#

but thanks anyways:).

#

hehe

#

!e is_hot = False
is_cold = False
if is_hot:
print("it's a hot day")
print("drink plenty of water")
elif is_cold:
print("it's an cold day")
print("wear warm clothes")
else:
print("it's a lovely day")

print("enjoy your day")

wise cargoBOT
#

@stoic grail :white_check_mark: Your eval job has completed with return code 0.

001 | it's a lovely day
002 | enjoy your day
stoic grail
#

🙂

#

i wrote this code :).

#

not lying its easy tho

primal yacht
somber heath
#

I realised my previous explanations were lacking.

primal yacht
#

@stoic grail you're not in VC

stoic grail
#

joined

#

booo

primal yacht
#

hewwOwO

somber heath
#

.uwu Salutations, everybody.

viscid lagoonBOT
#

Sawutations, evewybody.

stoic grail
#

im using pycharm

#

oh lol okay

#

sorry me dumb dumb

#

!e '''py

wise cargoBOT
#

@stoic grail :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     '''py
003 |          ^
004 | SyntaxError: EOF while scanning triple-quoted string literal
stoic grail
#

weeeeeeeeeeeeee

wise cargoBOT
#

Here's how to format Python code on Discord:

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

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

stoic grail
#

@solemn hornet amber is an game character :).

stoic grail
solemn hornet
#

huh?

stoic grail
# solemn hornet huh?

There's a game called brawl stars and amber is the rarest character to get in that game.

primal yacht
#
cat file.txt | tr -d 'aeiouAEIOU' | tee file2.txt
solemn hornet
somber heath
#

!e py print("".join(c for c in "Sample Text" if c not in "aeiouAEIOU")) 

wise cargoBOT
#

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

Smpl Txt
somber heath
#

!e py print("*".join("MASH"))

wise cargoBOT
#

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

M*A*S*H
primal yacht
#
JOINER_STR.join(ITERABLE_OF_STR)
muted belfry
#

!e ```py
print(' '.join('red sus'))

wise cargoBOT
#

@muted belfry :white_check_mark: Your eval job has completed with return code 0.

r e d   s u s
stoic grail
#

i will join in some mins

somber heath
#

!e ```py
no_vowels = str.maketrans({k: "" for k in "aeiouAEIOU"})

print("Sample text".translate(no_vowels))```

wise cargoBOT
#

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

Smpl txt
primal yacht
#

!e ```py
import re

text = "red sus\n is such a fuss"
pattern = re.compile(r"\S+")

for i in pattern.finditer(text):
print(i.group(0))

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

001 | red
002 | sus
003 | is
004 | such
005 | a
006 | fuss
primal yacht
#

!e ```py
import this

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!

primal yacht
#

!pep 20

wise cargoBOT
#
**PEP 20 - The Zen of Python**
Status

Active

Created

19-Aug-2004

Type

Informational

somber heath
#

!d str.maketrans

wise cargoBOT
#

static str.maketrans(x[, y[, z]])```
This static method returns a translation table usable for [`str.translate()`](https://docs.python.org/3.10/library/stdtypes.html#str.translate "str.translate").

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or `None`. Character keys will then be converted to ordinals.

If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to `None` in the result.
somber heath
#

!d str.translate

wise cargoBOT
#

str.translate(table)```
Return a copy of the string in which each character has been mapped through the given translation table. The table must be an object that implements indexing via `__getitem__()`, typically a [mapping](https://docs.python.org/3.10/glossary.html#term-mapping) or [sequence](https://docs.python.org/3.10/glossary.html#term-sequence). When indexed by a Unicode ordinal (an integer), the table object can do any of the following: return a Unicode ordinal or a string, to map the character to one or more other characters; return `None`, to delete the character from the return string; or raise a [`LookupError`](https://docs.python.org/3.10/library/exceptions.html#LookupError "LookupError") exception, to map the character to itself.

You can use [`str.maketrans()`](https://docs.python.org/3.10/library/stdtypes.html#str.maketrans "str.maketrans") to create a translation map from character-to-character mappings in different formats.

See also the [`codecs`](https://docs.python.org/3.10/library/codecs.html#module-codecs "codecs: Encode and decode data and streams.") module for a more flexible approach to custom character mappings.
somber heath
#

@flint kettle I'm afraid your audio clarity was poor and there seemed to be interfering noise. We didn't catch what you said.

primal yacht
#

@proper juniper

proper juniper
#

I'm trying to display a QErrorMessage but my GUI keeps crashing, this is my code ```py

def errorDialog(self, error: BaseException):
    self.dialog = qtw.QErrorMessage()
    self.dialog.showMessage(str(error))
rugged root
#

!stream 368671236370464769

wise cargoBOT
#

✅ @proper juniper can now stream until <t:1631280150:f>.

past pawn
#

heyyyy I exist!

#

hi whoever that was i blinked

#

I sprinkled some instant coffee in my toastie sandwich it tastes great!

stoic grail
#

mm gunna watch neo

#

the proud moment when people watch your steam

proper juniper
#
Traceback (most recent call last):
  File "c:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\src\__main__.py", line 76, in run
    Context.selectedProfile.run()
  File "c:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\src\core\profiling.py", line 342, in run
    acts.register()
  File "c:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\src\core\profiling.py", line 286, in register
    state = self.trigger_detail.register()
  File "c:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\src\core\profiling.py", line 219, in register
    locator = locateOnScreen(self.image, confidence=confidence, minSearchTime=self.timeout, grayscale=True)
  File "C:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\dependencies\lib\site-packages\pyscreeze\__init__.py", line 372, in locateOnScreen
    retVal = locate(image, screenshotIm, **kwargs)
  File "C:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\dependencies\lib\site-packages\pyscreeze\__init__.py", line 352, in locate
    points = tuple(locateAll(needleImage, haystackImage, **kwargs))
  File "C:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\dependencies\lib\site-packages\pyscreeze\__init__.py", line 206, in _locateAll_opencv
    needleImage = _load_cv2(needleImage, grayscale)
  File "C:\Users\User\Documents\Programming\Python\five\GUI App - yoohoo\dependencies\lib\site-packages\pyscreeze\__init__.py", line 169, in _load_cv2
    raise IOError("Failed to read %s because file is missing, "
OSError: Failed to read CACHE::png.png because file is missing, has improper permissions, or is an unsupported or invalid format```
past pawn
#

pog

wind raptor
#
msg = QtWidgets.QMessageBox()
msg.warning(self, "Error", f'This is the message')
rugged root
#
from PyQt5.QtWidgets import QMessageBox

msg = QMessageBox()
msg.setIcon(QMessageBox.Critical)
msg.setText("Error")
msg.setInformativeText('More information')
msg.setWindowTitle("Error")
msg.exec_()
wispy light
#

What are you gys up to ?

#

looks cool,

rugged root
#

At least as far as I can tell it's from these guys rather than Qt proper

stoic grail
#

hey can someone help my friend or he is gonna fail?

#

@primal yacht

rugged root
#

Help in what way

stoic grail
#

I will send a code just tell me which programming language is that

primal yacht
stoic grail
#

my first is asking

rugged root
#

Hold on

wispy island
#

damn lemon is here too

primal yacht
#

and is this homework?

rugged root
#

Is this for a test/exam

stoic grail
rugged root
#

Also why is he using you as a go between

stoic grail
#

Cause he dunno about this group

#

like he said he is gonna have an exam at 13th

#

umm i did not told him about this group

#

he said that pls help me or i will fail,lol

primal yacht
#

pls help me or i will fail
totally sounds like related to school work

stoic grail
#

should i invite him here?

rugged root
#

Probably easier, yeah

stoic grail
#

yeah he said that he will have an exam on 13th setp

#

int main ()
{
Int d =12;
float c1 = 17.50,tc;
tc=c1*d;
Cout << "Total Cost="<<tc;
return 0;
}

wispy light
#

@rugged root how much do you earn from coding ?

stoic grail
#

okay im inviting him

wispy light
#

wow, You seem like a good good programmer

#

I get it

#

I just completed my python course, but I am struggling on what to do next.

#

college

#

Bachelors in computing

stoic grail
#

@obtuse drum come here

wind raptor
#
class Main(Ui_MainWindow, QMainWindow):
    def __init__(self):
        super(Main, self).__init__()
        self.emit = EmitSignals()
        self.emit.signals.text_sig.connect(self.print_data)
        self.emit.signals.sig.connect(self.sig)
        self.emit.signals.int_sig.connect(self.print_data)

    def print_data(self, data):
        print(data)

    def sig(self):
        print("signal recieved")

# signals class
class MySignals(QtCore.QObject):
    sig = QtCore.Signal()
    text_sig = QtCore.Signal(str)
    int_sig = QtCore.Signal(int)

class EmitSignals(QtCore.QThread):
    QtCore.QThread.__init__(self, parent):
        self.signals = MySignals()
        self.emit_signals()

    def emit_signals(self):
        self.signals.text_sig.emit("Emitting text")
        self.signals.sig.emit()
        self.signals.int_sig.emit(5)
rugged root
#

@obtuse drum Okay so quick question, is this for an exam/test or is this for a study guide

stoic grail
digital jackal
#

hey guys

#

quick question

rugged root
#

Shoot

digital jackal
stoic grail
#

sheesh ask them here

digital jackal
#

anything wrong with this c++ code?

#

its not running

obtuse drum
obtuse drum
stoic grail
#

yes wait.

obtuse drum
#

ok

stoic grail
#

hemlock is a admin,lol

rugged root
#

I mean we're not really a C++ server. I do have some links to servers that should be able to help you

rugged root
#

I don't know C++

digital jackal
#

oh

rugged root
#

Which is why I'm trying to get you to a place that CAN help

obtuse drum
forest zodiac
somber heath
#

"You vex me. *rolls up keyboard* *THWAK*"

#

Keyboard to the face.

#

"This thing has bugs."
"Meh. Pile some features on top of everything. The bugs will get buried underneath and nobody will notice."

primal yacht
brave steppe
#

noooooo

primal yacht
rugged root
#

I was wrong

#

1,308 hours in TF2

primal yacht
vivid palm
#

666 o_O

stoic grail
leaden comet
stoic grail
#

@brave steppe the nice voice guy is here:).

brave steppe
stoic grail
woeful salmon
rugged root
primal yacht
leaden comet
#

but, yeah..

#

fuck that game

#

so addictive

rugged root
#

I've played my fair share of Pyro

#

They are my fave

woeful salmon
#

i have a worse addiction... though i only play like twice an year now

brave steppe
#

dear God

vivid palm
#

kikooooooooo did you watch spirited away yet? :3

#

@rich cloud

rich cloud
#

i did watch it, it was kinda weird

#

there's a theory about it too

vivid palm
#

share

#

i re-watch spirited away at least 1x a year lol

primal yacht
rich cloud
#

it's inappropriate so...

leaden comet
#

such a good movie

#

I'm sure you can find an appropriate way to formulate it, or link it or use some spoilers or something.

ebon fractal
rich cloud
amber raptor
#

no

#

let's not link to random tor sites

vivid palm
ebon fractal
#

nice joke

rich cloud
vivid palm
#

lol only in looks right? not in personality

woeful salmon
#

i was going to say you would probably reinstall your operating system with that if you change passwords on a normal netlify app

#

lol

ebon fractal
# ebon fractal nice joke

lol, i just typed whateer i want and put .onion so u guys wud suspect for sure that its a dark web link , lol

brave steppe
ebon fractal
#

no dont click this

rugged root
ebon fractal
#

lol

ebon fractal
primal yacht
#

my bad @rich cloud

rich cloud
vivid palm
#

i always get lost in the third/final act of howl's moving castle

#

and don't understand what's going on

ebon fractal
#

click on this link

primal yacht
#
$ node -p '(0.1 + 0.2).toFixed(100)'
0.3000000000000000444089209850062616169452667236328125000000000000000000000000000000000000000000000000
ebon fractal
#

now doesnt it look sus?

somber heath
#

doubles

dark seal
#

thanks

rugged root
#

The next random link you drop will result in a mute

#

Stop

ebon fractal
#

k

#

lol

#

link.link

stoic grail
#

Dont underestimate him

ebon fractal
#

he is 'the' mr hemlock after all

stoic grail
#

can i send a rickroll link or somthing?

ebon fractal
#

no

#

it will result i ammute

#

we can send only link.link

rugged root
#

!mute 884399825360125962 Sassing an admin after they just told you to stop dropping random links is pretty dang rude. Please re-read the #rules and listen to staff

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied mute to @ebon fractal until <t:1631288469:f> (59 minutes and 58 seconds).

stoic grail
somber heath
#

@vivid palm Unsatisfied with just one patrons tag...you made them give you two?

#

Boss move.

vivid palm
#

hahahaha

stoic grail
#

ya'll wanna know my VPN IP?

stoic grail
rugged root
#

Hilarious

stoic grail
#

yay

#

now ill get a promotion

rugged root
#

Sorry, we have enough people trying to do it, so it's irksome

stoic grail
#

boss is happy

#

lol

#

@rugged root if u ban me me will cry

rugged root
#

Wasn't planning on it

stoic grail
vivid palm
#

hemlock is my mic activating and emitting noise?

#

it keeps flickering green even tho i'm not saying anything lol

#

is it feeding back?

primal yacht
#
~~~~~~~~~~~~~~~~~
      /home
      sweet
      /home
~~~~~~~~~~~~~~~~~
stoic grail
#

im hearing wierd sounds @rugged root pls ban the sound

rugged root
#

@near niche Do you know you're deafened?

#

Just checking

stoic grail
rugged root
#

What question

near niche
#

sorry I was typing to someone else

stoic grail
vivid palm
#

@molten pewter ?

stoic grail
#

ok me dumb

#

just do it

#

or u not powerful

vivid palm
#

hi kj

rugged root
#

I have nothing to prove

#

Yo KJ

stoic grail
rugged root
#

People who laud their power over others just because they have it shouldn't have that power

somber heath
#

No fresh sourdough for Hemlock.

rugged root
#

That one went over my head

somber heath
#

Maybe if you're doing pizza.

stoic grail
#

same

stoic grail
primal yacht
#

sourdough is a type of bread IIRC

severe pulsar
#

mina that was a joke

#

sorry

rugged root
#

HA

stoic grail
somber heath
#

Sourdough because that's what everyone's doing during lockdown.

#

Making their own.

rugged root
stoic grail
somber heath
#

It is.

stoic grail
#

ok

#

visible confusion

terse needle
#
>>> dis('bool(10)')
  1           0 LOAD_NAME                0 (bool)
              2 LOAD_CONST               0 (10)
              4 CALL_FUNCTION            1
              6 RETURN_VALUE
>>> dis('not not 10')
  1           0 LOAD_CONST               0 (True)
              2 RETURN_VALUE
stoic grail
somber heath
#

What did I...oh.

#

Right. lol.

rugged root
#

print(). The best debugging

vivid palm
#

^^^^^^^^^^^^^

stoic grail
terse needle
#

loguru is great

vivid palm
rugged root
vivid palm
#

i was agreeing with print()

#

lol

terse needle
#

jake was showing me loguru, teaching me the ways

rugged root
#

I know it

vivid palm
#
print(f'{var = }')
#

da best

#

don't @ me

near niche
terse needle
#

@vivid palm

import sys
eval('sys.stdout.write(f"{var = }")')
primal yacht
#

@brave steppe

#

like wtf

brave steppe
#

Yeah, I picked the Better Text Readability option

rugged root
#

I don't know why I thought the variable and the = had to flush with each other

brave steppe
#

5 FPS but the best quality

rugged root
#

Yep

brave steppe
vivid palm
rugged root
#

!e

spam = "bacon"
print(f"{spam=}")
wise cargoBOT
#

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

spam='bacon'
brave steppe
#

!string-formatting

wise cargoBOT
#

String Formatting Mini-Language
The String Formatting Language in Python is a powerful way to tailor the display of strings and other data structures. This string formatting mini language works for f-strings and .format().

Take a look at some of these examples!

>>> my_num = 2134234523
>>> print(f"{my_num:,}")
2,134,234,523

>>> my_smaller_num = -30.0532234
>>> print(f"{my_smaller_num:=09.2f}")
-00030.05

>>> my_str = "Center me!"
>>> print(f"{my_str:-^20}")
-----Center me!-----

>>> repr_str = "Spam \t Ham"
>>> print(f"{repr_str!r}")
'Spam \t Ham'

Full Specification & Resources
String Formatting Mini Language Specification
pyformat.info

terse needle
#

!e

var = 10
import sys
eval('sys.stdout.write(f"{var = }")')
wise cargoBOT
#

@terse needle :white_check_mark: Your eval job has completed with return code 0.

var = 10
primal yacht
#
Help on built-in function compile in module builtins:

compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1, *, _feature_version=-1)
    Compile source into a code object that can be executed by exec() or eval().
    
    The source code may represent a Python module, statement or expression.
    The filename will be used for run-time error messages.
    The mode must be 'exec' to compile a module, 'single' to compile a
    single (interactive) statement, or 'eval' to compile an expression.
    The flags argument, if present, controls which future statements influence
    the compilation of the code.
    The dont_inherit argument, if true, stops the compilation inheriting
    the effects of any future statements in effect in the code calling
    compile; if absent or false these statements do influence the compilation,
    in addition to any features explicitly specified.
#
Help on built-in function eval in module builtins:

eval(source, globals=None, locals=None, /)
    Evaluate the given source in the context of globals and locals.
    
    The source may be a string representing a Python expression
    or a code object as returned by compile().
    The globals must be a dictionary and locals can be any mapping,
    defaulting to the current globals and locals.
    If only globals is given, locals defaults to it.
#
Help on built-in function exec in module builtins:

exec(source, globals=None, locals=None, /)
    Execute the given source in the context of globals and locals.
    
    The source may be a string representing one or more Python statements
    or a code object as returned by compile().
    The globals must be a dictionary and locals can be any mapping,
    defaulting to the current globals and locals.
    If only globals is given, locals defaults to it.
woeful salmon
vivid palm
severe pulsar
#

Sorry about the disturbance in VC

woeful salmon
#

going to top and bottom of the file

#

saw you using mouse to go up there

#

xD

brave steppe
#

Ah, lol

#

I do love my mouse 🐭

#

@rugged root

woeful salmon
#

👀 whatever works for you i was just making a suggestion

primal yacht
#

prepares to commit a figure 8 loop into the project

for(;;);
vivid palm
#

all i see is this

woeful salmon
#

i like google style but use sphinx style mostly...

brave steppe
#

For doc-strings?

vivid palm
#

:param foo:

woeful salmon
#

yes

vivid palm
#

@param

severe pulsar
#

I prefer numpy style

#

but its the most verbose

brave steppe
woeful salmon
#

💯 windows defender just deleted my lua executabble

severe pulsar
#

RIP

#

windows 💪 😂

primal yacht
rugged root
severe pulsar
#

damn

rugged root
#

I didn't think to look at that

primal yacht
#
/**
 * blah ...
 */
severe pulsar
#

JsDoc is nice

#

but the documentation ui isnt amazing

#

and if you want type hinting

#

I would just use typescript

#

Like the amount of effort for payoff isnt the best

#

but its a good tool

woeful salmon
#
/**
 * @param somebody
 */
function sayHello(somebody) {
    alert('Hello ' + somebody);
}
#

somewhat like that

primal yacht
#

What would the TypeScript type annotation for "anything easily convertable to a normal JavaScript string"?

severe pulsar
#

uhh..

#

can you give an example?

primal yacht
#

as in like [].join( SOME_VALUE )

woeful salmon
#

try just adding //@ts-check in a javascript file in vs code

#

it will give you linting for types without using typescript

#

no errors just linting

primal yacht
#

I meant "what is the type for this?"

whole bear
#

hi

primal yacht
#

Just curious

woeful salmon
#

ah i wasn't replying to you just generally saying

primal yacht
#

School of Rock

severe pulsar
whole bear
#

hi @brave steppe

severe pulsar
#

why "bird"

severe pulsar
#

But you can create your own

#
type coolType = string | string[]
#

something like that

whole bear
#

what is all this random code bluenix

primal yacht
brave steppe
whole bear
#

ye

brave steppe
#

I am making a wrapper around that, so that you can design bots around that

whole bear
#

beeaaast

woeful salmon
#

i saw that but i really really don't like discord.py so probably gonna use js to make a bot to use those if i ever do

whole bear
#

I started studying front/backend. Loved working with discord.py tho but trying out react now

severe pulsar
#

react is fun

whole bear
#

i haven't looked at react actually lol. I am about to learn it though. Been working with js/express/node.js first. will probably hit mongodb next and then react

#

what is mongoose

brave steppe
#

It's an ORM right?

#

It allows you to write Python code that becomes SQL queries

#

So you can use SQL databases without knowing SQL

whole bear
#

ohh fancy

primal yacht
#

A database wrapper as an API ?

brave steppe
primal yacht
#

as in not using raw SQL queries yourself

brave steppe
#

Ah, yes

whole bear
#

Honestly just aiming to land a React Dev role next year. Just working with js, express, node, mongo, mongoose, and ejs. Not sure what else I might need to know

brave steppe
#

I think that's good, just keep trying to learn more advanced topics

#

There was someone in the Devs' Guild that applied for a similar role but was rejected, they received a helpful list.

#

You could use it as topics to learn

#
To improve

* Missing knowledge in several JavaScript intermediate topics.

* Lack of experience in the industry

* No debugging skills

* No handle of asynchronism (async/await, Promises)

- Little to none knowledge about a11y.

- Little to none knowledge of what is Mobile First.

- Little knowledge of what SEO.

- Not aware of what is cross browsing.

- No experience with any type of animation, and shows no knowledge of how they can be implemented.

- No knowledge about web components. 

- Doesn't understand well how promises work. Little knowledge on whaat they are.

- No knowledge about design patterns.

- Little to none knowledge on what is OOP.

- Hasn't work with task runners.

- No knowledge of web performance.
- No anchors, images to see its SEO/a11y implementation.

- No usage of BEM.

- Did not use SASS
whole bear
#

a11y?

primal yacht
#
  • Little to none knowledge about a11y.
    a11y = accessibility
whole bear
#

oh

#

lol

#

ty for that list though, I'll save it and keep that in mind

primal yacht
#

I remember that ... and i18n which is "internationalization"

#

i18n is just named that because it is i, 18 characters, n

whole bear
#

gotcha

#

ty

primal yacht
#

Similar to a11y

clear shadow
#

Chemistry = Exception 😅

whole rover
#

this module looks good

swift valley
#

Oops

#

Android reverted PTT

#

Yikes

rugged root
#

Okay Pure, I have the functional itch again

#

What would you say is a good baby's first functional language

brave steppe
#

Haskell 😏

swift valley
#

If you want to do pure frontend do Elm

primal yacht
#
// JavaScript
const add = (a) => (b) => a + b
swift valley
#

But like, for general-ish things, any ML-derivative like OcaML or even F#

rugged root
#

I guess for getting a decent handle on all the core concepts

#

Something like BASIC or Python regarding being a good learning language

swift valley
#

Erlang is frustratingly functional

primal yacht
swift valley
#

It doesn't have proper types but it feels like it

#

oh it's joe

#

lmao

whole rover
#

joe mama

swift valley
#

...

rugged root
#

joe llama

swift valley
#

also Hemlock

molten pewter
swift valley
#

I suppose a LISP variant wouldn't hurt

whole rover
#

hylang sungale

swift valley
#

Scheme/Clojure/Hylang

#
(defclass FooBar []
  (defn __init__ [self x]
    (setv self.x x))
  (defn get-x [self] self.x))
#

Scary

molten pewter
#

import getpass
x = getpass.getpass(prompt='Enter a Password')

swift valley
#

The Common Lisp Object System (CLOS) is the facility for object-oriented programming which is part of ANSI Common Lisp. CLOS is a powerful dynamic object system which differs radically from the OOP facilities found in more static languages such as C++ or Java. CLOS was inspired by earlier Lisp object systems such as MIT Flavors and CommonLoops, ...

whole rover
#

emacs lisp time

#

i will write an os in emacs lisp

rugged root
#

And I love you for it

stuck furnace
swift valley
sweet lodge
#

vim is better

#

It's my turn to start the war today

whole rover
sweet lodge
#

Mom said so

swift valley
#

Emacs was made for the terminal 👀

woeful salmon
#

it took me 2 days to get decent speed in vim o-o its not that hard if you just follow vimtutor -> look up some more shortcuts -> just use it

stuck furnace
#

Hello Mina 👀

primal yacht
vivid palm
#

lololol you heard me

swift valley
#

My limited screen space constrained my workflow from split windows to buffer switching

primal yacht
woeful salmon
#

do macros work in it though

#

and norm

sweet lodge
#

To be fair, all IDEs (/text editors) have their share of elitist bullshit

swift valley
#

I do have one 13" monitor

#

Which is not a lot

#

1366x768

primal yacht
#

I'm using .... *checks*

swift valley
#

Instead of having to do C-w hjkl to navigate, I have one big window and I just use C-x C-b to switch files

woeful salmon
swift valley
#

I rarely do window splits unless it's a terminal

quaint wharf
#

Is there always so many people in the vcs?

swift valley
rugged root
#

Not consistently

woeful salmon
#

at this time yeah

rugged root
#

But yeah, usually rocking around this time

#

Especially if someone is streaming

swift valley
#

We've capped out to 30 before

primal yacht
#

1280x720 on my (unknown size) HDTV ... which is over a chair length away from my bed ... since my laptop's screen is like ... unreliable

#

It can go higher normally

quaint wharf
#

And what are they talking about rn?

rugged root
#

Oh Pure, so what would you say are the 3 decent options to learn.

swift valley
#

My laptop used to be able to do Virtual Super Resolution from the AMD card it has

woeful salmon
#

i tried ll of them except for Textual i think

rugged root
#

@quaint wharf The Python built-in library getpass

woeful salmon
#

because i didn't think anyone was gonna be using it after being told its in beta or sommething

swift valley
#

1920x1080 - looked blurry though

quaint wharf
#

Are they discussing like features and stuff?

rugged root
#

Features, alternatives, etc.

whole rover
woeful salmon
primal yacht
#

1920x1080 is max (using the HDMI port)

quaint wharf
#

Oh man, there's so many interesting conversations to be had. I'm still short from my 50 msgs to verify voice

swift valley
stuck furnace
#

You pretty much have to build an abstraction layer on top of curses anyway.

#

So you might as well use one written by someone else.

rugged root
#

I did like Elm

swift valley
#

Although I suggest thinking of Elm as more of an opinionated FP framework than a real FP language

rugged root
#

Yeah I think I'll toy with that again

#

Hmm true....

#

In fairness I have also been curious about F#

vivid palm
#

G♭

rugged root
#

How long did it take you to find the flat?

whole rover
#
do_a() |> do_b(123) |> IO.puts
molten pewter
swift valley
#

Two years of Haskell taught me not to suggest Haskell as an FP language

primal yacht
stuck furnace
#

Are you learning a functional language Hem? 👀

quaint wharf
rugged root
#

c += 1

whole rover
woeful salmon
#

??= and ||= are weird too in js

quaint wharf
rugged root
#

Maybe also

#
from getpass import getpass
primal yacht
#
let value = 1.5;
value++;
console.log(value); // output: 2.5
woeful salmon
#

salt did an ansi and an ascii terminal rick roll

primal yacht
#

ASCII ... [0..127]

quaint wharf
#

stream red

primal yacht
#

Latin-1 ... [0..255]

quaint wharf
#

(idk just trying to rack up the 50 msgs)

swift valley
#

If I unfolded this vertically, it'll be less readable

rugged root
#

So many folks just try to spam their way to it or put like one word per line

#

It's so irritating

molten pewter
whole rover
#

considering writing a pam module to test blood alcohol levels

whole rover
#

lol even i remember that

swift valley
#

We had a rotary phone

#

and a phone, with Wolverine

crystal fox
rugged root
crystal fox
sweet lodge
# molten pewter Would anyone enjoy giving my 16 lines of code a review?: https://paste.pythondis...
# Use from import so you can use getpass instead off getpass.getpass below
from getpass import getpass

# It's better to use descriptive variable names
real_password = getpass(prompt='Enter a Password')
guessed_password = getpass(prompt='Enter a Guess')

if real_password == guessed_password:
    print('You got a match on the first try!')
    print(guessed_password)

attempts = 0
# while doesn't need parentheses
while guessed_password != real_password:
    attempts = attempts + 1
    print('Not a match, try again')
    guessed_password = getpass(prompt='Enter a Guess')

    if guessed_password == real_password:
        # Use f-string to simplify print
        print(f'Match. you guessed {attempts} time(s)')
swift valley
#

This, basically

quaint wharf
#

modumb

whole rover
#

joe is afk

#

sorry

#

lol

#

time for steak sandwiches

sweet lodge
#

Overall, it's fine. There's nothing wrong, just things that would improve readability

swift valley
#

keights

rugged root
#

Kubes

#

Cubes

#

Just rolls off the tongue

rich cloud
#

color

#

col our

primal yacht
#
   aboot:blank
swift valley
#

droop snoot

woeful salmon
#

what would you call a couch then

quaint wharf
#

Sounds like an interesting expression, could come from gaelic

molten pewter
quaint wharf
#

Its an f-string, for string interpolation. Basically puts the str representation of the variable instead of the {variable} template

#

Really useful

#

Notice the string is f"The {string}" instead of "The " + string

sweet lodge
#

!fstring

wise cargoBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

molten pewter
quaint wharf
rugged root
#

We've got a handful of great tags

#

!tags

wise cargoBOT
#
**Current tags**

» docstring
» dotenv
» dunder-methods
» empty-json
» enumerate
» environments
» except
» exit()
» f-strings
» floats
» foo
» for-else
» functions-are-objects
» global
» guilds

quaint wharf
wise cargoBOT
#

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

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

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

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

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

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

!e

xs = [1, 2, 3]
ys = "{[1]}".format(xs)
print(ys)
woeful salmon
#

pathlib is indeed dope but also slow

quaint wharf
wise cargoBOT
#

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

2
rugged root
#

Yep, can pull the individual element

swift valley
#

!e

v = "v"
print("{.strip}".format(v)) 
wise cargoBOT
#

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

<built-in method strip of str object at 0x7fd1d847a6b0>
swift valley
#

yikes, I never learned that

#

That would've been useful

#

!e

v = " v  "
print("{.strip()}".format(v)) 
wise cargoBOT
#

@swift valley :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: 'str' object has no attribute 'strip()'
woeful salmon
#

!e
!e

foo = {"a" : 1, "b" : 2, "c": 3, "d": 4, "e": 5}

print(foo)

del foo["b"]

print(foo)

del foo["d"]

print(foo)

what's the problem with using a normal dictionary

wise cargoBOT
#

@woeful salmon :white_check_mark: Your eval job has completed with return code 0.

001 | {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}
002 | {'a': 1, 'c': 3, 'd': 4, 'e': 5}
003 | {'a': 1, 'c': 3, 'e': 5}
sweet lodge
#

Actually... yeah, that would theoretically work.

silk grove
#

where is os.getcwd() defined?
i didn't find it in os.py

swift valley
#

what

primal yacht
#

Bite-Sized Minecraft (1-3):
https://www.youtube.com/watch?v=qloBPxqV7sM
https://www.youtube.com/watch?v=00XJ9qrtyHM
https://www.youtube.com/watch?v=kMoS3z6L2rQ
Very old Minecraft: Java Edition tutorial for the piston thing:
https://www.youtube.com/watch?v=d8Etp3liY1w
Same-ish as last but I made it in Minecraft aka Bedrock Edition much more recently than it:
https://www.youtube.com/watch?v=7yb3U9lSa2Y
Full music video for that "Filler Clip" referenced in one of the 3 at the top:
https://www.youtube.com/watch?v=CiZBw9Memrc

primal yacht
quaint wharf
#

Wait no, it evals "v".strip and that's a function pointer

#

But with "v".strip() fails...

swift valley
#

How odd

#

It is a EDSL after all

silk grove
swift valley
silk grove
#

oh, thanks.

silk grove
#

but written where?

cerulean ridge
#

I have a list, and check it twice

quaint wharf
#

What attributes does a str have?

wise cargoBOT
#

Modules/posixmodule.c line 3757

static PyObject *```
swift valley
#

It should exist for NT as well

silk grove
#

thanks again

#

how did you find it?

quaint wharf
#

Doesn't str have any attributes?

swift valley
#

DuckDuckGo

silk grove
swift valley
#

Have site:github.com/python/cpython as a prefix then search the desired function

silk grove
#

ah, right

rugged root
quaint wharf
#

!e

class Person:
  def __init__(self, name):
    self.name = name

print("{.name}".format(Person("John")))
wise cargoBOT
#

@quaint wharf :white_check_mark: Your eval job has completed with return code 0.

John
rugged root
#

That's so weird

#

It makes sense but it feels weird

primal yacht
silk grove
#

yeah

swift valley
#

Damn, I feel a fever mounting

#

Gotta hop off early folks

silk grove
quaint wharf
#

Or like... can you?

rugged root
#

I think you can with a template string, yeah

#

Okay yeah, that actually does make a lot more sense

#

I think it's the bare {.name} that's giving me the willies

primal yacht
#
from collections import OrderedDict
DATA = json.loads(JSON_STR, object_hook=OrderedDict)
quaint wharf
#

!e

class Option:
  def __init__(self, name, choices, role):
    self.name = name
    self.choices = choices
    self.role = role

op = Option("Option1",31,"admin")
template = "{option.name} info: There are {option.choices} choices available if your are a {option.role}"

print(op.format(option=op))
wise cargoBOT
#

@quaint wharf :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 | AttributeError: 'Option' object has no attribute 'format'
quaint wharf
#

crap

#

!e

class Option:
  def __init__(self, name, choices, role):
    self.name = name
    self.choices = choices
    self.role = role

op = Option("Option1",31,"admin")
template = "{option.name} info: There are {option.choices} choices available if your are a {option.role}"

print(template.format(option=op))
wise cargoBOT
#

@quaint wharf :white_check_mark: Your eval job has completed with return code 0.

Option1 info: There are 31 choices available if your are a admin
primal yacht
#

GG

#

by the way

quaint wharf
#

I feel like I learned something HappyKragg

amber raptor
#

if you just storing data in class

quaint wharf
#

I know dataclasses

#

Just wanted to test that

swift valley
#

!e

class Option:
  def __init__(self, name, choices, role):
    self.name = name
    self.choices = choices
    self.role = role

op = Option("Option1",31,"admin")
template_fn = "{option.name} info: There are {option.choices} choices available if your are a {option.role}".format

print(template_fn(option=op)) 
wise cargoBOT
#

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

Option1 info: There are 31 choices available if your are a admin
swift valley
#

heh

rugged root
#

Woah wait what

#

That's surreal

quaint wharf
#

I would rather

template_fn = lambda option: f"{option.name} info: There are {option.choices} choices available if your are a {option.role}"
amber raptor
#

images -which become containers-> Containers <--- Kubernetes manages those

quaint wharf
primal yacht
#

@quaint wharf I'm going to show you something with the bot

#

!e ```py
import sys
UNICODE_TEMPLATE = 'U+{{:0{:d}X}}'.format(
len('{:x}'.format(sys.maxunicode))
)
print(UNICODE_TEMPLATE.format(ord('`')))

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

U+000060
primal yacht
woeful salmon
#

how many of you know that / in arguments makes anything before it positional only

primal yacht
#

I do

woeful salmon
#

just curious cuz i didn't know for a long time

swift valley
primal yacht
rugged root
swift valley
#

#bot-commands message

brave steppe
woeful salmon
#

!e

def foo(a, b, /):
    return a, b

print(foo(2, b=20))
wise cargoBOT
#

@woeful salmon :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 | TypeError: foo() got some positional-only arguments passed as keyword arguments: 'b'
quaint wharf
#

Like lambda allows both I think

brave steppe
#

Alright, gonna eat

swift valley
brave steppe
#

I'll be back to have mental breakdowns over lists and dicts

rugged root
#

First thing that comes to mind would be fore coordinates

primal yacht
#

!e ```py
class JSONishDict(dict):
def init(self, /, **pairs):
super().init(pairs)

x = JSONishDict(spam = 'eggs', self = 'this')
print(x)

wise cargoBOT
#

@primal yacht :white_check_mark: Your eval job has completed with return code 0.

{'spam': 'eggs', 'self': 'this'}
rugged root
#

You'd want that to be in a specific order

brave steppe
rugged root
#

And you'd rarely be doing it via kwargs

brave steppe
amber raptor
primal yacht
amber raptor
#

N<blah> E<blah>