How can I start running Python files after closing the Ubuntu terminal? In other words how to get a prompt like this in Ubuntu termial: (my_env)rashid@rashid-DH55TC: ~/environments$: This will enable me to execute .py file.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
To execute .py files, simply run the command
python name_of_file.py
See this link for more details.
If you are asking about activating your virtual environment (so that in the terminal you see (my_env)rashid@rashid… ) enable or activate your virtual environment using the command
$ source myenv/bin/activate
That will change
rashid@rashid-DH55TC: ~/environments$:
to
(my_env)rashid@rashid-DH55TC: ~/environments$:
(my_env) is the name of the virtual environment and it’s presence shows that you are now in a virtual environment.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.