Git Product home page Git Product logo

Comments (4)

docmarionum1 avatar docmarionum1 commented on June 5, 2024

Is it showing up with the line breaks in the string?

Something like:

"List of functions (and alternate names):\n1 ()\n1A ()\n1B (address)\n1E ()\n1N (street_name_to_street_code, get_street_code)\n2 (intersection)\n2W (intersections, intersection_wide)\n3 (street_segment)\n3C (blockface)\n3S (street_stretc
h)\nAP (address_point)\nBB (browse_back)\nBF (browse_forward)\nBL (bbl, tax_lot, lot)\nBN (bin, building)\nD (get_street_name)\nDG ()\nDN ()\nN* (normalize_street_name)\n\nCall a function using the function code or alternate name using G
eosupport.<function>() or Geosupport['<function>']().\n\nExample usage:\n    from geosupport import Geosupport\n    g = Geosupport()\n    # Call address using the alternate name.\n    g.address(house_number=125, street_name='Worth St', b
orough_code='Mn')\n    # Call function 3 using the function code.\n    g['3']({'borough_code': 'MN', 'on': '1 Av', 'from': '1 st', 'to': '9 st'})\n\nUse Geosupport.help(<function>) or Geosupport.<function>.help() to read about specific f
unction."

If so, it's because the function just returns the string instead of printing it.

Calling print(geosupport.help()) displays it correctly for me.

from python-geosupport.

ishiland avatar ishiland commented on June 5, 2024

Yeah thats exactly what Im seeing. I guess I was a little unclear of the how the help should behave at the command line, also looks the same in Jupyter notebooks. Otherwise my IDE displays the line breaks correctly without calling print.

Im not sure if this is something worth pursuing, but the feature as a whole is great for an un-initiated user. At the very least it may be worth a simple readme update.

from python-geosupport.

docmarionum1 avatar docmarionum1 commented on June 5, 2024

I wonder if it's possible to detect when whether a user is on the command-line/in a jupyter notebook and change it to print automatically?

I agree, I find it annoying that when I'm using it, it will not display correctly unless I use print. But I didn't want to make it impossible to use the help programatically.

Maybe printing by default but having a parameter to return instead?

def help(return_as_string=False):
    if return_as_string:
       return ...
    else:
        print(...)

from python-geosupport.

ishiland avatar ishiland commented on June 5, 2024

looks good, I think that should do it

from python-geosupport.

Related Issues (20)

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.