How to return text input into twilioHow to merge two dictionaries in a single expression?How do I check if a list is empty?How do I check whether a file exists without exceptions?How can I safely create a nested directory?How can I make a time delay in Python?How do I sort a dictionary by value?How to make a chain of function decorators?How to make a flat list out of list of listsHow do I list all files of a directory?Get the value in an input text box

What is my malfunctioning AI harvesting from humans?

I accidentally overwrote a Linux binary file

Are differences between uniformly distributed numbers uniformly distributed?

In a topological space if there exists a loop that cannot be contracted to a point does there exist a simple loop that cannot be contracted also?

Visa National - No Exit Stamp From France on Return to the UK

Different inverter (logic gate) symbols

AsyncDictionary - Can you break thread safety?

What are the conventions for transcribing Semitic languages into Greek?

How to mark beverage cans in a cooler for a blind person?

During the Space Shuttle Columbia Disaster of 2003, Why Did The Flight Director Say, "Lock the doors."?

Dropdowns & Chevrons for Right to Left languages

How can you evade tax by getting employment income just in equity, then using this equity as collateral to take out loan?

Was the 2019 Lion King film made through motion capture?

Why do oscilloscopes use SMPSes instead of linear power supplies?

Best gun to modify into a monsterhunter weapon?

Wherein the Shatapatha Brahmana it was mentioned about 8.64 lakh alphabets in Vedas?

Bitcoin successfully deducted on sender wallet but did not reach receiver wallet

As a 16 year old, how can I keep my money safe from my mother?

Why are Gatwick's runways too close together?

How are you supposed to know the strumming pattern for a song from the "chord sheet music"?

Understanding the point of a kölsche Witz

Withdrew when Jimmy met up with Heath

How does "Te vas a cansar" mean "You're going to get tired"?

Can a fight scene, component-wise, be too complex and complicated?



How to return text input into twilio


How to merge two dictionaries in a single expression?How do I check if a list is empty?How do I check whether a file exists without exceptions?How can I safely create a nested directory?How can I make a time delay in Python?How do I sort a dictionary by value?How to make a chain of function decorators?How to make a flat list out of list of listsHow do I list all files of a directory?Get the value in an input text box






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am relatively new to Kivy. I am trying to read a phone number that is entered into a text input within the "Emergency Contacts" button of my app. With that number, I would like to send a message using twilio. The message can be sent by pressing the "Call Family" button within the "View Heartrate" button. However, I am not too sure how to return the text input and a little guidance would really help.



from kivy.lang import Builder
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.clock import Clock
from kivy.uix.popup import Popup
from kivy.uix.textinput import TextInput
import random
from twilio.rest import Client

#twilio account info
#ACCOUNT SID AND TOKEN HERE. SORRY I CANT REALLY PROVIDE THEM

account_sid = '--------------'
auth_token = '------------'
client = Client(account_sid, auth_token)


Builder.load_string("""
<Bump@Button>:
font_size: 40
color: 1,1,1,1
size_hint: 0.8,0.4
background_color: 1,0,0,1

<Back@Button>:
text: 'back'
pos_hint: 'x':0,'y':0.9
size_hint: 0.2,0.1

<BoxLayout>:
font_size: 40
color: 1,0,1,1
background_color: 0,0,1,1

<menu>:
Bump:
text: "View Heart Rate"
pos_hint: "center_x": .5, 'center_y':.3
on_press: root.manager.current ='heartrate'
on_press: root.manager.transition.direction = 'left'

Bump:
text: "Emergency Contacts"
pos_hint: 'center_x': 0.5, 'center_y':0.7
on_press: root.manager.current = 'contact'
on_press: root.manager.transition.direction = 'left'
Label:
text: "Remity Biotechnologies"
pos_hint: 'center_x': 0.5, 'center_y':0.95


<heartrate>:
color: 1,1,1,1
Bump:
id: fam
text: "Call Family"
pos_hint: 'center_x':0.5,'center_y':0.7
on_press: root.schedule_event()

Label:
id: temp_label
font_size: 24
text: ''
pos_hint:'center_x':0.5,'center_y':0.3

Back:
on_press: root.manager.current = 'menu'
on_press: root.manager.transition.direction = 'right'

<contact>:
orientation: "vertical"
Label:
text: "Enter Emergency Contact"
pos_hint:'center_x':0.2,'center_y':0.75

BoxLayout:
height: "80dp"
size_hint_y: 0.1
TextInput:
size_hint_x: 20
Button:
text: "Save"
size_hint_x: 25
Back:
on_press: root.manager.current = 'menu'
on_press: root.manager.transition.direction = 'right'




<confirm@Popup>:
id: pop
size_hint: 0.2,0.2
title: 'Message Sent'
auto_dismiss: True

""")

class confirm(Popup):
pass

class menu(Screen):
def update(self,dt):
pass

class heartrate(Screen):
r = 0

def __init__(self, **kwargs): #initializes it to change im guessing
super(heartrate, self).__init__(**kwargs)
self.change = self.ids.temp_label

def update(self,dt): #update random number
self.r = str(random.randint(1,101))
print(self.r)
t = str(self.r)
self.change.text = t

def schedule_event(self, **kwargs):
#event that sends message and confirms message was sent
if 'fam' in self.ids:
message = client.messages
.create(
body="This is an automated message to let you know your son is showing signs of atrial fibrillation!",
from_='---------', #TWILIO PHONE NUMBER
to='---------' #NUMBER THAT THE USER ENTERS
)
print(message.sid)
c = confirm()
c.open()

class contact(Screen):
def update(self,dt):
pass


class ScreenManager(ScreenManager):

def update(self,dt):
self.current_screen.update(dt)

#screens screens screens
sm = ScreenManager()
sm.add_widget(menu(name='menu'))
sm.add_widget(heartrate(name='heartrate'))
sm.add_widget(contact(name='contact'))




class SimpleKivy4(App):

def build(self):
Clock.schedule_interval(sm.update,1)
return sm



if __name__ == "__main__":
SimpleKivy4().run()









share|improve this question






























    0















    I am relatively new to Kivy. I am trying to read a phone number that is entered into a text input within the "Emergency Contacts" button of my app. With that number, I would like to send a message using twilio. The message can be sent by pressing the "Call Family" button within the "View Heartrate" button. However, I am not too sure how to return the text input and a little guidance would really help.



    from kivy.lang import Builder
    from kivy.app import App
    from kivy.uix.screenmanager import ScreenManager, Screen
    from kivy.clock import Clock
    from kivy.uix.popup import Popup
    from kivy.uix.textinput import TextInput
    import random
    from twilio.rest import Client

    #twilio account info
    #ACCOUNT SID AND TOKEN HERE. SORRY I CANT REALLY PROVIDE THEM

    account_sid = '--------------'
    auth_token = '------------'
    client = Client(account_sid, auth_token)


    Builder.load_string("""
    <Bump@Button>:
    font_size: 40
    color: 1,1,1,1
    size_hint: 0.8,0.4
    background_color: 1,0,0,1

    <Back@Button>:
    text: 'back'
    pos_hint: 'x':0,'y':0.9
    size_hint: 0.2,0.1

    <BoxLayout>:
    font_size: 40
    color: 1,0,1,1
    background_color: 0,0,1,1

    <menu>:
    Bump:
    text: "View Heart Rate"
    pos_hint: "center_x": .5, 'center_y':.3
    on_press: root.manager.current ='heartrate'
    on_press: root.manager.transition.direction = 'left'

    Bump:
    text: "Emergency Contacts"
    pos_hint: 'center_x': 0.5, 'center_y':0.7
    on_press: root.manager.current = 'contact'
    on_press: root.manager.transition.direction = 'left'
    Label:
    text: "Remity Biotechnologies"
    pos_hint: 'center_x': 0.5, 'center_y':0.95


    <heartrate>:
    color: 1,1,1,1
    Bump:
    id: fam
    text: "Call Family"
    pos_hint: 'center_x':0.5,'center_y':0.7
    on_press: root.schedule_event()

    Label:
    id: temp_label
    font_size: 24
    text: ''
    pos_hint:'center_x':0.5,'center_y':0.3

    Back:
    on_press: root.manager.current = 'menu'
    on_press: root.manager.transition.direction = 'right'

    <contact>:
    orientation: "vertical"
    Label:
    text: "Enter Emergency Contact"
    pos_hint:'center_x':0.2,'center_y':0.75

    BoxLayout:
    height: "80dp"
    size_hint_y: 0.1
    TextInput:
    size_hint_x: 20
    Button:
    text: "Save"
    size_hint_x: 25
    Back:
    on_press: root.manager.current = 'menu'
    on_press: root.manager.transition.direction = 'right'




    <confirm@Popup>:
    id: pop
    size_hint: 0.2,0.2
    title: 'Message Sent'
    auto_dismiss: True

    """)

    class confirm(Popup):
    pass

    class menu(Screen):
    def update(self,dt):
    pass

    class heartrate(Screen):
    r = 0

    def __init__(self, **kwargs): #initializes it to change im guessing
    super(heartrate, self).__init__(**kwargs)
    self.change = self.ids.temp_label

    def update(self,dt): #update random number
    self.r = str(random.randint(1,101))
    print(self.r)
    t = str(self.r)
    self.change.text = t

    def schedule_event(self, **kwargs):
    #event that sends message and confirms message was sent
    if 'fam' in self.ids:
    message = client.messages
    .create(
    body="This is an automated message to let you know your son is showing signs of atrial fibrillation!",
    from_='---------', #TWILIO PHONE NUMBER
    to='---------' #NUMBER THAT THE USER ENTERS
    )
    print(message.sid)
    c = confirm()
    c.open()

    class contact(Screen):
    def update(self,dt):
    pass


    class ScreenManager(ScreenManager):

    def update(self,dt):
    self.current_screen.update(dt)

    #screens screens screens
    sm = ScreenManager()
    sm.add_widget(menu(name='menu'))
    sm.add_widget(heartrate(name='heartrate'))
    sm.add_widget(contact(name='contact'))




    class SimpleKivy4(App):

    def build(self):
    Clock.schedule_interval(sm.update,1)
    return sm



    if __name__ == "__main__":
    SimpleKivy4().run()









    share|improve this question


























      0












      0








      0








      I am relatively new to Kivy. I am trying to read a phone number that is entered into a text input within the "Emergency Contacts" button of my app. With that number, I would like to send a message using twilio. The message can be sent by pressing the "Call Family" button within the "View Heartrate" button. However, I am not too sure how to return the text input and a little guidance would really help.



      from kivy.lang import Builder
      from kivy.app import App
      from kivy.uix.screenmanager import ScreenManager, Screen
      from kivy.clock import Clock
      from kivy.uix.popup import Popup
      from kivy.uix.textinput import TextInput
      import random
      from twilio.rest import Client

      #twilio account info
      #ACCOUNT SID AND TOKEN HERE. SORRY I CANT REALLY PROVIDE THEM

      account_sid = '--------------'
      auth_token = '------------'
      client = Client(account_sid, auth_token)


      Builder.load_string("""
      <Bump@Button>:
      font_size: 40
      color: 1,1,1,1
      size_hint: 0.8,0.4
      background_color: 1,0,0,1

      <Back@Button>:
      text: 'back'
      pos_hint: 'x':0,'y':0.9
      size_hint: 0.2,0.1

      <BoxLayout>:
      font_size: 40
      color: 1,0,1,1
      background_color: 0,0,1,1

      <menu>:
      Bump:
      text: "View Heart Rate"
      pos_hint: "center_x": .5, 'center_y':.3
      on_press: root.manager.current ='heartrate'
      on_press: root.manager.transition.direction = 'left'

      Bump:
      text: "Emergency Contacts"
      pos_hint: 'center_x': 0.5, 'center_y':0.7
      on_press: root.manager.current = 'contact'
      on_press: root.manager.transition.direction = 'left'
      Label:
      text: "Remity Biotechnologies"
      pos_hint: 'center_x': 0.5, 'center_y':0.95


      <heartrate>:
      color: 1,1,1,1
      Bump:
      id: fam
      text: "Call Family"
      pos_hint: 'center_x':0.5,'center_y':0.7
      on_press: root.schedule_event()

      Label:
      id: temp_label
      font_size: 24
      text: ''
      pos_hint:'center_x':0.5,'center_y':0.3

      Back:
      on_press: root.manager.current = 'menu'
      on_press: root.manager.transition.direction = 'right'

      <contact>:
      orientation: "vertical"
      Label:
      text: "Enter Emergency Contact"
      pos_hint:'center_x':0.2,'center_y':0.75

      BoxLayout:
      height: "80dp"
      size_hint_y: 0.1
      TextInput:
      size_hint_x: 20
      Button:
      text: "Save"
      size_hint_x: 25
      Back:
      on_press: root.manager.current = 'menu'
      on_press: root.manager.transition.direction = 'right'




      <confirm@Popup>:
      id: pop
      size_hint: 0.2,0.2
      title: 'Message Sent'
      auto_dismiss: True

      """)

      class confirm(Popup):
      pass

      class menu(Screen):
      def update(self,dt):
      pass

      class heartrate(Screen):
      r = 0

      def __init__(self, **kwargs): #initializes it to change im guessing
      super(heartrate, self).__init__(**kwargs)
      self.change = self.ids.temp_label

      def update(self,dt): #update random number
      self.r = str(random.randint(1,101))
      print(self.r)
      t = str(self.r)
      self.change.text = t

      def schedule_event(self, **kwargs):
      #event that sends message and confirms message was sent
      if 'fam' in self.ids:
      message = client.messages
      .create(
      body="This is an automated message to let you know your son is showing signs of atrial fibrillation!",
      from_='---------', #TWILIO PHONE NUMBER
      to='---------' #NUMBER THAT THE USER ENTERS
      )
      print(message.sid)
      c = confirm()
      c.open()

      class contact(Screen):
      def update(self,dt):
      pass


      class ScreenManager(ScreenManager):

      def update(self,dt):
      self.current_screen.update(dt)

      #screens screens screens
      sm = ScreenManager()
      sm.add_widget(menu(name='menu'))
      sm.add_widget(heartrate(name='heartrate'))
      sm.add_widget(contact(name='contact'))




      class SimpleKivy4(App):

      def build(self):
      Clock.schedule_interval(sm.update,1)
      return sm



      if __name__ == "__main__":
      SimpleKivy4().run()









      share|improve this question














      I am relatively new to Kivy. I am trying to read a phone number that is entered into a text input within the "Emergency Contacts" button of my app. With that number, I would like to send a message using twilio. The message can be sent by pressing the "Call Family" button within the "View Heartrate" button. However, I am not too sure how to return the text input and a little guidance would really help.



      from kivy.lang import Builder
      from kivy.app import App
      from kivy.uix.screenmanager import ScreenManager, Screen
      from kivy.clock import Clock
      from kivy.uix.popup import Popup
      from kivy.uix.textinput import TextInput
      import random
      from twilio.rest import Client

      #twilio account info
      #ACCOUNT SID AND TOKEN HERE. SORRY I CANT REALLY PROVIDE THEM

      account_sid = '--------------'
      auth_token = '------------'
      client = Client(account_sid, auth_token)


      Builder.load_string("""
      <Bump@Button>:
      font_size: 40
      color: 1,1,1,1
      size_hint: 0.8,0.4
      background_color: 1,0,0,1

      <Back@Button>:
      text: 'back'
      pos_hint: 'x':0,'y':0.9
      size_hint: 0.2,0.1

      <BoxLayout>:
      font_size: 40
      color: 1,0,1,1
      background_color: 0,0,1,1

      <menu>:
      Bump:
      text: "View Heart Rate"
      pos_hint: "center_x": .5, 'center_y':.3
      on_press: root.manager.current ='heartrate'
      on_press: root.manager.transition.direction = 'left'

      Bump:
      text: "Emergency Contacts"
      pos_hint: 'center_x': 0.5, 'center_y':0.7
      on_press: root.manager.current = 'contact'
      on_press: root.manager.transition.direction = 'left'
      Label:
      text: "Remity Biotechnologies"
      pos_hint: 'center_x': 0.5, 'center_y':0.95


      <heartrate>:
      color: 1,1,1,1
      Bump:
      id: fam
      text: "Call Family"
      pos_hint: 'center_x':0.5,'center_y':0.7
      on_press: root.schedule_event()

      Label:
      id: temp_label
      font_size: 24
      text: ''
      pos_hint:'center_x':0.5,'center_y':0.3

      Back:
      on_press: root.manager.current = 'menu'
      on_press: root.manager.transition.direction = 'right'

      <contact>:
      orientation: "vertical"
      Label:
      text: "Enter Emergency Contact"
      pos_hint:'center_x':0.2,'center_y':0.75

      BoxLayout:
      height: "80dp"
      size_hint_y: 0.1
      TextInput:
      size_hint_x: 20
      Button:
      text: "Save"
      size_hint_x: 25
      Back:
      on_press: root.manager.current = 'menu'
      on_press: root.manager.transition.direction = 'right'




      <confirm@Popup>:
      id: pop
      size_hint: 0.2,0.2
      title: 'Message Sent'
      auto_dismiss: True

      """)

      class confirm(Popup):
      pass

      class menu(Screen):
      def update(self,dt):
      pass

      class heartrate(Screen):
      r = 0

      def __init__(self, **kwargs): #initializes it to change im guessing
      super(heartrate, self).__init__(**kwargs)
      self.change = self.ids.temp_label

      def update(self,dt): #update random number
      self.r = str(random.randint(1,101))
      print(self.r)
      t = str(self.r)
      self.change.text = t

      def schedule_event(self, **kwargs):
      #event that sends message and confirms message was sent
      if 'fam' in self.ids:
      message = client.messages
      .create(
      body="This is an automated message to let you know your son is showing signs of atrial fibrillation!",
      from_='---------', #TWILIO PHONE NUMBER
      to='---------' #NUMBER THAT THE USER ENTERS
      )
      print(message.sid)
      c = confirm()
      c.open()

      class contact(Screen):
      def update(self,dt):
      pass


      class ScreenManager(ScreenManager):

      def update(self,dt):
      self.current_screen.update(dt)

      #screens screens screens
      sm = ScreenManager()
      sm.add_widget(menu(name='menu'))
      sm.add_widget(heartrate(name='heartrate'))
      sm.add_widget(contact(name='contact'))




      class SimpleKivy4(App):

      def build(self):
      Clock.schedule_interval(sm.update,1)
      return sm



      if __name__ == "__main__":
      SimpleKivy4().run()






      python kivy twilio textinput






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 8:35









      Faisal ShahrilFaisal Shahril

      62 bronze badges




      62 bronze badges

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372812%2fhow-to-return-text-input-into-twilio%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55372812%2fhow-to-return-text-input-into-twilio%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript