3

I am pretty new to Subversion, and not that experienced in Python, but am doing some work with large volume of media-files that need moving around within the directory. Using the Visions GUI, some of the file transfers are taking a very long time, so I'd like to automate these tasks to run over night by storing the actions within a text file and then having a python script act on these overnight?

For example the text file might contain a command such as:

svn mv current desired

How can I send this string to Terminal to execute the command?

3 Answers 3

4

You could do os.system call or try using PySVN, which may give you more control in Python over SVN repository you're working with.

Sign up to request clarification or add additional context in comments.

2 Comments

// , I thought PySVN was a GUI client, not an automation library.
PySVN is accompanied by a Workbench, which is a GUI client. But please see pysvn.tigris.org/docs/pysvn_prog_guide.html for PySVN programmer's guide and you'll see that it's fine API for using SVN repo from within Python,.
0

The subprocess module is the best way to execute commands. As @Abgan points out, the better way might be to use a subversion library instead.

Comments

-1

If you're on Windows, it'd be better to use an SVN library. On Linux/Mac/Unix you could go either way realistically, because these can run a subprocess well - windows doesn't do terribly well at this.

subprocess is indeed preferred over os.system today.

The nice thing about using subprocess.Popen instead of an SVN library (module), is that you don't have to learn two ways of accessing SVN. Your command line SVN knowledge translates directly into your code.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.