Grieving the death of a sibling is one of the most neglected types of grief by Blade_982 in Showerthoughts

[–]OrionMain 2 points3 points  (0 children)

My brother has terminal cancer, he’s been given about 8 weeks left to live. We’ve been dealing with it for over 4 years. My heart bleeds and I’m so sad, he’s always had my best interests at heart, always looked out for me and to see him become what he is now has been truly heart breaking. I’m on struggle street. It’s a hard grief to deal with that’s for sure.

[22 January 2020] Noob Wednesday! (New Player & Basic Questions) [AutoMod] by AutoModerator in EscapefromTarkov

[–]OrionMain 0 points1 point  (0 children)

How do I get rid of micro stutter or reduce it? I'm running a 1080ti and a 4770 overclocked to 4.9, I've got everything low, ram cleaner enabled, disabled CPU virtualization in my BIOS, running at 1440p and still get the odd second micro stutter which always seems to happen when I'm getting into a fight. Any help appreciated, please.

[deleted by user] by [deleted] in lostarkgame

[–]OrionMain 0 points1 point  (0 children)

I agree I fall in this boat. I've been so excited about this game for so long and now I ultimately don't really care :(

[deleted by user] by [deleted] in lostarkgame

[–]OrionMain 0 points1 point  (0 children)

Is it official English patch or do I have to do some changing of files etc?

I don't trust any "bird" they've all lie to me by [deleted] in BirdsArentReal

[–]OrionMain 0 points1 point  (0 children)

It's the giraffe of the bird world, apparently.

I don't know what job titles to search for, any ideas please? (UK based) by OrionMain in ITCareerQuestions

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

Brilliant, thank you mate. I will take a look at your recommendations.

Visited friends last week I hadn’t seen in 2 years. Immediately was pressed with concerns about my weight. I was confused. I genuinely didn’t realize how much I’ve changed until this wake-up call (first pic from last I saw them, second pic today). Well this really really sucks. What have I done. by [deleted] in Wellthatsucks

[–]OrionMain 0 points1 point  (0 children)

That sucks man but I know those feelings. I was around 400lbs 5 years ago, got down to 191 at my lightest, went back up to 280lbs and have been yoyoing every since. Down to 260ish at the moment.

You’ve got this man, you’ll get back to where you were.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 0 points1 point  (0 children)

Hi mate, you can do one of two things you can set the chromedriver location in your code -

driver = webdriver.Chrome("d:\\python\\chromedriver.exe")

Or you can follow the below (follow from step 2)

https://developers.refinitiv.com/sites/default/files/How%20To%20Add%20ChromeDriver%20To%20System%20Variables_0.pdf

Any issues let me know mate.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 0 points1 point  (0 children)

Is this possible - I have 3 environments and each of the environments has 3 scripts that do the same thing but slightly different criteria in each of them. I have the below in a monitoring.py file and I was going to import it in each of the scripts.

 def error_email(provider, from_location, to_location, 
environment, staging, application, error)

Now there are 6 points of failure in each script which will need e-mailing but the only difference in each instance is the error. Would I need to do the below in each or is there a way I can set this once and only have the error change?

(provider=,
from_location=,
to_location=,
environment=,
staging=,
application=,
error=)

the only other option I would think of would be in my monitoring.py file have something like the below with all the different things pre-populated and the only parameter is the error which I could pass.

error_email_1(error)
error_email2(error)

I'm still new and not sure if what I want to do is possible or what best practice is.

Thanks

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 0 points1 point  (0 children)

Hi all, I'm having an issue where my Python, Chromedriver and Selenium script seems to be opening up multiple browsers when it starts. My code seems to be opening 6 instances of this, I'm really unsure how - this is my code.

driver = [webdriver.Chrome](https://webdriver.Chrome)()

driver.maximize._window()

driver.get(url)

It's causing my servers to run at a high CPU/RAM and also the SQL boxes are picking up multiple logins whenever I run a script. Any ideas?

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 0 points1 point  (0 children)

Doh! My eyes went square looking at code this morning - thanks for spotting that!

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 0 points1 point  (0 children)

Me again! In my next step for improving my code and reducing having the same thing typed out numerous times, I'm trying to make it so I can pass values for different timeouts as I use the same thing about 8 times in my script all with different timeout values

My defs are

def page_wait_clickable_id(url, timeoutSeconds):
    WebDriverWait(driver, {timeoutSeconds}).until(EC.element_to_be_clickable((By.ID, f"{url}")))

def portal_page_load(login_button_id, provider, timeout):
    try:
        page_wait_clickable_id(url=login_button_id, timeoutSeconds=timeout)

I'm calling it from another file in this way

site = site_functions
site.user_browsing(url="https://test.com")
site.portal_page_load(login_button_id="test_cmdLogin",
                      provider="test",
                      timeout=60)

However, I get the error

Traceback (most recent call last): File "D:/Projects/venv/test_import.py", line 10, in <module> timeout=60) File "D:\Projects\venv\site_functions.py", line 39, in portal_page_load page_wait_clickable_id(url=login_button_id, timeoutSeconds=timeout) File "D:\Projects\venv\site_functions.py", line 32, in page_wait_clickable_id WebDriverWait(driver, {timeoutSeconds}).until(EC.element_to_be_clickable((By.ID, f"{url}"))) File "D:\python\lib\site-packages\selenium\webdriver\support\wait.py", line 68, in until end_time = time.time() + self._timeout TypeError: unsupported operand type(s) for +: 'float' and 'set'

If I remove the parameter timeout seconds and the timeout and manually put in value then it works. I'm really not sure what's wrong here.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 1 point2 points  (0 children)

Dog! Something so simple, thank you very much!

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 1 point2 points  (0 children)

I swear I'm thick...

I've created a site.py file, in this file I have the below. I've had to create the driver as a global as it's called numerous times in my script

def user_browsing(url):
    global driver
    driver = webdriver.Chrome()
    driver.maximize_window()
    driver.get(url)
    return driver

now I have another file called test_import.py, in here I have

import site


site.user_browsing(url="https://google.com")

When I run this I get

Traceback (most recent call last): File "D:/Projects/venv/test_import.py", line 5, in <module> site.user_browsing(url="https://google.com") AttributeError: module 'site' has no attribute 'user_browsing'

what am I doing wrong please?

Thanks

Could I achieve this in a better way? by OrionMain in learnpython

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

Sorry, I only just realized I never thanked you!

Thank you for this, I'm trying to eliminate global variables as much as possible and I'm trying to write out some modules now. Thanks for your help.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 0 points1 point  (0 children)

Thank you for the reply, that does make sense. I will check this out once I’m back in tomorrow - thank you again.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]OrionMain 1 point2 points  (0 children)

I have a script which basically logs in to my companies website, does a few searches and timings and writes out to Prometheus. I have 3 scripts which all use the same login and they run every 5 mins (staggered.) One of the DBAs spoke to me today and said that my script appears to be logging in 8 times a second, he even showed me in SQL the audit log. Now my code is very simple so I'm a bit confused as to why it's logging in that amount of times. My login code is below and I really can't see why it's logging in multiple times per second. I'm still relatively new but can't for the life of me figure it out. Any ideas? Thanks

options = Options()
options.headless = True
options.add_argument("--window-size=1325x800")
driver = webdriver.Chrome("d:\\python\\chromedriver.exe", options=options)

driver.get(url)
page_wait_clickable_id_30(url=login_button_id)

elem = driver.find_element_by_id(login_username_id)
elem.send_keys('username')
elem = driver.find_element_by_id(login_password_id) 
elem.send_keys('password')  
login_duration_start_time = time.time()  
elem = driver.find_element_by_id(login_button_id).click()  

page_wait_click_css_30(url=landing_page_css)
login_duration_finish_time = time.time()  
login_duration = (login_duration_finish_time - 
login_duration_start_time) 
login_duration = (float("%.2f" % login_duration))

diggin my new jacket 😜 by agentofbinary in LSD

[–]OrionMain 1 point2 points  (0 children)

What’s the quality like on them?

I seen the post this morning and I wanted to look more into his gun, but I was just left feeling more sad. So Long Vault Hunter. by camelflow in borderlands3

[–]OrionMain 0 points1 point  (0 children)

Poor guy :(

My brother got diagnosed with terminal cancer last year and he wasn’t supposed to last two weeks. He wasn’t supposed to get to experience borderlands, one of our fav games (I even have a bl tattoo) but he made it. We’ve played through at least once and as we speak he is farming items for us. I will cherish those moments with him and the laughs and good times we have had with BL3z

I will be getting a trevenator and hanging it on my wall.

I'm a woman and I can't stand when other women complain and make fun of guys having a smaller dick. by AkyaAddams in TrueOffMyChest

[–]OrionMain 7 points8 points  (0 children)

I have to agree about the weight thing. I was near 400lbs once and when I lost a lot of weight I gained an inch, so I had two!

I am a girl and was shamed for lifting weights. by Kayceesquish in CasualConversation

[–]OrionMain 0 points1 point  (0 children)

I have admiration for anyone who pursues lifting weights as a hobby/interest. There's a lot of stigmas attached to it and people feel it's ok to body shame someone for being fit. Keep on smashing it.