That sounds what I need....

but:

ubuntu@ip:/home/www-data/web2py$ python scripts/cpdb.py -h
Traceback (most recent call last):
  File "scripts/cpdb.py", line 5, in <module>
    import argparse
ImportError: No module named argparse

then I read somewhere this:


1down vote

The argparse module was added in Python 2.7.
http://docs.python.org/library/argparse.html

Prior to 2.7, the most common way to handle command-line arguments was
probably getopt.http://docs.python.org/library/getopt.html

Of course you can always handle the command-line manually simply by looking
at sys.argv. Howevergetopt is a good abstraction layer, and argparse is
even better.

If you truly need argparse in older environments (debatable), there is a
Google Code project maintaining it, and you can include that in your
project. http://code.google.com/p/argparse/
link <http://stackoverflow.com/a/7476068>|improve this
answer<http://stackoverflow.com/posts/7476068/edit>

from:
http://stackoverflow.com/questions/7473609/argparse-python-modules-in-cli

And I'm like:
ubuntu@ip:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

wich means it doesn't work because I just don't have it.

someone said this:

up vote3down vote

Well if the only thing you need is argparse (saw that in one of your
comments!) you could just do :

pip install argparse

This is not exactly an answer to the exact question :-) , but indeed if you
are only missing a few feature, many 2.7 features actually come from
independent projects and/or some compatibility packages can be found, eg:


Also from:
http://stackoverflow.com/questions/7473609/argparse-python-modules-in-cli

wich made me think that I'm using 2.6 while there's 2.7 and 3.2 out
there... should I consider upgrading python to a newer version or just get
the missing module?

Thanks in advanced!
Marco Tulio

2012/3/27 nick name <i.like.privacy....@gmail.com>

> On Tuesday, March 27, 2012 11:26:17 AM UTC-4, Marco Tulio wrote:
>
>> How do I get the data that was on my app (on the sqlite database).
>
>
> Web2py comes with scripts/cpdb.py, which copies databases from one
> connection string to another with lots of other goodies.
>
> see
> http://web2py.com/books/default/chapter/29/6#Copy-data-from-one-db-into-another(if
>  it doesn't get you to the right place, look for "cpdb" in the page)
>



-- 
[]'s
Marco Tulio

Reply via email to