Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-16-2012, 11:03 PM   #1
Baseband Member
 
Join Date: Jul 2012
Location: Canada
Posts: 29
Default CMD Python

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.
__________________

BioHazard is offline   Reply With Quote
Old 08-17-2012, 01:35 AM   #2
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: CMD Python

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.
__________________

__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 08-17-2012, 10:11 AM   #3
Baseband Member
 
Join Date: Jul 2012
Location: Canada
Posts: 29
Default Re: CMD Python

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.
BioHazard is offline   Reply With Quote
Old 08-17-2012, 04:49 PM   #4
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: CMD Python

Follow the link I posted and it will help you with using CMD for python.
__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 08-28-2012, 12:44 PM   #5
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: CMD Python

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!
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 07:42 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0