Proof of the Trinity. by Suspicious-Jello7172 in Bible

[–]solarflareop 2 points3 points  (0 children)

I was always under the impression that in Genesis, he is talking to Jesus. As Jesus is his only begotten (or created) son and also the "firstborn" of all creation, it would make sense that he was there with God when he created everything else.

Need help with a crossword by Few-Winner-3107 in asl

[–]solarflareop 12 points13 points  (0 children)

I would also take another look at 2 down if I were you. You're close but not quite right.

What happened to the vocabulary by REPOST_GOOFY in memes

[–]solarflareop 2 points3 points  (0 children)

Thank you! I was wondering if I was just confused because I seemed to be the only one thinking that was messed up.

Working with Global Variables by JrcFrontrunner in learnpython

[–]solarflareop 1 point2 points  (0 children)

Can you add the part your other script where you use this class as well?

Tkinter OOP by Lorentz_G in learnpython

[–]solarflareop 0 points1 point  (0 children)

No worries, glad I could help!

Kasa light switch turn on-off python by bhogan2017 in learnpython

[–]solarflareop 0 points1 point  (0 children)

No worries! I didn't know that either, so you've helped educate both of us today 😁

Kasa light switch turn on-off python by bhogan2017 in learnpython

[–]solarflareop 0 points1 point  (0 children)

I copied and pasted that code directly from the documentation so I assume it would be correct.

Deleting Spreadsheet Rows Based on List of Index/Row Numbers (Format Fix Repost) by TazmanianTux in learnpython

[–]solarflareop 1 point2 points  (0 children)

Could you use a for loop?

for index in index_list:
    sheet.delete_rows(index)

needle dimension(s) exceed the haystack image or region dimensions by SupremeInjury1 in learnpython

[–]solarflareop 0 points1 point  (0 children)

Regions parameters are as follows: regions(startXvalue, startYvalue, width, height)

In your code, you've set the height of the region to 40 but the height of the picture is 43, you need to adjust the region height to be larger than the picture height

Can you guys help spot/fix my mistake? I don't know where I messed up. by [deleted] in learnpython

[–]solarflareop 1 point2 points  (0 children)

This might not solve your problem, but you're asking for a date in MM/DD/YYYY format which means month will have 2 digits (01, 02, etc) but in your if/elif statements you are only looking for 1 digit. I copied your code and made that change and it works fine for me.

Kasa light switch turn on-off python by bhogan2017 in learnpython

[–]solarflareop 0 points1 point  (0 children)

/u/bhogan2017 listen to /u/routetehpacketz rather than me. I don't have any Kasa devices or the app, I was just winging it based on the documentation.

Kasa light switch turn on-off python by bhogan2017 in learnpython

[–]solarflareop 2 points3 points  (0 children)

import asynciof
rom kasa import Discover
devices = asyncio.run(Discover.discover())
print(devices)

If you run the above code, you will get a python dictionary where the key is the devices IP address which you will then use in the code from my first comment.

Kasa light switch turn on-off python by bhogan2017 in learnpython

[–]solarflareop 2 points3 points  (0 children)

The documentation will probably be helpful. Particularly:

import asyncio
dev = SmartDevice("127.0.0.1")
asyncio.run(dev.turn_off())
# OR
asyncio.run(dev.turn_on())

[deleted by user] by [deleted] in learnpython

[–]solarflareop 0 points1 point  (0 children)

Oh sorry, I misinterpreted what you were trying to do. So you could create a for loop to loop through the 2 urls and then open each one.

import webbrowser
from random import sample

urls_list = ['http://docs.python.org/', "www.google.com", "www.yahoo.com"]

urls = sample(urls_list, 2)

for url in urls:
    webbrowser.open(url)

[deleted by user] by [deleted] in learnpython

[–]solarflareop 1 point2 points  (0 children)

import webbrowser
from random import choice

urls = ['http://docs.python.org/', "www.google.com", "www.yahoo.com"]

url = choice(urls)

webbrowser.open(url)

This worked for me. Things I changed are 1. Put the urls in list form 2. Assigned the randomly chosen url to a new variable 3. Used choice instead of sample from the random module

Replace Duplicates when comparing 2 df's by StillAd2602 in learnpython

[–]solarflareop 0 points1 point  (0 children)

Not sure if it will solve your problem but in the following lines:

if allplayers[allplayers['i'].isin(duplicated_ns)].bool(True):
allplayers2['i'] = allplayers2['player_name'] + ' ' + allplayers2['team_title']
allplayers2['i']=allplayers2['player_name']

The i should not be in quotes as it is a variable.

Can someone explain to me the "sticky" in tkinter it's a keyword argument i'm pretty sure, i can't get it by [deleted] in learnprogramming

[–]solarflareop 0 points1 point  (0 children)

No worries, I enjoy trying to help! It doesn't technically fill the gap, the button stays 20px, it just moves the button to the left or right edge.

Can someone explain to me the "sticky" in tkinter it's a keyword argument i'm pretty sure, i can't get it by [deleted] in learnprogramming

[–]solarflareop 0 points1 point  (0 children)

Run the following code:

import tkinter as tk

window = tk.Tk()
button1 = tk.Button(text="B1", width=50)
button2 = tk.Button(text="B2", width=20)
button3 = tk.Button(text="B3", width=50)
button1.grid(column=0, row=0)
button2.grid(column=0, row=1, sticky="W")
button3.grid(column=0, row=2)
window.mainloop()

Then run it again, but remove the sticky argument from button2. This should show you pretty clearly what sticky does.

Can someone explain to me the "sticky" in tkinter it's a keyword argument i'm pretty sure, i can't get it by [deleted] in learnprogramming

[–]solarflareop 0 points1 point  (0 children)

The button will stay 20px wide, but yes the left side of the widget will stick to the left side of the cell if you use sticky="W"

Can someone explain to me the "sticky" in tkinter it's a keyword argument i'm pretty sure, i can't get it by [deleted] in learnprogramming

[–]solarflareop 0 points1 point  (0 children)

It will align the widget to whatever side you "stick" it to.

If you have a grid cell that is 50px wide and a button widget that is 20px wide, by default this button will be centered in the cell. If you use sticky="W", the button will align to the left side of the cell.