fortran-lang / fprettify

auto-formatter for modern fortran source code
https://pypi.python.org/pypi/fprettify
Other
370 stars 76 forks source link

Run script #122

Open sindizzy opened 2 years ago

sindizzy commented 2 years ago

So I installed the latest Python and installed fprettify package. All was installed successfully. Now when I go to the Python terminal prompt it says:

fprettify C:\Users\Dude\Documents\Code\CP.F90 File "", line 1 fprettify C:\Users\Duede\Documents\Code\CP.F90 ^ SyntaxError: invalid syntax

So not sure what I'm doing wrong.

danielhollas commented 2 years ago

Are you on Windows? I think you need to launch fprettify from a command line, not from Python prompt.

sindizzy commented 2 years ago

Yes in windows 10. I tried both.

nbehrnd commented 2 years ago

@sindizzy The path after following the fprettify command might be too long.*)

Enter the the directory containing the Fortran file(s) to process with the command line (use of cd), then apply the utility locally (e.g., fprettify test.f90 or fprettify *.f90) on the current folder's content. This omits potential complications by forward/backward slashes. If using fprettify with an installation by pip (thus PyPi) for your standard CPython (or the portable WinPython) still fails, there apparently is a port to conda/miniconda (repository). Testing the installation with a minimal Fortran program may draw a base line, too.

*) On occasion, I observed difficulties to direct a program's action on a file if that file was too many levels away/the path pointing to the file to process was too quirky. Though this experience refers to Linux Debian 12/bookworm (perhaps more importantly, not limited to fprettify), maybe there equally is a similar implicit threshold in Windows as the operation system.

minimal.f90.zip