Git Product home page Git Product logo

Comments (6)

benoit128 avatar benoit128 commented on August 22, 2024 1

Hello @antjost ,
I think the problem with your solution si that you wont get the alias "python"=python3 after that change.
Can you try another solution :

if [ "$PYTHONEXE" = "python3" ]; then
    pyversion="python"`python3 -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"`
    alias python=python3
else
    pyversion="python"`python -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"`
fi

instead of :

if [ "$PYTHONEXE" = "python3" ]; then
python() { python3 "$@"; }
export -f python
fi
pyversion="python"`python -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"`

Can you tell me if it works?
Thank you
a+

from cassiopee.

benoit128 avatar benoit128 commented on August 22, 2024

Does anybody knows how to quote code correctly here?

from cassiopee.

antjost avatar antjost commented on August 22, 2024

Hello @benoit128,
Thank you for the quick response.
I added the 'alias python=python3' higher up in the file. Similar to how it used to be when Cassiopee was in svn and I forgot to add it to the proposed bug fix.
The bug fix you proposed works.
For the quote: I used \ , as in \` .

pyversion="python"\`python3 -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"`

from cassiopee.

antjost avatar antjost commented on August 22, 2024

Does anybody knows how to quote code correctly here?

The circled option:
image
lets you chose Code block and then you can chose shell. see below for the results

if [ "$PYTHONEXE" = "python3" ]; then
    pyversion="python"`python3 -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"`
    alias python=python3
else
    pyversion="python"`python -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"`
fi

if you want to avoid all the clicking you can just do the following:
image

where you replace shell with the language you would like as seen below
image

from cassiopee.

vincentcasseau avatar vincentcasseau commented on August 22, 2024
alias python=python3

we removed the alias because it would not be defined in subshells without alias expansion.

from cassiopee.

benoit128 avatar benoit128 commented on August 22, 2024

Thank you for the tips on code quote.

@vincentcasseau : we can discuss that on monday.

from cassiopee.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.