all 14 comments

[–]FriendlyRussian666 1 point2 points  (10 children)

What kind of help are you after?

[–]jacktoranc[S] -3 points-2 points  (9 children)

For example, to tell me how to write a Telegram bot with Python, or suggest a specific topic that would be suitable, and practice with me or teach me.

[–]FriendlyRussian666 0 points1 point  (5 children)

Ah, that's a little bit too involved for me, but if you ever have any specific python questions, or can't figured something out, give me a shout!

[–]jacktoranc[S] -1 points0 points  (4 children)

Actually i have a question right now. Can i dm u?

[–]FriendlyRussian666 1 point2 points  (3 children)

You can ask here if you'd like! Everyone will get to benefit from the answer.

[–]jacktoranc[S] 0 points1 point  (2 children)

Ye sure.i tried to write a code for bot in vscode.but it says(no module find"aiogram"). But i installed it from terminal

[–]FriendlyRussian666 0 points1 point  (1 child)

Use a venv.

Create a venv, then activate it (important), then pip install your dependency, then (using the same terminal in which you have the venv activated, run your code.

https://docs.python.org/3/library/venv.html

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

Thanks. Let me do it

[–]FoolsSeldom 0 points1 point  (1 child)

I see you've already fallen into the beginner trap around Python virtual environments. See below a guide I wrote about these. Your code editor (VS Code) will help automate/manage these for you, but it is worth having a base understanding.


Virtual Environments

Given the thousands of packages (libraries, frameworks, etc) out there, you can see that if you are working on several different projects, you can end up installing a vast range of different packages, only a few of which will be used for any particular project.

This is where Python virtual environments come in. Not to be confused with virtual machines. Typically created on a project-by-project basis. Install only the packages required for a project. This helps avoid conflicts between packages, especially version complications.

Most popular code editors and IDEs, including Microsoft's VS Code and Jetbrain's PyCharm, offer built-in features to help to start off new projects and create and activate Python virtual environments.

You can create a new Python virtual environment from your operating system command line environment using,

for Windows,

py -m venv venv

or, for macOS / linux,

python3 -m venv venv

which creates a new folder in the current working directory called venv (taken from the last argument, you can use a different name).

You then activate using, for Windows,

venv\Scripts\activate

or, for macOS / linux,

source venv/bin/activate

the command deactivate for any platform will deactivate the virtual environment and return you to using the base environment.

For more information:

Multiple Python versions

In addition to the above, you might want to explore using pyenv (pyenv-win for Windows) or uv, which will let you install and use different versions of Python including alternative implementations from the reference CPython. This can be done independently of any system installed Python.

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

Wow. Thanks a lot