Earlier, I wrote an article on how to set up a Virtual Environment for Python development on Ubuntu . This article, as the title suggests, focuses on setting up a virtual environment on Windows. I’m using Windows 8, and everything we will do here should work on other versions of Windows as well.
Installing Python, or any other software, for that matter, is fairly easy on Windows. You can download the Python installer from the Download Python page of the official website. The versions I will be using for this article, are 3.6 and 3.7. Please feel free to pick your own versions.
While installing Python 3.6, please make sure that you have selected the checkbox for “Add Python 3.6 to PATH”. Also, note that I’m installing Python in “C:\Python\Python36” directory, which would be useful later. So, I would recommend you to do the same, however, you are not bound to.
Once done, open up your PowerShell, type “python” and hit enter/return. You should see an output similar to mine. You can exit Python by using the quit() or exit() call.
It’s time to install Python 3.7 in the “C:\Python\Python37” directory. Please ensure that you select the checkbox for “Add Python 3.7 to PATH”. Once done, close the current PowerShell, and open it again. Then type “python --version” and hit enter/return. You should see an output similar to this one:
Notice how “python --version” returns the version to be “Python 3.7.0” and not “Python 3.6.6”. The reason for this is the value of the PATH environment variable. To see the value you need to,
You can now copy the value in your favorite text editor and look at it. Mine looks like the following.
C:\Python\Python37\Scripts\;C:\Python\Python37\;C:\Python\Python36\Scripts\;C:\Python\Python36\; //and a few other values
When we execute the command “python” or “python --version”, it looks into the “PATH” variable and finds Python 3.7 as the first match, it stops there and looks no further. Therefore, if we want to run “Python 3.6”, we have to manually change the “PATH” variable or change the installation order which will, in turn, change the variable.
However, there is a way to run a specified version of Python, and we can do so by using the command “py -”. Please refer to the image below.
To set up a virtual environment, we first need to install the package virtualenv using pip. To do so, open up your PowerShell and execute the following commands.
// upgrade pip to its latest version python -m pip install --upgrade pip // install virtualenv pip install virtualenv
If your requirement falls under any of the following categories,
Then, you can simply create your virtual environment using the “virtualenv venv” command, where “venv” is the environment name. However, if none of the above categories satisfies your requirement, then follow along as it’s time to create your virtual environment using with Python 3.6.
// navigate to Desktop cd .\Desktop // create a new directory 'project-36' mkdir project-36 // change currenct directory to 'project-36' cd .\project-36 // create a virtual environment named 'venv', feel free to name it anything you like virtualenv venv -p C:\Python\Python36\python.exe
Notice the last command. With the attribute “-p” we have specified the Python version that we want our virtual environment to use. In our case, it’s Python 3.6, which we had installed at “C:\Python\Python36”. If you installed it at a different location, please pass the complete path here.
If you want to use Python 3.7 instead, all you need is to change the installation path for Python in the last command. Just put in the path where you installed Python 3.7 and you are good.
Now, it’s time to activate the environment, check the Python version and also list the default packages installed for us. To do so, execute the following commands and you should see a similar output as shown in the image that follows. The (venv) on the left shows that our virtual environment is active.
// activate the virtual environment .\venv\Scripts\activate // check the python version python --version // list all packages installed by default pip list // deactivate the virtual environment deactivate
Congratulations! You have successfully created your first virtual environment for Python. And, you are now all set to start your journey with Python development over Windows.
Welcome to my Blog, In this article, we will learn python lambda function, Map function, and filter function.
Lambda function in python: Lambda is a one line anonymous function and lambda takes any number of arguments but can only have one expression and python lambda syntax is
Syntax: x = lambda arguments : expression
Now i will show you some python lambda function examples:
#python #anonymous function python #filter function in python #lambda #lambda python 3 #map python #python filter #python filter lambda #python lambda #python lambda examples #python map
No programming language is pretty much as diverse as Python. It enables building cutting edge applications effortlessly. Developers are as yet investigating the full capability of end-to-end Python development services in various areas.
By areas, we mean FinTech, HealthTech, InsureTech, Cybersecurity, and that's just the beginning. These are New Economy areas, and Python has the ability to serve every one of them. The vast majority of them require massive computational abilities. Python's code is dynamic and powerful - equipped for taking care of the heavy traffic and substantial algorithmic capacities.
Programming advancement is multidimensional today. Endeavor programming requires an intelligent application with AI and ML capacities. Shopper based applications require information examination to convey a superior client experience. Netflix, Trello, and Amazon are genuine instances of such applications. Python assists with building them effortlessly.
Python can do such numerous things that developers can't discover enough reasons to admire it. Python application development isn't restricted to web and enterprise applications. It is exceptionally adaptable and superb for a wide range of uses.
Python is known for its tools and frameworks. There's a structure for everything. Django is helpful for building web applications, venture applications, logical applications, and mathematical processing. Flask is another web improvement framework with no conditions.
Web2Py, CherryPy, and Falcon offer incredible capabilities to customize Python development services. A large portion of them are open-source frameworks that allow quick turn of events.
Simple to read and compose
Python has an improved sentence structure - one that is like the English language. New engineers for Python can undoubtedly understand where they stand in the development process. The simplicity of composing allows quick application building.
The motivation behind building Python, as said by its maker Guido Van Rossum, was to empower even beginner engineers to comprehend the programming language. The simple coding likewise permits developers to roll out speedy improvements without getting confused by pointless subtleties.
Utilized by the best
Alright - Python isn't simply one more programming language. It should have something, which is the reason the business giants use it. Furthermore, that too for different purposes. Developers at Google use Python to assemble framework organization systems, parallel information pusher, code audit, testing and QA, and substantially more. Netflix utilizes Python web development services for its recommendation algorithm and media player.
Massive community support
Python has a steadily developing community that offers enormous help. From amateurs to specialists, there's everybody. There are a lot of instructional exercises, documentation, and guides accessible for Python web development solutions.
Today, numerous universities start with Python, adding to the quantity of individuals in the community. Frequently, Python designers team up on various tasks and help each other with algorithmic, utilitarian, and application critical thinking.
Python is the greatest supporter of data science, Machine Learning, and Artificial Intelligence at any enterprise software development company. Its utilization cases in cutting edge applications are the most compelling motivation for its prosperity. Python is the second most well known tool after R for data analytics.
The simplicity of getting sorted out, overseeing, and visualizing information through unique libraries makes it ideal for data based applications. TensorFlow for neural networks and OpenCV for computer vision are two of Python's most well known use cases for Machine learning applications.
Thinking about the advances in programming and innovation, Python is a YES for an assorted scope of utilizations. Game development, web application development services, GUI advancement, ML and AI improvement, Enterprise and customer applications - every one of them uses Python to its full potential.
The disadvantages of Python web improvement arrangements are regularly disregarded by developers and organizations because of the advantages it gives. They focus on quality over speed and performance over blunders. That is the reason it's a good idea to utilize Python for building the applications of the future.
#python development services #python development company #python app development #python development #python in web development #python software development
Like other languages, Python has its way to download, store, and resolve packages. Creating a Python Virtual environment will allow you to work on an isolated copy of Python for specific projects without interfering or impacting the working of other ongoing projects.
These Python environments can be easily hosted on a VPS server or a dedicated server to be available for multiple users. It will be beneficial for different team members working on the same project.
#python #python-programming #windows-10 #windows #coding
Python is awesome, it’s one of the easiest languages with simple and intuitive syntax but wait, have you ever thought that there might ways to write your python code simpler?
In this tutorial, you’re going to learn a variety of Python tricks that you can use to write your Python code in a more readable and efficient way like a pro.
Swapping value in Python
Instead of creating a temporary variable to hold the value of the one while swapping, you can do this instead
>>> FirstName = "kalebu" >>> LastName = "Jordan" >>> FirstName, LastName = LastName, FirstName >>> print(FirstName, LastName) ('Jordan', 'kalebu')
#python #python-programming #python3 #python-tutorials #learn-python #python-tips #python-skills #python-development
Today you’re going to learn how to use Python programming in a way that can ultimately save a lot of space on your drive by removing all the duplicates.
In many situations you may find yourself having duplicates files on your disk and but when it comes to tracking and checking them manually it can tedious.
Heres a solution
Instead of tracking throughout your disk to see if there is a duplicate, you can automate the process using coding, by writing a program to recursively track through the disk and remove all the found duplicates and that’s what this article is about.
But How do we do it?
If we were to read the whole file and then compare it to the rest of the files recursively through the given directory it will take a very long time, then how do we do it?
The answer is hashing, with hashing can generate a given string of letters and numbers which act as the identity of a given file and if we find any other file with the same identity we gonna delete it.
There’s a variety of hashing algorithms out there such as
#python-programming #python-tutorials #learn-python #python-project #python3 #python #python-skills #python-tips