On Mon, 07 Apr 2014 19:06:48 +0200
Oliver Eichler <[email protected]> wrote:
> But does this work in 3.X too? I have no 3.X to test.
it does
[dan@eagle ~]$ python3
Python 3.3.2 (default, Mar 5 2014, 08:21:05)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> basedir="foo"
>>> print("Search for hgt files in: %s" % basedir)
Search for hgt files in: foo
>>>
[dan@eagle ~]$ python2
Python 2.7.5 (default, Feb 19 2014, 13:47:28)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> basedir="foo"
>>> print("Search for hgt files in: %s" % basedir)
Search for hgt files in: foo
>>>
Dan
>
>
>
> > On Mon, 07 Apr 2014 18:43:54 +0200
> >
> > Oliver Eichler <[email protected]> wrote:
> > > Well it's not quite the same.
> > >
> > > >>> x =
> > > >>> "sdsds" print("xxx",
> > > >>> x)
> > >
> > > ('xxx', 'sdsds')
> > >
> > > But on second thought, it won't hurt either. I'll change it.
> >
> > or maybe
> >
> > diff --git a/srtmconvert.py b/srtmconvert.py
> > index 95f63cb..638bd0d 100644
> > --- a/srtmconvert.py
> > +++ b/srtmconvert.py
> > @@ -13,7 +13,7 @@ def find_hgt(basedir):
> > @param basedir : Directory to start search for files.
> > @return List of strings with full path to hgt files.
> > """
> > - print 'Search for hgt files in:', basedir
> > + print("Search for hgt files in: %s" % basedir)
> > hgtfiles = []
> > for root, _dirs, files in os.walk(basedir, topdown=False):
> > for name in files:
> >
> >
> > tested even in 2.4
> >
> >
> > Dan
> >
> > > Oliver
> > >
> > > > On Mon, 07 Apr 2014 18:20:11 +0200
> > > >
> > > > Oliver Eichler <[email protected]> wrote:
> > > > > Hi Dan,
> > > > >
> > > > > but that will break the script for all Python 2.X users :) As
> > > > > this is more an inofficial add-on I think I leave it for
> > > > > Python 2.X just for a bit longer.
> > > >
> > > > AFAIK the print() syntax is supported in the 2.x series too,
> > > > I've tested 2.6 and 2.7 and it works there, so I guess the
> > > > change could be committed.
> > > >
> > > > Dan
> > > >
> > > > > Oliver
> > > > >
> > > > > > Oliver,
> > > > > >
> > > > > > I did run the 2to3 python conversion tool on srtmconvert.py
> > > > > > and the result is only the following change
> > > > > >
> > > > > > diff --git a/srtmconvert.py b/srtmconvert.py
> > > > > > index 95f63cb..1deb979 100644
> > > > > > --- a/srtmconvert.py
> > > > > > +++ b/srtmconvert.py
> > > > > >
> > > > > > @@ -13,7 +13,7 @@ def find_hgt(basedir):
> > > > > > @param basedir : Directory to start search for files.
> > > > > > @return List of strings with full path to hgt files.
> > > > > > """
> > > > > >
> > > > > > - print 'Search for hgt files in:', basedir
> > > > > > + print('Search for hgt files in:', basedir)
> > > > > >
> > > > > > hgtfiles = []
> > > > > >
> > > > > > for root, _dirs, files in os.walk(basedir,
> > > > > > topdown=False): for name in files:
> > > > > > Dan
> > > > > >
> > > > > > --------------------------------------------------------------------
> > > > > > ----
> > > > > > ---- -- _______________________________________________
> > > > > > Qlandkartegt-users mailing list
> > > > > > [email protected]
> > > > > > https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users
>
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users