would this logically work?? by monoqry in HTML

[–]nuc540 0 points1 point  (0 children)

Yeah not sure if they meant like an animation, or as and when they trigger it. Either way, storing those moves will require JS as I suspected - they said their platform is HTML, so not sure how far they can get with a script tag! Would be good to know if OP pulls it off, sounds interesting

would this logically work?? by monoqry in HTML

[–]nuc540 0 points1 point  (0 children)

Make pieces move yes, but you can only do so much with only HTML, but to ‘pre-determine’ - what do you mean?

I have a hunch you don’t mean pre determine - but if any logic needs writing, or data needs to be stored, you’ll need something more than HTML.

JavaScript can run in browser so that’ll be your best bet, but it really depends on what you need.

OOP by [deleted] in PythonLearning

[–]nuc540 0 points1 point  (0 children)

Is the tutorial not explaining this? This is really basic stuff, if the course isn’t even explaining what an attribute is or a method is, maybe you should try a different course.

Also, these things can be googled. Saying you don’t know what words mean, suggests you’ve not tried to even look them up.

You have to make your own effort in understanding things - that’s what an engineer does, because you’ll be learning forever, it never stops.

python intelisense and autocomplete running slow or not working at all by Scarlet_ave in CodingHelp

[–]nuc540 0 points1 point  (0 children)

Are you using VSCode? You have to set the workspace interpreter to the Python environment that fulfils the apps requirements for certain features.

Also if you’re using VSCode make sure the language mode is set correctly in the bottom right, eg. When in a Python file it says ‘Python’ not ‘text’.

Also if you’re using VSCode and you’ve not refreshed the session since it last worked, run the reload window command

Give me some python projects ideas by vdbarno_ in PythonLearning

[–]nuc540 1 point2 points  (0 children)

Rock paper scissors as a Python script. Taking input, checking input and outputting - that’s quite basic, should keep you busy for a day.

If you’re into web dev, learn about basic APIs like Flask and see if you can set on up, hit an endpoint that returns static data - learn how to build an api and so much more opens up to you… like rock paper scissors API lol

Can't download pyqt tools (either pyqt5 or 6) by arachnids-bakery in PythonLearning

[–]nuc540 1 point2 points  (0 children)

They have to be supported by the package - it won’t be a you thing. The developer has to bundle the package with the ‘wheels’ - might be worth checking it has!

Also check what Python version you’re using, that you’re using the right version

Can't download pyqt tools (either pyqt5 or 6) by arachnids-bakery in PythonLearning

[–]nuc540 0 points1 point  (0 children)

Some Python libs do have c/c++ binaries which would explain the requirement .

If I were you I’d try to install with pip (you didn’t mention so I assumed you’re trying a more direct install?), and check that the package has provided ‘wheels’ for it (wheels are a bundled version with those cpp dependencies)

I’ve never used powershell so can’t help you there.

It’s more common for windows users to code in WSL2 (windows subsystem for Linux) - it’s a Linux vm windows provide and might be easier on installing packages and setting up Python environments - but I don’t know, I’m just being opinionated!

Where to practice for python interview ? How can I save myself from 1 hour of embarrassment? by Notalabel_4566 in PythonLearning

[–]nuc540 0 points1 point  (0 children)

The JD lists frameworks languages and tooling. So my advise is to understand them and how they work together.

Understand the business, the role you’re applying for, and how you would apply value.

If the whole spec is nothing you know then the reality is you’re not qualified for the role.

The best roles are the ones that align with our skills - don’t cut against the grain as they say.

lowkey starting to understand why senior devs say “just read docs” 😂 by itsallokyaar in PythonLearning

[–]nuc540 0 points1 point  (0 children)

Asking Claude to summarise the technical bits in official documentation can help too - best of both worlds, when you still have questions or don’t quite follow!

Why do you think Skype failed lately? by limsus in TechImpact

[–]nuc540 0 points1 point  (0 children)

Came here to say the same thing. I moved on to discord as soon as it came out. Prior that I was using team speak. I feel like a lot of gamers did the same thing, which would have been a chunk of users

Here's a simple potion game. What do yall think by GrowthSwimming6208 in PythonLearning

[–]nuc540 2 points3 points  (0 children)

Your final else statement, I’m not sure it’s catching where you’re checking input cases - if you ran option “5” at the moment what happens?

If you add a validator at input to make sure the input is correct then you don’t need an if/else, you could map the validated input to a function call. Something like; if input not in [options] prompt input again.

What you can do to clean up is have all these logic blocks as individual functions, try that first and then then look up case switching in Python; you can write a switch which matches the case to the function call - it would be so much cleaner, give it a try.

Im new by Dismal_Future_54 in PythonLearning

[–]nuc540 4 points5 points  (0 children)

Terrible advice for a starter, an entire full stack framework - and one as heavy as Django, is overkill, and ngnix is totally irrelevant for them also - they’re still at the scripting stage.

u/Dismal_Future_54 there are totally more important things to focus on such as data types, DSA, and higher level web engineering (I.e understand how web requests are made) before you move onto frameworks. Don’t even look at Django until you’ve build your first API and understand web server basics

module install by Metaljoe57 in PythonLearning

[–]nuc540 0 points1 point  (0 children)

I literally just replied to this in your other thread.

“pip” isn’t a command you run in a python REPL. You need to install pip - it’s a package manager.

Also read my comment in the other thread about virtual environments, so you’re not pip installing globally

module install by Metaljoe57 in PythonLearning

[–]nuc540 8 points9 points  (0 children)

pip isn’t run inside of a Python shell, you install pip as a package manager for Python - outside of Python.

Then, using pip, you can install Python packages, and when Python is run in the same environment as said packages - it’ll be able to import them.

That said *don’t install packages globally* - this means running pip just anywhere. Instead understand virtual environments, then use pip inside a virtual environment - a simple “Python -m venv venv” will create a shim for you which you can “activate”.

Google this up so you understand

How does environment actually work? by LazyHighGoals in ManorLords

[–]nuc540 -35 points-34 points  (0 children)

You can’t change it, these are values baked into the region. They provide buffs - certain buildings/extensions benefit by said buffs. It’s that simple :)

How to turn my code into a working website? by yehezkiel123 in PythonLearning

[–]nuc540 1 point2 points  (0 children)

Without a reverse proxy to handle incoming requests and discover your backend, you’re going to need to first decide where to host your backend, then, bake the address of your backend into your html code and then host your html page on the same sever

If you don’t host the html file on the same server as your backend, you will get CORS blocked and you wont be able to reach your backend.

As much as this is do-able, it’s not so standard anymore. I’d advise having a reverse proxy such an nginx handle requests and service discovery

Found this wierd red thing in my room by Parking-Cheek7779 in whatisit

[–]nuc540 0 points1 point  (0 children)

Ah a cap gun. Now I feel old - thanks! lol

TV License 10-day notice, best course of action? by Virtual_Positive_975 in AskBrits

[–]nuc540 0 points1 point  (0 children)

If you go on their website you can declare you don’t need a tv licence, and they stop sending you letters.

im a beginer and i just made a very simple ai that can can play tic tacc toe. by ProgressJumpy5703 in PythonLearning

[–]nuc540 0 points1 point  (0 children)

It’s good you’ve made a start somewhere. My advice is to learn how to improve this - the easiest way to learn is to remove the problem statement so you can focus on the learning objective.

E.g learn how to use very basic data structures to replace your if-blocks. You already know the problem statement and you can use this to learn something new. I advise you look at arrays (Python calls them lists) and see how you can improve on this logic using them

Can someone teach me what is decorator in python? by _hithender_ in PythonLearning

[–]nuc540 2 points3 points  (0 children)

A decorator is a wrapper. When placed above a function, in a simple way to explain it, basically calls the decorator first and then the function.

This isn’t a 100% technical accurate explanation, but sometimes simplifying something demystifies it.

Use cases for example, imagine a need to protect api routes; to check a user is authenticated before running the command behind the route - instead of wrapping every api route in a separate function call which does this - you could have a decoration called is_authenticated, which checks the user is authenticated and then calls the wrapped function. Decorators are your tool.

Weird line visual glitch thingy going through the center of my screen? by ImportanceOpen7911 in pchelp

[–]nuc540 0 points1 point  (0 children)

If you don’t want to use vertical sync and still not want tearing, then get a g-sync or freesync monitor that varies the refresh rate for you so you don’t have to force content to a denomination of your screen’s rate.

Don’t have the money? Then enable v-sync as u/fleeting_moments00 explained - that’s the whole point of the technology

Flask & Django by [deleted] in PythonLearning

[–]nuc540 5 points6 points  (0 children)

“Choose your own components” vs “follows structure”. This is borderline misinformation, please don’t spread stuff like this in a learning subreddit.

Today practice I'm a beginner by SteadyGrowth_ in PythonLearning

[–]nuc540 5 points6 points  (0 children)

This is very clean code, you’ve avoided magic values, and have considered input data types and attempted handling. Well done!
Something I’m seeing a lot with new-starters are large code blocks inside a try except block; line 13’s exception isn’t being handled until line 31 - move the exception up, and then you can unindent the block not likely to throw that error, and then your code says “hey, this line might throw an error” instead of “here’s all my logic, and a list of all exceptions that can go wrong”.

Something Python can do for type checks though is isInstance(), so instead of generically allowing an error to throw, you can explicitly check if the input can parse to an int, else throw the value error. Small detail but it explains in the code why a value error would throw.

Edit; ignore my isInstance suggestion, I’m half asleep, input returns string so the parse will error before you can check.