Sorry in advance for my lack of proper programming lingo.
I currently have a Python 3.10 script in Jupyter Notebooks that I want to convert into some sort of packageable application for distribution to students as an educational tool. I was thinking to turn it into a container and run it through Docker Desktop, having students install Docker Desktop and distributing the container, but I am unsure of exactly how to do this, especially with specific libraries and environmental variables. Or, if there's another easier way to accomplish this, I am all ears. Thanks in advance!
Jupyter Notebooks says that it can export to HTML, which may be useful, but I'm unsure how to use this to get it to do what I want it to do.
Related
I am unfortunately an absolute beginner in programming.
First of all, I'm programming with the PyCharm IDE on a Windows computer, but the script will later run on a RaspberryPi.
I want to turn on my TV with a Python script via HDMI-CEC and I came across libcec.
However, I can't figure out the setup instructions for Windows.
https://github.com/trainman419/python-cec
Can anyone give me a step by step guide on what exactly I need to do to use the CEC commands in Python?
Or should I program with PyCharm directly on the RaspberryPi? This one is way too slow for this task in my opinion. Then I could install the CEC library very easily.
Thanks for your help.
I am really new to Jenkins and Python so when I have initially researched for this problem, there has been a limit to my understanding. I am looking to write a Python script and for it to be run on Jenkins as part of some automated testing I wish to do. My script interacts with an API and hence imports the 'requests' module on Python. It works fine using the Python interpreter on my local machine but I have had issues when I have tried using the Jenkins Python script builder and so I am looking for a way around this.
As I mentioned, I have looked around the internet for solutions but as my knowledge on this topic is limited I have found it difficult to understand certain ideas that have been mentioned on the web. One lead I have had is related to the use of virtual environments on Jenkins, but as its something I've never used, I have struggled implementing it. I have installed the ShiningPanda Plugin on Jenkins, but I am unsure how to use it.
Any help given is greatly appreciated :)
Thanks
I am wondering if it is possible, without any problems, to have Python installed on a network drive for use by multiple Windows users who have only read and execute rights. As far as I know, it is possible to add the python binaries to the PATH variable and run python on another drive without any problem, but I was wondering some things :
I know you can install Python on another drive than your C: drive, but not sure if the same is possible with a network drive.
Can this support concurrent users? Like two people running python scripts at the same time.
Would users with no write privileges still be able to install python modules? I want only users with write access to the drive to be able to do this.
Would this pose any problems with some modules?
Thanks.
I'm a Linux user so can't test, but this seems like a common question and google finds lots of similar questions with answers
to answer your questions to be best of my ability:
it should certainly support "concurrent users", the file server wouldn't even know the program is running, it'll just see devices on the network opening/reading the files
users obviously wouldn't be able to install things on network drives if they don't have write permission, but they should still be able to install modules locally (i.e. on their own machine) with something like pip install --user requests
I'm sure this would cause problems with some modules, but I wouldn't expect it to be many. note that lots of modules have issues running under OSs that they weren't developed/tested in, and a lot of Python work happens on Unix/Linux/OSX machines
If you want everyone to have the same development enviorment:
Try creating a python virtualenv on the remote folder,so they can activate it when its required. https://virtualenv.pypa.io/en/stable/
But if want you want to do is to distribute an app and want everyone to have the same python, may be take a look at pyinstaller 'An application to convert python scripts into stand-alone binaries'
I (a scientist rather than software developer) have developed an application using jupyter dashboards and would like to make sure, colleagues (no programming skills) can use it in the future. However, jupyter dashboards are incompatible with the newest jupyter versions. We run windows on all of our desktop computers and cannot install software at will but have to use portable apps like anaconda python. For example, the anaconda navigator for example cannot modify the start entry after the installation because it requires admin rights. Furthermore, the firewall blocks conda update
I thought of two solutions:
1) the least complicated (for me)
Provide a .yaml file for the anaconda environment and a tutorial how to
install anaconda and activate the required environment. Problem: the firewall of the company does not allow anaconda to install packages. I can install it, log into my private wlan and cirumvent that but that is not an option for everyone. I would have to deploy somehow the specific anaconda environment offline. I do prefer this solution because it seems to be simpler and least error prone.
2) using docker
There are docker images available. We do have a local PC on which I could install docker and set up everything. Problem. If a new PC is installed, someone else would have to do all that, and honestly I doubt anyone would do that. We have an IT department but that is way out of the box and would require special attention and human ressource as well as a lot of mails and calls to the IT-service line
I would appreciate any advice or ideas how to make sure in the simplest way possible that my work can be used by other scientists with minimal effort.
Out of what you mentioned, I prefer docker approach. It allows you to define a well-controlled environment with a relatively easy setup for new users. Note that Docker has some quirks when running on windows and can sometimes cause weird issues (containers running out of space out of the blue, pathing issues [if running on docker toolbox]) and such.
It is slightly more complicated to setup (than yaml) but as a tradeoff you are much less dependant on every single machine's/network's specifications.
If your workplace has it department and if your team is supposed to share the work, i'd suggest to request them to create a cloud (intranet) jupyter server so your team could have centralized access to the jupyter infrastructure.
In my company we have an even more complex approach, an intranet copy of google colab. That would be the best approach if you can push your it dept this much.
Good luck!!
Recently I have been approached by friends and family asking me to create various python apps for them. I'm trying to find an easy way to distribute these projects in a way that requires zero prior knowledge and minimal explanation.
My idea is to create a virtual environment for each app and compress it, then I can simply email it to them, they can unzip it and be good to go. My question is how can I have this create shortcuts on their desktops to things such as the batch file (most importantly), excel sheets, image folders, etc?
I would appreciate any help on this, or if I'm going about this completely wrong, it would be great to learn of a better way.
What you are taking about is 'freezing' your code so it can be distributed. Here is an overview of the concept http://docs.python-guide.org/en/latest/shipping/freezing/.
I personally have had the best luck with PyInstaller being able to create a single executable file (i.e. my_app.exe) https://pyinstaller.readthedocs.io/en/stable/operating-mode.html
Now that your code is portable, to create the desktop icon there are various installers you can use to package that and anything else you need. http://www.makeuseof.com/tag/how-to-make-an-exe-installation-file/