Am 03.05.2013 10:34, schrieb Myles English:

Hi Andreas,

Andreas Röhler writes:

Hi,

have in some source file, let's assume Python, the following:


foo = {
      "bar": (
           "baz",
           "qux",
      ),
}

What is the best way to put this into an

#+BEGIN_SRC python

foo = {
      "bar": (
           "baz",
           "qux",
      ),
}

#+END_SRC

A literal answer would be:

echo "#+BEGIN_SRC python\n" > newfile.org
cat somefile.py             >> newfile.org
echo "\n#+END_SRC\n"        >> newfile.org

Myles


ahh, that's great too :)

BTW think it should exist a way to transform a region accordingly. Will open a 
separate thread maybe.

Andreas

Reply via email to