#python-discussion

1 messages Β· Page 295 of 1

onyx marlin
#

Can i learn python from his yt videos? Is it useful?

past shard
past shard
edgy krakenBOT
#
Kindling Projects

The Kindling projects page contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

young flare
past shard
onyx marlin
past shard
past shard
torn viper
#

Should I be prefixing everything I'm not explicitly exporting from a package with an _, or is there a better metric I should be using?

past shard
#

@onyx marlin you can use the book , "automate the boring stuff with python" too, it's very good and teaches you about automation and scraping.

spice hill
past shard
edgy krakenBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

young flare
# past shard His youtube videos are quite good and structured

Maybe some like it, some don't, I personally don't especially those extremely long, 12 hour long videos. I feel like many people give up before finishing it completely. I find that when topics broken down to smaller parts (like a course or book) have better attention span because people have a better sense of tracking their progress rather than tracking progress based on how much time they have consumed off the video. But that might just be me

onyx marlin
#

@past shard found it!! Ty

past shard
young flare
spice hill
# torn viper Thank you

Sometimes the meaning of _ is ambiguous, I don't know if there's a good way to systematize it. For example, you might intend for an attribute to be used freely anywhere within a library, but not by outside users; and then you might have attributes that are only intended to be used within a single module.

onyx marlin
#

In that list

past shard
crisp jay
#

Some of his videos are good but meh

pallid garden
#

good but meh?

onyx marlin
torn viper
spice hill
past shard
spice hill
#

do note that __ only works for class attributes/methods, not items in a module

pallid garden
#

a few months you will remember that you watched a long ass video for 12 hours

#

but probably only 50% of the content

#

at best

past shard
pallid garden
#

yea

frail forge
#

Yoo

merry pilot
#

yo how could i learn to code in python (nd on a scale 1/10 how hard is it)

pastel sluice
edgy krakenBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

pastel sluice
#

we get a lot of questions along the lines of "how hard is it to do this?" and the only fair answer is "We can't tell you, because that's all going to come down to you"

dusky crag
#

I was (mostly) able to understand window functions and even used them to make some pretty nice queries i needed for my project. Took ALOT of time trouble shooting though.

kindred hemlock
#

I talk python

dusky crag
kindred hemlock
#

loooool

dull dune
#

and recognize that you're not really learning python, you're learning how to program and python is the vehicle. that can help clarify what's worth deeply understanding vs just memorizing

merry pilot
#

this may be the most helping comunity i ve seen

proud escarp
merry pilot
#

thx guys

dull dune
#

it's more about how to think about designing programs and working with and building abstractions (which is the real gist of what software development is). It's an updated version of the wizard book using python and is for a class taught at Berkeley @merry pilot

harsh swallow
#

Sounds like something I recommend, but without a link - I always tell people to use pen and paper and plan their things, instead of just trying to write code without thinking. And I mention how i use that in my bigger projects as well, it's not a sign of beginner vs advanced, it's about planning

misty kite
#

is there a way to delete a file without it going into my recycle bin? i have a script that generates a bunch of files and then deletes any old ones and it results in my recycle bin having like 4000 files in it after i run it enough

#

rn im using os.remove

golden mortar
unborn lagoon
misty kite
#

theyre being put in my recycle bin

oblique spindle
#

Documentation of os.remove says it removes them permanently

misty kite
#

weird, maybe it's an arg or something, lemem check the docs

kindred hemlock
#

I wouldn't have even started if it weren't for these good friends of ours

misty kite
#

what im doing is i have a script that generates font bitmap data and i have an option to save the bitmaps to files, so i can look at how they turned out

but i sometimes change the character set, so i have it delete all the old bitmaps in the folder before rendering

clear fable
#

hi

unborn lagoon
misty kite
#

lemme see

kindred hemlock
oblique spindle
#

Confused noises

unborn lagoon
kindred hemlock
misty kite
#

im just doing

cwd = os.getcwd()
if(save_font):
    old_chars = os.listdir("chars")
    for i in old_chars:
        os.remove(cwd+"/chars/"+i)

probably better to use like os.path.join but i couldnt be bothered at the time

unborn lagoon
misty kite
#

maybe

wise imp
#

shutil.rmtree go brrrt

misty kite
#

very possible

minor silo
#

hello everyone new here

#

can anybody tell me what is git or git hub

misty kite
misty kite
minor silo
#

oh okay

#

thank u

misty kite
#

np
and git is basically a software that github uses, it's used to manage updating and working on software
so like if you mess up when you write some code and you wanna go back to an old version, git can help with that without you having to manually make backups

#

also i can confirm it was that i had manually deleted some of the files, os.remove is working as normal

i probably should have checked that first lmao

steady rain
steady rain
misty kite
#

yeah i know htey dont need it i just do it for clarity idk
got used to it after writing in other langs

wise imp
#

I also write other langs but I don't pollute my Python code with them, smh /lh

steady rain
#

anyway, if you used pathlib

directory = Path.cwd() / "chars"
if save_font:
    for path in directory.iterdir():
        path.unlink()
wise imp
misty kite
#

it wasnt actually os.remove it was me not realizing i had manually removed some files lol
silly mistake on my end

tiny kraken
#

sure i would like that

#

i ll take a look

surreal ridge
#

what can i make with python

golden mortar
golden mortar
#

That's what general-purpose means

cyan scaffold
#

You can browse through the topical channels on this server to get an idea

golden mortar
#

It's not necessarily suitable for all kinds of applications, but it's still possible

#

You could implement an extremely slow-running Elden Ring in Python given enough time and effort

south vessel
#

Is there any free tiktok api or tools that provide tiktok profile info and other things

cyan scaffold
#

I'm assuming you have to rent an API key

golden mortar
#

If free access to that info is not provided through the official API, it's safe to assume that any other means would violate Tiktok ToS

#

which means that we can't help you with it on this server

#

!rule 5

edgy krakenBOT
#

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

south vessel
copper walrus
#

!resources

edgy krakenBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

eternal shoal
#

can anyone guide me for GSOC

crisp jay
wise imp
lunar cobalt
#

Does anyone know how to make a looping perlin noise map?

copper walrus
lunar cobalt
#

So it can be seamlessly tiled

eternal shoal
lunar cobalt
#

Its the space and Ill use it to vary the tint of the background

#

so it needs to be tileable

eternal shoal
#

okay

#

so can you tell me about the issue

lunar cobalt
#

I dont know how to make a perlin noise map that loops over

#

It should work in a way that basically reconnects to itself at the end to the start

misty kite
#

hm

#

what you can do is make an input noise map that loops and then feed that in

clever aurora
#

hello guys

#

today i did a personal project can you guys give feedback for it?

lunar cobalt
#

not sure what you mean

languid notch
clever aurora
misty kite
alpine dragon
#

Guys, how do I redo an if statement?

cerulean ravine
misty kite
#

ok actually just doing modulus on the inputs makes it... seamful

alpine dragon
cerulean ravine
paper jay
#

How can I keep a bot online if my computer turns off?

#

I know I have to run the code in like a

alpine dragon
unborn lagoon
alpine dragon
paper jay
#

Like raspberry pi?

#

Those?

alpine dragon
lament rose
#

In the case of a raspberry pi you'd need to keep it on

#

Any external hosting service just handles that for you

eternal shoal
alpine dragon
cerulean ravine
alpine dragon
#

Ok

#

Lemme send screenshot

copper walrus
cerulean ravine
cerulean ravine
copper walrus
alpine dragon
lament rose
# paper jay Replit?

Replit isn't a hosting service from what I know, also doesn't handle your bot token securely

cerulean ravine
copper walrus
frigid trout
cerulean ravine
copper walrus
alpine dragon
cerulean ravine
misty kite
# lunar cobalt not sure what you mean

ok i was worried for a moment but i got something that works i think
you just take regular perlin noise, but in the input noise function you take the modulus of the coordinates

alpine dragon
#

As its for screaming

cerulean ravine
#

it hinders communication

copper walrus
alpine dragon
misty kite
#

using hash() for this isnt optimal since it's not deterministic but it'll do

misty kite
#

not if you do it right

eternal shoal
#

using high dimensional mapping is the right way

cerulean ravine
misty kite
#

it is

#

see the link

#

might break for higher octaves idk

eternal shoal
#

I am not sure what were the requirements of the guy

cerulean ravine
# misty kite it is

looking at the code, it seems like two x values very close together could get noise values far apart, because hash() is discontinuous? But I could be missing something.

autumn pelican
#

Log in with a browser, get your session cookie and curl it passing the cookie as a parameter and it works

misty kite
#

the noise can be anything

#

what i posted isnt the full perlin noise function, the gradient takes in the noise and smooths it

all that rly matters is that it's reproducable for that run of the program and that there's no internal state

ocean ridge
#

hi guys! im going to make a super light weight but really fun to use IDE for python. its not gonna be as bloaty as pycharm and certainly not as boring as vs code. Any suggestions fellow python users?

chilly umbra
#

wdym by fun?

ocean ridge
ocean ridge
# chilly umbra wdym by fun?

any features u would like to have? any extensions that you use in vs code that u like to see replicated here? (strictly python only for now)

chilly umbra
#

auto completetion, formatting, and diagnostics are always appreciated

ocean ridge
chilly umbra
#

lsp based is fine

copper walrus
#

!topic

edgy krakenBOT
ocean ridge
copper walrus
ocean ridge
ocean ridge
copper walrus
lusty reef
#

Anyone ever get so frustrated with a portion of their code that they just delete the module and want to start over? lmao

ashen cipher
#

yes

lusty reef
#

I essentially did that with my microphone/audio/Whisper code

#

Because it was nonstop phantom transcriptions, no matter what I did, with webrtcvad

copper walrus
lusty reef
#

But I'm also a newbie, and real time audio/transcription is one of the most stressful/harder things to deal with apparently

ashen cipher
#

you're essentially plugging in a wave into your program and somehow finding words in that wave

lusty reef
#

So I'm just going to have to suffer in trying to figure it out or is there anything that can help with that lol

eternal shoal
#

Doing Open Source Contribution is hard.
Finding Projects that are sweet spot in difficulty and interest is harder

surreal ridge
dull dune
surreal ridge
dull dune
#

I don't see that being super productive without some programming background

dull dune
#

yes

surreal ridge
#

R u deadass?

odd wyvern
#

yestrday i was helping my little brother learn python for 5 hours and he only new the print("hello world") can someone pls tell me a good way to teach him faster?

dull dune
#

yes, if you don't have any idea how to program, staring at code is a bad place to start

#

cs50p is great

#

Investing a week of regular time in that would open up a ton of ability to usefully read code

dull dune
odd wyvern
#

thanks i have done python for over a year now and i still only know <!DOCTYPE html>
<html>
<head>
<title>Google Sign-In App</title>

<script src="https://accounts.google.com/gsi/client" async defer></script>

</head>
<body>
<h1>Welcome to My Site</h1>

<!-- 1. The Configuration Div -->
<div id="g_id_onload"
     data-client_id="YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com"
     data-context="signin"
     data-ux_mode="popup"
     data-callback="handleCredentialResponse"
     data-auto_prompt="false">
</div>

<!-- 2. The Visual Button Div -->
<div class="g_id_signin"
     data-type="standard"
     data-shape="rectangular"
     data-theme="outline"
     data-text="signin_with"
     data-size="large"
     data-logo_alignment="left">
</div>

<script>
    // This function handles the response from Google
    function handleCredentialResponse(response) {
        console.log("Encoded JWT ID token: " + response.credential);
        
        // Send the token to your Python backend for verification
        fetch('/login/google', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({ id_token: response.credential })
        })
        .then(res => res.json())
        .then(data => {
            if (data.success) {
                window.location.href = "/dashboard";
            } else {
                alert("Login failed!");
            }
        });
    }
</script>

</body>
</html>

odd wyvern
#

oh sorry that was javascript

solemn rain
#

Thats html

odd wyvern
#

and javascript

lunar elk
#

And JWT.

solemn rain
#

with javascript

odd wyvern
#

yeah

lunar elk
#

Uhh, how should I get back into Python..? I need it for Discord bot devving but yeaah, I never went in-depth into it.

thorny latch
#

trying to re-learn Python here

#

my first programming language

visual juniper
thorny latch
visual juniper
#

if you already know it , you can glance over ur previous notes and get a good feel for it

#

no need to start at 0

visual juniper
thorny latch
brazen patrol
thorny latch
#

I'm starting with Flask

brazen patrol
brazen patrol
visual juniper
thorny latch
visual juniper
thorny latch
#

it was all just in the terminal

#

useless scripts, and I wanted something bigger so that's why I moved to JavaScript then later started using TypeScript

visual juniper
thorny latch
visual juniper
#

decorators , functions

#

actually u dont need to know much about decorators , u wont be making any yourself

thorny latch
#

and about functions, yeah

brazen patrol
visual juniper
visual juniper
thorny latch
brazen patrol
thorny latch
#

I've always used ExpressJS, I did grasp a few concepts but I couldn't expand, because I wanted to use TypeScript for ExpressJS and setting it up either creates hell lots of errors when put into production or something else

#

a pain especially trying to find out what it meant by TypeError: argument handler must be a function

chilly trout
#

i hate AI so much bro

#

i asked claude code to fix a simple seg fault its been 20+ minutes

#

ima just do it myself atp

brazen patrol
brazen patrol
languid notch
chilly trout
languid notch
#

(or took 20 hours)

thorny latch
chilly trout
#

20 dollars a month for what 😭

#

wait 40* actually im stupid

ornate wren
languid notch
chilly trout
#

it depends how complicated the thing i want from it actually is

ornate wren
brazen patrol
chilly trout
ornate wren
#

I only used chatgpt prompt what i want in smaller pieces, i asked a few times for the whole foundation of a project (like build a hexagon archictecture for x purpuse) but i had later to code a lot of stuff on my own and also asked for smaller changes

#

Btw i aint paying for A.I (i only used chatgpt, gemini and deeepseek free chat options)

chilly trout
chilly trout
ornate wren
chilly trout
#

yeah

ornate wren
#

So i aint even vibecoding correctly

chilly trout
#

😭

ornate wren
#

Using I.A usually kills my learning process and its making my skills dulll

#

So i'm really missing coding stuff by hand like before

wise imp
#

not moltbot

ornate wren
#

openmeme is the correct name

ornate wren
upbeat sleet
#

Is it okay to sleep 13 hours a day cuz I’m unemployed college student

ornate wren
#

10 hours seems like the limit

#

13 hours you already wake up tired lol

upbeat sleet
#

More sleep is better cuz I don’t gotta deal w this world

wise imp
upbeat sleet
#

I did

#

My blood work is good

#

But still

#

So they can’t help

red mural
#

They'd probably suggest other things to look at

upbeat sleet
#

Nop I’m healthy on paper

wise imp
#

Could be a mental issue too I suppose
Pick up a hobby or a sports activity to do regularly, go out, yk, do something besides strictly college

upbeat sleet
#

All sorts of healthy

red mural
#

Well 13 hours of sleep a day is not healthy

wise imp
#

Make projects with Python (very topical for this server and especially for this channel)

upbeat sleet
#

I have an appointment w him in like a week but idk

wise imp
wise imp
red mural
upbeat sleet
wise imp
upbeat sleet
#

I swear its all useless

#

I went to sleep at like 3 AM

#

And woke up at 5 and something PM

upbeat sleet
#

So I don’t have to deal with w this world

#

I don’t like this world at all

wise imp
#

irregular sleep schedule might also contribute to disturbances in your sleep pattern

wise imp
#

!ot

edgy krakenBOT
upbeat sleet
#

U go sleep and wake in the same time always?

alpine dragon
verbal wedgeBOT
#
**Do you have any plans for future projects?**

Suggest more topics here!

rugged barn
#

Lots

#

Not lots of energy for them, though

alpine dragon
ashen cipher
spiral karma
#

hi

young flare
#

Greetings

ashen cipher
#

o/

spiral karma
#

i wanna do a music bot
and i have
from youtube_dl import YoutubeDL
But when i run, it says no module found

#

what i do?

pastel sluice
#

!ytdl

edgy krakenBOT
#
Our youtube-dl, or equivalents, policy

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
spiral karma
#

oh

#

ok, and if i have
import requests
and it says no module found, what i do?

young flare
#

you aint slick

cyan scaffold
#

Ironic how YouTube has ytdl tutorials on it

narrow iron
#

@spiral karma no module for the import? You might have to install the library if you do not have it

spiral karma
cyan scaffold
#

No you have it you're good

alpine dragon
#

How to erase a message in python?

cyan scaffold
#

Depends on the message

alpine dragon
#

An input

cyan scaffold
#

Well you can write a space character to replace it or use an escape code to do it

#

Wdym erase an input message

alpine dragon
gaunt badge
#

!d getpass

edgy krakenBOT
gaunt badge
#

maybe you want this, but I'm still not fully understanding I think

alpine dragon
#

It should be like /r and smt

brazen patrol
cyan scaffold
#

It's \r and then whatever characters you want to overwrite on that line

alpine dragon
#

Maybe, dont know much like you all do about python

alpine dragon
cyan scaffold
#

Well actually this isn't a Python specific issue per se

cyan scaffold
#

\r doesn't delete any character. It just brings you back to the beginning of the line so you can write over stuff

alpine dragon
#

So i have a variable for the input so i can reuse it later and doing \r how do i reuse the input variable for it?

cyan scaffold
#

What you type for an input() is given to the program so you can capture it in a variable to be re/used. No need to do any printing for any of this

alpine dragon
#

I know, but how should it be coded?

#

I just need an example

cyan scaffold
#

Well here's one

my_input = input()
print("Uppercase:", my_input.upper())
alpine dragon
#

Does it delete the first input?

cyan scaffold
#

No

alpine dragon
#

Ok, not pretending but i need it to delete the input πŸ™‚

cyan scaffold
#

You can run it and see if it's what you want

brazen patrol
alpine dragon
cyan scaffold
alpine dragon
#

But not all of python

cyan scaffold
#

Again you can print \r and then a matching number of spaces as the input

stark mango
#

\r sends the cursor to the beginning of the line

alpine dragon
# cyan scaffold Like what you type in for it?

I have for now a programm that its only function that is a calculator. Since its designed to have a lot more functions i need to say what function i want to use deleting the input and giving me the what i need

stark mango
#

You can overwrite the line with whitespaces and ask for input again

cyan scaffold
stark mango
#

If you're doing a more complex terminal user interface, use ncurses library

wise imp
#

nah, use textual

alpine dragon
#

What that?

wise imp
#

or just do subprocess.run("clear", shell=True)

alpine dragon
#

textual

wise imp
#

!pypi textual

edgy krakenBOT
#

Modern Text User Interface framework

Released on <t:1771261934:D>.

cyan scaffold
#

Now thinking about it it's probably going to be two escape codes

stark mango
#

There this ansi code \033[A you can print to go up by one line the same way as \r to go to beginning

#

not the recommended way tho

alpine dragon
#

Textual huh? Lemme try that

stark mango
#

Anthropic is apparently using react for their tui lol

alpine dragon
#

Does textual work in Coding Python?

stark mango
#

1

wise imp
#

it's written in Python and you interact with it via Python

stark mango
alpine dragon
stark mango
#

if it has a terminal ui it should work

compact loom
#

isnt there a file type i can include on github which shows what librarys people will need to use my project?

stark mango
#

which app

alpine dragon
#

Ok

alpine dragon
stark mango
#

it should work fine on something like termux or pydroid

#

not sure about that app

wise imp
compact loom
#

ahh it might be requirements.txt

#

i just wanna make some half decent documents for my not very complicated autoclicker program

#

cause again im sure when people look at my github and wanna see my progress, they probably wanna see i was documenting from early on

alpine dragon
cyan scaffold
compact loom
#

yeah im writing my README rn

cyan scaffold
#

Cool

compact loom
#

im writing a bit of context about why i made the application, then ill give some information about the application itself

cyan scaffold
#

pyproject.toml/requirements.txt is also important. Usually you leave out dependencies and only include one of these files to install them from

compact loom
#

what do you mean leave out dependencies

somber osprey
#

hello I wanna ask tiny question

sys β€” System-specific parameters and functions

This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available. Unless explicitly noted otherwise, all variables are read-only.

are they talking about something like environmetn variables but in python's "shell"

cyan scaffold
#

You shouldn't track and add dependencies in your git repository

compact loom
young flare
cyan scaffold
#

Whatever you pip install or whatever

compact loom
#

ohh i dont do that

#

i .gitignore that stuff

cyan scaffold
# compact loom i .gitignore that stuff

Yeah so in order for people to then be able to run your project you do add one of those pyproject.toml or requirements.txt files so they can set up an environment themselves

compact loom
#

okay got it thank you

somber osprey
#

( I tried searching for myself )

young flare
somber osprey
young flare
somber osprey
#

I found both computer science and uhhm economics definition of that word

#

I do like elders

#

okay bye

#

I am very grateful

young flare
#

<@&831776746206265384>

autumn pelican
autumn pelican
#

Bear

crisp jay
#

also should i make selenium download ublock using the official website or use wget to download it

brisk token
dry pike
#

short here fine

wise imp
dry pike
#

funny

brisk token
wise imp
#

apology not accepted /s

brisk token
#
import pandas as pd
from scipy.stats import quantile

CL_Data = pd.read_csv(r"\NYMEX_CL1!, 1D_62cc5.csv") #removed file path

returns = CL_Data.close.pct_change()
pos_returns = returns[returns > 0]
neg_returns = returns[returns < 0]

pos_returns = pos_returns[pos_returns > pos_returns.quantile(.9)]
neg_returns = neg_returns[neg_returns < neg_returns.quantile(.1)]```

For some reason, `neg_returns` and `pos_returns` have the exact same index. Am I calculating something wrong?
subtle coyote
#

wow you can now react in python discussion

#

thats rad

brisk token
dry pike
#

oh what, reaction time

#

why is there a comma in your file name πŸ€”

brisk token
#

It won't affect my numbers, my issue is that
neg_returns.index
and
pos_returns.index
Get the exact same value

#

But I filtered them...

runic flower
charred tusk
#

@runic flower is your site open source?

runic flower
#

Aha I see.

pos_returns = CL_Data[returns > 0]
neg_returns = CL_Data[returns < 0]
runic flower
charred tusk
#

It's uh... huge
I'll ping you in OT

brisk token
#

I think I just didn't rerun everything by accident, mb

#

Thanks for your help guys

ocean ridge
#

hi guys

wet burrow
#

Hello guys

autumn pelican
#

You'd probably just install the extension and add it to the web driver configuration

#

Or I suppose downloading it once through the WD would work as well

placid ether
#

@inland karma if you're up for doing it today, please say either here or in DMs

#

best in DMs as I might not get a notification otherwise

crisp jay
fervent pewter
#

Hi i'm new at python

hallow umbra
#

Hype train into achieving a master's science degree at Kyiv Polytechnic Institute in the next 2 years! πŸ₯³

fervent pewter
#

Does anyone know how python works?

#

πŸ₯Ή

harsh swallow
fervent pewter
#

πŸ₯Ή

jade roost
# fervent pewter πŸ₯Ή

I usually don't recommend using videos for learning programming. But it shouldn't matter since you're a complete beginner. Try picking up a tutorial from YouTube.

pastel sluice
#

!res

edgy krakenBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

pastel sluice
#

Try something from the resources list

jade roost
#

Or try out the book, "Automate the boring stuffs". I've heard good things.

frail scaffold
fervent pewter
#

Python is difficult?

fallen yoke
jade roost
frail scaffold
fervent pewter
#

Do u make money with python

jade roost
frail scaffold
pastel sluice
#

<@&831776746206265384>

fervent pewter
jade roost
fervent pewter
jade roost
crisp jay
#

wdym

jade roost
gaunt badge
#

!kick 1326652614519029873 No, try again. Read our #rules before.

edgy krakenBOT
#

:incoming_envelope: :ok_hand: applied kick to @fallen yoke.

glacial ginkgo
#

whats up chat

jade roost
#

Teeny Peeny, lmao. What a name.

frail scaffold
jade roost
#

But for absolute beginners, I'd say videos are just fine.

frail scaffold
glacial ginkgo
jade roost
jade roost
frail scaffold
frail scaffold
wise imp
#

well, if you just watch them, I can definitely see how they might feel that way

jade roost
glacial ginkgo
#

I mean, I like to listen to and watch tutorials in the background while I do other stuff. It is good to get a primer that way before digging in. Data with Baraa really helped me through a lot of concepts but nothing has been as good as turning off wifi and sitting down with a learning project and some downloaded md files + the sdk.

silver plover
silver plover
frail scaffold
frail scaffold
silver plover
fervent pewter
#

I kinda read the person who send me a message

#

Why did he delete it?

jovial onyx
#

hello

golden mortar
# fervent pewter Why did he delete it?

I accidentally pasted something that was in my clipboard but that I didn't intend to send here. I meant to send this:

jovial onyx
#

ooh

#

there is reactions now

#

thats cool

clever axle
#

Yo I'm in y11 and I wanna be a software dev but I only know python and I wanna learn another language but I need to balance it with school though yall got any advice?

golden mortar
timber bolt
#

Hey yall What are your thoughts on coursera courses for python

golden mortar
jade roost
timber bolt
gloomy radish
#

guys what does β€œsnek” mean?

jade roost
jovial onyx
gloomy radish
jovial onyx
#

snek sounds like snake

#

python is a snake

autumn forge
gloomy radish
jade roost
timber bolt
# golden mortar They matter very little.

Like how about when I look for a job. If I don’t get certs how can I prove I have knowledge. I know people say having a portfolio helps but can’t anyone just copy stuff and make up a portfolio?

gloomy radish
jovial onyx
golden mortar
#

Is there a reason you can't go to uni and study CS?

gloomy radish
#

i got the β€œprecious” snek tag

glacial ginkgo
#

Im kinda struggling to pick a new learning project now. I have a solkd handle on syntax, oop, control flow, error handling, data structures/data structure manipulation. Idk I got started bc I have an ai homelab but I dont care about the ai stuff now that I understand it better. Just cant come up with anything to get excited about.

edgy krakenBOT
#
Kindling Projects

The Kindling projects page contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

timber bolt
jade roost
frosty oriole
granite wyvern
gloomy radish
#

i am in my new home with no electricity how can i charge my phone without powerbank or nthg

jade roost
frosty oriole
jovial onyx
#

depending where u from try community college its cheaper

wise imp
#

what about dense air then

autumn forge
frosty oriole
#

i guess except windmills

golden mortar
frosty oriole
#

though i dont know how well they work in thin air

timber bolt
frosty oriole
#

yeah i dont know what to tell you about that

gloomy radish
jovial onyx
gloomy radish
jovial onyx
glacial ginkgo
crisp jay
timber bolt
granite wyvern
manic flare
#

Do you have a couple of hundred dollar bills to pay for the electricity?

gloomy radish
granite wyvern
gloomy radish
frosty oriole
golden mortar
frosty oriole
manic flare
gloomy radish
frosty oriole
#

and?

gloomy radish
#

everywhere is closed

frosty oriole
#

just go to bed then not having your phone charged for one night wont kill you

#

this is literally not even an issue

manic flare
gloomy radish
#

i charge it at work then.

manic flare
golden mortar
wise imp
frosty oriole
#

it is how it is

gloomy radish
peak relic
jade roost
#

I have no idea where this conversation is going. Lmao.

#

Anyway, I'm off. Goodnight, guys.

gloomy radish
wise imp
#

"Man Dies in Mysterious Circumstances After Phone Runs Out of Battery and Electricity Bill is not Paid"

granite wyvern
granite wyvern
golden mortar
wise imp
#

hope not

gloomy radish
#

good night guys, i will write here when i get to work

wise imp
fading valve
#

Does scipy.optimize.linprog just not work at all for integer linear programming? It has an integrality argument that is ALLEGED to treat a variable as an integer, but in reality it just BRAVELY ignores this argument.

The documentation says that it uses highs (a C++ ilp solver) as a backend for ilp problems, but it returns floating point garbage. This happens if I let it default to highs or manually specify method="highs". Eg:

A_ub = [[617700, 1234977], [-7069232, -14133623], [1757440, -57677832], [4694092, 70576478]]
b_ub = [0, 0, -1, 9444371]
lsoln = linprog(A_ub[-1], method="highs", A_ub=A_ub, b_ub=b_ub, bounds=(None, None), integrality=1)
lsoln.succes: True
lsoln.x: [-2.61384659e-07  1.30737094e-07] # scholars will note these are not integers
lsoln.fun: 7.999999999989568

Is there a way to make scipy actually do this, or do I have to use a different library?

gloomy radish
fading valve
#

scipy is a python library

gloomy radish
wise imp
glacial ginkgo
#

a game does sound fun. I had an idea to combine "learn by teaching" with programming by making a teaching rpg. Like your "class" is literally instantiated as a subclass of your character and you have to write functions to attack, move, and use your inventory (which is a list you have to instantiate after unlocking). Idk.

manic flare
#

Interesting

fading valve
#

I think I'll try PuLP (different python library) instead, it really is so stupid that scipy has an integrality flag but it's just completely broken, like, why not just remove it if it does not work πŸ€”

gloomy radish
#

guys please ping me after i go to sleep i want to wake up to notifications

wise imp
#

@gloomy radish are you asleep yet?

gloomy radish
manic flare
gloomy radish
unborn heron
#

Y'all quick question

#

do yall think that making a DnD style game is possible

wise imp
#

yes

unborn heron
#

not much screen and stuff but mostly rp

#

I have a sick idea with some of the new stuff I learnt last class

gloomy radish
#

last 2 minutes

#

guys never forgett me

glacial ginkgo
gloomy radish
#

😭

golden mortar
gloomy radish
#

DnD do not disturb?

unborn heron
glacial ginkgo
unborn heron
wise imp
golden mortar
#

Mm, yeah, I think the idea of xp and levels originally came from D&D.

gloomy radish
#

goodnight

golden mortar
#

Yeah, it did.

unborn heron
#

cuz the first time it was used i think is tetris stuff

manic flare
unborn heron
#

or yk the original pong

golden mortar
glacial ginkgo
#

I think the earliest use was in working tools

unborn heron
golden mortar
#

So all games with xp and levels draw on D&D indirectly.

unborn heron
#

also yall imma send a code review again i hope this time someone sees it D

#

XD*

glacial ginkgo
gleaming marten
#

.offtopic

#

Goddang command fail

steel whale
#

just got a hall effect keyboard

gray prawn
#

Hi

jade bone
#

Hi

pallid garden
#

lol for some reason reactions are enabled

autumn forge
#

it is the latest and greatest update

pallid garden
autumn forge
pallid garden
#

oh hell yea

rare tiger
autumn forge
#

now the pins are out of date

craggy trench
#

woah

rare tiger
#

I used SDL to make mine

#

wouldn't recommend making a widget toolkit in python though

pallid garden
#

from what i saw on linkedin, everyone and their grandma

#

bad joke, ignore me

rare tiger
#

Python isn't very fast, especially for something as complex as a widget toolkit

rapid bridge
#

GUI usually isn't done from complete scratch, since your operating system has some widgets built in, but sometimes people do just grab OpenGL or similar and get drawing - this can cause accessibility issues, break some input methods and such.

TUIs are pretty straightforward, swap the terminal to the appropriate modes, and do the positioning as required.

rare tiger
#

Yes, but it's quite slow

cerulean ravine
rapid bridge
#

I've seen a couple people do perfectly serviceable TUIs and GUIs in Python

#

Batgrl, kivy for example

#

I do expect that work went into performance there that you'd perhaps get away with in C++, but it's definitely not a major obstacle.

rare tiger
#

For fun mostly

#

I also know Javascript and I'm learning Nim

pallid garden
#

"60fps CLI in react"

rapid bridge
#

Yeah, you do have to talk to OS to open a window and draw on it

oblique spindle
#

The emojis are back? 🀩

rapid bridge
#

The OS also has e.g. a textbox that behaves "correctly" for the platform (text navigation, copy paste, special input methods and such)

#

You don't have to use it, but then it's usually polite to reimplement the native behavior

stoic elm
#

Hiii guys , is there free alternatives to cursor , Antigravity ?

#

If i do not ?

#

Thank you

rare tiger
#

I want to rewrite my widget toolkit it in Nim

unborn heron
#

I've never been this close to a headache but not a headache before XD

rare tiger
#

also it's just fun to learn something new

#

Yeah

#

Nim is compiled

#

so it's a whole lot faster

#

Oh yeah, I'll need to fix it lol

pastel sluice
#

I tried out Nim and was somewhat let down by it. The language compiles to fast code and it isn't hard to learn, but it's full of design decisions that felt compulsively quirky, and it's just not getting much uptake compared to, say, Rust. And the direction of the language is dictated mostly by one guy who is rather opinionated about it.

autumn pelican
rare tiger
#

Really with programming in Python correctly you mostly should just be following PEP style guidelines wherever possible

#

PEP 8 is like 90% of the style guidelines

#

the others are just little things that are good to follow

#

yeah

frail scaffold
#

sup

rare tiger
#

None of them lol, my CS teacher taught us PEP styling

young flare
#

i never had to read peps except a few specific ones

oblique spindle
#

I would rather use a formatter than write perfect PEP8 code

young flare
#

yeah formatters and linters help with it

#

but with time you automatically write on your own without their help lol

stone hollow
#

quick question: i have a project im planning on working on but im unsure about how to do a specific part should i ask this in here or put it in python help. The part i need help with is a rather short thing

rare tiger
frail scaffold
#

@pallid garden Your actually really new here

glacial ginkgo
#

How would you guys go about writing a heavily sanitized code executor? I am running with my python-rpg game idea but I obviously can't just let players have raw execution. I'm thinking of something like parsing, linting the code for safety, running it a separate process with try-except soup, and then checking if the results are valid with the game rules and then just comparing the new value to the game state and updating the game state. This way the code has to work, can't crash the game, and still does what it is supposed to? Or am I overcomplicating this?

pastel sluice
rugged barn
#

That seems hard to do

frosty oriole
glacial ginkgo
surreal knot
#

huh did reaction permissions change in this channel ? pithink

crisp jay
#

wait how do you read the output file of python -m profile with the -o flag?

surreal knot
raw bramble
frosty oriole
fiery yarrow
zealous lion
#

we can still flex image perms if we need to

glacial ginkgo
silent wave
#

Applied for a data analyst role at cern πŸ™‚

unborn lagoon
frosty oriole
languid notch
#

How do I get the list to print out the tuples of the zip object instead of a reference to the zip object in #bot-commands message

unborn lagoon
young flare
#

lst = [(c, r) for r in e]

languid notch
fiery yarrow
# oblique spindle ??

the reaction restriction to pydis-and-discord-wide emojis did not apply to staff before. now it does. this may not apply to all staff, like mods or higher, but for us helpers, it does

oblique spindle
fiery yarrow
#

perhaps you can answer that question, being a director, stel. are all staff levels no-external-emojis here?

steady rain
oblique spindle
#

I just need a role with color , I'm scared of losing this color :(

#

Also when is this role getting removed?

steady rain
fiery yarrow
#

isn't the aoc role usually removed come the first week of february

steady rain
#

we'll sunset the AOC stuff Soon.

oblique spindle
oblique spindle
steady rain
ornate wren
#

@glacial ginkgo You have check RLMS (recursive language models) they run repl with AI generated code and they do sandbox the code, you may look how they do it

upbeat sleet
#

The gym > python

dusty ember
#

who says you can't have both

steel whale
uneven harness
upbeat sleet
swift sparrow
dusty ember
#

i know people who're jacked and cracked

autumn pelican
upbeat sleet
#

Programmers are sassy ( most )

#

And low testosterone

pastel sluice
#

@upbeat sleet You can stop trolling now, thanks.

bright shoal
bright shoal
charred tusk
upbeat sleet
#

sassy boy πŸ’ͺ

dusty ember
#

.topic

verbal wedgeBOT
#
**How would you learn a new library if needed to do so?**

Suggest more topics here!

upbeat sleet
#

And proceed

autumn pelican
pastel sluice
# verbal wedge

look at the examples, copy one, build on it until it matches my needs

bright shoal
autumn pelican
#

dude i was the 0th percentile BMI for my age range

autumn pelican
crisp jay
# verbal wedge

by looking at docs/good tutorials (im looking at you tkinter)

pallid garden
#

what do you think an interviewer might ask for a python fastAPI interview

pallid garden
#

specifically asyncio?

#

or just async in general

crisp jay
#

probably in general

#

take my information as a grain of salt

verbal citrus
short solstice
pallid garden
verbal citrus
#

yeah that's going to be something i'd ask probably

unborn adder
#

Remember, no ChatGPT.

charred tusk
#

🀨

#

They’re taking my AIs!!

charred tusk
autumn pelican
#

yh

steady rain
#

And the heaviest is 100

random bronze
#

do ya'll use coding agents for programming?

surreal knot
#

no

random bronze
#

never ever?

glacial ginkgo
# random bronze do ya'll use coding agents for programming?

Not anymore, but only because I'm still very new to programming and actually learning how to build the little stuff I was vibing has helped make me better. I still don't think I want to 100% vibe but I plan on eventually using ai completions to speed up my work once I'm confident I really know what I'm doing.

verbal citrus
#

i do nowadays for web design stuff that i hate doing

random bronze
#

lol

#

i hate web too

rare tiger
velvet trout
ornate wren
#

vibe coding seems to good to launch a quick mvp

random bronze
#

like making dashboards and other stuff or similar complexity slightly harder even!

random bronze
vale wasp
random bronze
#

i also think i'd need to build a habit of reading lot of ai written code 😩

vale wasp
ornate wren
steady rain
vale wasp
ornate wren
#

you can have 0 percent right?

random bronze
#

and just seeing it work

slow rivet
#

well the term is very poorly defined

random bronze
crisp jay
ornate wren
#

nothing

random bronze
#

wht does saas have to do with this 😭

vale wasp
slow rivet
#

some people use vibe coding to mean fully ai generated with no technical input from the user, some mean vibe coding as in just using ai for most work, some call using ai at all vibe coding

crisp jay
random bronze
ornate wren
random bronze
# crisp jay bro doesnt know

the heck are you on about 😭 have you ever actually shipped anything? i still don't know what does saas have to do with what we're talking about.

ornate wren
#

You can still vibe your way into the mvp, but you may add guardrails for best results

orchid pier
#

Coding too hard bro I still don't know def broo

random bronze
#

!d def

edgy krakenBOT
random bronze
crisp jay
#

ngl they should change def to fun

crisp jay
velvet trout
random bronze
long tangle
#

What the fuck is object oriented programing

ornate wren
#

everything is a object

long tangle
random bronze
cerulean ravine
slow rivet
crisp jay
random bronze
#

why do you ask?

long tangle
ornate wren
#

Can we de debate oop in this channel or its a heated subject? @cerulean ravine

vale wasp
crisp jay
#

its like if c structs had the possbility to add functions in them

cerulean ravine
random bronze
vale wasp
ornate wren
#

Because mostly definitions of oop are deadly wrong..

slow rivet
#

oop is actually kinda poorly defined, the definition has shifted a lot over the years. Tho python is generally considerd to be very oop heavy

vale wasp
random bronze
#

wym sort of?

crisp jay
vale wasp
# random bronze wym sort of?

You can add pointers to functions to the struct and then when you instantiate you need to actually point them at the desired functions.

ornate wren
#

OOP was not classes or methods (modula, c++ style that has infected every language), it was about objects that could change their own state based on MESSAGES that they could comply or not

crisp jay
#

im pretty sure there is an academic paper thing about oop

slow rivet
vale wasp
cerulean ravine
vale wasp
#

The concept evolved, as many things do.

crisp jay
#

can we make functional programming the new meta?

velvet trout
# orchid pier Coding too hard bro I still don't know def broo

def means define, it is used to define (create) a function, a function is just a block of code which you can call more than once however you like. A function takes some inputs (called as arguments) and returns a value, a function is called by its name with () (called as parenthesis)

example:

def add(number_1, number_2):
    result = number_1 + number_2
    return result

result = add(2, 3)
print(result)

You can call the function add with different inputs as many times as you want. In this case, the function helped you save the logic of addition of numbers in a single place without needing to repeat the same addition logic whenever you repeatedly need it to add numbers.

ornate wren
#

C structs with methods is just an improvement or a evolution of the Module concept, with iinheritance (bad) and interfaces (implementation definitions, nice)

crisp jay
velvet trout
ornate wren
random bronze
#

f(x) = ax + b
or if you want formal mapping
f:x -> ax + b

lambda x : a*x + b
cerulean ravine
orchid pier
vale wasp
orchid pier
random bronze
#

yeah you gotta have an actual usecase example like that don't usually click anyway

orchid pier
#

Surprising bruh everyone else would of understand by now

vale wasp
# orchid pier No bro

Please don't call me "bro". If you tell me what you don't understand, I can see if I can explain such that you do.

random bronze
crisp jay
velvet trout
# orchid pier Idk this bro I don't understand bro

Could you clarify what exactly do you not understand in this?

First of all, relax your mind, do not think you wouldn't understand or this is scary or anything that is negative.

Re-read what i wrote in the message, see the first word or a few words together, then come back and look if you understand it or not. Note down what you did not understand and i will help you understand it.

random bronze
orchid pier
random bronze
#

all good

random bronze
frail scaffold
#

Guys I am overwhelmed by the amount of options l have

orchid pier
random bronze
#

nice

crisp jay
orchid pier
velvet trout
#

Tho it's helpful for those individuals who have done math (assuming they're fine or fluent with it) to learn programming from a mathematical perspective and similar analogies.

random bronze
orchid pier
#

I wanna learn it

random bronze
crisp jay
random bronze
orchid pier
crisp jay
ornate wren
random bronze
#

you don't need def to measure the area 😭

orchid pier
steady rain
swift sparrow
orchid pier
vale wasp
random bronze
crisp jay
#

you will get it,friction is the part of learning things

cerulean ravine
orchid pier
steady rain
crisp jay
orchid pier
rare tiger
# orchid pier I wanna learn it

Basically, you use def to define a resuable block of code that can return data back. For example, you can have a function that multiplies an integer (number) by two and returns it back for use later or in the moment.

def multiply_by_two(input):
    output = input * 2
    print(f"{input} times two is {output}.")
    return output

number = 4
multiplied_number = multiply_by_two(input=number)
orchid pier
crisp jay
velvet trout
waxen hazel
#

hey guys
ideas on how to get chatgpt to read a problem effectively and meet all its requirements?

cerulean ravine
rare tiger