-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

7
  • 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. Commented Jul 1, 2021 at 2: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 Commented Jul 1, 2021 at 3: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') Commented Jul 1, 2021 at 3: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. Commented Jul 1, 2021 at 3: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. Commented Jul 1, 2021 at 3:24

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.