Changes between Version 70 and Version 71 of ControlSystems/SoftwareTeam/IntroToPython


Ignore:
Timestamp:
Sep 4, 2017, 10:12:04 PM (8 years ago)
Author:
cdelgigante
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/IntroToPython

    v70 v71  
    287287Now that you seen the basics of the Python language, and have created your own functions.  Its time to see what else is out there.   It turns out there are A LOT of libraries out there for python that do pretty much everything you want, from advance machine intelligence, to 3D graphics, to yes controlling robots.  These libraries were created by others and are offered for free, and others may be offered at a cost.
    288288
    289 You can find these libraries by googling for with the term "<subject> python library".  For example "spell check python library".  This turns up [https://pythonhosted.org/pyenchant/ PyEnchant] which describes how to use and access the library.  There are probably others.
    290 
    291 To use it in code, you use the !`import` keyword in Python like so:  
     289You can find these libraries by googling for with the term "<subject> python library".  For example "spell check python library".  This turns up [https://pythonhosted.org/pyenchant/ PyEnchant] which describes how to use and access the library. There are probably others.
     290
     291To use it in code, you use the !`import` keyword in Python like so:
    292292
    293293{{
    294 
    295 #!python
    296 
     294#!python
    297295import enchant
    298 
    299 d=enchant.Dict("en_US")  # Selects the US english dictionary
    300 
    301 bad=check("Helo")
    302 
    303 good=check("Hello")
    304 
     296d=enchant.Dict("en_US")  # Selects the US english dictionary
     297bad=check("Helo") # Spell checks the given string, not correctly spelled, returns False
     298good=check("Hello")  # Correctly spelled word returns True
    305299}}
    306300
    307 It would be a enormous effort to create your own spell check library, so this saves a lot of time.   We'll be using this when we program robots because a lot of work has already been done.
    308 
     301It would be a enormous effort to create your own spell check library, so this saves a lot of time.   We'll be using this when we program robots because a lot of work has already been done.
     302
     303
     304----
    309305[[[wiki:ProgrammingReserve Programming]Archive | Programming Archive]]