Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Executing WinXP commands using os module

Reply
Thread Tools

Executing WinXP commands using os module

 
 
pranav
Guest
Posts: n/a
 
      01-23-2009
Greetings,
I am writing a code to perform operations like checkout, check-in and
others for SS. (SS is the command line utility for Visual SafeSource,
VSS). I am familiar with all the commands for this purpose. I know
li'l python also.
What i want to learn is how do i use the command line arguments in os
(or any other call that will fulfill my purpose). I can use popen to
create a command prompt. But i need to use commands like

ss checkout $\projectName\file -Yusername,password -c'Test comment'

Please help me.

Thanks in advance,
Regards

Pranav Prakash

http://codecontrol.blogspot.com
 
Reply With Quote
 
 
 
 
Chris Rebert
Guest
Posts: n/a
 
      01-23-2009
On Fri, Jan 23, 2009 at 3:50 AM, pranav <(E-Mail Removed)> wrote:
> Greetings,
> I am writing a code to perform operations like checkout, check-in and
> others for SS. (SS is the command line utility for Visual SafeSource,
> VSS). I am familiar with all the commands for this purpose. I know
> li'l python also.
> What i want to learn is how do i use the command line arguments in os
> (or any other call that will fulfill my purpose). I can use popen to
> create a command prompt. But i need to use commands like
>
> ss checkout $\projectName\file -Yusername,password -c'Test comment'


You want the `subprocess` module. See
http://docs.python.org/library/subprocess.html

Cheers,
Chris

--
Follow the path of the Iguana...
http://rebertia.com
 
Reply With Quote
 
 
 
 
Méta-MCI \(MVP\)
Guest
Posts: n/a
 
      01-23-2009
Hi!

Try:
os.system("""start "" cmd /css checkout
$\projectName\file -Yusername,password -c'Test comment' """)

(not tested ; it's directly from my memory)


@-salutations
--
Michel Claveau


 
Reply With Quote
 
pranav
Guest
Posts: n/a
 
      01-23-2009
On Jan 23, 5:05*pm, Chris Rebert <(E-Mail Removed)> wrote:
> On Fri, Jan 23, 2009 at 3:50 AM, pranav <(E-Mail Removed)> wrote:
> > Greetings,
> > I am writing a code to perform operations like checkout, check-in and
> > others for SS. (SS is the command line utility for Visual SafeSource,
> > VSS). I am familiar with all the commands for this purpose. I know
> > li'l python also.
> > What i want to learn is how do i use the command line arguments in os
> > (or any other call that will fulfill my purpose). I can use popen to
> > create a command prompt. But i need to use commands like

>
> > ss checkout $\projectName\file -Yusername,password -c'Test comment'

>
> You want the `subprocess` module. Seehttp://docs.python.org/library/subprocess.html
>
> Cheers,
> Chris
>
> --
> Follow the path of the Iguana...http://rebertia.com


Thanks, will try it
 
Reply With Quote
 
 
 
Reply

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
executing commands in the same shell in Windows using Perl Murugesh Perl Misc 5 12-07-2005 04:25 PM
Microsoft Data Access Blocks (SqlHelper) - Executing 2 SQL commands FyinsFlip ASP .Net 4 12-29-2004 05:25 PM
Need Help Differentiating Bad Commands From Incomplete Commands Tim Stanka Python 1 08-02-2004 02:08 AM
Remotely executing commands over Serial Port Mitchley Perl 0 06-09-2004 11:48 PM
Re: man pages for C commands (GCC commands) Ben Pfaff C Programming 4 06-28-2003 06:21 PM



Advertisments