Skip to content

Spoke Right

Education for everyone

https://spokeright.com
Primary Menu
  • Home
  • Our Services
    • Translation
    • Interpretation
    • Transcription
    • Voice-Over
    • Proofreading
    • Content writing
  • Free Education
    • Learn Android Studio
    • Learn Python
    • Learn MongoDB
    • Learn MySql
    • Learn React
    • Montessori Education
  • Spoke Right News
  • Earn Online
  • Classic Games by Spoke Right
    • TicTac
    • Checkers
    • Foosball
    • Billiards
    • Master Chess
    • Logic Game
  • Contact Us
Download Now
  • Home
  • Learn Python
  • How do I run Python from command line
  • Learn Python

How do I run Python from command line

Spoke Right November 30, 2022 2 min read

Python command line

In this tutorial, you will learn how to use command line. How you can create, copy, move files and folder from one location to another location using terminal.

Open your vscode and press “cntrl+~ “key to enter into terminal. This terminal is a git bash that we have integrated with vscode. You can test these command as written below:

(note: In linux we treat everything as files or folder. Like if we have a drive in windows system in linux we create LVM which are treated as folder)

  • Cd : by cd command we enter into directory.
    Ex: if we want to move from c drive to e drive.

Pwd : shows you present at location/path of the directory.
Ex:-

Mv : to move the directory from one directory/file to another directory.
Ex: mv <source file/folder> <destinationfolder/path>

mv demo_directory/test.py workspace/

Cp: to copy the file/directory to another directory.
Ex: cp -var <source file/folder> <destination folder/path>
cp -var demo_directory/test.py workspace/newfolder/

Mkdir: to make a new directory.

Ex: mkdir john sara albert

(above command will create 3 directories named john sara albert in existing location)

If you want to make a directory having space between them you can do this by following way
mkdir “ python practice”

  • rm: To remove a file.
    Ex:  $  rm <file name>

    rm test.txt

  • rm -fr: To delete directory.
    $  rm -fr workspace

ls : to view the details of all the folder.

touch: to create a file.

  • Clear: to clear the screen.
    Ex:   clear
  • Code: to start write code in .py file
    Ex: code hello.py

After entering above written command, a new screen will be displayed upside with name of .py file, we will write our program here as shown in following screen.

Continue Reading

Previous: How do I create a Git project in Python
Next: How do I fix Python command not found

Related Stories

What is Data Statistics And Analysis With Java And Python
9 min read
  • Learn Python

What is Data Statistics And Analysis With Java And Python

December 7, 2022
How do I get the date in Python
2 min read
  • Learn Python

How do I get the date in Python

December 7, 2022
What is an exception handler in Python
2 min read
  • Learn Python

What is an exception handler in Python

December 7, 2022

This AD Will support Us

Support Us

Coding Ustad LTD Support
Coding Ustad LTD Support

Coding Ustad LTD

Coding Ustad LTD
Coding Ustad LTD

Recent Posts

  • How to Install Node.js and npm on CentOS 7
  • How to Install Node.js and npm on CentOS 7
  • How to Install CentOS Web Panel (CWP) on CentOS 7
  • The Power of Marketing in Real Estate: A Guide to Boost Your Business
  • Vehicle Verification in Pakistan

Get free Hosting

Hostens.com - A home for your website

You may have missed

How to Install Node.js and npm on CentOS 7
4 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install Node.js and npm on CentOS 7

May 3, 2023
How to Install Node.js and npm on CentOS 7
4 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install Node.js and npm on CentOS 7

May 2, 2023
How to Install CentOS Web Panel (CWP) on CentOS 7
3 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install CentOS Web Panel (CWP) on CentOS 7

May 2, 2023
The Power of Marketing in Real Estate: A Guide to Boost Your Business https://thaikadar.com/secureinvestment/
2 min read
  • Article By Spoke Right
  • Blog By Spoke Right
  • Circular Byte Private Limited

The Power of Marketing in Real Estate: A Guide to Boost Your Business

January 30, 2023
  • Home
  • Our Services
  • Free Education
  • Spoke Right News
  • Earn Online
  • Classic Games by Spoke Right
  • Contact Us
Copyright © All rights reserved. | MoreNews by AF themes.