#python-discussion
1 messages ยท Page 139 of 1
If you do not get an answer here, you may try poking around in #tools-and-devops.
https://stackoverflow.com/questions/23516219/pycharm-hide-files-by-pattern This seems to talk about hiding files. Maybe you'll see something useful. I don't know enough about PyCharm to be particularly useful.
@gilded wolf ^^
Looks like it's only for the file selector dialogue.
The element is known. What is not known is the maximum and minimum number of times an element may occur within the "array", which could be one of a number of different object types and whether we need to find all such indexes or just the first. enumerate may be applicable or not, depending.
Thanks bud
Wait letme check
Thankyouu
@shrewd lance What type of object is the array in question? Is it a list?
is _variable and __variable both private variables?If yes then why some places use __
Neither are private.
They're both considered private because they begin with underscores. Just a naming convention.
The __variable one is subject to name mangling, intended to support subclassing.
When you use it in a class, it gets prefixed with the class name, so that the same __foo in dirrentent class attributes have distinct names.
This isn't used much.
The single prefixed underscore is a suggestion to the user-programmer "You probably shouldn't be using this directly. def _foo(): ...
As an affix, a single underscore can be used to avoid shadowing of particularly builtins.
Where OpalMist is going is: Python doesn't prevent you accessing these variables. The name is just a hint to other programmers.
sum_ = ...
I don't think OpalMist knows where OpalMist is going
yea when i use these variables in class arent they private variables?
from what u have said i think this is what u mean
_foo is probably used to show dont use this outside class
__foo has to do something with subclass
Yes.
!e ```py
class Foo:
def init(self):
self._a = 1
self.__b = 2
f = Foo()
print(vars(f))
:white_check_mark: Your 3.14 eval job has completed with return code 0.
{'_a': 1, '_Foo__b': 2}
Read this section: https://docs.python.org/3/tutorial/classes.html#tut-private
The single prefix _ is something independent of classes.
Though it may still be used as you describe.
in a class named Foo, an attribute named __b is shorthand for _Foo__b
i just learnt this
and the reason that's useful is to allow a class that's being subclassed by different authors to easily have per-subclass attributes that won't conflict with the parent class's attributes or with other subclasses' attributes
Hello, everyone.
imo __foo is a pita and doesn't belong in python
You're welcome to not use it. Many do not.
it's not commonly useful, it's a workaround for a problem that most people don't have
i was learning getters and setters and @property or smt which are ways to access the private variable in case ig,
tho we can get and set variables like print(p.email) or p.email = "hh" we dont do that but use the 2 methods of getting and setting ig
just let me monkey patch whatever I want without obscuring it further smh
will read ๐
my issue comes from libraries that use it
Really? They're "private" attributes. Do they affect you?
Right now, I found out about the @property decorator, too! It makes creating getters in Python so much better. I wish I knew about this decorator sooner.
like u found about this on my message?
Remember that a property wants to look like an attribute.
- O(1) instant access, usually
- probably doesn't change
Just guidelines.
single underscore is fine then, it gets the point across
getters allow you to get directly relevent info . Lets say you have a clas that has a dict member, and whenever you "get" that variable , all you are looking for is a certain attribute from that dict , like name of person , you can write a getter to do that
setters allow you to do input validation , like make sure any invariants needed for that class are met and not allow any input that doesnt make sense, like not allowing setting a negative number for person's age
more relevantly, getters let you synthesize an attribute
No, I was writing a message about finding that out, and you sent your message. I think that it's a cool coincidence that we found out about the same thing at the same time.
Birthday paradox.
nah my doubt is we can actually get and set without these methods but we use it for convention anyways?
i just told you how a getter/setter can have different functionality from just doing print(class.variable) or class.variable = value
class Square:
def __init__(self, side_length):
self.side_length = side_length
@property
def area(self):
return self.side_length * self._side_length
@property
def perimeter(self):
return 4 * self.side_length
no, you should only create a setter or a getter when you want to do something other than just set or just get the attribute.
In python we often just access attributes directly. Pure OOP goes through getters and setters because of the separation of methods from the object internals.
We use @property and @....setter etc when we want some extra behaviour assoicated with something which, from outside, looks like an attribute.
do you seek to invoke the wrath of hettinger? a square class? a square?
it's fine as long as no one tries to put a Rectangle in the same program
Does it make sense for a property to be O(n) access sometimes? For example, what if the property is the sum of the elements in a list in the class?
reject property, embrace setter functions for chainability /s
I've often said that I think the biggest problem with teaching OOP is that the examples that are small enough to be easily understood are too trivial to be useful, and thus make bad examples, and but the examples that make it clear why OOP is useful are more complex and aren't able to be understood without first understanding those basics
that should almost certainly be a method rather than a property
users expect property access to be fast, and doing an unbounded amount of work in a property defies user expectations
Clearly then this is knowledge of which man is not meant to ken. Forbidden knowledge.
If you get to do it once and then cache it? Maybe. If the list is always very short (eg your 3 items example). Yes. If it's potentially very long so that the O(n) matters, better as a method so that users' expectations are not misplaced.
or to put that slightly differently: by making it a method, you can convey extra information to the user that is helpful for them to have; namely that it is not as cheap as accessing an attribute
so we can access it anyhow we want.But pure oop uses getters and setters as convention.
and We use @property and @....setter etc when we want some extra behaviour assoicated with something which, from outside, looks like an attribute. ic ig i got it now
But pure oop uses getters and setters as convention.
I'd say that Java-style OOP uses getters and setters by convention. Python-style OOP does not
Thanks! That's good to know.
Python-style OOP doesn't need to, because @property and @x.setter allow a method to masquerade as an attribute
Java-style OOP uses getters and setters for everything just in case extra behavior needs to be added later. Python-style OOP doesn't need to use getters and setters for anything, because you can replace an attribute with a @property in the future without breaking your users
yea kind of my teacher is teaching java setter and getter in python as a traditonal way and then saying use @property instead .....
that's not the typical idiom in Python
you would typically use regular attributes until and unless you need specific extra functionality, at which point you would switch that attribute to a property
@chilly whale, why do think that it's more acceptable to have multiple classes in a single file in Python, while it's looked down on in Java?
sometimes people take practices from an old language to a new one, without considering that the new one is different ๐
๐คท
that's enforced by the language. Java doesn't allow you to have two top-level classes in the same file.
is that still true?
hi, where can i ask for help on a project, like, in general?
last I heard, but I haven't written Java in a decade, so maybe my knowledge is outdated
You can ask for help in #1035199133436354600.
java doesn't allow you to have more than one public class in a file
thank you
Although I'm aware that it's not allowed, I'm wondering about the reason that it's not allowed.
if your file has more than one public class, it's doing too much
java kinda swiped the python change system and has JEPS. their influence has made modern java wild. anonymous classes and such things. it's probably somewhat unrecognizable to not just godly but me too
what a terrible take
you can't have two public classes in one file in java
in the context of java
oh
btw does name mangling a thing only for classes to make strict private variables or can it be used in other places maybe like a function or module uk
After all, if you have multiple classes that are closely related to each other and are short, isn't it better to have them all in one file?
they should be in the same package
or at the very least, private classes in one file
name mangling applies to attributes and methods, but not to functions or modules
only for classes, but it's not for "strict" private variables/attributes --- it's for cases where you're afraid the attribute name may clash with a parent's or subclasses or something
ohh ok
like, it's fine to just prefix private attributes with _
โ
if someone depends on your private attribute, it's their problem
as unpythonic as it sounds, I wouldnโt mind a better/real way to set private attributes. in cpython at least, itโs a common headache for us to break things downstream because people rely on our internals
.read for my own reference
I agree with that.
python's fault for having good internal tools
bye yall
it sometimes gets so bad that we just give in and turn something prefixed with _ into a public, documented interface
users being able to mess with every attribute of a class has occasionally forced me to make something into an extension class for no other reason than to have true privates, so I actually more or less agree with you
when did that happen



i was about to mention codecs.escape_decode (and escape_encode) with a ๐ฅบ, but instead i shall hereby request you distribute several cookies to whoever decided to add it to the docs for 3.13+
thinking out loud, what if there were an unstable tier for python APIs? like sys._getframe could become sys.__unstable__.getframe. that way, we can expose helpful implementation details without actually committing to the maintenance burden. (we already do this in the C API with PyUnstable)
i think i've used random private functions in heapq
one of the siftdowns
or maybe something else, dunno
Often.
Yo how do I fix โ โawait โ allowed only within asynic functions 5 times and continue can be used with in a loop errors?
By making the function an async function.
How?
Unless you're trying to await nonasync things in a nonasync function.
async def instead of just def
But it sounds like you may not be familiar with the async stuff.
This seems related to the way everyone ignores depreciation warnings
If is before it tho
You will need to show the actual code.
''' if await can_send_message(user_id, channel_id, db):
msg = await create_message(db, channel_id, user_id, processed["content"])
await manager.broadcast(channel_id, {
"user_id": user_id,
"content": processed["content"],
"timestamp": str(msg.timestamp)
})
else:
await websocket.send_json({"user_id": "system", "content": "You are not allowed to send messages here", "timestamp": ""})
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from app.utils.rate_limit import rate_limit
from app.utils.logging_utils import log_action
Rate limit before broadcasting
try:
rate_limit(user_id, limit=5, per_seconds=10)
except HTTPException as e:
await websocket.send_json({"user_id": "system", "content": str(e.detail), "timestamp": ""})
continue '''
This is the part I have errors on
Go to the top of the function. Is it def or async def ?
''' py @router.websocket("/ws/{channel_id}/{user_id}")
async def websocket_endpoint(websocket: WebSocket, channel_id: str, user_id: str, db: AsyncSession = Depends(get_db)):
await manager.connect(channel_id, websocket)
try:
while True:
data = await websocket.receive_text()
processed = await process_message(user_id, data)
if processed["allowed"]:
msg = await create_message(db, channel_id, user_id, processed["content"])
await manager.broadcast(channel_id, {
"user_id": user_id,
"content": processed["content"],
"timestamp": str(msg.timestamp)
})
else:
await websocket.send_json({"user_id": "system", "content": processed["content"], "timestamp": ""})
except Exception:
manager.disconnect(channel_id, websocket)
from app.config import DATABASE_URL
from app.security.permissions import can_send_message '''
Hey @barren valley!
You are using the wrong character instead of backticks. Use ```, not '''.
Also, make sure there are no spaces between the back ticks and py. Make sure you put your code on a new line following py. There must not be any spaces after py.
Here is an example of how it should look:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
That's not where the error is from. Show the full error message
@router.websocket("/ws/{channel_id}/{user_id}")
async def websocket_endpoint(websocket: WebSocket, channel_id: str, user_id: str, db: AsyncSession = Depends(get_db)):
await manager.connect(channel_id, websocket)
try:
while True:
data = await websocket.receive_text( processed = await process_message(user_id, data)
if processed["allowed"]:
msg = await create_message(db, channel_id, user_id, processed["content"] await manager.broadcast(channel_id, "user_id": user_id,
"content": processed["content"],
"timestamp": str(msg.timestamp)
})
else:
await websocket.send_json({"user_id": "system", "content": processed["content"], "timestamp": ""})
except Exception:
manager.disconnect(channel_id, websocket)
from app.config import DATABASE_URL
from app.security.permissions import can_send_message
Before broadcasting message
if await can_send_message(user_id, channel_id, db):
msg = await create_message(db, channel_id, user_id, processed["content"])
await manager.broadcast(channel_id, {
"user_id": user_id,
"content": processed["content"],
"timestamp": str(msg.timestamp)
})
else:
await websocket.send_json({"user_id": "system", "content": "You are not allowed to send messages here", "timestamp": ""})
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from app.utils.rate_limit import rate_limit
from app.utils.logging_utils import log_action
try:
rate_limit(user_id, limit=5, per_seconds=10)
except HTTPException as e:
await websocket.send_json({"user_id": "system", "content": str(e.detail), "timestamp": ""})
continue
log_action(f"Sent message in channel {channel_id}: {processed['content']}", user_id)
from fastapi import HTTPException, status
from app.security.permissions import can_send_message
you need to use backticks [ ` ] and not single quotes [ ' ].
backtick is usually found above the Tab key on English keyboard layouts.
!trace
Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.
A full traceback could look like:
Traceback (most recent call last):
File "my_file.py", line 5, in <module>
add_three("6")
File "my_file.py", line 2, in add_three
a = num + 3
~~~~^~~
TypeError: can only concatenate str (not "int") to str
If the traceback is long, use our pastebin.
"await" allowed only within async function Pylance [Ln 47, Col 4]
"await" allowed only within async function Pylance [Ln 48, Col 11]
x "await" allowed only within async function Pylance [Ln 49, Col 5]
x "await" allowed only within async function Pylance [Ln 55, Col 5]
x "await" allowed only within async function Pylance [Ln 64, Col 5]
"continue" can be used only
only within a loop Pylance [Ln 65, Col 5]
What happens when you run the code?
We don't know what line 44 is. But you're not showing us the right code. Use the pastebin, so we can see line numbers
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Hi I am just wondering, can Django be used with React?
Yes, Django can be used very effectively with React
But how does that work? How do you use templates with react?
There's three blocks of code that make no sense where they are at the bottom. The 'continue' outside a loop, for instance.
Line 67-70?
That's one block, yes
Its easier if you make Django serve API endpoint and then use React to consume that API
Deleted
OHH. So would react still be served using django? Or would react be served independantly?
Delete continue or no?
you can have it both ways, though the latter is simpler
What are you trying to do with this code? Why is that continue there?
if you start passing around too many parameters do you group related ones into an object
So Ifi added more code itll continue
What?
Honestly that didn't even make sense to me
You're really trying to do something hard.
Async, discord bots, etc do require understand certain fundamentals (like loops and continue)
I know but only have 19 errors that is kinda hard but easy
probably more errors as you fix the errors
You don't have 19 errors, the entire thing appears to be wrong.
The problems tab says 19
The problems tab only tells you about syntax problems
"A purple elephant danced in my taco"
Oh
Might be a valid sentence, even if it makes no sense
So how would icheck it run debugger
Do one thing at a time, run it, review any errors, then do the next thing
the next thing: rage
against the machine, for sure
So ignore the await errors and the others
Can anybody come in help section
what is an "away error"?
Auto correct
The file is my web socket For the chat app
@silver plover found traceback
@warped sigil Wsp
there's no reason to type as List instead of list right
unless you're on an ancient python version
Yeah
Idk what to do rn
code a b2b yc backed ai saas
l , jkhj/o;'
Check out #python-discussion message
For the errors?
Hello snek world
Happy today's New Years Eve Day! I'm so excited for achieving a master's science degree in Computer Engineering!
Yay
Damn congrats
people be making naked pics of me with ai on insta is there any way to avoid this
do i just delete everything
you can report it - that's about it
report to who
whatever platform it is on.
thats not gonna stop them
cyber cell๐
who is that
As far as ik, if something is on the internet (leaked), you canโt completely delete it. Even if you try it. copies may already exist and it wonโt truly be erased
file a complain to CyberCell of your country
If you are a child in the United States you can make a report to the FBI's Child Exploitation Notification Program. https://www.fbi.gov/how-we-can-help-you/victim-services/cenp
Thats why people keep repeating ,
"what you upload will never be ereased"
im not a child
and privacy is a myth
on god ai ruined social media
Why what happend
Uhh is that epstein on ya pfp ๐ญ
Social media was already ruined what are you on?
random people sending me my naked pics that i never shared
Exactly. It's just "loop"
made by ai
I recommend moving to off topic since this is no longer Python.
What happend
u r right
bitter truth, but it can't be reversed
I quit social media half a year ago and my life became slightly better.
Its not good for you to doomscroll tiktok
Of real people ?
yes
If you are not a child then it is freedom of the artist's expression. There are multiple cases where this has happened. You can report the user on the platform where the images are being shared if you don't consent to the creation, but it is not a crime in most locations.
sad thing if you would want to report it you cant sue the software or the company only the user who sent you the pictures
why is OT more on topic than here lol
This chat derails after 1:00 AM EST in most instances lol
it looks so real like if they send those to any of my family memeber or school friend they would beilive it no matter
Thats why you dont upload yourself to social media
You accepted a ToS tho
when registering
Yes, but this happens to Linkedin members too lol.
There's a legitimate Chollima deepfake campaign by APT Lazarus.
mah
ai will take over
lmao
Ai cant get better
it's a cat & mouse game of standards & procedures. everything will catch up eventually
ok so with this script that i am tryna to use it just keep saying Traceback (most recent call last):
File "C:/Users/user/AppData/Local/Programs/Python/Python314-32/genscript.py", line 4, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
help me please ๐ญ
where did you get the script from? did you install requests?
no how do i do that im new to python
it seems like you dont have module named requests
and i got the script from a yt vid
does the video not provide install instructions or anything?
...hope it's a trusted source
python -m pip install requests on command line
generato
where do i put that
this script is going to reach his braincells and destroy them
im slow ๐ญ
cmd dummy
you're in windows, right? open terminal (search terminal in windows search)
it'll give you a space to type, paste that command and press enter
let's not be rude to people who aren't as technically inclined as you think they need to be
it says C:\Users\user>python -m pip install requests
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
try py -m pip install requests instead
^
ok
also you should ideally not keep your project/script files in the same folder where python is installed
ok so ill move them
do you have pip installed?
almost
thanks for yall help fr tho ๐
ok i have it downloaded
so i try the file again?
script*
now it says = RESTART: C:/Users/user/AppData/Local/Programs/Python/Python314-32/genscript.py @hasty island
restart
my pc?
k ty
well, that doesn't look like an error, without knowing what the script does, I can't say what that means for sure, but restarting the pc is a good guess
the script is to generate nitro codes ๐ญ ๐

๐ญ ๐ญ ๐ญ ๐ญ ๐ญ ๐ญ ๐ญ
Yeah okay not something we're going to help with
And fair warning most nitro code generators you grab off the internet are most likely malware
๐๏ธ
ok sorry ๐ญ thanks for help tho
What do you think malware is?
uh huh
a. A script doesn't need to download anything to perform malicious stuff
b. Remember the requests library you installed? That can absolutely download stuff
what video did you get the script from?
ion got nothing that good on here tbh
ill send link in pms
there's more that can be compromised than you would expect
- money is money
And even a honest to god nitro code brute forcer is not going to fetch you valid codes in any reasonable amount of time
best case scenario you run the script to no avail, worst case scenario you end up with malware on your pc
this is a throwaway laptop i dont even have discord downloaded
๐ญ
๐ฟ
alright
dm me rq
unable
what even..
?
.....
๐
๐ญ
I was about to report this to the mods
crazy work
uhm so yea
I have a channel just for myself
Fortunately not malware, but the uploader does provide a Linkvertise URL to access the script, so do with that information what you will

do you make scripts for python?
what do you mean?
like just script like gui or sum
I'm not sure what you mean, but I do sometimes write scripts if that is what you're asking
From all over to be honest, I guess most of it came from trying stuff out
ohhhhh ok ik how to make like some multi tools in notepad++ from yt and stuff im just trying to learn python now
!resources page has a great list of beginner guides to learn Python
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
"Automate the Boring Stuff" is a free ebook that you can read online and follow exercises.
ty
CS50P from Harvard is a free course with video and an online editor to submit your lessons and exercises too
bet
If I put an ai generated document into an ai to human text tool, can a professor still detect it?

is it worth the risk?
yea
i need help ๐ฆฅ
https://www.youtube.com/watch?v=hMloyp6NI4E (why you "should" cheat)
so what if I say they would not see it?
u sure tho
I never lie
๐ฆฅ
Go ahead and ask we won't bite
#โ๏ฝhow-to-get-help if it's you feel it'll take a bit of back and forth, otherwise just ask here
so basically iam tring to make a controller macro but the problem is every time i try it , the buttons are always wrong
im not writing about deep q networks by myself
why not?

i++
because I dont know to use the right professional phrases
!paste your code
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
without little cheating
ok lets say i made a Dos attack whould i get in trouble by the police if i send it to 20+ ppl?
mport pygame
import pydirectinput
import time
import sys
EDIT_KEY = 'f'
AXIS_THRESHOLD = 0.85
DEBOUNCE_TIME = 0.12
FPS = 240
pygame.init()
pygame.joystick.init()
if pygame.joystick.get_count() == 0:
sys.exit()
pad = pygame.joystick.Joystick(0)
pad.init()
pydirectinput.PAUSE = 0
pydirectinput.FAILSAFE = False
clock = pygame.time.Clock()
editing = False
last_action = 0
def detect_l3():
start = time.time()
while time.time() - start < 10:
pygame.event.pump()
for i in range(pad.get_numbuttons()):
if pad.get_button(i):
return ("button", i)
for i in range(pad.get_numaxes()):
if abs(pad.get_axis(i)) > AXIS_THRESHOLD:
return ("axis", i)
time.sleep(0.01)
sys.exit()
l3_type, l3_index = detect_l3()
def l3_pressed():
pygame.event.pump()
if l3_type == "button":
return pad.get_button(l3_index)
return abs(pad.get_axis(l3_index)) > AXIS_THRESHOLD
while True:
pressed = l3_pressed()
now = time.time()
if pressed and not editing and now - last_action > DEBOUNCE_TIME:
pydirectinput.keyDown(EDIT_KEY)
pydirectinput.mouseDown(button="left")
editing = True
last_action = now
elif not pressed and editing and now - last_action > DEBOUNCE_TIME:
pydirectinput.mouseUp(button="left")
pydirectinput.keyUp(EDIT_KEY)
editing = False
last_action = now
clock.tick(FPS)
so if you cheat a little or you cheat a lot - you still cheated & you submitted a cheated assignment, right?
so using fake sounding phrases would make it more believable?
Just use your own language that your teachers know about
why do you make a dos attack at the first place
you might
i def did not lets just say i did
Use the link in the bot response to avoid a wall of text (and it's just easier to look at)
I'm sure your professor would rather get something that you wrote yourself, even if it doesn't sound professional. People are pretty sick of LLM-speak writing anyway.
Nah youre weird and a liar
put ur code in barckets like that 3x`py
not weird but ok bud
so not disagreeing with liar?
weird```
Your ISP can flag you and terminate your contract if malicious enough.
true
hn i made a Dos attack frm this yt vid i seen
with a batch file
how ๐
Since its not Python related, please take it to offtopic. kthx 
๐ฟ
^^ read the embed it walks you through it @patent sky
yeah, that might get you into troubles
brother who are you python police ๐ญ
helpers are here to help bro
yea maybe im not going to send it out
Why are you disrespectful?
This is a python discussion. There's a literal off topic thread for most of these questions.
No, he's python agent q
im not lol im just asking

you should reach out to a lawyer, not admitting to these crimes on discord where it's off topic
๐ญ
tbh most batch file dos attempts are just pinging the firewall with max packets in the cli
Whats the problem?
all mine do it just open cmd
idk tbh but it always detect the wrong buttons
until your pc crash
Its not the same tho if you say
"I made a dos program"
"i followed a tutorial and copied his code to make a dos program"
thats a zip bomb
why are you using pydirectinput?
well yea i made it in notepad++
I know that guy
Youre weird honestly
I went on my own quest to nmap the internet just to discover someone already did it. https://www.youtube.com/watch?v=Hk-21p2m8YY
how am i weird
i thought it's better
๐คฆโโ๏ธ
isn't it ?
Time to stop discussing malicious code
What was wrong with pygame.key ?
how am i weird
tbh buddy just discovered .bat files & a continuous ping
One day you will hopefully understand.
Lets switch topic
he'll probably go to school & be like "we got a huge cybersecurity risk here, i need to discuss with the sysadmin now" > shows some .bat file
iam making this code for fortnite so pygame.key dont work for it
pygame is a game engine made in Python. Its made for developers who wants to build a game
so ?
How is fortnite related to game building?
iam not using pygame.key
when i use it will not detect any key
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
wth ?
sounds like game cheat or something
no ๐ฆฅ
No Wind - You are looking for help on mapping a controller to new keys, is that correct?
yh
so what are you doing that is not related to a game cheat or something?
good morning soon to be new years people!
and you are trying to map this using a python tool?
yeah ?
what the game cheat you are seeing ?
the type of game cheat when you inject input?
Sometimes people ask us generic questions for their own non-python related questions.
What about looking into keybinds? Does changing the keybinds work for you? or are you specifically targeting a python related issue?
you dont have to be defensive, you can just tell us what you want to do
iam not doing what are you saying
so tell us, you have not done that yet
I am asking if you are trying to do a game cheat by injecting input
i said to you up there No
so what is the thing that you are trying to do that is not trying to make a game cheat by injecting input?
That is a rule violation. We're not going to discuss remote administrative tools via Python unless you have a very case specific use like enterprise monitoring.
wanna take a look at the code ?
you will know its not " cheating "
sure, but you can just tell us instead
I did, and it did look like trying to inject input into a game cheat
we want to know
the code is here just take a look
.
you still haven't stated what you are trying to do that is not about a game cheat that inject input
thanks, now tell us what you are doing or trying to do please
omg man english is not my first language how am i supposed to tell you
oh i see @patent sky you will be banned for running this with fortnite
you should try your best
fortnite is the problem ?
๐ฟ
fortnites anticheat is strickt with this yes
so hows yall day
no its not man
tell us what you want to do and maybe we know another way
wait a sec why you want to know ?
oh i see, did you do any work on EAC?
is it that important for you ?
It helps solve the XY problem and making sure we solve the right problem.
The more you try to hide the actual problem you want to solve, the more suspicious it makes you
LOL
they are 1000 words
now, you have an issue X, you dont know how to solve that. but you think you can solve it by doing Y. you tried to do Y, and im telling you if you do Y you will get banned, and you violate muyltiple of our rules and you break fortnites terms of serviice @patent sky
and you should read and understand them
i readed them but i havenot fined the rule that i breaked
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
You, apparently
inappropriate, malicious, or illegal. ?
you missed a part
the first part
may violate terms of service
what does that mean
you don't say? Insert Nicolas Cage meme*
you are breaking fortnites rules
that is called a terms of service
ok so what i did to break it ?
but you might not @patent sky it just looks like you are
bypassing Fortnite's anti-cheat mechanism violates Fortnite's terms of service that you agreed to.
the script you posted appears to remap the L3 key & then enable a faster rate of fire?
throwback to putting a spoon inside my controller so I could rip shots on the fn fal
tell us what you want to do instead
but iam not
you are automating input to the game
yo eivl
yo
i just want to know what is the number for L3 CONBTROLER BUTTON
hows your day bro
i see, why do you want that, tell us what you are trying to do instead of all this back and forth please
im cookiung turkey, so its all good! ๐
it is not any of your bussiness
i gusse
yes it is, thats why we are asking if you dont like that you can leave
thats good i hope its good
i can just not tell you
then you cannot ask about help here. please stop this conversation
dont help with breaking rules here
wtf
bro he is helping me with fortnite settings
stop it
Assuming your use case was legit, you could have shared your use case with us, we would have all learned from it, and you would have gotten your answers half hour ago
i dont even think that's breaking rules. holmes has a controller with more buttons than fortnite is displaying in the custom controller settings.
he's just being dubious af
i told you all the code is up there
you are trying to break our rules @patent sky and you are not telling is what you are doing. you will not get any help here since you are not willing to share
and it breaks fortnites rules, now stop it
final warning
i told you what i want to know
and there was no use case shared
There's no legitimate reason for the script. The article I posted came from fortnite direct.
you did not tell me what i needed to know,.. now either do or stop it
what do you want to know ?
i have already asked that six or seven times already.
tell me what your intent is
Also note that this is not stackoverflow. This is a community where discussions go both ways. This is interactive
So you should expect back and forth, discussions and follow ups
yeah i know! im hip ๐
its learning
what problem are you trying to solve i mean
stack overflow wouldve banned him for repeating on the 2nd try lol
wrong detected buttons
saying your learning and its educational, is just bullishit language to buypass rules
explain what that means
its easy what do you mean explain
wrong detected buttons
what is the hard part
i dont understand what that means, why do you need that, what is it for
any good python library for delaunay triangulation?
i only know how EAC works, i dont know how fortniite works
i want when i press l3 on the controller i want the letter f to be pressed
oga boga
you want to remap or rebiind a controller input to a keybooard inpuut?
yes
but the problem is its not detecting l3
why cant you do that ingame?
or in the OS
i can't
check your controller setting in your OS
there is no setting for it
it has to work there first
i tried DIS4
i see, thank you, now you have a valid reason to do what you are trying to do. and what you are t rying to do will not work. but ill stiilil help you
and did it registerr?
and what if i want l3 to press f and left mouse button
what controller are you using, and what os?
nono
i mean, in your OS
win 11 , ps5
let me get a ps5 contrroller and test it out.. hold on
EAC will stop you from doing that
your controller mapping needs to be one to one
i tried it already man
Most games afaik - will only toggle between one of the two channeled inputs. So you can't have a keyboard & controller plugged in. I mean you can, but it will only keep one active at a time.
- The game input will freeze & then switch back to the other input if you try using both. It only has one 'channel' to read inputs.
yes you can bc i tried it and it worked but wrong button it dont read l3
Which is why people use macros to automate their keyboard inputs. Ive never seen a macro toggle xbox buttons to do certain tasks, it has to stay in the macrolaneeee
even tried detect button
def detect_l3():
start = time.time()
while time.time() - start < 10:
pygame.event.pump()
does F mean Edit builds ?
We are aware of an issue where some players might not be able to use the L3 button to edit buildings in Fortnite. We are investigating and working on resolving this issue. In the mean time, please use a different button in order to edit structures in Fortnite.
this is a message from epic
on their support page
cant fight epic games fate
so once epic has fixed this, your mapping will work
but in fortnite i can edit with l3
now.. you cant change mapping in software with python, EAC wwill trigger
so what is the problem >?
so i just change the l3 and it will work ?
you can map a one to one with a xinput hardware modification on your controller
one to two
iam saying one to two
EAC will trigger if you have one button mapped to two
i said 3 times i tried it and it worked
what driver are you using?
im not saying it do not work, im saying EAC will trigger
no body cares man
'this guy got me vac banned!' - 48 hours later
you are clearly here to waste our time
this sounds like a #ot0-psvmโs-eternal-disapproval discussion rather than a #python-discussion ?
now lets stopped it
no this sounds like a stopped discussion because you are doing this in ill faith
it is innapropriiiate and possible illegal
whatever man you have been talking for half an hour and nothing was fixed ๐
dont worry, i know how to fix it. now lets stop it. no more its clear you want to cheat in the game
eivl's patience far exceeds what wouldve been alloted to you in the morning hours
yeah yeah whatever
be friendly from now on! we are just trying to help you, but once you admitted you where going to cheat, its now clear that we will not help you.
we will just not help you do that, thats all. nothing more!
๐
lol
recently switched to cs50p from helsinki's mooc & i feel like a whole new world of understanding has been unlocked
oh really.. i have heard good things.. tell me more please
iam fixing it by myself
iam always friendly
๐๐๐
head my warning, i know how eac works! ๐
oh, is it that much better?
fantastic! you seem like a nice young man ๐
your warning does not work on me ๐ฆฅ
the videos coincide with the exercises a bit more
...like the idea of chaining methods together isn't ever mentioned in helsinki's mooc, but it's mentioned in week 0 right at the start
i.e.
name.strip().replace()
thx ๐
many have said that right before the ban wave came out! ๐ also EAC is evil..... not as evil as vanguard, but still evil
i feel like there are a lot more exercises in helsinki's mooc, but sometimes it just feel like the solution test cases were a bit more demanding
do you know why this works from an python OOP perspective?
no haha ๐
you should keep that question in the back of yourr miind, and let me know when you figure that out
i have been doing this for 2 years ๐
might take a year or so, so keep iit in the back of your head
and i started with this before the internet! in the early 90s ๐
lmao
so how old are you ?
I did training kata the other day & the solution had a ton of ".replace().replace().replace()"
& for an hour I went bonkers doing multiple lines of .replace just to find it only doing one replacement operation being daisy chained lol
67
damn
HA
40s ?
im 44 now i think
damn
'do you wake up & start screaming?'
What the
no, life just gets better the older you get
this is the way
do people call you daddy ?
not always, but i let it slide in here when people realize im PythonDaddy
that is not common no. my son does that ofc..
PythonBaby*
awww cute
apparently a baby python is called a snakelet, hatchling, or neonate
nerd ?
just autistic
U were trying to cosplay something on the pfp @inland karma
dont tell the moderators, ill get in trouble again
yes
the amount of knowledge staff has in this server is unreal
staff you mean
i stand adjusted
and also the restraint. That daddy answer on any other server would have been devastating
the knowlege lies with the helperrs here, staff and non staff, the rest of us just have experience
you the youth can learn and obtain and therefore share expertise of what you know. us old people can share experience.
a Master to embody power, and an Apprentice to crave it.
iim feeling a new infraction incoming
๐
how else will the chat flourish in the night time of alaskan hours
what happened here
is your gif quota for the year still not empty and you have to use up all of them
i have to use them up ๐ i get a refill 1.1.26 ๐
Is your favourite emoji "๐ "
your name is detected as spam lmao
yeah, and 
he's just doing it for the love of the game ๐ญ
bro chat gpt just made me a code for python it work good
welcome to vibe coding

how did you just manage to send a file
huh you just send the media.discordapp link
Yeah, the same thing happens when all these scam bots try to upload images
discord is inconsistent about how they handle URLS
its a huge problem imho, they teach people that the only way to judge a link is to click it
@inland karma
how else am I supposed to test a link?! (/s)
Not many people realize you can test links through something like a virustotal check. They sandbox the link for you in most cases & report back any malicious cases.
can someone help me
i used visual studio code for a ticket bot but it worked before but now it doesnt work
I find https://urlscan.io to be quite cool for this case.
I usually throw it into virustotal but Ive seen a ton of false positives through virustotal lol
lol, i just ignore them
urlscan.io doesnt accurately flag the eicar file which is kind of interesting
https://urlscan.io/search/#page.domain%3Asecure.eicar.org
there are many ways, but looking at the url, and typing iti in the brower yourself is a good way as well
I don't, I love investigating random stuff
the problem is how diiscord shows links
[THIS IS NOT FINE FOR A URL](https://www.pythondiscord.com)
now i can make it worse by doing
<> perchance?
[https://fakeurl.com](https://www.pythondiscord.com)
nevermind.
tbh I lead a phishing campaign with the username of "slamcannon69@hotmail.co.uk" and I still had to explain to end user's that their CEO's e-mail address would come from @organization.com
you'll have to be more specific than "it doesn't work". Perhaps try opening a help thread with more information

I misinterpreted the "I lead a phishing campaign" bit at first
there are some solid campaigns out there that make you go "yeeee that's a tough one"
also love those url redirects that pop you into sharepoint
loook in #โ๏ฝhow-to-get-help to see how to make it
you have to fill out some fields for you to make a thread
i have name description .txt file for the code and code review checked
text file?
we dont allow you to upload a text file, use our pastebin if the code is long
you can also just do what #โ๏ฝhow-to-get-help shows you and add more details later when you have created the thread! ๐
you can also have a title which shows on hover (at least on desktop)
[scammy site](https://www.pythondiscord.com "click here")
scammy site
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
reminds me of phishyurl links that went around for awhile
yeah, i dont like that discord does this.
this just in, python discord is a scammy site
if you want to test your URLs on another level of redirection: https://phishyurl.com/
I mean, there is the "are you sure you want to go here, you haven't allowlisted this domain" dialog
hello everyone, is there some free course learnin' or some good supply to study python fer me?
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
most things
what some example 'ere mate?
a web backend
an API
a simple game
a data visualization tool
a file organizer
a web scraper
the uses are endless
i see...
does anyone 'ere know how to run me codes in visual code studio?
I am lowkey gonna create an API? i think that tracks nasa spacestation?
whats an api
bruh i just learned about them
i can try
ohh
yes of course
like self.blablabla right?
yuh
but
หหหclass Player:
pass
def init(self)
this is the place where you can store the variables
init is written with two lowercase lines on both sides bt
i still don't understand the logic about the meaning "pass"
Its just like if you dont have written anything, it just say pass
passlike if you call a function and theres only pass in it, it does absolutely nothing
So no errors gonna come
its liike a placeholder for a future script
understood?
Im gonna teach you
do you have python open rn
okokkookoko the dm me
Hey
lowkey dont know? I just saw the intro of day 33 of 100 days of code
breh
That youโre still reaction farming with that charged phrase
ohhhh? autocorrect. I used that word too much that when i type lowkey it changes to that
yall what makes someone a bad programmer?
you could also ...
what makes me a good programmer? if i were a bad programmer, i wouldnt be sitting here discussin it with you now would i?
-# (it's a tf2 bit)
im so sad today i deleted all of my code even tho a fair amount of it was good enough!
AYYYEEE
now itll only get better
i'll let you in on a secret
i delete my own code ALL THE TIME
is that how you keep crashing prod? /s
small chunks of it yeah!! but lot of perfectly working code lol
for a given PR, 60% of the code i write from the start to the end are deleted
why is that?
the first time round i am just trying to get it to work
once it works i would refactor and change stuff, see if i can optimize things
and then of course, if a test discovers that there is some stuff that doesnt work
i'll have to rework stuff
ik lot of people who do that but sometimes it can't be refactored because of bad coupling
and other stuff
then you kinda have to just rewrite the entire thing
yrp
if codewars is teaching me anything...it can always be refactored
it only depends on how much effort it takes
- try make it work
- fail
- try a different approach
- huge mess
- try a different approach
- less mess
- clean up which deletes a good chunk of my code
- send for review
- rewrite half the thing again in response to reviewer feedback
isn't that just a leetcode alternative?
(might I interest you in a jj?)
it really is try a different approach -> huge mess -> try again
i should probably try that next year
queue "my god, what have I done" > talking heads
i am more worried if the reviewer doesn't ask me to rewrite anything
at times I might have a few tries sticking around, before I commit to one and abandon the others
i think this is just not my forte i find solving some very specific problem fun even tho it takes lots of braincells
but keeping it mind all the different components and how they're stuctured and how they should be structured and if you do x what will happen to y and hundered other level of abstractions,
what is more simple? what is more complicated? how much time should be spend on feature x etc ๐
hell i even got lost in circular imports once ๐ญ
aswell in hell of abstractions!
what are you learning for?
it's ok
it's like that
you'll get used to it
rn? to learn how to work with other peoples code mainly..
yesterday i was investigating an issue that was reported by one of the maintainer
the maintainer himself thought that the root cause was something
Does anyone know where this project is from I wanted to do more of these
#1453396549441949828 message
but it turns out it was an intended feature
it's alright to get confused about the architecture
even the maintainers get it wrong sometimes
CS50 or cs50p
did not know leetcode had daily problems
where do you find the daily problems?
You have to click into their calendar - https://leetcode.com/problems/last-day-where-you-can-still-cross/description/?envType=daily-question&envId=2025-12-31
i have yet to see a staff member or highly experienced person recommend leetcode in the past month. seems like its only good for grinding interview prep questions
no its not good for that at all
its a junk site that on a good day, is only OK at best
if i had a candidate for a job that would brag about solving leetcode, i would not hire them
and ofc, the way they collect all your browser and user data to sell to others is just so bad
you should venture on linkedin someday ;-;
Its the people hiring that need to stop using leetcode
they will this year
AI has now made it impossible to ask those questions
hard to when interviews itself are so dsa heavy with some niche question along with 3-4 rounds of the same stuff (atleast where i live)
Now they just have to worry about people cheating
that just means the places that ask those questions are not a good place to work
Almost every place is like this
From tiny startups to giant multinational corpos
im still holding firm on my comment, its not a good place to work
i think stripe is the only exception i know of among large companies which dont have leetcode heavy interviews
i dont believe any interview is gonna ask "Do u do leetcode everyday"
u can show them ur git hub tho ig
yeah but questions are going to be skewed to leetcode medium or hard
not really much in depth project diving or some thought process/design based questions
i went over all leetcodes data coollecction vendors
its like 45 mins to solve this dsa problem and explain the space time complexity for most interviews
what do they do with this data? sell it to mnc's?
also how did u get this vendor list
by not accepting, i never press concent
and leetcode dont have a i do not concent button
fair enough
open an incognito tab to see it
underr manage options
they are at least, as far as i know, not as bad as others
Why do you mean that
they just collect your data and sell it
because people that solve leetcode are mostly terrible programmers
Don't they have tougher questions
and even worse developers
Then where else we have to go and practice
you dont learn programming or development from leetcode
Its all the same thing
codewars is just slightly better, ok on a normal day
that feels like a pretty broad brush youre painting with
Ok then what else should we do
where do you see manage options dosent show for me mind sharing a screenshot
What makes it slightly better? The prettier wrap?
Codewars has even worse terms nowadays. They have forced arbitration now
yes, very broad on putpose, leetcode interviewing should die
oh that is news to me.... yeah. so many do that now
leetcode definitely doesnt teach you very practical skills though yeah
their questions are more taileroed to valid real problems and not pure DSA
leetcode brought me zero impact
codewars has repetition based training
Granted, im still ass
it still only let you pratise algorithmic thiinking, thats what it does
Codewars has more interesting problems that don't necessarily focus on getting the best asymptotic complexity. Like https://www.codewars.com/kata/59c132fb70a3b7efd3000024 (there's some overlap of course)
im saying you can practise this to teach yourself algorithmic thinking, but you still need to learn programming and development
I understand that but from where
learning how to solve a partial differentiation equation is different from understanding how that applies to thermodynamics
you dont actually use DSA for about 98% off the time, and juniors never have a chance to impact anything with this knowledge
Solving problems only gives real knowledge Right
you write programs on your own, you do all the work yourself
build projects
I feel like people sometimes miss the point of learning programming
I can't recommend Leetcode to people if only because of the abominable format the problems are in (e.g. requiring a Solution class in Python, function signatures being nonsensical in Rust, probably more stuff)
project based learning is where you learn development
I see
doing one or two hours of DSA before an interview is fine if the interviewer is going to ask you silly questions
still, i feel like my dsa leaves a lot to be desired
i also wish leetcode interviewing should go away but i dont think it will tbh
or well
DSA is a whole course. an entire couple books can be dedicated to DSA.
I feel like when I first started I said my interest was "doing dsa problems" and Ive quickly realized that's just a small destination on the journey lol
idk if ai changes this but
the new AI tools are so good at solving this for you, live, so once everyone is using it, it will go away
there are definitely some known dsa problems that i should be able to solve without having to spend time mulling over it
i can eventually solve it, but not without spending time thinking long and hard about it
99.8% are just โuse hashmaps better plsโ /j
give me five miiinutes with someone and i will figure out more about that persons skills than an interviewer doing leetcode questions for an hour
are thumbscrews involved?
๐ maybe
what might you ask?
Can u suggest a python project u did
huh. i never really thought about it but are in person interviews not standard for programming positions?
i would just talk about a project they made, have them go trrough a problem tthey solved, explain it to me so i can understand how they solved it and what the implementation was
i see
so STAR
people forget their personality is also on trial during the interview
dude if interviewers let me go on a 4 hour programming rant to determine whether or not they hire me ๐
id cook
lol
have not been standard for a while, most i see are remote... but i dont know all how other places does it
here's to a better 2026
oh right thats today
year of the linux desktop
we are walking into 2026 with hope
is over
REAL
Where are u working
it's 2025
this might be the firrst time i have every actually belived it
2025 is the year of the linux desktop
year of the FreeBSD laptop
Norway
no way!
oh yee of little faith
Company name and position?
Python developer right
why are you so interested?
im a python developer yes
I want to be a developer that's why
Whatโre the last 4 digits of your motherโs maiden name?
2069
she did not have any digits! ๐
thats nice, you should learn programmiing, python is a great place to start
that's rough, mine has 20
๐
Am beginner, but Python is fun!
what do you find fun
When there is no error in the output, gives a satisfying feeling
lol
lol
someone should really introduce you to:
Test Suites: [2;36m95 passed[0m, 95 total
Tests: [2;36m642 passed[0m, 642 total
Snapshots: [2;36m49 passed[0m, 49 total
Time: 43.419 s
Ran all test suites.
Done in 44.38s.
labubu
What's that?
add coverage and testing to that, and its even better!
this is the result from a jest test run
Where should I try it and what is it for?
it's automated software testing
U use it to test ur programs to ensure they work as intended
pytest and coverage.py are the two libraries at work all python projects have. and precommit as a close third
you write the intended behavior of your code and you run them after you made some changes
to make sure that you didnt break anything
They have built in test cases or do we need to provide that too
hello
you write them yourself
you write your own test cases
Itโs one that u write ur selves
Are u also a python dev?
there is a youtube short meme thing by alberta tech that says something like "why does being a programmer make you a worse person? it's a lot harder to feel bad about scolding the intern in the morning when all your tests pass"
