How to mix batch and Python code

Source: Internet
Author: User
Batch processing can be easily mixed with other languages programming, in addition to fun, there is considerable practical value, such as the Windows version of the Ruby Gem Package Manager is the use of batch processing and Ruby mixed writing, Bathome produced by the Command Toolkit manager BCN used bat+ A mixed implementation of JScript.

Cn-dos and Bathome Forum has a post introduction and demonstration of batch processing and a variety of language scripts mixed programming, interested can search to see.

Python does not criticize the file suffix, as long as the program contains the correct Python code can be interpreted with the Python interpreter execution.

The hybrid programming method for batching and Python is simple, save as Xx.bat, and the code is as follows:

"" ":: ================= This is a note:: Batch-to-Python programming:: May 18, 2016 14:26:03 Codegay:: Write Batch code below @echo Off&clsecho batch Echopython.exe%0&pause::================= This is the comment "" "#下面写你的python代码print (" python print ") #如果需要python输出中文, Need to save the file as Utf8print ("Chinese")

The above is a small series to introduce you to the batch processing and Python code mixed programming method of knowledge, I hope to help you, if you have any questions please give me a message, small series will promptly reply to you. Thank you very much for the support of the Scripting House website!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.