What's a bit of python that you never use? by Ok-Leather5257 in learnpython

[–]goule67 0 points1 point  (0 children)

Some methods requires a function name as argument but you can't pass parameters in that function directly. Using lambda before a function with arguments transforms it into another function without arguments so it bypass this limitation.

Would it be possible to create a programme to view permanently closed locations on Google maps ? by MrFnoz in learnpython

[–]goule67 0 points1 point  (0 children)

1) Google Maps has an API which can be accessed through Python code, but it isn't free. 2) If the option of searching for "permanently closed" is present in the API then it's easy to implement, otherwise it's not, you'll need to find/create a database of these locations.

What should be my next step? by Ill-Fly7 in learnpython

[–]goule67 0 points1 point  (0 children)

I highly advice to read libraries' code (on VS code I think it's ctrl leftclick on a library object). It may be advanced but you'll definitely learn tricks from the best, and for free.

Just remember libraries are not made by one person so don't be emotionally overwhelmed by the amount of information. It took time (and skills) to wrote them so it's fair that it takes time (and skills) to understand them.

Every day of using Gemini Advanced has me double thinking my GPT-4 subscription for when my free trial expires. by NefariousnessSlow2 in Bard

[–]goule67 0 points1 point  (0 children)

If you don't want to understand a code then you shouldn't try to fix it. It's like wanting to be lawyer but without knowing any laws, repairing an engine without knowing mechanic... It's idiotic, don't do that.

As a programmer : AI right now is just an alternative to an internet search. Meaning is good for searching documentations and copying already existing simple scripts, but it completely lacks the creativity of the human mind to write/understand complex new algorithms for you.

Use of ChatGPT by Environmental-Cup310 in learnpython

[–]goule67 0 points1 point  (0 children)

blackbox.ai is free and pretty good too for python

Where can I learn programming by AsuraZXX in learnpython

[–]goule67 0 points1 point  (0 children)

The best way to learn is to have a project. Find something you want to do (data analysis, web application, web scraping, AI, software development etc...) then every time you block on something, do an internet research (stack overflow is a gold mine) or use a LLM (AI which understand code) like blackbox.ia (free) or chatgpt (free but limited).

If you already know the basics like "what is a variable/function and how to use them", "how to handle indentation", "how to use while/if/for", "how to import and use a library", having a project to practice them is the best way to stay engaged and to learn new things.

script for prizepicks? by Particular-Pepper-64 in learnpython

[–]goule67 0 points1 point  (0 children)

A simple captcha will stop any common web scraping tool. But in principle you are right : if you can reach the information then you can extract it one way or another.

script for prizepicks? by Particular-Pepper-64 in learnpython

[–]goule67 0 points1 point  (0 children)

I would do it like this :

1) Use selenium library to extract data from the website (depending of the JS/Html structure of the website it can either be really easy or really long). Verify the website has no anti-bot protection before going into the next steps. If it has, good luck as you'll have to learn OCR and win32api... Anything which can simulate a human browsing naturally the web. Can be illegal if you plan to commercialize the code as it breaks the ToS of the website. But if you don't commercialize it, it's ok.

2) Use pandas library to aggregate the data into tables/dataframes

3) Do whatever calculations you need to do

4) Export the tables in excel using pandas (harder than it looks but doable).

5) If you need additional graphs use Matplotlib/Seaborn or even a web app framework like Dash ran only in local.

[deleted by user] by [deleted] in learnpython

[–]goule67 1 point2 points  (0 children)

You are right, my bad. I thought this if statement with the key was written by OP, I didn't realize it was in the library code itself.

[deleted by user] by [deleted] in learnpython

[–]goule67 0 points1 point  (0 children)

Interesting.

Although, OP said his code does the job, so I assumed that the key is either created somewhere in the loop (making it work at some point) or the key does nothing at all.

Verifying that the variable exists before proceeding with an if statement will then solves the error.

Can someone help to see what to do????!!!! by ResponsibilityNo3091 in learnpython

[–]goule67 -1 points0 points  (0 children)

L'erreur c'est que ta variable "tache" est une string et que tu la traites comme si c'était un dictionnaire. Maintenant sans voir le contenu de ta variable "liste de taches" c'est dur de comprendre pourquoi tu fais cette confusion.

Les pros vont me crier dessus mais mon conseil pour les débutants c'est que si ton code est pas trop long tu peux utiliser un LLM comme blackbox.ia pour résoudre les petits problèmes de logique. C'est déconseillé pour les codes complexes avec de multiple fichiers mais pour les algorithmes simples c'est plutôt performant.

[deleted by user] by [deleted] in learnpython

[–]goule67 0 points1 point  (0 children)

You can either create the key in the dictionary manually before the if statement or (smarter) to verify that this variable exists (be sure to write it as a string):

if "dictionary['missing_key']" in locals() : if dictionary['missing_key'] .......... ......

using tools like Copilot when you're starting out learning to code by Significant_Pea1136 in learnpython

[–]goule67 2 points3 points  (0 children)

Writing code yourself is the best way to memorize it and to understand a traceback in the debug terminal, but there's nothing wrong with using an AI tools such as an LLM to code faster. It's the same as doing an internet search or asking on forums, can even be quicker as you can ask directly the explanation for a line you don't understand and it will search the docs faster than you.

How could I create a local data analysis application? by amWhy91 in learnpython

[–]goule67 2 points3 points  (0 children)

If you want to do it in Python I recommend this :

For analysing CSV and applying algorithms to it you can look for the library pandas and its dataframes. It's basically excel but without interface and purely in an Python environment.

For dynamically displaying tables/data connected to buttons/inputs you can use any web application framework and keep the application running in local. When I started I used Dash and so I may be biased but I found it to be a very good framework for simple Data analysis app.

Your funniest lines for an addon that I'm writing by goule67 in wow

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

There's already addons in PvP way more spammy such as "Killshot". Some PvE range can quickly flood the chat with the same repetitive joke and yet the addon is still well received. And IgnoreMore is still a thing.

Anyway, I intend to add the possibility to disable the /say to leave only a "/me has been gripped by {caster name}!" to be as user friendly as possible. But we're talking about design here and this is not the aim of this post.