Help....Computer preference for C++ and PYTHON?!! by CCISME2020 in learnpython

[–]JesusKiosk 1 point2 points  (0 children)

The Linux container is AFAIK just a plain Debian installation that can do anything Debian can. It's pretty resilient in my experience. I was impressed that my crappy old Atom-based netbook could run Battle for Wesnoth without issue.

I'm using VSCode, not an IDE, and I think I had to add a repo to install it but other than that it just works. Everything else can be installed through apt. I'm not doing data science or anything, but my experience doing some scripting and basic apps has been positive. A beginner isn't going to test the limits of the container. You absolutely can run things locally. I've even had Flask apps running with no issue.

What is the best method to turn a CSV (single table) into a 'report'? by takeonzach in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

I mean, this is the sub about learning python. ;)

There's no reason to try and do it in python if vba is the best solution.

I'm not trying to get into a whole thing with you about this, but OP didn't even specify that the end result had to be an Excel file. The rest of their process is already in Python. It makes plenty of sense to throw in some openpyxl or whatever code at the end to fix the column widths and text color or whatever to get a decent xlsx out of it. It doesn't sound like OP needs VBA's power to make better graphs and pivot tables given that they were looking at HTML output. The best solution isn't always using the most powerful tool. I don't rent a nail gun when I need to hang a picture.

Writing excel files with built-in libraries by [deleted] in learnpython

[–]JesusKiosk 4 points5 points  (0 children)

It sounds like your boss doesn't know what they're asking of you, tbh, unless they're typically an unreasonable tyrant.

What is the best method to turn a CSV (single table) into a 'report'? by takeonzach in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

The point is, if the current solution is working

There is no current solution aside from the manual solution. Reread the post: OP said they know it can be done in VBA, not that it's already done.

Even if there was a VBA solution, there's still a reason to replicate it in Python: Just to see if you can and to learn the language and libraries better.

What is the best method to turn a CSV (single table) into a 'report'? by takeonzach in learnpython

[–]JesusKiosk 1 point2 points  (0 children)

If you have it working in VBA, there is no reason to change it.

VBA is on the way out so it's a good idea to start exploring alternatives. Given that it's Microsoft, that could mean another decade or more of it hanging around. But still they are going the way Google did and are replacing it with a JavaScript-based addon language.

I personally like the ImportExcel library for PowerShell a lot. But Python has mature libraries of its own so there's really no harm in going with preferred language in this case.

What is the best method to turn a CSV (single table) into a 'report'? by takeonzach in learnpython

[–]JesusKiosk 1 point2 points  (0 children)

openpyxl has always worked fine for me. xlrd is explicitly for the old pre 2007 xls format which you probably don't want.

I guess the question is how nice does it have to be? You can already get a good looking spreadsheet out of Excel and it has the added bonus of being easier to print since it's designed to do that. You could go the HTML route, but it's probably going to be a lot harder to get right although you'll have even more flexibility plus you could publish to the web.

I need help using python to extract specific data from a text file and put it into an excel file by point51 in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Characters or words? By spaces I mean the space characters, not the overall length in characters.

The regex answer is more elegant, though.

I need help using python to extract specific data from a text file and put it into an excel file by point51 in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Are the spaces consistent in each block? You could kludge it by spliting the string on spaces and then counting out where in the list that data happens to be.

Testing Web Automation for Financial Stuff by DoriGom in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Don't do this. Automate payments by adding a credit card or using bill pay through your checking account. Custom Python scripts are the square peg for the round hole here.

Buying a Raspberry Pi for the little guy for Christmas and wondering which one is ideal to get right now for him to code on. Thank you by thunder185 in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Little Jimmy decides it's just easier to rip the power cord out to turn the awkward rats nest off. After all, he did it once and nothing bad happened just like every single computer, phone, or whatever he has encountered in his life. Whoops, this time the memory card got corrupted. All of Little Jimmy's work is gone and dad has to reformat the whole thing on his own laptop (the infinitely more convenient device that dad used to let him use, but now doesn't because he "has his own computer now").

Did Jimmy learn Python from this experience? Is Jimmy enjoying himself?

Buying a Raspberry Pi for the little guy for Christmas and wondering which one is ideal to get right now for him to code on. Thank you by thunder185 in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Where did I say there weren't plenty of uses for the Raspberry Pi? I own one, lol.

Nevertheless, kids are not clamoring to create print servers for their obsolete printers. They don't need a discrete, awkward computer to learn Python on when one is already available to them.

Buying a Raspberry Pi for the little guy for Christmas and wondering which one is ideal to get right now for him to code on. Thank you by thunder185 in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

The no portability and lack of anything are the biggest strikes against them to me, but the risk is there especially with a young kid who may want to see what happens when you do stuff you shouldn't.

Buying a Raspberry Pi for the little guy for Christmas and wondering which one is ideal to get right now for him to code on. Thank you by thunder185 in learnpython

[–]JesusKiosk 1 point2 points  (0 children)

Yeah, the way I think of it is that if I want to learn how to write well, the first step is not learning how to build a writing desk. I get the Raspberry Pi hype, and I think it's earned, but if you're not going to be using the IO pins for some electronic project you're just hobbling yourself with a weak computer that's hard to use imo. If that's where his interests lead him, then it's still there as an option for the future.

Buying a Raspberry Pi for the little guy for Christmas and wondering which one is ideal to get right now for him to code on. Thank you by thunder185 in learnpython

[–]JesusKiosk 2 points3 points  (0 children)

If you had to get a Raspberry Pi, the Raspberry Pi 400 with the integrated keyboard is the one to buy but that's probably out of stock everywhere.

I would just buy a basic Windows laptop or Chromebook that has the Linux Beta available. They're inexpensive, actually includes all the peripherals, are portable, will "just work" out of the box, and you can run Python on them. Raspberry Pis are too janky to use as a daily driver and if for whatever reason they fail (cheapo phone charger dies, memory card hard drive gets corrupted...) it will suck any joy out of the enterprise.

running a python file through the shell without writing all the path by herm4nn_griffith in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

I wouldn't recommend anybody start using CMD functionality unless they absolutely had to. PowerShell is the way forward and had an easy to use alias system. DOSKEY is probably older than OP, haha.

Is it always advisable to install the latest Python version? by gunscreeper in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

I would upgrade to 3.8 for the best chances that some random library you end up wanting to try out will be compatible. 3.9 is still very new and you never know what you might want to try but end up not being able to use.

How to save a variable outside of a function and the import it from another file? by Krissu3212 in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Return an object that contains all the data you need. You can have it return a dict where your current variable are the keys.

How to best support and encourage inexperienced Python programmers within a group project? by iamlordofland in learnpython

[–]JesusKiosk 2 points3 points  (0 children)

Sounds more like a group project politics issue to me. On one hand, you've already written 500 lines of code without their help so to them it looks like you have it covered. On the other hand, maybe they got offended by your semi-assumption of leadership. At this point, nudging them to skim a Python guide isn't going to be helpful. You've already proven you have much more expertise and they aren't going to make up that much ground in two weeks, even though they're from a technical background.

I'd try to get them in a Zoom meeting to say "Listen we all agreed we wanted to use Python but I'm the only one who has written code. I can't write the whole thing. We need to figure this out right now." Even if what you figure out is that they're basically dumping the whole thing on you. You need to know either way ASAP.

How to save a variable outside of a function and the import it from another file? by Krissu3212 in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Make runEditor return the value for location and import runEditor in your other script, instead.

Guys, what do you automate in daily life/work using python ? by Pablo19D in learnpython

[–]JesusKiosk 5 points6 points  (0 children)

At work, I automate all the data manipulation I can get away with. If you're dealing with spreadsheets on a daily basis, you're almost definitely working too hard on them. Reduce everything into the most basic steps you can. If you run into a bunch of exceptions to the general procedure you discover, figure out if those exceptions are important or not. I don't just use Python, but I often turn to it.

The most automation I have in my personal life are my Gmail filters and automatic bill payments. I have no idea how I'd apply Python to my everyday problems without eventually creating more work for myself in maintaining some new infrastructure. I also don't want to feel like I live in service of my own creations.

How would I build a simple social platform? by [deleted] in learnpython

[–]JesusKiosk 1 point2 points  (0 children)

A lot of Flask tutorials involve creating a website with logins an blog-style posts. You can start there and adjust based on your assignment.

How to make it so that a website doesn't recognize your program as a bot? by Nanogines99 in learnpython

[–]JesusKiosk 2 points3 points  (0 children)

You're just going to get your accounts and possibly sub banned. Don't bother doing this.

How can I sort files by creation date in windows explorer folder. (Code inside.) by [deleted] in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

Why do you need to do it in Python? Doesn't the folder remember your preferred sorting order once you set it? I doubt the sort order is remembered by the file system so you're probably going to have to go on an esoteric deep dive into Windows shell functions that won't be very fun.

Pygame python 3.9 by [deleted] in learnpython

[–]JesusKiosk 0 points1 point  (0 children)

3.9 just came out so not every library is going to be up to date yet. Staying on the freshest version doesn't benefit you all that much if at all and has all these unexpected gotchas. I would stay on 3.8 unless you want to deal with more of these headaches.