Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Executing WinXP commands using os module

2 views
Skip to first unread message

pranav

unread,
Jan 23, 2009, 6:50:39 AM1/23/09
to
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

Chris Rebert

unread,
Jan 23, 2009, 7:05:50 AM1/23/09
to pranav, pytho...@python.org
On Fri, Jan 23, 2009 at 3:50 AM, pranav <pra...@gmail.com> 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

pranav

unread,
Jan 23, 2009, 7:08:36 AM1/23/09
to
On Jan 23, 5:05 pm, Chris Rebert <c...@rebertia.com> wrote:
> On Fri, Jan 23, 2009 at 3:50 AM, pranav <pra...@gmail.com> 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

Méta-MCI (MVP)

unread,
Jan 23, 2009, 7:05:57 AM1/23/09
to
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


0 new messages