Command line question

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 382
Reputation: tomtetlaw is an unknown quantity at this point 
Solved Threads: 4
tomtetlaw's Avatar
tomtetlaw tomtetlaw is offline Offline
Posting Whiz

Command line question

 
0
  #1
May 12th, 2009
Is there any way to check if the script is being run in the Windows command line?
...
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 128
Reputation: slate is an unknown quantity at this point 
Solved Threads: 31
slate slate is offline Offline
Junior Poster

Re: Command line question

 
0
  #2
May 12th, 2009
Honestly I do not know the answer. I think it is more difficult than it seems.
Why do you need that? Maybe there is another way to solve the problem.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 38
Reputation: _Nestor is an unknown quantity at this point 
Solved Threads: 4
_Nestor _Nestor is offline Offline
Light Poster

Re: Command line question

 
0
  #3
May 13th, 2009
You could find out the os by importing the platform module
platform.system() should give the os or if your looking for a particlar release you could use the platform.release()
  1. import platform
  2.  
  3. if platform.system() == 'Windows':
  4. #Do something
  5. else:
  6. #Do something else
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 240 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC