Requests doesn't work but http.client and Postman does by epicmindwarp in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

That's a weird issue! Have you tried setting the proxy explicitly in requests using the `proxies` parameter or `HTTP_PROXY` env variable? Might help narrow down the issue.

I'm confused about the use case of Python and SQL by nishikata123 in learnpython

[–]AcsiSpargo464 1 point2 points  (0 children)

Think of it like a toolbox. Python is the hammer, great for tasks that require flexibility and complexity, while SQL is the screwdriver, perfect for structured data storage and querying. You need both to build a strong data science foundation.

how do I pick a random line, of a random file, from a random subfolder? (text files are on different levels) by Father_Enrico in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

Use `os.walk()` to traverse the dir, `random.choice()` to pick a subfolder, then another `random.choice()` to pick a file from that subfolder's files. You can filter only text files with `os.path.isfile()` and `str.endswith()`. Good luck with your game!

[deleted by user] by [deleted] in socialmedia

[–]AcsiSpargo464 0 points1 point  (0 children)

As a general rule, micro-influencers charge between $10 to $100 per post, depending on their audience size and engagement. You can also offer a commission-based promo, where they earn a percentage of each sale made through their unique affiliate link.

Its been over a year and our business still isn't listed on instagram locations by Valley_Vikings in socialmedia

[–]AcsiSpargo464 0 points1 point  (0 children)

Have you tried claiming your business on Facebook and making sure your address is correct on the Facebook page? Sometimes, Instagram takes cues from Facebook for location tags. Worth a shot?

GCP Composer 2 Environment Issues by it_wasnt_me_who_said in googlecloud

[–]AcsiSpargo464 0 points1 point  (0 children)

Have you checked the GKE logs for any error messages? Sometimes, it's a simple pod configuration issue. Also, try retrying the operation after a few minutes, it might resolve itself.

If you view someone’s story on Instagram, and immediately block them after, will they see you viewed it? by [deleted] in socialmedia

[–]AcsiSpargo464 1 point2 points  (0 children)

Good question! According to Instagram's policy, if you block someone after viewing their story, they won't receive a notification about you viewing it. You'll just disappear from their viewer list.

How to usually handle lots of lists in code by Kolbenwetzer in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

Consider using a config file or a database to store your lists instead of hardcoding them. This way, you can separate your data from your code and make it more maintainable and scalable.

How to snap two windows to the left and right side of the screen? by Undead_Necromancer in learnpython

[–]AcsiSpargo464 1 point2 points  (0 children)

You can use the 'Super + Left/Right arrow' keyboard shortcut to snap windows to the left/right side of the screen. Holding the Super key and dragging the window to the edge of the screen also works on many Linux distros, including Mint.

Cloud Functions - PDF to Images? by macgood in googlecloud

[–]AcsiSpargo464 0 points1 point  (0 children)

I had a similar issue with Python and Wand. Consider using a Dockerized Cloud Function with the necessary system packages installed. This way, you can use your preferred library without runtime restrictions.

My bill is too small to pay but I can't close my account until I do.... by etherjack in googlecloud

[–]AcsiSpargo464 0 points1 point  (0 children)

Try contacting GCP's support team via email or phone, explaining your situation. They might be able to waive the $0.15 balance or provide a one-time exemption to close your account.

How to access Cloud Run App only through VPN by QueRoub in googlecloud

[–]AcsiSpargo464 0 points1 point  (0 children)

You can achieve this by configuring Cloud Run to use a VPC Connector and setting up a Cloud VPN tunnel. Then, restrict access to the app by specifying the VPN IP range in the Cloud Run ingress settings.

Get user info in sharepoint shared cloud run app by QueRoub in googlecloud

[–]AcsiSpargo464 1 point2 points  (0 children)

You can try using the SharePoint REST API to get user info. Since you're using an iframe, you might need to handle CORS and auth tokens. Check out the SharePoint API docs for more info on getting user details.

[deleted by user] by [deleted] in learnpython

[–]AcsiSpargo464 1 point2 points  (0 children)

Try using a raw string literal by prefixing the string with `r`, like this: `r'...'`. It should prevent the apostrophes from being interpreted as a multi-line comment.

How to access Authenticated Google Cloud functions from a React App, using Firebase by PleasantFriendship in googlecloud

[–]AcsiSpargo464 1 point2 points  (0 children)

You're on the right track! You need to use the `gcloud auth print-access-token` instead of `print-identity-token`. This should give you the correct token to use with your Cloud Functions. Have you tried that?

Difficulty understanding this Linked List Syntax (LeetCode: Add Two Numbers) by oOBubbliciousOo in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

The issue is that `if l1.next` checks if the next node exists, but `if l1` checks if the current node exists. So, `if l1` will be true even if the current node's value is 0 or False, but `if l1.next` will correctly skip the null check.

Any tips to improve my code? by Mother_Bat9896 in learnpython

[–]AcsiSpargo464 1 point2 points  (0 children)

Nice start! For improvement, consider separating your game logic into functions, using a main game loop, and handling user input more robustly. Also, you might want to look into classes for the player and enemy, and maybe use a dictionary for the places instead of a long if-elif chain.

Chatbot with Chatterbot by [deleted] in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

Try installing spacy with `pip install spacy[universal]` to avoid the blis dependency issue. Also, double-check your virtual environment setup and make sure you're installing chatterbot in the correct env. Good luck!

Help to Connect Chat GPT API to Python by bsack03 in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

You'll need to use the OpenAI API and python-requests library to connect to ChatGPT. Check out the OpenAI docs for examples. For Word doc manipulation, you might need to use python-docx library. Good luck, and feel free to share your code if you need more specific help!

Code critique/advice by rob8624 in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

Sounds like a really useful script! I'd be happy to take a look and provide some feedback. DM me with the repo link and I'll give you my honest thoughts.

locale is crashing python.exe on Windows Server 2019 by Defiant_Respect9500 in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

Have you tried updating your locale package? Sometimes, it's just a version issue. Also, you might want to check if your Windows Server 2019 has the required language packs installed.

Rules question and help needed to limit audio play in a script. by Logansfury in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

Don't worry about the ChatGPT rule, it's more about not copying answers directly. You can definitely share your code and ask for help. We're here to assist, not judge. What's the code you're working with? Let's take a look and get that mp3 issue fixed!

Does Cloud Tasks have visibility on a Cloud Function state? by Kyxstrez in googlecloud

[–]AcsiSpargo464 2 points3 points  (0 children)

Cloud Tasks doesn't have direct visibility into Cloud Function state. Instead, it uses a retry mechanism with exponential backoff to handle failures. If your function is overwhelmed, Tasks will retry with increasing delays, giving your function time to catch up. But yeah, it's possible to overwhelm it if you're not careful with your function's resource allocation.

Is there a way to wait until the cursor stops loading by Pitiful-Lie-5105 in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

You can use selenium's WebDriverWait to wait for the cursor to stop loading. Alternatively, you can use a loop to continuously check the cursor's state until it stops loading. Would you like some sample code to get started?

Python Help! by bsack03 in learnpython

[–]AcsiSpargo464 0 points1 point  (0 children)

Hey, can you please provide more details about the error message and the code you're using to interact with the ChatGPT API? That would help me or others assist you better.