Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

How do i run a python programm....

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
SarahS93
l33t
l33t
Posts: 746
Joined: Thu Nov 21, 2013 11:48 am

How do i run a python programm....

  • Quote

Post by SarahS93 » Sun Feb 22, 2026 11:28 pm

I have some question about python and how to use Programms they are writen in Python.

I have installed tor and i will use a python script for showing the Tor-Ciruit by the Tor-CLI.

python <tab><tab> than i see:

Code: Select all

python             python3            python3.11         python3.11-config  python3.12         python3.12-config  python3.13         python3.13-config  python3-config     python-config      python-exec2c
I can connect to the Tor-Cli

Code: Select all

echo -e 'AUTHENTICATE \r\nGETINFO entry-guards  \r\nQUIT' | nc localhost 9051
I see some infos about the tor entry-guards.


I tried
git clone https://git.torproject.org/stem.git
cd stem/
python setup.py install
for installing stem.
But what have i than to do?

I will use this script:
https://stem.torproject.org/tutorials/e ... cuits.html
to get infos about the Tor-Ciruit by the Tor-Cli
What have i to do for that?!
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Mon Feb 23, 2026 12:09 am

Well, the example you linked looks pretty straight-forward:
python list_circuits.py

So, what's the problem?
Make Pipewire a system service
Top
SarahS93
l33t
l33t
Posts: 746
Joined: Thu Nov 21, 2013 11:48 am

  • Quote

Post by SarahS93 » Mon Feb 23, 2026 9:15 am

after
python setup.py install
what have i to do?
i dont understand how to use the script and how to use stem.
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Mon Feb 23, 2026 10:14 am

I don't understand what you're trying to do and what you're stuck on.
I get that you're doing something with tor, but you're asking about running python programs (which makes the tor part look irrelevant), even though you linked an example of an invocation (and output) of a python program which does exactly what you declared as your intent in the second sentence of your first post.

You literally solved your stated problem in the opening post, just to follow it up with "what do I do now?"
Doesn't make any sense to me.
Make Pipewire a system service
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56108
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Feb 23, 2026 8:40 pm

SarahS93,

stem is a library. You do not use it directly.
Once it's installed, Python scrips can use it's content.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
SarahS93
l33t
l33t
Posts: 746
Joined: Thu Nov 21, 2013 11:48 am

  • Quote

Post by SarahS93 » Tue Feb 24, 2026 12:41 am

i do not know how to use the script from
https://stem.torproject.org/tutorials/e ... cuits.html

i know i have to store the code beginning from
"from stem import CircStatus
....
print(" %s- %s (%s, %s)" % (div, fingerprint, nickname, address))
"
in a file called "list_circuits.py".
but at what place have i to store this file?


for installing stem is all i have to do:
"git clone https://git.torproject.org/stem.git
cd stem/
python setup.py install"
nothing more?
Top
Phoenix591
Guru
Guru
Posts: 506
Joined: Mon Sep 17, 2007 3:52 am

  • Quote

Post by Phoenix591 » Tue Feb 24, 2026 8:10 am

SarahS93 wrote: but at what place have i to store this file?
Anywhere you want, you don't even have to name it the same.
SarahS93 wrote: for installing stem is all i have to do:
"git clone https://git.torproject.org/stem.git
cd stem/
python setup.py install"
nothing more?
no, for python things that don't have a Gentoo package you can either create one, or more simply just create a venv and install the package into it ( this gets it from pypi and installs all its dependencies) .

Code: Select all

python -m venv ~/stem
source ~/stem/bin/activate
pip install stem
python (path to example script)
to run your script then you'd need to either activate the venv by sourcing the activation script before running python, or run it using the python in the venv: ~/stem/bin/python (path to script)
Top
SarahS93
l33t
l33t
Posts: 746
Joined: Thu Nov 21, 2013 11:48 am

  • Quote

Post by SarahS93 » Tue Feb 24, 2026 8:39 pm

Now it works!

Thanks guys!
Top
Post Reply

8 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic