-1

I want to do is create a new python script so that I can start coding in python. I am new to using windows command prompt. How can I access and create a new python script using the command prompt window? I have tried using cd (location of already made script). I have also just used data\scripts which is where the rest of the python scripts are located.

I have also attached a screenshot of what I attempted.

enter image description here

martineau
  • 119,623
  • 25
  • 170
  • 301
Ruva
  • 47
  • 5
  • You don't typically use the command prompt to *create* a Python script. You use a text editor or IDE to create a Python script, and then you might *run* it from the command prompt. – larsks Jul 01 '21 at 02:54
  • you have to enter into python shell. If python is in your PATH, the simply typing python will let you into the shell then you can write. other wise navigate to /bin/python and enter python – Epsi95 Jul 01 '21 at 03:01
  • 1
    You will do yourself a massive favour not just working from the command prompt. Windows lacks a decent text editor on the command line, so you're better off starting with one of the many free alternatives, like VSCode or PyCharm community. Even a basic text editor like Notepad++ or even just Notepad is a better idea than the bare CLI. (And I'm assuming you're not on Linux because of your use of the phrase 'command prompt window') – Grismar Jul 01 '21 at 03:06
  • All you really need is a decent text editor. The one I use let me customize it to run the script I'm editing and captures any output it produces — there are many that can do this. – martineau Jul 01 '21 at 03:13
  • Also note the paths on Windows use backslashes, so you would need to type `cd U:\data\scripts` at the command prompt to change to that subdirectory. – martineau Jul 01 '21 at 03:24
  • Please [don’t post images of code, error messages, or other textual data.](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors) – tripleee Jul 01 '21 at 03:56
  • We don't know whether you have a folder named U:\data\scripts or why you just mistyped the name, or if you are trying to access something which simply isn't installed on your system. Voting to close as lacking enough details. – tripleee Jul 01 '21 at 03:57

1 Answers1

1

To access this in the CMD, you just need to type:-

cd data\scripts

Then you will be in your directory.

If you just want shell access, type:-

python

in the interface.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Om Parab
  • 70
  • 7