#voice-chat-text-0

1 messages Β· Page 188 of 1

somber heath
#

@halcyon spruce πŸ‘‹

halcyon spruce
vocal basin
#

match is better fit for structural patterns rather than just equality

scarlet halo
#

when a mod is in the vc you can ask nicely for stream perms

somber heath
#

@scarlet fiber πŸ‘‹

scarlet fiber
#

hi

vivid gorge
#

most of the time I will have commands that have to do with the same thing like clicking so I have them all under if "click" in cmd

scarlet halo
#

bye opal

#

you will be missed

#

@somber heath

somber heath
#

Only because I'm so good at dodging.

vivid gorge
scarlet halo
vocal basin
#

!e

from io import StringIO

commands = {}

def command(f):
    commands[f.__name__] = f

@command
def test():
    print("test")

@command
def add(a, b):
    print(int(a) + int(b))

program = StringIO("""
test
add 1 2
test
add 5 -3
""".strip())

for line in program:
    command_name, *args = line.split()
    commands[command_name](*args)
wise cargoBOT
#

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

001 | test
002 | 3
003 | test
004 | 2
vocal basin
#

I prefer this approach to choosing which command to execute based on the name

vivid gorge
#

to find the function in question search for command parsing and execution in the github go to macro.py and search for def parse_and_execute_command

#

yay I can talk now

vocal basin
#

can rightclick only be called without coordinates?

#

unlike normal click

wise cargoBOT
#

macro.py lines 481 to 482

elif cmd == "rightclick":
    pyautogui.rightClick()```
vivid gorge
#

the rightclick command takes no args

#

just right clicks

#

no coords

scarlet halo
#

pyautogui is amazing

vocal basin
wise cargoBOT
#

macro.py line 390

parts = command.split(' ')```
vocal basin
#

as it treats repeated space as one + cuts out all the leading/trailing spaces

vivid gorge
#

ok I

#

changed

vapid parrot
#

Why is the server pp changed ?

vocal basin
vivid gorge
#

fixed this: args = parts[1:].lower() to be

#

Save the full command
full_command = command
# Split the command and arguments
parts = command.split()
parts = parts.lower()
cmd = parts[0].lower()
args = parts[1:]

#

nwm that does not work too

#

I will just not make it lower

vocal basin
#

command.lower().split()

vivid gorge
#

k

#

great thx

vocal basin
#

I think this is repeated enough times to make it a separate method

if self.advanced_errors == True:
    messagebox.showerror(title="<some title>", message="<UI error>")
print("<log error>")
vivid gorge
#

I did

#

self.error

vocal basin
wise cargoBOT
#

macro.py lines 472 to 474

if self.advanced_errors == True:
    messagebox.showerror(title="Click Command Error", message="Please enter 2 numbers with no other characters for the x and y.")```
vivid gorge
#

I just did it very late on

#

I just added self.error so late along that I did not feel like updating it and so just left it their

#

it is about time I just did not want to commit to it

vocal basin
#

isn't switch basically just doing this?

def switch(self, string, comparisons):
    try:
        return string in comparisons
    except TypeError:
        return False
vivid gorge
#

I knew I should of but since I had 4 other things I had to work on I just hoped I did not mess it up

#

I'll fix it

#

oh wait I did just in not a good way

#

good less code

vocal basin
#

I myself generally try to avoid suppressing too much of type-related errors
so I'd probably just write this instead of introducing an extra method:

if args[0] in ["tk", "tkinter"]:
    ...
#

or

match args:
    case ["tk" | "tkinter"]:
        ...  # omitted because long
    case ["tk" | "tkinter", "copy"]:
        pyperclip.copy(macrosaves.tkinter_template)
    case ["tk" | "tkinter", "gui" | "screen"]:
        ...  # omitted because long
    case ["tk" | "tkinter", "gui" | "screen", "copy" | "duplicate" | "dupe"]:
        copy(macrosaves.tkinter_template)
#

!e

args = ["tk", "screen"]

match args:
    case ["tk" | "tkinter"]:
        print("case 0")
    case ["tk" | "tkinter", "copy"]:
        print("case 1")
    case ["tk" | "tkinter", "gui" | "screen"]:
        print("case 2")
    case ["tk" | "tkinter", "gui" | "screen", "copy" | "duplicate" | "dupe"]:
        print("case 3")
wise cargoBOT
#

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

case 2
vivid gorge
#

nice

vocal basin
#

that requires Python 3.10 and above

vivid gorge
#

I use 3.11

#

python --version
Python 3.11.4

vocal basin
#

so it would've been pyperclip.copy

#

... which allows to merge two branches

#

!e

args = ["tk", "screen", "copy"]

match args:
    case ["tk" | "tkinter"]:
        print("case 0")
    case ["tk" | "tkinter", "gui" | "screen"]:
        print("case 1")
    case ["tk" | "tkinter", "copy"] | ["tk" | "tkinter", "gui" | "screen", "copy" | "duplicate" | "dupe"]:
        print("case 2")
wise cargoBOT
#

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

case 2
vocal basin
#

(I probably wouldn't write it this way)

vivid gorge
#

one thing I will say is that I do not like how the mouse is moved with the smove function

vocal basin
wise cargoBOT
#

macro.py lines 291 to 303

xstep = difx / self.steps
ystep = dify / self.steps

if xstep == 0 and ystep == 0:
    return

# Set a constant duration to achieve a constant speed
constant_duration = 0.2

for _ in range(self.steps):
    pyautogui.moveTo(startx + xstep, starty + ystep, duration=constant_duration)
    startx += xstep
    starty += ystep```
vocal basin
#

how stable does it need to be?
does it need to get back on track if the pointer was moved due to external reasons?

vivid gorge
#

one sec

vocal basin
#

actually, why is it in steps?

vivid gorge
#

before while I was bug fixing it was not working so I would have it move the mouse in segments

vocal basin
#
if delay == True:
    ...
elif delay == False:
    ...
else:
    print("How?")

this will probably look cleaner:

if delay:
    ...
else:
    ...
#

whatever happens to mouse movement, happens both with and without delay?

vivid gorge
#

prob to do with some feature I was going to add then did not want to

#

fixed

#

with that I am now at 992 lines

vivid gorge
#

ok now fixed

#

983 lines

#

I am still here @vocal basin just not in vc

scarlet halo
#

click

#

wyd

#

yo aetherclouds

vivid gorge
vocal basin
#

!d assert

wise cargoBOT
#

7.3. The assert statement

Assert statements are a convenient way to insert debugging assertions into a program:


assert_stmt ::=  "assert" expression ["," expression]
``` The simple form, `assert expression`, is equivalent to

```py
if __debug__:
    if not expression: raise AssertionError
```...
vocal basin
#

optional

#

!e

assert False, "example"
wise cargoBOT
#

@vocal basin :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 |     assert False, "example"
004 | AssertionError: example
scarlet halo
#

!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) 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) 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) will be used. Since printed arguments are converted to text strings, [`print()`](https://docs.python.org/3/library/functions.html#print) cannot be used with binary mode file objects. For these, use `file.write(...)` instead.
vocal basin
#

EBNF, I guess

#

it's some type of BNF

scarlet halo
#

whats the flush thing

#

in print

vocal basin
#

forces the stream to update instead of bufferring

#

or, at least, attempts to

#

in some circumstances, printed output won't appear instantly

#

@dry jasper what is the bottleneck? IO or CPU?

#

for WSGI/ASGI, runners start multiple processes by default

#

that includes Flask

#

"production-grade" WSGI/ASGI app can't really store anything in-memory for that reason

#

ASGI is generally better if you do any IO as part of handling the request

scarlet halo
#

alisa why havent you voice verified yet?

vocal basin
#

at least, it has less memory overhead

#

there are some simplifications made in WSGI which are impossible to replicate in ASGI
so some things might be more difficult to handle

#

but those simplifications were mostly wrong to begin with

pallid plover
#

simplification on whose end? the programmer implementing or developing wsgi?

vocal basin
#

WSGI as an interface and certain frameworks implementing

pallid plover
#

it was so long ago but I don't remember having any compromises switching to asgi

#

with django

scarlet halo
#
keys im spelis
click (clicks=2)
goto 12 12
if 1==2||2==3 hotkey ctrl alt del; break
if 1==1&&2!=1 break
keys test if test

very simple macro language (hopefully it works)

vocal basin
#

Flask suffers more from WSGI lock-in

pallid plover
#

I guess I am having it easy since it's just like changing one or few lines in django?

vivid gorge
#

e

#

""r3r3r3r3r3r3rr3
"""

vocal basin
vivid gorge
#

"cool"

#

"a

vocal basin
#

RabbitMQ likely

vocal basin
scarlet halo
#

cool

#

also

#

nvm

pallid plover
#

ain't print literally a wrapper for stdout write or something

vocal basin
#

somewhat more complex

scarlet halo
#

also with pyinstaller i get a no module named "..."

#

error

vocal basin
#

iirc, write may wait for reader to read in certain circumstances

scarlet halo
#

yo

vocal basin
scarlet halo
#

ModuleNotFoundError

vocal basin
#

might be failing to find hidden imports

#

queue.Queue should've been put into threading.Queue

#

this way it would be

asyncio.Queue threading.Queue multiprocessing.Queue
asyncio.Lock  threading.Lock  multiprocessing.Lock
scarlet halo
vocal basin
#

what's the name of the module?

#

what imports it?

scarlet halo
#

pyautogui

vivid cloak
#

In discrete geometry, an opaque set is a system of curves or other set in the plane that blocks all lines of sight across a polygon, circle, or other shape. Opaque sets have also been called barriers, beam detectors, opaque covers, or (in cases where they have the form of a forest of line segments or other curves) opaque forests. Opaque sets wer...

#

^ what I’m working on now, a program to test if a set of lines is an opaque set

vocal basin
#

FastAPI/Django likely have it built-in

#

(both FastAPI docs and Flask-related answers link to it)

#

(suggesting solutions to an earlier question; idk what the actual problem is)

scarlet halo
#

neural networks sound complicated to my brain

vivid cloak
#

The test program

scarlet halo
#

i taste blood from my tooth

vocal basin
#

I'd expect it to be just gradient descent, without layering

scarlet halo
#

dw theyre baby teeth

#

gtg

#

bye

distant blade
#

hello

vivid gorge
nimble atlas
#

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

lone heart
#

hi

glossy spear
#

hi

#

hi

#

hi

#

hi

fervent grail
#

Hello there

glossy spear
#

from how long u guys doing python ?

fervent grail
#

uh 2 years

fervent grail
glossy spear
#

its been more than a year now

fervent grail
#

what you can do man ?

#

*with python

lone heart
#

i am new lol

fervent grail
#

@glossy spear what's your favorite in python ?

fervent grail
#

good you're web developer

#

my favorite thing in python is opencv & pytorch

fervent grail
lone heart
#

nahh i am beginnier in python i am not that good lol

fervent grail
#

what you can do in python ?

lone heart
#

idk like some oop and like i am starting to learn things

fervent grail
#

good

#

what are you using to learn ?

lone heart
#

like pygame

lone heart
#

@fervent grail Do u have any tips for begginer?

fervent grail
#

uh learn python standard library

lone heart
#

ok thanks

obsidian dragon
#

!voice @trim relic

wise cargoBOT
#
Voice verification

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

trim relic
#

sorry i cant talk

#

im not voice verfied.

obsidian dragon
#

I know

#

I know all

#

@trim relic I know your species

trim relic
#

what species am i then?

obsidian dragon
#

you lizard folk can't trick me

trim relic
#

i was voice verfied on my old account but i left for reasons.

#

i wish i was a cat.

lone heart
#

hello

scarlet halo
#

how do i throw an exception i forgor

somber heath
#

@molten bear πŸ‘‹

scarlet halo
#

ah

somber heath
#

@proven forge πŸ‘‹

scarlet halo
#

πŸ‘ hemlock go

rugged root
#

@cobalt cloak This is where you'd put your code

cobalt cloak
scarlet halo
cobalt cloak
#

i need to put the marked codes instead of it?

somber heath
#

@violet sleet πŸ‘‹

scarlet halo
#

so you replace move[1] = move[1]+1 with move[1] += 1

somber heath
#

@rich siren πŸ‘‹

#

@swift cypress πŸ‘‹

violet sleet
somber heath
scarlet halo
#

yeah

#

go opal

#

πŸ‘

#

brb

reef badger
#

up and down could use gravity and physics of bouncing

somber heath
violet sleet
somber heath
violet sleet
somber heath
#

UKelele.

scarlet halo
#

πŸ’―

#

fugg 9-5

cobalt cloak
scarlet halo
#

damn that drawing on the back

cobalt cloak
#

it came with the shoes

violet sleet
#

oh wow

lone heart
#

hello

cobalt cloak
#

join ther call

lone heart
#

me?

cobalt cloak
#

yas

lone heart
#

i dont have voice verifeid

violet sleet
scarlet halo
#

voice verification took me like a day (without spam)

lone heart
#

yeah but if i want to only chat i will be there and i like want to speak

violet sleet
scarlet halo
#

yeah 😎

lone heart
#

someone know how can i check if i completed the 50 messages?

#

for the voice?

scarlet halo
#

only 32

#

actually 33

lone heart
#

howw do u saw thatt

#

now is 34 lol

lone heart
#

how do u see how much messages people havee

scarlet halo
#

the search bar

lone heart
#

ohh thankss

#

nah i need 50 messagessss

#

lets goo 13 moree

scarlet halo
#

1000 messages im never talking in text ever again

vocal basin
somber heath
#

@delicate wraith πŸ‘‹

delicate wraith
#

hey

vocal basin
#

doesn't basically only VSC support Dev Containers?

scarlet halo
#

i have more than 50k messages with my friend

rugged root
#

We are happy to share with you that we have added Dev Container support In Visual Studio 2022 17.4 for C++ projects using CMake Presets. Containers are a great way to package up everything for running an application. Through a Dockerfile all prerequisites are captured so that there is a consistent runtime environment anywhere the container is de...

vocal basin
#

JetBrains have docker/remote support
but that's paid

#

or was

uncut meteor
rugged root
vocal basin
#

you can also use remote containerised build tools in JetBrains

#

(it was already a feature in 2021; maybe earlier)

#

but that involves copying everything to remote server via ssh on each build

#

core -> .net
framework -> nothing

#

VS has way better debugging support

#

(compared to VSC)

vocal basin
#

as it wanted to use local docker-compose

#

I switched over to VSC in 2022 when my license ended

#

and VSC just worked

somber heath
violet sleet
#

in our university they told us to use spider for python but i was already familiar with VSC

somber heath
#

Staple of petrol stations and convenience stores, almost everywhere.

vocal basin
#

PyCharm/CLion -> VSC switch for me was likely easier because I don't rely on using the debugger

#

too many things are async

somber heath
#

@tidal tide πŸ‘‹

tidal tide
violet sleet
#

nicee @cobalt cloak

cobalt cloak
#

thx

dry jasper
vocal basin
#

without stopping everything else

#

capture a task, move it to a separate loop

#

somehow

dry jasper
violet sleet
vocal basin
#

would be not so helpful for asynchronous things

#

likely only makes sense for algorithms

lone heart
#

hello

cobalt cloak
#

sup

vocal basin
#

and if the code is so complex that you need a diagram to find out what's happening,
it might be a signal to rewrite (simplify) it

rugged root
#

Dumb question, can you use git cleanly with jupyter notebook stuff? Or does the notebook get saved as a binary or something weird

tidal tide
#

@cobalt cloak python is not fun for making games (or web development)
if you want to make games, maybe try C# and unity, or mobile game development
python is the most fun for web scraping and data manipulation and things like that

oblique ridge
#

you can or can't gitignore the side stuff you get from it iirc

vocal basin
#

jupyter notebooks have good enough compatibility with Git

cobalt cloak
vocal basin
#

if all outputs are text, it might be okay to check them in

oblique ridge
#

hey calm down with the web dev
django is nice af

vocal basin
#

as for images -- more difficult

tidal tide
lone heart
#

i have 9 m

tidal tide
#

raw html/css/js/php is better

uncut meteor
#

@pure gust jupyter nbconvert --clear-output --inplace my_notebook.ipynb

lone heart
somber heath
#

Broblox.

rugged root
#

I'll start pushing Godot more every since Unity essentially shot indie devs in the foot

#

Correction

#

Shot them in the foot and then asked them to dance

somber heath
#

and mugged them

rugged root
#

Yarp

somber heath
#

With a time machine.

vocal basin
#

VS Code is doubting my knowledge

#

almost every time I tried to use launch configurations, it went terribly wrong

somber heath
#

@dense ibex @oblique ridge Voice twins.

vocal basin
#

the only project, that I remember using launch configurations more than once, was in Lua

#

I was not excepting Google to actually find something like that

#

code is the unit test for unit tests testing that code

#

mutual recursion

#

interface-based mock testing works great

#

injecting code and messing with things is sad

dry jasper
violet sleet
#

@uncut meteor that's why in greece use C#

#

from what i heard

vocal basin
#

in JS mocks objects are okay-ish
but there you also don't have type issues

#
# test that tests test 
assert True
with self.assertRaises(AssertionError):
    assert False
gentle flint
somber heath
#

If you're in a mood when you make them, are they instead snitzels?

gentle flint
dry jasper
somber heath
gentle flint
#

it's a gemberbolus

#

lots of ginger

#

lots of pastry

#

lots of sugar

#

it's a traditional Portuguese Jewish pastry from Amsterdam

somber heath
#

"Why would you eat pasta and pizza at the same time?"
So you can eat Italian while you eat Italian.

dense ibex
#

We need more people like me

somber heath
#

Stay away from water.

oblique ridge
somber heath
#

@halcyon nymph πŸ‘‹

halcyon nymph
#

hi

somber heath
#

Yoda poop?

halcyon nymph
#

bruhh

rugged root
#

Yoda cook?

#

Yoda cougar

somber heath
#

Yoda cooker. It's like an air fryer, but for Yodas.

rugged root
#

For cooking Yoda or for Yoda to use to cook

somber heath
#

Definitively the former.

rugged root
#

Crispy Jedi masters

#

With half the fat!

somber heath
#

But enough about Mace Windu...

rugged root
gentle flint
dense ibex
#

im gonna go play texas chain saw massacre

#

bye

somber heath
#

The Fault in our Stars is where I knew him from, first.

rugged root
#

The Fault in our Starwars

lavish rover
#

if you have images they get base64 encoded

rugged root
#

Oh kinky

#

Thanks for the mod alert pings

undone idol
#

did anyone said cookie?

#

i have it

#

chem class

#

carbonised is addition of h2co3

#

not co2

rugged root
#

Oh huh

#

TIL

copper oak
#

horse tail hairs are used to play vilon

rugged root
#

Neat. Poor horse out there with a naked tail somewhere

#

Stuck with a cold butt

undone idol
#

@rugged root stages are still there on discord?

#

'bandstage'

rugged root
#

I'm not sure actually

#

I never actually messed with it

#

"What would you like? Chai?" "Nah."

#

I'm lazy busy

fleet hawk
#

hello guys

rugged root
#

Yo

#

How's it going

fleet hawk
#

good what about you

rugged root
#

I'm alright

#

Yeah the voice chat is.... weird today

fleet hawk
#

what do you think guys about unitest

rugged root
#

Very helpful, I'm just bad about doing them

gentle flint
fleet hawk
rugged root
#

Not to be confused with pydantic

heady rock
rugged root
#

Does he even have nostrils?

fleet hawk
#

can you share with me some resource to know about unittest

#

you guys

rugged root
#

#unit-testing Will have more knowledge and info than I would be able to offer

fleet hawk
#

you tallk about my country

#

hhhhhhhhhhhh

rugged root
#

Unfortunately I haven't used it enough to give good opinions

fleet hawk
#

ohhh

fleet hawk
#

classes

rugged root
#

Charlie's glasses

fleet hawk
#

i want know about classes to

#

method

rugged root
#

No pesudocode, though

fleet hawk
#

instences

fleet hawk
rugged root
#

No I do it as a hobby. I don't code much for my job

fleet hawk
#

oh cool

#

oh god πŸ˜‚ i thought that you are talking about classes in python but you guys talk about glasses

#

🀣

rugged root
#

HA

fleet hawk
#

i just know it hahahahaha

#

are you using linux for coding

#

do you use cocain or what

signal kraken
#

hi

fleet hawk
#

?

#

cocain will let you code 100000 line

#

πŸ˜‚

#

and debaggin

#

are you using linux for coding

#

drugs are legal in united state

#

drugs in united state are more than any contry

#

there are all type of drugs

#

in usa

#

hahahhahaha

#

yes

heady rock
#

cold? raining? Why does that sound like paradise to me?

fleet hawk
#

in morocco if you drink in public you will prison 48 h

#

πŸ˜‚

#

you talk arabic

#

repeat this word

#

hahahahahahahaha

rugged root
#

If you're drinking at a restaurant patio or something you can drink outside, otherwise it's a no no

fleet hawk
#

yeah yeah if they know you they will catch you

#

just us moroccan people

#

but like you if come to morocco you will leave like a king

#

hhhh

#

live

#

"live"

oblique ridge
gentle flint
rugged root
reef fractal
uncut meteor
heady rock
#
oblique ridge
feral sinew
#

@reef fractal @oblique ridge @rugged root i have a question in c can anyone of u help me?

#

could u just explain the 2nd line?

oblique ridge
#

sorry im simply a humble pythonista

feral sinew
#

😦

oblique ridge
#
c = 1 if x > y else 3
feral sinew
#

ok thnx

reef fractal
#

?av @feral sinew

feral sinew
#

but whats the point of else if?

#

in this particular code

#

k 2min

stuck furnace
#

Can you run the code through a formatter? It would be easier to see what's going on.

feral sinew
#
int main()
{
 int x,y;
 scanf("%d %d",&x,&y);int c;
 if((x-y)%2==0){
 c=(x>y)?1:3;
 }
 else{
     if(x>y){
         c=2;
     }
     else if (y>x){
     c=1;
     }
     else{ c=0;}
}
 printf("%d",c);
return 0;
}```
reef fractal
#
#include <stdio.h>
int main()
{
 int x,y;
 scanf("%d %d",&x,&y);int c;
 if((x-y)%2==0){
 c=(x>y)?1:3;
 }
 else{
     if(x>y){
         c=2;
     }
     else if (y>x){
     c=1;
     }
     else{ c=0;}
}
 printf("%d",c);
return 0;
}
stuck furnace
rugged root
#

Yeah there's some confusing things about that code

feral sinew
#

here's the ques btw

#

xd

feral sinew
quick vigil
oblique ridge
feral sinew
coarse spindle
robust ridge
#

hello crewmate

lone heart
#

hello

lofty echo
#

were whta

#

what

#

look just add a surface for the cicle and a rect and a velocity and change the velocity when the player presses a key

#

can you do that?

#

also it says I dont have permission to speak in this channel

#

ok

#

so add a var called ball_surf outside the loop

#

and remove the drawing of the ball inside the loop

#

then make the surface a pygame surface with ame

#

surf1 = pygame.Surface((width,height))
surf1.fill((0,255,0))
pygame.draw.circle(surf1, (0,0,0), (200,2000), 5)

#

add the last line in the loop

#

pygame.surface is creating a surface that you can blit onto the screen

#

this line add in the loop pygame.draw.circle(surf1, (0,0,0), (200,2000), 5)

#

then make a rect like ball_rect = surf1.get_rect(center = (x, y))

#

enter the pos of the ball in the x and y

#

take your time

#

it makes the surface a rectangle object that has collisons and you can reposion it better too

#

so wich directions do you want the ball to move in up and down, left or right or both

#

what

#

oh the rect put it ouside

#

so wich directions do you want the ball to move in up and down, left or right or both

#

okay so make an x_vel var and set it to 0 same with the y

#

can I see ur code so far

#

okay first of all move the pygame.init to the very top of the code but below the import pygame

#

becouse pygame.init starts the module and you cant create a surf before that

#

ok next del the ball_surf var you dont need it any more becouse you have surf_1 as the surf

#

wait, do you want to move a circle or sqare/rectangle bec moving a circle is a little harder

#

ok so del this pygame.draw.circle(surf_1, (0,0,0), (200,2000),5)
ball_rect

#

can I see ur code again?

#

btw when you make the surf_1 the 500, 500 is the width and the height of the sqare

#

also the surf_1.fill (0,250,0) is the RGB color of the sqare

#

also why is thier 2 pygame.init

#

remove the second one

#

okay now onto the movment

#

it's fine

#

so make x_vel and y_vel and set them both to 0 outside the loop

#

next inside the loop write ball_rect.x += x_vel

#

this will incoment the pos of the ball rect on the vel

#

do the same for the y

#

and also at the end of the loop before display.flip write screen.blit(surf_1, ball_rect)

#

it is drawing to sqare onto the screen

#

yes

#

blit stands for block image transer

#

okay next in the event handerler add an if stantment if the user presses an arrow key or what ever key you want

#

first have an if to check if the user pressed a key if event.type == pygame.KEYDOWN:

#

then inside that add an if event.key == pygame.K_a:

#

then if that happened then change the x_vel to -5 or -what ever speed you want

#

can I see ur code?

#

.K_a is the a key

#

can I see ur code

#

put this in the for loop if event.type == pygame.KEYDOWN:
pass

delicate ether
#

you

#

yo

#

whats good

lofty echo
#

hi miracle

#

I am new to this server

#

I know it's greate

#

great

#

lol

delicate ether
#

im learning python and looking for a study group

lofty echo
#

hows ur coding journy going

#

I can help you

#

I started a few months ago

#

we could code together

delicate ether
#

my code jourey has been hard

lofty echo
#

very good I am really injoying it and I have also got prettty deep into pygame

#

nice

delicate ether
#

same we should ask for a study group channel

lofty echo
#

should I recomend so tutorails you could watch

#

on youtube

#

maybe you can try and see

#

that would be great I teach you u teach me

#

so do you want to finsh the movment

#

can I see ur updated code so I can remember were to go next?

delicate ether
#

can so some teach me some basics

lofty echo
#

yeah sure

#

α“‚α˜α—’ | α“•α˜α—’ | α“‡α˜α—’ what can I call you

#

so these 3 lines put after the for loop

#

screen.fill("yellow")
ball_rect.x += x_vel
all_rect.y += y_vel

sterile trellis
#

Hello everyone.
Does anyone know anything about stn files?

lofty echo
#

Idk

#

after the first if add if event.key == pygame.K_a: for the a key

#

okay so in that if add x_vel = -5 or what speed you want test it out and see what speed works for you

#

also can you give me the new code so I can debug it?

#

after you add the ifs

#

these can be outside the for loop

#

screen.fill("yellow")
ball_rect.x += x_vel
ball_rect.y += y_vel

#

but it doesnt really make too big of a diffrence if you leave it in

#

btw you can run it now and see if the a key works!

#

so just add the same logic with w s and d

#

and also add a way when the user lifts up the key the vel is 0

#

just uses if event.type == pygame.KEYUP:

#

and copy and paste the same code but change the vel to 0

#

ill show you

#

here you go import pygame

pygame.init()
running = True
surf_1 = pygame.Surface((50, 50))
surf_1.fill("red")
ball_rect = surf_1.get_rect(center=(100, 100))
clock = pygame.time.Clock()
screen = pygame.display.set_mode((500, 500))
x_vel = 0
y_vel = 0
screen.fill("yellow")
ball_rect.x += x_vel
ball_rect.y += y_vel

while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_a:
x_vel = -1
if event.key == pygame.K_d:
x_vel = 1
if event.key == pygame.K_w:
y_vel = -1
if event.key == pygame.K_s:
y_vel = 1

    if event.type == pygame.KEYUP:
        if event.key == pygame.K_a:
            x_vel = 0
        if event.key == pygame.K_d:
            x_vel = 0
        if event.key == pygame.K_w:
            y_vel = 0
        if event.key == pygame.K_s:
            y_vel = 0

screen.fill("yellow")
ball_rect.x += x_vel
ball_rect.y += y_vel
screen.blit(surf_1, ball_rect)
pygame.display.flip()
clock.tick(60)

pygame.quit()

#

this works I have tested it if you have and questions then ask i go to go bye

#

btw what code editor do u use

vapid parrot
#

Im not voice verifyd

#

😭

#

😭

lofty echo
#

Same

#

how do I get verigyed

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
lone heart
#

yeah i have 4 messages leftt

#

wait like but do i need to wait like 3 days or like 72 hours after i joined here?

mystic lily
#

message = reaction.message
print (len(message))

#
        # Get the message for which the reaction was added
        message = reaction.message

        # Count the number of unique users who reacted (excluding the bot)
        unique_users = len({user for reaction in message.reactions if not reaction.me for user in await reaction.users().flatten()})
        
        print (unique_users)
#

discord.on_raw_reaction_add(payload)

#

@client.event
async def on_raw_reaction_add(payload):
    if payload.channel_id == 614467771866021944:
        if payload.emoji.name == ":repeat:":
            channel = client.get_channel(payload.channel_id)
            message = await channel.fetch_message(payload.message_id)
            reaction = get(message.reactions, emoji=payload.emoji.name)
            if reaction and reaction.count > 4:
                await message.delete()
scarlet halo
#

yo

lofty echo
#

does anybody have any project ideas I am struggling to find one thats not the hard but not the easy?

#

I am an intermideate

lone heart
#

hi

lofty echo
#

hi

#

liam

lone heart
#

hello wsp

lofty echo
#

nothing, just looking for some project ideas, ypuj

#

you

#

are you new to this server

#

if so I am to

#

I just joined today

lone heart
#

i am a beginner i dont good at this lol

lofty echo
#

same

lone heart
#

oh welcomee

lofty echo
#

I am a python beginner

lone heart
#

same

lofty echo
#

what are some projects you have built?

lone heart
#

like idk like some games on pygame

lofty echo
#

SAme I love pygame

lone heart
#

oh thats cool

lofty echo
#

this is a project i made a couple weeks ago

lone heart
#

nicee ur better than me lol

lofty echo
#

you can check out my git hub, rn I just got 1 project tho

lone heart
#

how much time ur on python?

lofty echo
lofty echo
lone heart
#

ohh nice i am like a month nice for u

lone heart
lofty echo
#

you can ask me i just dont know what that means lol

lone heart
#

yeah nvm its ok, also my english is not that good lol

lofty echo
#

okay

lone heart
#

i will be better, i hope lol

lofty echo
#

sure will

#

I can help you code

#

we could code together

lone heart
#

yeah maybe one time becuase i am not near my computer lol i now was at school lol

lofty echo
#

how old are you

#

not tryna be mean

lone heart
#

lets go for the dm ok?

lofty echo
#

ok

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied timeout to @clever ice until <t:1695122443:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

versed heath
#

cool

dusky lynx
elfin moth
#

hello guys

vocal basin
#

autoplay may be blocked

#

quite normal

#

especially if the video is not muted

molten pewter
somber heath
#

JRPG Item storage ability, but it's a cloud. "Oh, hang on, let me just store this in the cloud."

rugged root
zenith radish
stuck furnace
#

Yeah GCC is from the 90s?

#

LLVM is the new kid on the block

#

It's like the good old IE days πŸ˜”

somber heath
#

Netscape Navigator.

stuck furnace
#

@cobalt cloak You've got static coming through intermittently.

cobalt cloak
#

AND NOW

#

THX

rugged root
#

Damn it

#

.xkcd 927

viscid lagoonBOT
#

Fortunately, the charging one has been solved now that we've all standardized on mini-USB. Or is it micro-USB? Shit.

rugged root
#

There we go

#

Yeah I don't have the numbers memorized. I am a scrub

cobalt cloak
#

what are you talking about

molten pewter
#

EU regulations

cobalt cloak
#

oh

#

food is good

wind raptor
#

Hey all πŸ‘‹ πŸ˜„

cobalt cloak
#

hi

#

my game files that i made got deleted somehow

#

i got it back

dry jasper
#

MS server 2003 is awesome

molten pewter
#

Windows Server (formerly Windows NT Server) is a group of operating systems (OS) for servers that Microsoft has been developing since July 27, 1993. The first OS that was released for this platform is Windows NT 3.1 Advanced Server. With the release of Windows Server 2003, the brand name was changed to Windows Server. The latest release of Windo...

lone heart
#

hi

cobalt cloak
#

all i did was ask something i dont see anything wrong with it jeez

molten pewter
#

it's just rabbit

#

he is grumpy and not very patient.

cobalt cloak
#

okay

molten pewter
#

That is his stick, don't take it personally.

dry jasper
#

he is just very cocky and things that he knows everything, like most of us πŸ˜„

cobalt cloak
#

okay

somber heath
#

Shtick.

#

But stick works, too.

stuck furnace
#

Spain? pithink

cobalt cloak
#

who?

stuck furnace
#

Colorado?

#

I kind of want to move to Denver for some reason πŸ˜„

terse needle
terse needle
cobalt cloak
#

yo that looks like a rdr2 boat looks like

cobalt cloak
#

yea

dry jasper
#

@zenith radish

reef badger
#

Choose a safer drink

cobalt cloak
#

cocke is better

#

pepsi is the bad cousin

cobalt cloak
#

yas

dry jasper
#

@zenith radish

cobalt cloak
#

and i am ksi

cobalt cloak
#

better call saul

cobalt cloak
#

you got that right

#

(breaking bad refrence)

reef badger
#

expat communities may not even interact with the natives. This causes countries to adapt <Country>-ization where they make the expats move away. True story.

cobalt cloak
#

efi the tiger

somber heath
#

@cobalt cloak Your mic keeps fuzzing.

cobalt cloak
#

sorry

somber heath
#

No.

stuck furnace
#

@cobalt cloak this

reef badger
#

decrease sensitivity, so we don't pick up the air brushing against the mic

stuck furnace
#

You raised/lowered it right? It sounds better πŸ€”

#

Back later πŸ‘‹

reef badger
#

enable push to talk

#

i'm new

cobalt cloak
#

oh

molten pewter
reef badger
rugged root
#

Easy on the gifs

reef badger
reef badger
#

that's what she said

cobalt cloak
#

🀌 🀌

#

pizza pasta mama mia

reef badger
#

in windows 11, just holding the print screen gives the snipper

rugged root
#

My only problem with the snipping tool is that some drop-downs or windows will change when you press a key

#

It's why I like Greenshot. It takes the frame before the keypress and lets you snip that

reef badger
#

That's magical

exotic moss
#

im p sure sharex might do that but im not completely sure

#

i only use the snipping tool when i dont have anything else to use bc its good enough

reef badger
#

studying, learning and growing doesn't really stop and just because one knows the derivation to projectile motion doesn't mean they should end up in ballistics.

dry jasper
#

Unit 8200 (Hebrew: Χ™Χ—Χ™Χ“Χ” 8200, Yehida shmone matayim "Unit eight two-hundred") is an Israeli Intelligence Corps unit of the Israel Defense Forces responsible for clandestine operation, collecting signal intelligence (SIGINT) and code decryption, counterintelligence, cyberwarfare, military intelligence, and surveillance. Military publications inc...

reef badger
#

lambda x: print("I've already said Hello to you World, what now")

dry jasper
#

menemen

reef badger
#
def hello():
 print(input("What is the answer to life?"))
 return 0
somber field
#

42

#

btw

fleet hawk
#

hello guys

reef badger
fleet hawk
#

can someone help me in python i have an error and i need help

somber field
reef badger
rugged root
reef badger
fleet hawk
#

okeey

wind raptor
#

!tvmute 266899703067705344 1w Racist remarks/jokes are never allowed in the server. It is offensive and inappropriate in all situations. Please take this time to review our #rules and #code-of-conduct.

wise cargoBOT
#

:incoming_envelope: :ok_hand: applied voice mute to @somber field until <t:1695746011:f> (7 days).

somber field
#

got muted

#

im not racist lmfao

#

nvm

fleet hawk
#

I updated these functions but the error is

#

from models.engine.file_storage import FileStorage
ModuleNotFoundError: No module named 'models

rugged root
fleet hawk
#

yes

dry jasper
#

like this

fleet hawk
#

you mean like this

dry jasper
#

no

#

3x `

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.

rugged root
#

Like that in the embed

fleet hawk
#
#!/usr/bin/python3
"""This module defines a class to manage file storage for hbnb clone"""
import json

class FileStorage:
    """This class manages storage of hbnb models in JSON format"""
    __file_path = 'file.json'
    __objects = {}

    @property
    def cities(self):
        """"return cities"""

    def delete(self, obj=None):
        """delete obj from __objects if it’s inside - if obj"""
        if obj:
            id = obj.to_dict()["id"]
            claName = obj.to_dict()["__class__"]
            kyName = claName+"."+id
            if kyName in FileStorage.__objects:
                del (FileStorage.__objects[kyName])
                self.save()

    def all(self, cls=None):
        """Returns a dictionary of models currently in storage"""
        n_dict = {}
        if cls is not None:
            claName = cls.__name__
            for key, value in FileStorage.__objects.items():
                if key.split('.')[0] == claName:
                    n_dict[key] = str(v)
            return n_dict
        else:
            return FileStorage.__objects

    def new(self, obj):
        """Adds new object to storage dictionary"""
        self.all().update({obj.to_dict()['__class__'] + '.' + obj.id: obj})

    def save(self):
        """Saves storage dictionary to file"""
        with open(FileStorage.__file_path, 'w') as f:
            temp = {}
            temp.update(FileStorage.__objects)
            for key, val in temp.items():
                temp[key] = val.to_dict()
            json.dump(temp, f)

    def reload(self):
        """Loads storage dictionary from file"""
        from models.base_model import BaseModel
        from models.user import User
        from models.place import Place
        from models.state import State
        from models.city import City
        from models.amenity import Amenity
        from models.review import Review
rugged root
#

Boom, perfect

fleet hawk
#
 classes = {
                    'BaseModel': BaseModel, 'User': User, 'Place': Place,
                    'State': State, 'City': City, 'Amenity': Amenity,
                    'Review': Review
                  }
        try:
            temp = {}
            with open(FileStorage.__file_path, 'r') as f:
                temp = json.load(f)
                for key, val in temp.items():
                        self.all()[key] = classes[val['__class__']](**val)
        except FileNotFoundError:
            pass
#

this is the error

#

from models.engine.file_storage import FileStorage
ModuleNotFoundError: No module named 'models

reef badger
#

This is the first time in my life I've seen a function do module imports, wow.

past flare
#

hey guys

#

how are you doing

reef badger
#

Reading the code above this

#

and listening to someone talk not about Jojo Rabbit

past flare
#

dude i dont think Im able to send 50 messages to get voice verify

#

😭

#

lets have a convo

#

help me

reef badger
#

If the admins here had any sense of strictness, they wouldn't allow convo from voice channel chats to count to the message count.

past flare
#

where is your brain dude? really

ivory flower
cobalt cloak
reef badger
past flare
#

so doesnt it help me?

#

y/n

reef badger
ivory flower
#

I dunno your project structure, just want to see the path to the module

dry jasper
#

zschoken

fleet hawk
dry jasper
trim badge
#

guys

#

i need to send 50 messages

#

to talk?

#

yes?

wind raptor
#

Please do not spam or you will have to wait longer

trim badge
#

wait no

#

but i want to talk and i dont know what to send

#

chris

wind raptor
#

Just participate in the normal conversations within the server.

trim badge
wind raptor
#

Yes

trim badge
#

ok thank you

wind raptor
#

Check out that channel to see the requirements

trim badge
#

ok

reef badger
#

!e for i in range(10): print(i)

wise cargoBOT
#

@reef badger :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
reef badger
#

yay, i made a loop work

#

why waste diamonds on the drill.

#

the dust could be used for makeup

vocal basin
wise cargoBOT
#

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

42
vocal basin
#

!charinfo ΰ§ͺΰ­¨

wise cargoBOT
reef badger
#

glad to know

echo garden
#

That's me using a push mower

reef badger
#

you caused a robot to lose its job today hihi

echo garden
#

@reef badger A push mower

#

!

#

my body is already soar

rugged root
#

Wait, why are you guys still in code help

wind raptor
#

Β―_(ツ)_/Β―

rugged root
#

Just noticed that

wind raptor
#

We'll move haha

scarlet halo
#

hey

rugged root
#

Bois D'Arc

scarlet halo
#

i'd be left i believe in myself

rugged root
#

Miss Tryst

dry jasper
#

Why is python soooo good?!?!?

scarlet halo
reef badger
dry jasper
#

Especially compared to js

dry jasper
reef badger
dry jasper
#

Ros?

reef badger
#

because talking to servo motors is important

dry jasper
#

I am a noob

#

Whats ros?

reef badger
#

you wouldn't believe me if I told you

dry jasper
#

Most likely

reef badger
#

robot operating system

#

ros

cobalt cloak
#

what are you talking about?

dry jasper
#

Dat dus

#

About how awesome python is

cobalt cloak
#

oh gut gut

dry jasper
#

And how its way better than js

cobalt cloak
#

you are not even inthe vc

reef badger
#

poor js battling with webassembly and typescript, now contending with python. I don't think it's meant to be compared.

rugged root
#

It's not battling at all

#

It won

#

Everything still boils down to JS at the end

dry jasper
#

I know

#

From a astetics python also wins

#

That sexy indentation

#

Look at those curves

reef badger
#

okay, as long as you're having fun.

dry jasper
#

Klopt

stuck furnace
rugged root
#

Well played

#

Very well played

#

Wait what the heck is a stack profiler trampoline

stuck furnace
rugged root
stuck furnace
whole bear
#

Casting spells ?

#

Over

stuck furnace
#

sys.activate_assembler_trombone() is being added in 3.13

rugged root
#

A trampoline is a small piece of code that is created at run time when the address of a nested function is taken. It normally resides on the stack, in the stack frame of the containing function.

stuck furnace
#

I'm going to have to read that a few times to understand it I think pithink

rugged root
#

I... kind of get it?

stuck furnace
#

Oh he was having some intermittent noise issues earlier because his mic sensitivity was too high.

rugged root
dry jasper
#

that looks juicy

wise loom
#

yes

#

vanilla extract

#

you can throw in a lot of things

fierce summit
#

hi

rugged root
#

How've you been?

#

Been a while

gentle flint
#

hi

fierce summit
#

I was finally been able to get into the Python course on my university

rugged root
#

Niiiiiiiiiiiiiiiiiiiiiiiiiiiice

dry jasper
#

The Kooikerhondje (Dutch for "Duck catcher's small dog") is a small spaniel-type breed of dog of Dutch ancestry that was originally used as a working dog, particularly in an eendenkooi (duck decoy) to lure ducks. Kooikers were popular in the 17th and 18th century and appear in the paintings of Rembrandt, Gerard ter Borch, and Jan Steen. The bre...

fierce summit
#

It's kinda easy for me for the time being

vivid palm
rugged root
gentle flint
#

Apporteren (Frans: apporter = "hier brengen") is het ophalen van wild of gevogelte door een jachthond. Op het apporteren gespecialiseerde honden worden retrievers (letterlijk "ophalers") genoemd, maar ook andere jachthonden worden geacht te apporteren. Ook als spel is deze activiteit niet ongebruikelijk, hoewel het dan meestal gaat om het terugb...

fierce summit
#

Athough I've been struggleing with downloading an older python to my linux laptop

dry jasper
vivid palm
rugged root
#

pyinstaller should help

fierce summit
#

on manjaro?

#

I might just stick to windows, when it comes to python

gentle flint
#

or just virtualenv

rugged root
#

Wait

#

No, I'm thinking the wrong thing

dry jasper
#

Fetch is a pet game where an object, such as a stick or ball, is thrown a moderate distance away from the animal, and it is the animal's objective to grab and retrieve ("fetch") it. Many times, the owner of the animal will say "Fetch" to the animal before or after throwing the object. The game is usually played with a dog, but in rare instance...

rugged root
#

pyenv

#

That's the one I was thinking

dry jasper
fierce summit
#

yeah, I've been trying that, but it doesn't recognise pyenv

#

I might just be stupid for linux

gentle flint
#

manjaro can be annoying

fierce summit
#

I will ask my classmate tomorrow, who did my linux laptop

gentle flint
#

it's why most people are told to start with Ubuntu

rugged root
#

It can still be an issue

gentle flint
#

sure

rugged root
#

Wrangling multiple Python versions on Linux is always a bear

gentle flint
#

it's just often easier to fix

#

cuz more support

#

so there's usually already a stackoverflow question about it

rugged root
#

Why would that be a sad face

vivid palm
whole bear
fierce summit
# gentle flint manjaro can be annoying

yeah, but I like it better than ubuntu, because I had problems with some stuff (like c and c++ compiler) being not the same version as the teachers on LTS ubuntu

rugged root
#

Oh my god I've never seen that emoji before

#

That's gold