~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Doc/library/turtle.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
322
322
 
323
323
   :param y: a number (integer or float)
324
324
 
325
 
   Set the turtle's first coordinate to *y*, leave second coordinate
326
 
   unchanged.
 
325
   Set the turtle's second coordinate to *y*, leave first coordinate unchanged.
327
326
 
328
327
   >>> turtle.position()
329
328
   (0.00, 40.00)
1563
1562
 
1564
1563
   Subclass of TurtleScreen, with :ref:`four methods added <screenspecific>`.
1565
1564
 
1566
 
   
 
1565
 
1567
1566
.. class:: ScrolledCavas(master)
1568
1567
 
1569
1568
   :param master: some Tkinter widget to contain the ScrolledCanvas, i.e.
1588
1587
   "compound"  ``None`` (a compund shape has to be constructed using the
1589
1588
               :meth:`addcomponent` method)
1590
1589
   =========== ===========
1591
 
                
 
1590
 
1592
1591
   .. method:: addcomponent(poly, fill, outline=None)
1593
1592
 
1594
1593
      :param poly: a polygon, i.e. a tuple of pairs of numbers
1595
1594
      :param fill: a color the *poly* will be filled with
1596
1595
      :param outline: a color for the poly's outline (if given)
1597
 
     
 
1596
 
1598
1597
      Example:
1599
1598
 
1600
1599
      >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
1638
1637
 
1639
1638
     >>> help(Screen.bgcolor)
1640
1639
     Help on method bgcolor in module turtle:
1641
 
    
 
1640
 
1642
1641
     bgcolor(self, *args) unbound turtle.Screen method
1643
1642
         Set or return backgroundcolor of the TurtleScreen.
1644
 
    
 
1643
 
1645
1644
         Arguments (if given): a color string or three numbers
1646
1645
         in the range 0..colormode or a 3-tuple of such numbers.
1647
 
    
1648
 
    
 
1646
 
 
1647
 
1649
1648
           >>> screen.bgcolor("orange")
1650
1649
           >>> screen.bgcolor()
1651
1650
           "orange"
1652
1651
           >>> screen.bgcolor(0.5,0,0.5)
1653
1652
           >>> screen.bgcolor()
1654
1653
           "#800080"
1655
 
    
 
1654
 
1656
1655
     >>> help(Turtle.penup)
1657
1656
     Help on method penup in module turtle:
1658
 
    
 
1657
 
1659
1658
     penup(self) unbound turtle.Turtle method
1660
1659
         Pull the pen up -- no drawing when moving.
1661
 
    
 
1660
 
1662
1661
         Aliases: penup | pu | up
1663
 
    
 
1662
 
1664
1663
         No argument
1665
 
    
 
1664
 
1666
1665
         >>> turtle.penup()
1667
1666
 
1668
1667
- The docstrings of the functions which are derived from methods have a modified
1670
1669
 
1671
1670
     >>> help(bgcolor)
1672
1671
     Help on function bgcolor in module turtle:
1673
 
    
 
1672
 
1674
1673
     bgcolor(*args)
1675
1674
         Set or return backgroundcolor of the TurtleScreen.
1676
 
    
 
1675
 
1677
1676
         Arguments (if given): a color string or three numbers
1678
1677
         in the range 0..colormode or a 3-tuple of such numbers.
1679
 
    
 
1678
 
1680
1679
         Example::
1681
 
    
 
1680
 
1682
1681
           >>> bgcolor("orange")
1683
1682
           >>> bgcolor()
1684
1683
           "orange"
1685
1684
           >>> bgcolor(0.5,0,0.5)
1686
1685
           >>> bgcolor()
1687
1686
           "#800080"
1688
 
    
 
1687
 
1689
1688
     >>> help(penup)
1690
1689
     Help on function penup in module turtle:
1691
 
    
 
1690
 
1692
1691
     penup()
1693
1692
         Pull the pen up -- no drawing when moving.
1694
 
    
 
1693
 
1695
1694
         Aliases: penup | pu | up
1696
 
    
 
1695
 
1697
1696
         No argument
1698
 
    
 
1697
 
1699
1698
         Example:
1700
1699
         >>> penup()
1701
1700
 
1871
1870
Changes since Python 2.6
1872
1871
========================
1873
1872
 
1874
 
- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and 
1875
 
  :meth:`Turtle.window_height` have been eliminated. 
1876
 
  Methods with these names and functionality are now available only 
 
1873
- The methods :meth:`Turtle.tracer`, :meth:`Turtle.window_width` and
 
1874
  :meth:`Turtle.window_height` have been eliminated.
 
1875
  Methods with these names and functionality are now available only
1877
1876
  as methods of :class:`Screen`. The functions derived from these remain
1878
 
  available. (In fact already in Python 2.6 these methods were merely 
1879
 
  duplications of the corresponding 
 
1877
  available. (In fact already in Python 2.6 these methods were merely
 
1878
  duplications of the corresponding
1880
1879
  :class:`TurtleScreen`/:class:`Screen`-methods.)
1881
1880
 
1882
 
- The method :meth:`Turtle.fill` has been eliminated. 
1883
 
  The behaviour of :meth:`begin_fill` and :meth:`end_fill` 
1884
 
  have changed slightly: now  every filling-process must be completed with an 
 
1881
- The method :meth:`Turtle.fill` has been eliminated.
 
1882
  The behaviour of :meth:`begin_fill` and :meth:`end_fill`
 
1883
  have changed slightly: now  every filling-process must be completed with an
1885
1884
  ``end_fill()`` call.
1886
 
  
 
1885
 
1887
1886
- A method :meth:`Turtle.filling` has been added. It returns a boolean
1888
1887
  value: ``True`` if a filling process is under way, ``False`` otherwise.
1889
1888
  This behaviour corresponds to a ``fill()`` call without arguments in