• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2689)  |  Call(2592)  |  Derive(0)  |  Import(97)
atoi(s [,base]) -> int

Return the integer represented by the string s in the given
base, which defaults to 10.  The string s must consist of one
or more digits, possibly preceded by a sign.  If base is 0, it
is chosen from the leading characters of s, 0 for octal, 0x or
0X for hexadecimal.  If base is 16, a preceding 0x or 0X is
accepted.

        def atoi(s , base=10):
    """atoi(s [,base]) -> int

    Return the integer represented by the string s in the given
    base, which defaults to 10.  The string s must consist of one
    or more digits, possibly preceded by a sign.  If base is 0, it
    is chosen from the leading characters of s, 0 for octal, 0x or
    0X for hexadecimal.  If base is 16, a preceding 0x or 0X is
    accepted.

    """
    return _int(s, base)
        


src/p/k/pksampler-HEAD/pk/stereo/PyCDDB.py   pksampler(Download)
    def query(self, discid):
        if discid != "":
            result = []
            self.track_offset = map(string.atoi, string.split(discid)[2:-1])
            self.disc_length = string.atoi(string.split(discid)[-1:][0]) * 75
            query = urllib.quote_plus(string.rstrip(discid))
            url = "%s?cmd=cddb+query+%s&hello=%s+%s+%s+%s&proto=%d" % \
                  (self.cddb_server, query, self.user, self.host, self.app,
                   self.version, self.protocol)
            response = urllib.urlopen(url)
            header = response.readline()
            if re.match("[0-9]+.*", header):
                self.code = string.atoi(string.split(header, ' ', 1)[0])
               self.user, self.host, self.app, self.version, self.protocol)
        response = urllib.urlopen(url)
        header = response.readline()
        self.code = string.atoi(string.split(header, ' ', 1)[0])
        if self.code == 210:
            re_indexed_key = re.compile("([^=0123456789]+)([0-9]+)=(.*)")
            re_key = re.compile("([^=]+)=(.*)")

src/m/a/matplotlib-HEAD/py4science/book/examples/WindowLevelInterface.py   matplotlib(Download)
    def SetSlice(self,slice):
        self.viewer.SetZSlice(string.atoi(slice))
        self.viewer.Render()
 
    def SetWindow(self,window):
        if string.atoi(self.getvar('video')):
            self.viewer.SetColorWindow(-string.atof(window))
    def SetInverseVideo(self):
        if string.atoi(self.getvar('video')):
            self.viewer.SetColorWindow(-string.atof(self.getvar('window')))
        else:
            self.viewer.SetColorWindow(string.atof(self.getvar('window')))
        self.viewer.Render()
 

src/m/a/matplotlib-HEAD/course/examples/WindowLevelInterface.py   matplotlib(Download)
    def SetSlice(self,slice):
        self.viewer.SetZSlice(string.atoi(slice))
        self.viewer.Render()
 
    def SetWindow(self,window):
        if string.atoi(self.getvar('video')):
            self.viewer.SetColorWindow(-string.atof(window))
    def SetInverseVideo(self):
        if string.atoi(self.getvar('video')):
            self.viewer.SetColorWindow(-string.atof(self.getvar('window')))
        else:
            self.viewer.SetColorWindow(string.atof(self.getvar('window')))
        self.viewer.Render()
 

src/b/a/badger-lib-HEAD/packages/gdata/samples/mashups/birthdaySample.py   badger-lib(Download)
 
    title = "%s's Birthday!" % name
    content = "It's %s's Birthday!" % name
    month = string.atoi(birthday.split("/")[0])
    day = string.atoi(birthday.split("/")[1])
 
    # Get current year
    year = time.ctime()[-4:]
    year = string.atoi(year)

src/p/o/polinax-HEAD/libs/external_libs/gdata.py-1.0.13/samples/mashups/birthdaySample.py   polinax(Download)
 
    title = "%s's Birthday!" % name
    content = "It's %s's Birthday!" % name
    month = string.atoi(birthday.split("/")[0])
    day = string.atoi(birthday.split("/")[1])
 
    # Get current year
    year = time.ctime()[-4:]
    year = string.atoi(year)

src/t/o/Toolserver-0.4.1/samples/ServerManager.py   Toolserver(Download)
import hashlib
from xml.sax.handler import ContentHandler
from thread import allocate_lock
from string import atof, atoi
 
from Toolserver.Tool import registerTool
from Toolserver.CRAMUtils import OnlyRPCCRAMTool
		file.close()
		return [self._createToken(),
			atof(load1), atof(load5), atof(load15),
			processes, atoi(maxpid)
		]
 
	loadavg_signature = ('typens:listResult', 'typens:cramToken')

src/b/a/badger-lib-HEAD/packages/gdata/samples/spreadsheets/spreadsheetExample.py   badger-lib(Download)
  def _ListUpdateAction(self, index, row_data):
    self.list_feed = self.gd_client.GetListFeed(self.curr_key, self.curr_wksht_id)
    entry = self.gd_client.UpdateRow(
        self.list_feed.entry[string.atoi(index)], 
        self._StringToDictionary(row_data))
    if isinstance(entry, gdata.spreadsheet.SpreadsheetsList):
      print 'Updated!'
 
  def _ListDeleteAction(self, index):
    self.list_feed = self.gd_client.GetListFeed(self.curr_key, self.curr_wksht_id)
    self.gd_client.DeleteRow(self.list_feed.entry[string.atoi(index)])

src/g/d/gdata-python-client-HEAD/samples/mashups/birthdaySample.py   gdata-python-client(Download)
 
    title = "%s's Birthday!" % name
    content = "It's %s's Birthday!" % name
    month = string.atoi(birthday.split("/")[0])
    day = string.atoi(birthday.split("/")[1])
 
    # Get current year
    year = time.ctime()[-4:]
    year = string.atoi(year)

src/g/o/google-data-api-HEAD/samples/mashups/birthdaySample.py   google-data-api(Download)
 
    title = "%s's Birthday!" % name
    content = "It's %s's Birthday!" % name
    month = string.atoi(birthday.split("/")[0])
    day = string.atoi(birthday.split("/")[1])
 
    # Get current year
    year = time.ctime()[-4:]
    year = string.atoi(year)

src/p/o/polinax-HEAD/libs/external_libs/gdata.py-1.0.13/samples/spreadsheets/spreadsheetExample.py   polinax(Download)
  def _ListUpdateAction(self, index, row_data):
    self.list_feed = self.gd_client.GetListFeed(self.curr_key, self.curr_wksht_id)
    entry = self.gd_client.UpdateRow(
        self.list_feed.entry[string.atoi(index)], 
        self._StringToDictionary(row_data))
    if isinstance(entry, gdata.spreadsheet.SpreadsheetsList):
      print 'Updated!'
 
  def _ListDeleteAction(self, index):
    self.list_feed = self.gd_client.GetListFeed(self.curr_key, self.curr_wksht_id)
    self.gd_client.DeleteRow(self.list_feed.entry[string.atoi(index)])

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next