CMD Python

BioHazard1

Baseband Member
Messages
29
Location
Canada
I heard it is possible to type code into the CMD on windows and then compile it from there as well, almost as if the command prompt is an IDE/Compiler. I was wondering if this is possible with python, if so, how? Thanks to anyone who can answer this.
 
It can be done, though I wouldn't use CMD to write python. Have a look at for more help. I would recommend using IDLE which installs when you install python. It is cleaner and nicer in my opinion.
 
I have been using IDLE, but I just would like to see what it is like to have to use the command prompt to code.
 
ummm... yeah.

you could use the command prompt to write and compile code:

example
(my C compiler is called tcc, it's just a more lightweight version of gcc)



Code:
C:\Users\me\Desktop>echo #include^<stdio.h^> > Test.c

C:\Users\me\Desktop>echo void main() >> test.c

C:\Users\me\Desktop>echo { >> test.c

C:\Users\me\Desktop>echo printf("helloworld"); >> test.c

C:\Users\me\Desktop>echo } >> test.c

C:\Users\me\Desktop>tcc test.c

C:\Users\me\Desktop>test.exe
helloworld
C:\Users\me\Desktop>

the question rather becomes... why would you?


I suppose if you were faced with a editorless terminal you might copy line by line into a file the source code to give you a basic editor.

but why not just use notepad if you don't want a real IDE.

or I can recommend a program called Turbopad (does context highlighting and has nothing else associated with an IDE)

you're still going to need something like Tcc or Gcc to actually compile the source though.

and if you made a mistake it'd be a real pain in the rear to fix it.



of course, my example is in C, but it's exactly the same with python, you can write plain text to a file and then do whatever you like with it after that!
 
Back
Top Bottom