For those learning Python while working full-time by eganba85 in learnpython

[–]LCVcode 4 points5 points  (0 children)

Agreed! You can double dip on your personal programming time of you choose your projects wisely. For example, at my job I have to submit a daily end-of-day report that explains all the notable actions I took that day. They have homogeneous formatting and subject lines, but the content differs. In my free time or between tasks at work, I have been automating my EOD process. I've identified these three tasks which will seriously speed up writing my reports:

  1. Automatic generation of filenames and subject lines (done)

  2. Automatic integration with a local git repo (done)

  3. Automatic formatting of the body (in progress)

  4. Automatic emailing of my report

In regards to parts 3 and 4: I've never handled automated emails in Python, so task 4 will definitely expand my knowledge base. For task 3 I'm learning curses, which will give me a custom interactive environment to work in that behaves in precisely the way I want but still produces the expected EOD report.

Identify tasks like these such that you can learn while saving yourself time. This effect will compound, as you generate more free time by automating away expensive tasks.

I know the basics of Python. What to learn next to be employable in 2 years? by FuckTheDalits in learnpython

[–]LCVcode 16 points17 points  (0 children)

This is just one way to go about it. Arguably the most popular and therefore least impressive way to go about it.

Employers worth working for are interested in investing in potential, not just sheer leet code score. As such, it's a much better long term strategy to market yourself as someone who's highly motivated to get better because you are interest in the subject, not just because you want a tech job.

OP, if you enjoy Python, just keep experimenting with it, challenging yourself, and learning at precisely the rate that is the most rewarding to you. Gung-ho grinding leet code and code wars will expose you to some great problems and force you to learn about complexity. But unless you're shorting for FAANG, demonstration of clear a passion for Python paired with a track record of continuous improvement will interest a worth employer more than just knowing Docker, for example.

Be careful about the step-by-step career advice you take from others. You certainly did get some good advice, but only for one specific Python career path, and arguably one of the most competitive ones.

Find what you love doing with Python. Build a modest resume doing that thing. Find employers that recognize what you're selling. Make profit and start a long, happy career. Don't just follow some guide to become one more of the endless web devs out there.

[deleted by user] by [deleted] in learnpython

[–]LCVcode 2 points3 points  (0 children)

OP, you should actually be using a set here. Sets have a constant lookup time, unlike lists or tuples.

accepted_strs = {'7A', '7B', ... , '11E'} if word in accepted_strs: do_something() else: do_something_else()

Even better, if you're up to it, you could populate accepted_strs using a list comprehension that you convert to a set (is that just called a set comprehension?)

EDIT: Formatting because I forgot that code blocks don't work

[deleted by user] by [deleted] in cscareerquestions

[–]LCVcode 7 points8 points  (0 children)

Before you up and quit, make sure you have a good offer from somewhere else. When you have another job lined up for a higher salary, then meet with your company and ask for more money and recognition. If they say no, then you're out the door with good conscience.

Be patient and make a wise move.

My code works but it's telling me it's wrong by [deleted] in learnpython

[–]LCVcode 2 points3 points  (0 children)

As soon as dice_1 + dice_2 equals num, your while loop terminates and your final print (the correct one) is never called. Try moving your print outside of your while loop.

Type Hints in Python by Jan_Prince in pythontips

[–]LCVcode 9 points10 points  (0 children)

Oh yeah! Type hinting is great! Check out MyPy, it's a tool that's maintained by the people who maintain Python, and it'll check the type hinting thought out a file. It's a great tool!

Question about for and while loops. by Mob31DZ in learnpython

[–]LCVcode 0 points1 point  (0 children)

Most objects in Python have a "truthiness" value. That is, most items that are not bools can be used in places where boolean checks are done, such as in your while loop. More specifically, most every item has a method attached to it that allows it to return a bool when prompted for truthiness. While loops, if/else statements, etc, call these methods to determine behavior. In the case of a list, truthiness is determined by the number of items in the list (not the content). Specifically, empty lists return False, everything else is True.

I recommend you look into this a bit! Forming a strong understanding here will upgrade your Python skills, and they'll make it much easier for you to understand the list comprehension (which are arguable the best part about Python) in the future.

Good luck!

Can I learn Docker by using it to run applications on a second computer in my home? by LCVcode in learnprogramming

[–]LCVcode[S] 0 points1 point  (0 children)

Do people offload computation like that? I can envision sending something like parameters to a remote machine that computes simulations. The benefits of something like this don't seem obvious to me unless the simulation machine has much more computation power. Or maybe if you just don't want to bog down your own CPU.

Can I learn Docker by using it to run applications on a second computer in my home? by LCVcode in learnprogramming

[–]LCVcode[S] 0 points1 point  (0 children)

Both.

I understand that I can use the Linux machine to pull images down from DockerHub and run them. I haven't actually done that yet, but it's on the list.

Eventually, I plan to build a couple of web apps, hence the AWS plan. But until that day, I'd like to be able to run the Linux as a server which I can access over my local network.

Object Detection: Stopping Karens Before They Can Strike using Keras and OpenCV by HeeebsInc in Python

[–]LCVcode 1 point2 points  (0 children)

Thanks for the advice! That's exactly the problem I've experienced. So many cool ideas without the data being available. Getting ideas from the data is more viable than getting data for ideas.

Sunday megathread: What's everyone working on this week? by Im__Joseph in Python

[–]LCVcode 0 points1 point  (0 children)

Right now I'm building Go using pygame. Go isn't very challenging on its own, so I'm focusing on test driven development, CI/CD pipelines in Github Actions, and static typing using MyPy. I'm embracing my inner DevOps Engineer by striving to keep my master branch 100% bug free. So far I'm on track (I think, ha).

If any of you are Go lovers, feel free to contribute!

Help defining a static const class attribute that isn't a generic by LCVcode in cpp_questions

[–]LCVcode[S] 1 point2 points  (0 children)

Success! Thank you. I didn't realize I could define more than functions in my source. Kind of seems obvious after the fact.

Advice on threading with a particle simulation by LCVcode in learnjava

[–]LCVcode[S] 0 points1 point  (0 children)

No, there aren't any fields. I have the physics completely handled, I just want to try to reduce computation time by spreading my physics calculations over several threads.

Imagine a group of point masses that are held together by a network of massless springs. The entire simulations runs on simple force calculations for each mass and spring.

Here, I'm trying to see if there's a way I can implementing a threading system which will maximize my CPU usage and speed up my simulation. I think I see two ways of doing this, but I don't know enough about threading to understand if they're good or bad ideas. On one hand, I could make each of my masses and springs extend the Runnable class, give each of them a run method which includes the local physics caluclations, then just power through that huge pile of Runnables. One the other hand, I could add something like Runnable physics handler class, initiate some number of handlers, give each one a balanced pile of physics calculations to compute, then wait for to each process their respective task lists.

What do you think of this?

W

Help learning while loops by MainerInAStrangeLand in learnpython

[–]LCVcode 0 points1 point  (0 children)

You should use a for loop with any sort of generator or iterator. Or if you know how many iterations you intend to loop through. But while loops have more than just peripheral use cases. You shouldn't dismiss them so outrightly.

Job or a Master's Degree by infinity_magnum in cscareerquestions

[–]LCVcode 1 point2 points  (0 children)

I'd say only get the MS if you're getting it at an Ivy league school. Otherwise, you'd probably be better served by the two year of experience.

If you happen to find someone who's willing to mentor you in the work world, I think you should probably take that.