chunvn8888: I can confirm Galaxy S25 series will have Qi2 wireless charging standard. However, it will use the standard Qi2 without magnet (aka MagSafe) so only upgrade so far is wireless speed up to 25W instead of 15W. Though you can buy Sammy’s first party case with Qi2 magnet ring. /u/FragmentedChicken Android

chunvn8888: I can confirm Galaxy S25 series will have Qi2 wireless charging standard. However, it will use the standard Qi2 without magnet (aka MagSafe) so only upgrade so far is wireless speed up to 25W instead of 15W. Though you can buy Sammy’s first party case with Qi2 magnet ring. /u/FragmentedChicken Android

chunvn8888: I can confirm Galaxy S25 series will have Qi2 wireless charging standard. However, it will use the standard Qi2 without magnet (aka MagSafe) so only upgrade so far is wireless speed up to 25W instead of 15W. Though you can buy Sammy’s first party case with Qi2 magnet ring. /u/FragmentedChicken Android

chunvn8888: I can confirm Galaxy S25 series will have Qi2 wireless charging standard. However, it will use the standard Qi2 without magnet (aka MagSafe) so only upgrade so far is wireless speed up to 25W instead of 15W. Though you can buy Sammy's first party case with Qi2 magnet ring. submitted by /u/FragmentedChicken
[link] [comments]

​r/Android submitted by /u/FragmentedChicken [link] [comments] 

chunvn8888: I can confirm Galaxy S25 series will have Qi2 wireless charging standard. However, it will use the standard Qi2 without magnet (aka MagSafe) so only upgrade so far is wireless speed up to 25W instead of 15W. Though you can buy Sammy's first party case with Qi2 magnet ring. submitted by /u/FragmentedChicken
[link] [comments]

  submitted by /u/FragmentedChicken [link] [comments]

Read more

OpenAI API – Continuous 500 Error /u/Foreign_Weekend2920 Python Education

OpenAI API – Continuous 500 Error /u/Foreign_Weekend2920 Python Education

I continue to receive this error when I supply image files (.png) to OpenAI for analysis. Everything I’ve found online looks like it’s a transient error but I have never got it to work.

Any ideas? Is this truly a bug?

Code:

def analyze_property_condition(image_path): try: # Open the image file with open(image_path, "rb") as image_file: image_data = image_file.read() # Send the image and prompt to GPT-4 Vision response = openai.ChatCompletion.create( model="gpt-4-vision-preview", messages=[ {"role": "system", "content": "Prompt."}, {"role": "user", "content": "Prompt."}, {"role": "user", "content": {"type": "image_url", "image_url": "data:image/png;base64," + base64.b64encode(image_data).decode()}} ], max_tokens=10000 ) # Return the GPT-4 Vision response return response.choices[0].message.content except Exception as e: return f"Error processing {image_path}: {str(e)}" # Loop through all PNG files in the folder if __name__ == "__main__": import base64 print("Starting analysis of property images...n") # Check if the folder exists if not os.path.exists(image_folder): print("The specified folder does not exist. Please check the path.") exit() # Iterate over all PNG files in the folder for filename in os.listdir(image_folder): if filename.lower().endswith(".png"): image_path = os.path.join(image_folder, filename) print(f"Analyzing image: {filename}") result = analyze_property_condition(image_path) print(f"Result for {filename}:") print(result) print("-" * 50) print("nImage analysis completed.") 

Error:

Error processing C:UsersDownloadsImagesscreenshot 2024-12-17 01-16-36-11.png: The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.) { "error": { "message": "The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)", "type": "server_error", "param": null, "code": null } } 500 {'error': {'message': 'The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)', 'type': 'server_error', 'param': None, 'code': None}} {'Date': 'Tue, 17 Dec 2024 15:21:22 GMT', 'Content-Type': 'application/json', 'Content-Length': '369', 'Connection': 'keep-alive', 'access-control-expose-headers': 'X-Request-ID', 'openai-processing-ms': '540', 'x-ratelimit-limit-requests': '500000', 'x-ratelimit-limit-tokens': '300000', 'x-ratelimit-remaining-requests': '499999', 'x-ratelimit-remaining-tokens': '299455', 'x-ratelimit-reset-requests': '0s', 'x-ratelimit-reset-tokens': '108ms', 'x-request-id': 'req_b488781814317423cbf3955b65d7088b', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'CF-Cache-Status': 'DYNAMIC', 'X-Content-Type-Options': 'nosniff', 'Server': 'cloudflare', 'CF-RAY': '8f37e6f879b29011-BOS', 'alt-svc': 'h3=":443"; ma=86400'} 

submitted by /u/Foreign_Weekend2920
[link] [comments]

​r/learnpython I continue to receive this error when I supply image files (.png) to OpenAI for analysis. Everything I’ve found online looks like it’s a transient error but I have never got it to work. Any ideas? Is this truly a bug? Code: def analyze_property_condition(image_path): try: # Open the image file with open(image_path, “rb”) as image_file: image_data = image_file.read() # Send the image and prompt to GPT-4 Vision response = openai.ChatCompletion.create( model=”gpt-4-vision-preview”, messages=[ {“role”: “system”, “content”: “Prompt.”}, {“role”: “user”, “content”: “Prompt.”}, {“role”: “user”, “content”: {“type”: “image_url”, “image_url”: “data:image/png;base64,” + base64.b64encode(image_data).decode()}} ], max_tokens=10000 ) # Return the GPT-4 Vision response return response.choices[0].message.content except Exception as e: return f”Error processing {image_path}: {str(e)}” # Loop through all PNG files in the folder if __name__ == “__main__”: import base64 print(“Starting analysis of property images…n”) # Check if the folder exists if not os.path.exists(image_folder): print(“The specified folder does not exist. Please check the path.”) exit() # Iterate over all PNG files in the folder for filename in os.listdir(image_folder): if filename.lower().endswith(“.png”): image_path = os.path.join(image_folder, filename) print(f”Analyzing image: {filename}”) result = analyze_property_condition(image_path) print(f”Result for {filename}:”) print(result) print(“-” * 50) print(“nImage analysis completed.”) Error: Error processing C:UsersDownloadsImagesscreenshot 2024-12-17 01-16-36-11.png: The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.) { “error”: { “message”: “The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)”, “type”: “server_error”, “param”: null, “code”: null } } 500 {‘error’: {‘message’: ‘The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)’, ‘type’: ‘server_error’, ‘param’: None, ‘code’: None}} {‘Date’: ‘Tue, 17 Dec 2024 15:21:22 GMT’, ‘Content-Type’: ‘application/json’, ‘Content-Length’: ‘369’, ‘Connection’: ‘keep-alive’, ‘access-control-expose-headers’: ‘X-Request-ID’, ‘openai-processing-ms’: ‘540’, ‘x-ratelimit-limit-requests’: ‘500000’, ‘x-ratelimit-limit-tokens’: ‘300000’, ‘x-ratelimit-remaining-requests’: ‘499999’, ‘x-ratelimit-remaining-tokens’: ‘299455’, ‘x-ratelimit-reset-requests’: ‘0s’, ‘x-ratelimit-reset-tokens’: ‘108ms’, ‘x-request-id’: ‘req_b488781814317423cbf3955b65d7088b’, ‘strict-transport-security’: ‘max-age=31536000; includeSubDomains; preload’, ‘CF-Cache-Status’: ‘DYNAMIC’, ‘X-Content-Type-Options’: ‘nosniff’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘8f37e6f879b29011-BOS’, ‘alt-svc’: ‘h3=”:443″; ma=86400’} submitted by /u/Foreign_Weekend2920 [link] [comments] 

I continue to receive this error when I supply image files (.png) to OpenAI for analysis. Everything I’ve found online looks like it’s a transient error but I have never got it to work.

Any ideas? Is this truly a bug?

Code:

def analyze_property_condition(image_path): try: # Open the image file with open(image_path, "rb") as image_file: image_data = image_file.read() # Send the image and prompt to GPT-4 Vision response = openai.ChatCompletion.create( model="gpt-4-vision-preview", messages=[ {"role": "system", "content": "Prompt."}, {"role": "user", "content": "Prompt."}, {"role": "user", "content": {"type": "image_url", "image_url": "data:image/png;base64," + base64.b64encode(image_data).decode()}} ], max_tokens=10000 ) # Return the GPT-4 Vision response return response.choices[0].message.content except Exception as e: return f"Error processing {image_path}: {str(e)}" # Loop through all PNG files in the folder if __name__ == "__main__": import base64 print("Starting analysis of property images...n") # Check if the folder exists if not os.path.exists(image_folder): print("The specified folder does not exist. Please check the path.") exit() # Iterate over all PNG files in the folder for filename in os.listdir(image_folder): if filename.lower().endswith(".png"): image_path = os.path.join(image_folder, filename) print(f"Analyzing image: {filename}") result = analyze_property_condition(image_path) print(f"Result for {filename}:") print(result) print("-" * 50) print("nImage analysis completed.") 

Error:

Error processing C:UsersDownloadsImagesscreenshot 2024-12-17 01-16-36-11.png: The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.) { "error": { "message": "The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)", "type": "server_error", "param": null, "code": null } } 500 {'error': {'message': 'The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)', 'type': 'server_error', 'param': None, 'code': None}} {'Date': 'Tue, 17 Dec 2024 15:21:22 GMT', 'Content-Type': 'application/json', 'Content-Length': '369', 'Connection': 'keep-alive', 'access-control-expose-headers': 'X-Request-ID', 'openai-processing-ms': '540', 'x-ratelimit-limit-requests': '500000', 'x-ratelimit-limit-tokens': '300000', 'x-ratelimit-remaining-requests': '499999', 'x-ratelimit-remaining-tokens': '299455', 'x-ratelimit-reset-requests': '0s', 'x-ratelimit-reset-tokens': '108ms', 'x-request-id': 'req_b488781814317423cbf3955b65d7088b', 'strict-transport-security': 'max-age=31536000; includeSubDomains; preload', 'CF-Cache-Status': 'DYNAMIC', 'X-Content-Type-Options': 'nosniff', 'Server': 'cloudflare', 'CF-RAY': '8f37e6f879b29011-BOS', 'alt-svc': 'h3=":443"; ma=86400'} 

submitted by /u/Foreign_Weekend2920
[link] [comments]  I continue to receive this error when I supply image files (.png) to OpenAI for analysis. Everything I’ve found online looks like it’s a transient error but I have never got it to work. Any ideas? Is this truly a bug? Code: def analyze_property_condition(image_path): try: # Open the image file with open(image_path, “rb”) as image_file: image_data = image_file.read() # Send the image and prompt to GPT-4 Vision response = openai.ChatCompletion.create( model=”gpt-4-vision-preview”, messages=[ {“role”: “system”, “content”: “Prompt.”}, {“role”: “user”, “content”: “Prompt.”}, {“role”: “user”, “content”: {“type”: “image_url”, “image_url”: “data:image/png;base64,” + base64.b64encode(image_data).decode()}} ], max_tokens=10000 ) # Return the GPT-4 Vision response return response.choices[0].message.content except Exception as e: return f”Error processing {image_path}: {str(e)}” # Loop through all PNG files in the folder if __name__ == “__main__”: import base64 print(“Starting analysis of property images…n”) # Check if the folder exists if not os.path.exists(image_folder): print(“The specified folder does not exist. Please check the path.”) exit() # Iterate over all PNG files in the folder for filename in os.listdir(image_folder): if filename.lower().endswith(“.png”): image_path = os.path.join(image_folder, filename) print(f”Analyzing image: {filename}”) result = analyze_property_condition(image_path) print(f”Result for {filename}:”) print(result) print(“-” * 50) print(“nImage analysis completed.”) Error: Error processing C:UsersDownloadsImagesscreenshot 2024-12-17 01-16-36-11.png: The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.) { “error”: { “message”: “The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)”, “type”: “server_error”, “param”: null, “code”: null } } 500 {‘error’: {‘message’: ‘The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_b488781814317423cbf3955b65d7088b in your email.)’, ‘type’: ‘server_error’, ‘param’: None, ‘code’: None}} {‘Date’: ‘Tue, 17 Dec 2024 15:21:22 GMT’, ‘Content-Type’: ‘application/json’, ‘Content-Length’: ‘369’, ‘Connection’: ‘keep-alive’, ‘access-control-expose-headers’: ‘X-Request-ID’, ‘openai-processing-ms’: ‘540’, ‘x-ratelimit-limit-requests’: ‘500000’, ‘x-ratelimit-limit-tokens’: ‘300000’, ‘x-ratelimit-remaining-requests’: ‘499999’, ‘x-ratelimit-remaining-tokens’: ‘299455’, ‘x-ratelimit-reset-requests’: ‘0s’, ‘x-ratelimit-reset-tokens’: ‘108ms’, ‘x-request-id’: ‘req_b488781814317423cbf3955b65d7088b’, ‘strict-transport-security’: ‘max-age=31536000; includeSubDomains; preload’, ‘CF-Cache-Status’: ‘DYNAMIC’, ‘X-Content-Type-Options’: ‘nosniff’, ‘Server’: ‘cloudflare’, ‘CF-RAY’: ‘8f37e6f879b29011-BOS’, ‘alt-svc’: ‘h3=”:443″; ma=86400’} submitted by /u/Foreign_Weekend2920 [link] [comments]

Read more

Windows service identifies correct registry key path, but doesn’t retrieve the stored values. /u/blajjefnnf Python Education

Windows service identifies correct registry key path, but doesn’t retrieve the stored values. /u/blajjefnnf Python Education

Hi, I’m making a Windows service, one of it’s functions is to retrieve the stored values from the registry.

The standalone python script works as intended, but when I try running it as a Windows service, it doesn’t retrieve the stored values from the registry

 # Default control targets self.control_list = ["none", "none", "none", "none"] # Stored control targets self.settings = QSettings("CompanyName", "ProductName") self.load_volume_targets() logging.info(self.settings.fileName()) def load_volume_targets(self): saved_targets = self.settings.value("currentlySavedVolumeTargets", []) if isinstance(saved_targets, list) and len(saved_targets) == 1: targets = saved_targets[0].split(", ") self.control_list = targets logging.info("Saved control targets loaded:", self.control_list) 

The service log file logs: logging.info(self.settings.fileName())

HKEY_CURRENT_USERSoftwareCompanyNameProductName 

The standalone script finds and prints out the saved values correctly:

Saved control targets loaded: ['Master', 'None', 'None', 'None'] HKEY_CURRENT_USERSoftwareCompanyNameProductName 

The code is the same for the standalone script and the service, both of them are in a class.

How can I debug why can’t the service retrieve the values from the registry?

submitted by /u/blajjefnnf
[link] [comments]

​r/learnpython Hi, I’m making a Windows service, one of it’s functions is to retrieve the stored values from the registry. The standalone python script works as intended, but when I try running it as a Windows service, it doesn’t retrieve the stored values from the registry # Default control targets self.control_list = [“none”, “none”, “none”, “none”] # Stored control targets self.settings = QSettings(“CompanyName”, “ProductName”) self.load_volume_targets() logging.info(self.settings.fileName()) def load_volume_targets(self): saved_targets = self.settings.value(“currentlySavedVolumeTargets”, []) if isinstance(saved_targets, list) and len(saved_targets) == 1: targets = saved_targets[0].split(“, “) self.control_list = targets logging.info(“Saved control targets loaded:”, self.control_list) The service log file logs: logging.info(self.settings.fileName()) HKEY_CURRENT_USERSoftwareCompanyNameProductName The standalone script finds and prints out the saved values correctly: Saved control targets loaded: [‘Master’, ‘None’, ‘None’, ‘None’] HKEY_CURRENT_USERSoftwareCompanyNameProductName The code is the same for the standalone script and the service, both of them are in a class. How can I debug why can’t the service retrieve the values from the registry? submitted by /u/blajjefnnf [link] [comments] 

Hi, I’m making a Windows service, one of it’s functions is to retrieve the stored values from the registry.

The standalone python script works as intended, but when I try running it as a Windows service, it doesn’t retrieve the stored values from the registry

 # Default control targets self.control_list = ["none", "none", "none", "none"] # Stored control targets self.settings = QSettings("CompanyName", "ProductName") self.load_volume_targets() logging.info(self.settings.fileName()) def load_volume_targets(self): saved_targets = self.settings.value("currentlySavedVolumeTargets", []) if isinstance(saved_targets, list) and len(saved_targets) == 1: targets = saved_targets[0].split(", ") self.control_list = targets logging.info("Saved control targets loaded:", self.control_list) 

The service log file logs: logging.info(self.settings.fileName())

HKEY_CURRENT_USERSoftwareCompanyNameProductName 

The standalone script finds and prints out the saved values correctly:

Saved control targets loaded: ['Master', 'None', 'None', 'None'] HKEY_CURRENT_USERSoftwareCompanyNameProductName 

The code is the same for the standalone script and the service, both of them are in a class.

How can I debug why can’t the service retrieve the values from the registry?

submitted by /u/blajjefnnf
[link] [comments]  Hi, I’m making a Windows service, one of it’s functions is to retrieve the stored values from the registry. The standalone python script works as intended, but when I try running it as a Windows service, it doesn’t retrieve the stored values from the registry # Default control targets self.control_list = [“none”, “none”, “none”, “none”] # Stored control targets self.settings = QSettings(“CompanyName”, “ProductName”) self.load_volume_targets() logging.info(self.settings.fileName()) def load_volume_targets(self): saved_targets = self.settings.value(“currentlySavedVolumeTargets”, []) if isinstance(saved_targets, list) and len(saved_targets) == 1: targets = saved_targets[0].split(“, “) self.control_list = targets logging.info(“Saved control targets loaded:”, self.control_list) The service log file logs: logging.info(self.settings.fileName()) HKEY_CURRENT_USERSoftwareCompanyNameProductName The standalone script finds and prints out the saved values correctly: Saved control targets loaded: [‘Master’, ‘None’, ‘None’, ‘None’] HKEY_CURRENT_USERSoftwareCompanyNameProductName The code is the same for the standalone script and the service, both of them are in a class. How can I debug why can’t the service retrieve the values from the registry? submitted by /u/blajjefnnf [link] [comments]

Read more

Plotting a grid of boxes like an excel sheet? /u/Frankyboy07 Python Education

Plotting a grid of boxes like an excel sheet? /u/Frankyboy07 Python Education

I’m trying to find a library that can help me to plot some cells as red boxes in a grid style. I.E if i had data showing a cell should be colored at (3,5) it would fill in a cell box at 3,5 and be listed as 3,5 when moused over or listed out.

I’ve tried numpy to do

data = np.zeroes((rows,columns))

and then insert a 1 at the row or column where I have a cell to be shaded.

When i plot this with imshow I get a box cenetered at the correct poin but mousing over it extends from the point to halfway to the next. Is there an easy way to color in a cell similar to how an excel cell would be colored if I was flling in say A:2

submitted by /u/Frankyboy07
[link] [comments]

​r/learnpython I’m trying to find a library that can help me to plot some cells as red boxes in a grid style. I.E if i had data showing a cell should be colored at (3,5) it would fill in a cell box at 3,5 and be listed as 3,5 when moused over or listed out. I’ve tried numpy to do data = np.zeroes((rows,columns)) and then insert a 1 at the row or column where I have a cell to be shaded. When i plot this with imshow I get a box cenetered at the correct poin but mousing over it extends from the point to halfway to the next. Is there an easy way to color in a cell similar to how an excel cell would be colored if I was flling in say A:2 submitted by /u/Frankyboy07 [link] [comments] 

I’m trying to find a library that can help me to plot some cells as red boxes in a grid style. I.E if i had data showing a cell should be colored at (3,5) it would fill in a cell box at 3,5 and be listed as 3,5 when moused over or listed out.

I’ve tried numpy to do

data = np.zeroes((rows,columns))

and then insert a 1 at the row or column where I have a cell to be shaded.

When i plot this with imshow I get a box cenetered at the correct poin but mousing over it extends from the point to halfway to the next. Is there an easy way to color in a cell similar to how an excel cell would be colored if I was flling in say A:2

submitted by /u/Frankyboy07
[link] [comments]  I’m trying to find a library that can help me to plot some cells as red boxes in a grid style. I.E if i had data showing a cell should be colored at (3,5) it would fill in a cell box at 3,5 and be listed as 3,5 when moused over or listed out. I’ve tried numpy to do data = np.zeroes((rows,columns)) and then insert a 1 at the row or column where I have a cell to be shaded. When i plot this with imshow I get a box cenetered at the correct poin but mousing over it extends from the point to halfway to the next. Is there an easy way to color in a cell similar to how an excel cell would be colored if I was flling in say A:2 submitted by /u/Frankyboy07 [link] [comments]

Read more

Sending an email on behalf of a shared account (In Outlook) /u/Alongsnake Python Education

Sending an email on behalf of a shared account (In Outlook) /u/Alongsnake Python Education

I am trying to send an email on behalf of a shared account in outlook.

Using win32com, I am able to read the emails in the shared account, but not send an email from it (It would be on behalf of). As from what I understand, the shared account is not something you can log into, but an owner has granted access for people to use it.

when doing

outlook = win32.Dispatch('outlook.application') for account in outlook.Session.Accounts: print(account.DisplayName) outlookInbox = outlook.GetNamespace("MAPI") for folder in outlookInbox: print(folder.name) 

I get just my account in the accounts, and my account and the shared folders in the inbox

This leads me to believe that in order for me to send an email from a shared account, I need to log in, but, there is no password for me to log into it.

I have also tried using

mail.SendUsingAccount = "email@account" mail.Sender = "email@account" mail._oleobj_.Invoke(*(64209, 0, 8, 0, "email@account")) 

But none of them seem to work.

submitted by /u/Alongsnake
[link] [comments]

​r/learnpython I am trying to send an email on behalf of a shared account in outlook. Using win32com, I am able to read the emails in the shared account, but not send an email from it (It would be on behalf of). As from what I understand, the shared account is not something you can log into, but an owner has granted access for people to use it. when doing outlook = win32.Dispatch(‘outlook.application’) for account in outlook.Session.Accounts: print(account.DisplayName) outlookInbox = outlook.GetNamespace(“MAPI”) for folder in outlookInbox: print(folder.name) I get just my account in the accounts, and my account and the shared folders in the inbox This leads me to believe that in order for me to send an email from a shared account, I need to log in, but, there is no password for me to log into it. I have also tried using mail.SendUsingAccount = “email@account” mail.Sender = “email@account” mail._oleobj_.Invoke(*(64209, 0, 8, 0, “email@account”)) But none of them seem to work. submitted by /u/Alongsnake [link] [comments] 

I am trying to send an email on behalf of a shared account in outlook.

Using win32com, I am able to read the emails in the shared account, but not send an email from it (It would be on behalf of). As from what I understand, the shared account is not something you can log into, but an owner has granted access for people to use it.

when doing

outlook = win32.Dispatch('outlook.application') for account in outlook.Session.Accounts: print(account.DisplayName) outlookInbox = outlook.GetNamespace("MAPI") for folder in outlookInbox: print(folder.name) 

I get just my account in the accounts, and my account and the shared folders in the inbox

This leads me to believe that in order for me to send an email from a shared account, I need to log in, but, there is no password for me to log into it.

I have also tried using

mail.SendUsingAccount = "email@account" mail.Sender = "email@account" mail._oleobj_.Invoke(*(64209, 0, 8, 0, "email@account")) 

But none of them seem to work.

submitted by /u/Alongsnake
[link] [comments]  I am trying to send an email on behalf of a shared account in outlook. Using win32com, I am able to read the emails in the shared account, but not send an email from it (It would be on behalf of). As from what I understand, the shared account is not something you can log into, but an owner has granted access for people to use it. when doing outlook = win32.Dispatch(‘outlook.application’) for account in outlook.Session.Accounts: print(account.DisplayName) outlookInbox = outlook.GetNamespace(“MAPI”) for folder in outlookInbox: print(folder.name) I get just my account in the accounts, and my account and the shared folders in the inbox This leads me to believe that in order for me to send an email from a shared account, I need to log in, but, there is no password for me to log into it. I have also tried using mail.SendUsingAccount = “email@account” mail.Sender = “email@account” mail._oleobj_.Invoke(*(64209, 0, 8, 0, “email@account”)) But none of them seem to work. submitted by /u/Alongsnake [link] [comments]

Read more

Coding a game /u/ArtistName Python Education

Coding a game /u/ArtistName Python Education

Me and my friend are making a little space shooter games for our end of semester school project. We are using codeHS. Although, our game ends after we score once. It just freezes.

This is our code: import tkinter as tk import random

Constants

WIDTH = 600 HEIGHT = 800 PLAYER_WIDTH = 50 PLAYER_HEIGHT = 50 ENEMY_WIDTH = 50 ENEMY_HEIGHT = 50 BULLET_WIDTH = 5 BULLET_HEIGHT = 10 PLAYER_SPEED = 20 BULLET_SPEED = 15 ENEMY_SPEED = 5 POWERUP_WIDTH = 20 POWERUP_HEIGHT = 20 POWERUP_SPEED = 3

class ShootingGame: def init(self, root): self.root = root self.root.resizable(False, False) # Added this line self.canvas = tk.Canvas(root, width=WIDTH, height=HEIGHT, bg=”black”) self.canvas.pack() self.powerups = [] self.power_active = False self.power_timer = 0 self.power_type = None

 # Player setup with adjusted position self.player = self.canvas.create_rectangle( WIDTH // 2 - PLAYER_WIDTH // 2, # X start HEIGHT - PLAYER_HEIGHT - 20, # Y start - moved higher up WIDTH // 2 + PLAYER_WIDTH // 2, # X end HEIGHT - 20, # Y end fill="yellow", outline="white", width=3 ) # Debug print for player coordinates player_coords = self.canvas.coords(self.player) print(f"Player coordinates: {player_coords}") # List for bullets and enemies self.bullets = [] self.enemies = [] # Score self.score = 0 self.score_text = self.canvas.create_text( 10, 10, anchor="nw", text=f"Score: {self.score}", fill="white", font=("Arial", 16) ) # Controls self.root.bind("<Left>", self.move_left) self.root.bind("<Right>", self.move_right) self.root.bind("<space>", self.shoot_bullet) # Start game loop self.running = True self.update_game() def move_left(self, event): if self.canvas.coords(self.player)[0] > 0: self.canvas.move(self.player, -PLAYER_SPEED, 0) def move_right(self, event): if self.canvas.coords(self.player)[2] < WIDTH: self.canvas.move(self.player, PLAYER_SPEED, 0) def shoot_bullet(self, event): x1, y1, x2, y2 = self.canvas.coords(self.player) bullet = self.canvas.create_rectangle( (x1 + x2) // 2 - BULLET_WIDTH // 2, y1 - BULLET_HEIGHT, (x1 + x2) // 2 + BULLET_WIDTH // 2, y1, fill="white" ) self.bullets.append(bullet) def spawn_enemy(self): x = random.randint(0, WIDTH - ENEMY_WIDTH) enemy = self.canvas.create_rectangle( x, 0, x + ENEMY_WIDTH, ENEMY_HEIGHT, fill="red" ) self.enemies.append(enemy) def update_bullets(self): for bullet in self.bullets[:]: self.canvas.move(bullet, 0, -BULLET_SPEED) if self.canvas.coords(bullet)[1] < 0: self.canvas.delete(bullet) self.bullets.remove(bullet) def update_enemies(self): for enemy in self.enemies[:]: self.canvas.move(enemy, 0, ENEMY_SPEED) if self.canvas.coords(enemy)[3] >= HEIGHT: self.running = False self.canvas.create_text( WIDTH // 2, HEIGHT // 2, text="GAME OVER", fill="white", font=("Arial", 40) ) for bullet in self.bullets[:]: if self.check_collision(enemy, bullet): self.canvas.delete(enemy) self.canvas.delete(bullet) self.enemies.remove(enemy) self.bullets.remove(bullet) self.score += 1 self.canvas.itemconfig(self.score_text, text=f"Score: {self.score}") def check_collision(self, enemy, bullet): e_coords = self.canvas.coords(enemy) b_coords = self.canvas.coords(bullet) return not ( e_coords[2] < b_coords[0] or e_coords[0] > b_coords[2] or e_coords[3] < b_coords[1] or e_coords[1] > b_coords[3] ) def update_game(self): if not self.running: return if random.randint(1, 50) == 1: self.spawn_enemy() self.update_bullets() self.update_enemies() self.root.after(50, self.update_game) # Different power-up types and their colors self.powerup_types = { "double_shot": "blue", "speed_boost": "green", "shield": "purple" } def spawn_powerup(self): x = random.randint(0, WIDTH - POWERUP_WIDTH) power_type = random.choice(list(self.powerup_types.keys())) color = self.powerup_types[power_type] powerup = self.canvas.create_oval( x, 0, x + POWERUP_WIDTH, POWERUP_HEIGHT, fill=color, outline="white" ) self.powerups.append({"item": powerup, "type": power_type}) def update_powerups(self): for powerup in self.powerups[:]: self.canvas.move(powerup["item"], 0, POWERUP_SPEED) # Check if powerup is off screen if self.canvas.coords(powerup["item"])[3] >= HEIGHT: self.canvas.delete(powerup["item"]) self.powerups.remove(powerup) continue # Check collision with player if self.check_collision_with_player(powerup["item"]): self.activate_powerup(powerup["type"]) self.canvas.delete(powerup["item"]) self.powerups.remove(powerup) def check_collision_with_player(self, item): p_coords = self.canvas.coords(self.player) i_coords = self.canvas.coords(item) return not ( i_coords[2] < p_coords[0] or i_coords[0] > p_coords[2] or i_coords[3] < p_coords[1] or i_coords[1] > p_coords[3] ) def activate_powerup(self, power_type): self.power_active = True self.power_type = power_type self.power_timer = 100 # Power-up lasts for 100 game ticks if power_type == "speed_boost": global PLAYER_SPEED PLAYER_SPEED *= 2 def update_power_status(self): if self.power_active: self.power_timer -= 1 if self.power_timer <= 0: self.deactivate_powerup() 

if name == “main“: root = tk.Tk() root.title(“Shooting Game”) game = ShootingGame(root) root.mainloop()

Any tips?

submitted by /u/ArtistName
[link] [comments]

​r/learnpython Me and my friend are making a little space shooter games for our end of semester school project. We are using codeHS. Although, our game ends after we score once. It just freezes. This is our code: import tkinter as tk import random Constants WIDTH = 600 HEIGHT = 800 PLAYER_WIDTH = 50 PLAYER_HEIGHT = 50 ENEMY_WIDTH = 50 ENEMY_HEIGHT = 50 BULLET_WIDTH = 5 BULLET_HEIGHT = 10 PLAYER_SPEED = 20 BULLET_SPEED = 15 ENEMY_SPEED = 5 POWERUP_WIDTH = 20 POWERUP_HEIGHT = 20 POWERUP_SPEED = 3 class ShootingGame: def init(self, root): self.root = root self.root.resizable(False, False) # Added this line self.canvas = tk.Canvas(root, width=WIDTH, height=HEIGHT, bg=”black”) self.canvas.pack() self.powerups = [] self.power_active = False self.power_timer = 0 self.power_type = None # Player setup with adjusted position self.player = self.canvas.create_rectangle( WIDTH // 2 – PLAYER_WIDTH // 2, # X start HEIGHT – PLAYER_HEIGHT – 20, # Y start – moved higher up WIDTH // 2 + PLAYER_WIDTH // 2, # X end HEIGHT – 20, # Y end fill=”yellow”, outline=”white”, width=3 ) # Debug print for player coordinates player_coords = self.canvas.coords(self.player) print(f”Player coordinates: {player_coords}”) # List for bullets and enemies self.bullets = [] self.enemies = [] # Score self.score = 0 self.score_text = self.canvas.create_text( 10, 10, anchor=”nw”, text=f”Score: {self.score}”, fill=”white”, font=(“Arial”, 16) ) # Controls self.root.bind(“<Left>”, self.move_left) self.root.bind(“<Right>”, self.move_right) self.root.bind(“<space>”, self.shoot_bullet) # Start game loop self.running = True self.update_game() def move_left(self, event): if self.canvas.coords(self.player)[0] > 0: self.canvas.move(self.player, -PLAYER_SPEED, 0) def move_right(self, event): if self.canvas.coords(self.player)[2] < WIDTH: self.canvas.move(self.player, PLAYER_SPEED, 0) def shoot_bullet(self, event): x1, y1, x2, y2 = self.canvas.coords(self.player) bullet = self.canvas.create_rectangle( (x1 + x2) // 2 – BULLET_WIDTH // 2, y1 – BULLET_HEIGHT, (x1 + x2) // 2 + BULLET_WIDTH // 2, y1, fill=”white” ) self.bullets.append(bullet) def spawn_enemy(self): x = random.randint(0, WIDTH – ENEMY_WIDTH) enemy = self.canvas.create_rectangle( x, 0, x + ENEMY_WIDTH, ENEMY_HEIGHT, fill=”red” ) self.enemies.append(enemy) def update_bullets(self): for bullet in self.bullets[:]: self.canvas.move(bullet, 0, -BULLET_SPEED) if self.canvas.coords(bullet)[1] < 0: self.canvas.delete(bullet) self.bullets.remove(bullet) def update_enemies(self): for enemy in self.enemies[:]: self.canvas.move(enemy, 0, ENEMY_SPEED) if self.canvas.coords(enemy)[3] >= HEIGHT: self.running = False self.canvas.create_text( WIDTH // 2, HEIGHT // 2, text=”GAME OVER”, fill=”white”, font=(“Arial”, 40) ) for bullet in self.bullets[:]: if self.check_collision(enemy, bullet): self.canvas.delete(enemy) self.canvas.delete(bullet) self.enemies.remove(enemy) self.bullets.remove(bullet) self.score += 1 self.canvas.itemconfig(self.score_text, text=f”Score: {self.score}”) def check_collision(self, enemy, bullet): e_coords = self.canvas.coords(enemy) b_coords = self.canvas.coords(bullet) return not ( e_coords[2] < b_coords[0] or e_coords[0] > b_coords[2] or e_coords[3] < b_coords[1] or e_coords[1] > b_coords[3] ) def update_game(self): if not self.running: return if random.randint(1, 50) == 1: self.spawn_enemy() self.update_bullets() self.update_enemies() self.root.after(50, self.update_game) # Different power-up types and their colors self.powerup_types = { “double_shot”: “blue”, “speed_boost”: “green”, “shield”: “purple” } def spawn_powerup(self): x = random.randint(0, WIDTH – POWERUP_WIDTH) power_type = random.choice(list(self.powerup_types.keys())) color = self.powerup_types[power_type] powerup = self.canvas.create_oval( x, 0, x + POWERUP_WIDTH, POWERUP_HEIGHT, fill=color, outline=”white” ) self.powerups.append({“item”: powerup, “type”: power_type}) def update_powerups(self): for powerup in self.powerups[:]: self.canvas.move(powerup[“item”], 0, POWERUP_SPEED) # Check if powerup is off screen if self.canvas.coords(powerup[“item”])[3] >= HEIGHT: self.canvas.delete(powerup[“item”]) self.powerups.remove(powerup) continue # Check collision with player if self.check_collision_with_player(powerup[“item”]): self.activate_powerup(powerup[“type”]) self.canvas.delete(powerup[“item”]) self.powerups.remove(powerup) def check_collision_with_player(self, item): p_coords = self.canvas.coords(self.player) i_coords = self.canvas.coords(item) return not ( i_coords[2] < p_coords[0] or i_coords[0] > p_coords[2] or i_coords[3] < p_coords[1] or i_coords[1] > p_coords[3] ) def activate_powerup(self, power_type): self.power_active = True self.power_type = power_type self.power_timer = 100 # Power-up lasts for 100 game ticks if power_type == “speed_boost”: global PLAYER_SPEED PLAYER_SPEED *= 2 def update_power_status(self): if self.power_active: self.power_timer -= 1 if self.power_timer <= 0: self.deactivate_powerup() if name == “main”: root = tk.Tk() root.title(“Shooting Game”) game = ShootingGame(root) root.mainloop() Any tips? submitted by /u/ArtistName [link] [comments] 

Me and my friend are making a little space shooter games for our end of semester school project. We are using codeHS. Although, our game ends after we score once. It just freezes.

This is our code: import tkinter as tk import random

Constants

WIDTH = 600 HEIGHT = 800 PLAYER_WIDTH = 50 PLAYER_HEIGHT = 50 ENEMY_WIDTH = 50 ENEMY_HEIGHT = 50 BULLET_WIDTH = 5 BULLET_HEIGHT = 10 PLAYER_SPEED = 20 BULLET_SPEED = 15 ENEMY_SPEED = 5 POWERUP_WIDTH = 20 POWERUP_HEIGHT = 20 POWERUP_SPEED = 3

class ShootingGame: def init(self, root): self.root = root self.root.resizable(False, False) # Added this line self.canvas = tk.Canvas(root, width=WIDTH, height=HEIGHT, bg=”black”) self.canvas.pack() self.powerups = [] self.power_active = False self.power_timer = 0 self.power_type = None

 # Player setup with adjusted position self.player = self.canvas.create_rectangle( WIDTH // 2 - PLAYER_WIDTH // 2, # X start HEIGHT - PLAYER_HEIGHT - 20, # Y start - moved higher up WIDTH // 2 + PLAYER_WIDTH // 2, # X end HEIGHT - 20, # Y end fill="yellow", outline="white", width=3 ) # Debug print for player coordinates player_coords = self.canvas.coords(self.player) print(f"Player coordinates: {player_coords}") # List for bullets and enemies self.bullets = [] self.enemies = [] # Score self.score = 0 self.score_text = self.canvas.create_text( 10, 10, anchor="nw", text=f"Score: {self.score}", fill="white", font=("Arial", 16) ) # Controls self.root.bind("<Left>", self.move_left) self.root.bind("<Right>", self.move_right) self.root.bind("<space>", self.shoot_bullet) # Start game loop self.running = True self.update_game() def move_left(self, event): if self.canvas.coords(self.player)[0] > 0: self.canvas.move(self.player, -PLAYER_SPEED, 0) def move_right(self, event): if self.canvas.coords(self.player)[2] < WIDTH: self.canvas.move(self.player, PLAYER_SPEED, 0) def shoot_bullet(self, event): x1, y1, x2, y2 = self.canvas.coords(self.player) bullet = self.canvas.create_rectangle( (x1 + x2) // 2 - BULLET_WIDTH // 2, y1 - BULLET_HEIGHT, (x1 + x2) // 2 + BULLET_WIDTH // 2, y1, fill="white" ) self.bullets.append(bullet) def spawn_enemy(self): x = random.randint(0, WIDTH - ENEMY_WIDTH) enemy = self.canvas.create_rectangle( x, 0, x + ENEMY_WIDTH, ENEMY_HEIGHT, fill="red" ) self.enemies.append(enemy) def update_bullets(self): for bullet in self.bullets[:]: self.canvas.move(bullet, 0, -BULLET_SPEED) if self.canvas.coords(bullet)[1] < 0: self.canvas.delete(bullet) self.bullets.remove(bullet) def update_enemies(self): for enemy in self.enemies[:]: self.canvas.move(enemy, 0, ENEMY_SPEED) if self.canvas.coords(enemy)[3] >= HEIGHT: self.running = False self.canvas.create_text( WIDTH // 2, HEIGHT // 2, text="GAME OVER", fill="white", font=("Arial", 40) ) for bullet in self.bullets[:]: if self.check_collision(enemy, bullet): self.canvas.delete(enemy) self.canvas.delete(bullet) self.enemies.remove(enemy) self.bullets.remove(bullet) self.score += 1 self.canvas.itemconfig(self.score_text, text=f"Score: {self.score}") def check_collision(self, enemy, bullet): e_coords = self.canvas.coords(enemy) b_coords = self.canvas.coords(bullet) return not ( e_coords[2] < b_coords[0] or e_coords[0] > b_coords[2] or e_coords[3] < b_coords[1] or e_coords[1] > b_coords[3] ) def update_game(self): if not self.running: return if random.randint(1, 50) == 1: self.spawn_enemy() self.update_bullets() self.update_enemies() self.root.after(50, self.update_game) # Different power-up types and their colors self.powerup_types = { "double_shot": "blue", "speed_boost": "green", "shield": "purple" } def spawn_powerup(self): x = random.randint(0, WIDTH - POWERUP_WIDTH) power_type = random.choice(list(self.powerup_types.keys())) color = self.powerup_types[power_type] powerup = self.canvas.create_oval( x, 0, x + POWERUP_WIDTH, POWERUP_HEIGHT, fill=color, outline="white" ) self.powerups.append({"item": powerup, "type": power_type}) def update_powerups(self): for powerup in self.powerups[:]: self.canvas.move(powerup["item"], 0, POWERUP_SPEED) # Check if powerup is off screen if self.canvas.coords(powerup["item"])[3] >= HEIGHT: self.canvas.delete(powerup["item"]) self.powerups.remove(powerup) continue # Check collision with player if self.check_collision_with_player(powerup["item"]): self.activate_powerup(powerup["type"]) self.canvas.delete(powerup["item"]) self.powerups.remove(powerup) def check_collision_with_player(self, item): p_coords = self.canvas.coords(self.player) i_coords = self.canvas.coords(item) return not ( i_coords[2] < p_coords[0] or i_coords[0] > p_coords[2] or i_coords[3] < p_coords[1] or i_coords[1] > p_coords[3] ) def activate_powerup(self, power_type): self.power_active = True self.power_type = power_type self.power_timer = 100 # Power-up lasts for 100 game ticks if power_type == "speed_boost": global PLAYER_SPEED PLAYER_SPEED *= 2 def update_power_status(self): if self.power_active: self.power_timer -= 1 if self.power_timer <= 0: self.deactivate_powerup() 

if name == “main“: root = tk.Tk() root.title(“Shooting Game”) game = ShootingGame(root) root.mainloop()

Any tips?

submitted by /u/ArtistName
[link] [comments]  Me and my friend are making a little space shooter games for our end of semester school project. We are using codeHS. Although, our game ends after we score once. It just freezes. This is our code: import tkinter as tk import random Constants WIDTH = 600 HEIGHT = 800 PLAYER_WIDTH = 50 PLAYER_HEIGHT = 50 ENEMY_WIDTH = 50 ENEMY_HEIGHT = 50 BULLET_WIDTH = 5 BULLET_HEIGHT = 10 PLAYER_SPEED = 20 BULLET_SPEED = 15 ENEMY_SPEED = 5 POWERUP_WIDTH = 20 POWERUP_HEIGHT = 20 POWERUP_SPEED = 3 class ShootingGame: def init(self, root): self.root = root self.root.resizable(False, False) # Added this line self.canvas = tk.Canvas(root, width=WIDTH, height=HEIGHT, bg=”black”) self.canvas.pack() self.powerups = [] self.power_active = False self.power_timer = 0 self.power_type = None # Player setup with adjusted position self.player = self.canvas.create_rectangle( WIDTH // 2 – PLAYER_WIDTH // 2, # X start HEIGHT – PLAYER_HEIGHT – 20, # Y start – moved higher up WIDTH // 2 + PLAYER_WIDTH // 2, # X end HEIGHT – 20, # Y end fill=”yellow”, outline=”white”, width=3 ) # Debug print for player coordinates player_coords = self.canvas.coords(self.player) print(f”Player coordinates: {player_coords}”) # List for bullets and enemies self.bullets = [] self.enemies = [] # Score self.score = 0 self.score_text = self.canvas.create_text( 10, 10, anchor=”nw”, text=f”Score: {self.score}”, fill=”white”, font=(“Arial”, 16) ) # Controls self.root.bind(“<Left>”, self.move_left) self.root.bind(“<Right>”, self.move_right) self.root.bind(“<space>”, self.shoot_bullet) # Start game loop self.running = True self.update_game() def move_left(self, event): if self.canvas.coords(self.player)[0] > 0: self.canvas.move(self.player, -PLAYER_SPEED, 0) def move_right(self, event): if self.canvas.coords(self.player)[2] < WIDTH: self.canvas.move(self.player, PLAYER_SPEED, 0) def shoot_bullet(self, event): x1, y1, x2, y2 = self.canvas.coords(self.player) bullet = self.canvas.create_rectangle( (x1 + x2) // 2 – BULLET_WIDTH // 2, y1 – BULLET_HEIGHT, (x1 + x2) // 2 + BULLET_WIDTH // 2, y1, fill=”white” ) self.bullets.append(bullet) def spawn_enemy(self): x = random.randint(0, WIDTH – ENEMY_WIDTH) enemy = self.canvas.create_rectangle( x, 0, x + ENEMY_WIDTH, ENEMY_HEIGHT, fill=”red” ) self.enemies.append(enemy) def update_bullets(self): for bullet in self.bullets[:]: self.canvas.move(bullet, 0, -BULLET_SPEED) if self.canvas.coords(bullet)[1] < 0: self.canvas.delete(bullet) self.bullets.remove(bullet) def update_enemies(self): for enemy in self.enemies[:]: self.canvas.move(enemy, 0, ENEMY_SPEED) if self.canvas.coords(enemy)[3] >= HEIGHT: self.running = False self.canvas.create_text( WIDTH // 2, HEIGHT // 2, text=”GAME OVER”, fill=”white”, font=(“Arial”, 40) ) for bullet in self.bullets[:]: if self.check_collision(enemy, bullet): self.canvas.delete(enemy) self.canvas.delete(bullet) self.enemies.remove(enemy) self.bullets.remove(bullet) self.score += 1 self.canvas.itemconfig(self.score_text, text=f”Score: {self.score}”) def check_collision(self, enemy, bullet): e_coords = self.canvas.coords(enemy) b_coords = self.canvas.coords(bullet) return not ( e_coords[2] < b_coords[0] or e_coords[0] > b_coords[2] or e_coords[3] < b_coords[1] or e_coords[1] > b_coords[3] ) def update_game(self): if not self.running: return if random.randint(1, 50) == 1: self.spawn_enemy() self.update_bullets() self.update_enemies() self.root.after(50, self.update_game) # Different power-up types and their colors self.powerup_types = { “double_shot”: “blue”, “speed_boost”: “green”, “shield”: “purple” } def spawn_powerup(self): x = random.randint(0, WIDTH – POWERUP_WIDTH) power_type = random.choice(list(self.powerup_types.keys())) color = self.powerup_types[power_type] powerup = self.canvas.create_oval( x, 0, x + POWERUP_WIDTH, POWERUP_HEIGHT, fill=color, outline=”white” ) self.powerups.append({“item”: powerup, “type”: power_type}) def update_powerups(self): for powerup in self.powerups[:]: self.canvas.move(powerup[“item”], 0, POWERUP_SPEED) # Check if powerup is off screen if self.canvas.coords(powerup[“item”])[3] >= HEIGHT: self.canvas.delete(powerup[“item”]) self.powerups.remove(powerup) continue # Check collision with player if self.check_collision_with_player(powerup[“item”]): self.activate_powerup(powerup[“type”]) self.canvas.delete(powerup[“item”]) self.powerups.remove(powerup) def check_collision_with_player(self, item): p_coords = self.canvas.coords(self.player) i_coords = self.canvas.coords(item) return not ( i_coords[2] < p_coords[0] or i_coords[0] > p_coords[2] or i_coords[3] < p_coords[1] or i_coords[1] > p_coords[3] ) def activate_powerup(self, power_type): self.power_active = True self.power_type = power_type self.power_timer = 100 # Power-up lasts for 100 game ticks if power_type == “speed_boost”: global PLAYER_SPEED PLAYER_SPEED *= 2 def update_power_status(self): if self.power_active: self.power_timer -= 1 if self.power_timer <= 0: self.deactivate_powerup() if name == “main”: root = tk.Tk() root.title(“Shooting Game”) game = ShootingGame(root) root.mainloop() Any tips? submitted by /u/ArtistName [link] [comments]

Read more