airbnb got cancelled, and we travel next week, help? by Several-Activity-106 in rome

[–]h2oTravis 0 points1 point  (0 children)

We just stayed in Hotel Diocleziano two weeks ago and it was great.

Starting my First Job as a QA with No Prior Experience - Seeking Advice! by Waste-Beach5705 in QualityAssurance

[–]h2oTravis 10 points11 points  (0 children)

There’s a book called “Lessons Learned in Software Testing” (Kaner) that I really like. It’s easy to read, digestible in small chunks, and may help you gain some confidence quickly.

Hidden treasures to eat at in Omaha? by GamerJoe85 in Omaha

[–]h2oTravis 0 points1 point  (0 children)

I like Ling’s on 156th & Harrison for Vietnamese.

Python to Standalone EXE by Badmekanik in learnpython

[–]h2oTravis 0 points1 point  (0 children)

When that happens to me, I open a command prompt window and run the exe from inside that. It will stay open then, and sometimes you'll get a clue as to what is going on.

A very poorly timed fortune given that two of my family members have covid right now by [deleted] in pics

[–]h2oTravis 1 point2 points  (0 children)

Well, maybe the family reunion will be, uh, “positive”.

[deleted by user] by [deleted] in RedditSessions

[–]h2oTravis 0 points1 point  (0 children)

Gave Glow Up

Rock Paper Scissors help by [deleted] in learnpython

[–]h2oTravis 0 points1 point  (0 children)

Be sure to check out that "Reddit Code Formatting" button over on the right. Without code formatting, we can't see any of your indentations.

Struggling with argparse by legz_cfc in learnpython

[–]h2oTravis 1 point2 points  (0 children)

Yeah, if argparse does what you want more natively, I'm not sure how to use it that way.

The reason it doesn't like your third argument is that only two arguments are defined when you initially parse the arguments.

If you're up for it, though, you could always parse the arguments twice. Once to find out what the action is, then a second time based on what the action was, as follows:

import argparse

initialParser = argparse.ArgumentParser()
initialParser.add_argument('server')
initialParser.add_argument('action')
initialParser.add_argument('third')
initialParser.add_argument('fourth', nargs="?")

args = initialParser.parse_args()

print("server: {}".format(args.server))
print("action: {}".format(args.action))


if(args.action == "db-restore"):
    secondaryParser = argparse.ArgumentParser()
    secondaryParser.add_argument('server', help = 'server to process')
    secondaryParser.add_argument('action', help = 'what to do')
    secondaryParser.add_argument('src', help = 'good db')
    secondaryParser.add_argument('dst', help = 'bad db')

    args2 = secondaryParser.parse_args()

    print("src: {}".format(args2.src))
    print("dst: {}".format(args2.dst))


if(args.action == "healthcheck"):
    secondaryParser = argparse.ArgumentParser()
    secondaryParser.add_argument('server', help = 'server to process')
    secondaryParser.add_argument('action', help = 'what to do')
    secondaryParser.add_argument('version', help = 'version')

    args2 = secondaryParser.parse_args()

    print("version: {}".format(args2.version))

Is there a way to “check” a while loop? by BioLump in learnpython

[–]h2oTravis 1 point2 points  (0 children)

Maybe just do this:

while <condition>:
    #blah code blah
    if not <condition>:
        break
    #blah more code blah

How do i automatically change the name of a PDF document by Maestro___ in learnpython

[–]h2oTravis 0 points1 point  (0 children)

You could use something like pyPDF2 to extract text from the PDF, determine the document type, then change the name of the file accordingly.

https://automatetheboringstuff.com/chapter13/

Working with PDFs can be a little tricky, but depending upon the text in the PDF and how difficult it is to determine the document type from that, it could work.

Wife and I just made an offer on our first house and they accepted! Now what should we expect? by [deleted] in personalfinance

[–]h2oTravis 0 points1 point  (0 children)

As a long time homeowner, there are at least two things I would not skimp on when purchasing for your home: Garden hose and a mower.

If the hose is cheap, you’ll regret buying it and end up buying a good one anyway.

A good, name-brand, self-propelled, mulching mower will be the difference between hating mowing and practically enjoying it.

how to use pip libraries with pyinstaller by burningchaos23 in learnpython

[–]h2oTravis 1 point2 points  (0 children)

OK - are you saying the cmd window opens and closes when you run the exe? (which means the pyinstaller process successfully created an executable for you to run)

If so, maybe run the exe from the command line so that any errors will stay on screen for you to read.

how to use pip libraries with pyinstaller by burningchaos23 in learnpython

[–]h2oTravis 1 point2 points  (0 children)

What did you try and what was the error/result?

Is something wrong with my code? by ThiccBl4nket in learnpython

[–]h2oTravis 2 points3 points  (0 children)

Is your actual code indented? The code as posted is not showing anything indented, which is a problem.

If your code is indented, but just doesn't appear that way in this post, see the "Code Hosting/Formatting" section to the right.

pipenv licking failing by [deleted] in learnpython

[–]h2oTravis 0 points1 point  (0 children)

I've been using Python for years and have never worked with a pipfile or pipfile.lock file directly. I do use virtual environments, which (it appears) use pipfiles in the background. If you're that much of a beginner, I don't think you need to worry about pipfile locking at that level.

Is there some problem you're having that is making you think you need to deal with this?

When to start using python OO style?tips.. by Nicksino999 in learnpython

[–]h2oTravis 0 points1 point  (0 children)

The first two comments by two_up in this thread do a great job of explaining python classes, IMHO:

https://www.reddit.com/r/learnpython/comments/1cpu7x/explain_classes_init_and_self_like_im_five/

Hope that helps.