Re:Show HN: A platform for beginners to learn programming in...
by noitpmeder on Saturday August 01, 2020 @10:14PM
(#24025769)
" you can assume that there is an interpreter available on the system, say /usr/bin/python3, you can use that instead of creating a virtual environment."
Please DO NOT do this. It is so much easier to always create a virtual environment, and then you never have to worry about installing two applications on the same system that may have conflicting versions. Additionally, you don't know what else may be installed into the system's default python environment.
Re:Show HN: A platform for beginners to learn programming in...
by jamestimmins on Sunday August 02, 2020 @01:08AM
(#24026515)
I find you're better off pretending that your system doesn't have any builtin Python. I use virtual environment for everything.
Re:Show HN: A platform for beginners to learn programming in...
by ptx on Sunday August 02, 2020 @10:42AM
(#24028989)
Using the system Python for scripts that only depend on the standard library should be pretty safe. As soon as I need any third-party dependency I create a virtual environment.
Edit: Although if startup performance is important, using a virtual environment might be a good idea even for simple scripts. Running a "hello world" program using the system Python takes twice as long on my system as running it with "python -S" (i.e. ignoring site packages) or from a fresh virtual env.
Re:Show HN: A platform for beginners to learn programming in...
by simonebrunozzi on Saturday August 01, 2020 @04:04PM
(#24023451)
Yes, please.
Aaaand, now that you're at it, a single .dmg file for MacOS with binaries and scripts so us lazy people with Macbooks can start coding right away :) (it might be a bit inaccurate but I guess you know what I mean)
Re:Show HN: A platform for beginners to learn programming in...
by aerovistae on Saturday August 01, 2020 @02:56PM
(#24022967)
lord yes
Re:Show HN: A platform for beginners to learn programming in...
by nemosaltat on Saturday August 01, 2020 @03:13PM
(#24023098)
Seconded
Re:Show HN: A platform for beginners to learn programming in...
by cvhashim on Saturday August 01, 2020 @07:02PM
(#24024675)
That would be awesome
Re:Show HN: A platform for beginners to learn programming in...
by somurzakov on Saturday August 01, 2020 @04:45PM
(#24023770)
yes please
Re:Show HN: A platform for beginners to learn programming in...
by williamtwild on Saturday August 01, 2020 @03:21PM
(#24023148)
yes pleasr
2) Run pip install. myproject/bin/activate; pip install requirements.txt; (download all project dependencies).
3) Start the application. myproject/bin/activate; python myapp.py
If you can assume that there is an interpreter available on the system, say /usr/bin/python3, you can use that instead of creating a virtual environment.
If you want to embed all the dependencies, you can save all the files created by pip install in the /lib directory if I remember the name well.
Should I write a full blog post with example? I used to deploy python applications in a bank, can explain all the advanced usage with and without internet access, with and without dependencies.