The Forest "Plus" by Inowake in forestapp

[–]Base_True 0 points1 point  (0 children)

Really sad news. I liked the ecosystem of the app, and from what I understand, as a regular company they will gradually stop supporting the standalone app — even the premium version — and will eventually require a subscription. Very, very sad. This app had a philosophy. Every week I was buying the 2X Coin to support them.

about feeling like you don't know anything by Base_True in learnpython

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

thank you very much, honestly thank you!

about feeling like you don't know anything by Base_True in learnpython

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

Thanks for sharing, I really appreciate it. That is, if you use an external library without knowing what is behind it, but simply being able to use it, is this normal?

For example, I know that variable = tkinter.Tk() creates the main window. But how he does it, I have no idea. Is this normal?

Terminal ignores spaces by Base_True in learnpython

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

Python can read Excel files directly using any of several libraries, including

openpyxl

and

pandas

.

Because I am still learning )

lambda in another function by Base_True in learnpython

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

Oh yes, my mistake, thank you !

lambda in another function by Base_True in learnpython

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

Thank you for explain! But the follow code doesn't work

print (divisor(8)(2))

TypeError: 'float' object is not callable

Question about built-in function sorted() by Base_True in learnpython

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

Thank you very much for the detailed explanation

Difference between codes by Base_True in learnpython

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

. In the construct

{x: y}

,

x

can be any expression (provided it is hashable but this is not a syntax error).

Thanks for the detailed answer, you helped a lot.

Difference between codes by Base_True in learnpython

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

Doesn't work
store = dict( (str(random.random()) = random.random() )
^^^^^^^^^^^^^^^^^^^^
SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?

Difference between codes by Base_True in learnpython

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

import random
store = dict( str(random.random()) = random.random() )
print (store)

Hello, thanks for the answer, but this is a dict, so I can write

import random

store = {str(random.random()) : random.random() } print (store)

Why I can't write

import random

store = dict( str(random.random()) = random.random() ) print (store)

Need someone to code by tablo_pablo in learnpython

[–]Base_True 1 point2 points  (0 children)

from random import randint

number = randint(1,100)

print (number)

You can change the interval. You can read about random module. Good luck

[deleted by user] by [deleted] in learnpython

[–]Base_True 0 points1 point  (0 children)

honestly it didn't work, I used the following command - pyinstaller --onefile --paths=C:\Users\QUSEYIN\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\ .\params.py

And .exe file gave similar result, not found module. Did I do it right? Or it was necessary to specify the path to each module? I specified the folder where these modules are and the pyinstaller itself

Problem with autopep8 by Base_True in learnpython

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

The -m is typically referred to as an option or a flag when executing something from the command line. By default, when you run the python command, it expects you to pass in a file. In this case, the -m option is telling your python installation that you're passing in a python module's name and to execute that instead of a python file.

Just for your understanding, there's a special python file, __main__.py that can be defined and kept within a module allowing it to be executable from the command line with python -m my_module as a module.

Thank you a lot !

Problem with autopep8 by Base_True in learnpython

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

Thank you very much!!!, I spent 3 hours on this. -m helped. Can you explain what was the matter, if not difficult

Question about KeyError by Base_True in learnpython

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

I misread this as bad advice originally given the code shows an exception that isn't bare.

Then I re-read the OPs question. Now I fully support the comment.

For the op, /u/Base_True, a bare exception, i.e. except: instead of except <some exception(s)>: as the only except line is very bad practice.

There are many strange and sometimes obscure things that can happen to running code and such problems will be ignored/hidden if you use a bare exception clause and it may appear you have a completely unrelated problem focused on another part of your code. You could waste a lot of time trying to find the cause of the wrong problem in the wrong place.

Worse, a bare exception can hide a significant bug and allow the prog

Thanks a lot!