SendText message on errors

Results 1 to 4 of 4

Thread: SendText message on errors

  1. #1
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default SendText message on errors

    Has anyone done a send text message on error function ? I did it in M3 and M4 and UCCNC but so far Python is a mystery to me. Not a programmer.

    (;-) TP

    Similar Threads:


  2. #2
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: SendText message on errors

    Hi Guys I am working on code to send a text message from PathPilot. I am tryin gthis code but I keep getting an error I do not know how to handle. It seems that Python is extremely indent sensitive ??

    Anyone know how to fix it.

    import smtplib

    smtpObj = smtplib.SMTP('smtp.EXAMPLE.com', 587)
    smtpObj.ehlo()
    smtpObj.starttls()
    smtpObj.login('y@EXAMPLE.com', ' PASSWORD')
    smtpObj.sendmail('F@EXAMPLE.com', 'T@EXAMPLE.com', 'Subject: Machine #29 , Broken ToolBit'){}
    smtpObj.quit()

    I get this error when I run the script in PP

    IndentationError: unexpected indent



  3. #3
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: SendText message on errors

    OK PP can now call home (;-) Just need to figue out how to control it and use it for error messages and to send a message to a supervisor from teh controller. Type in a message and push teh CALL button.

    (;-) TP



  4. #4
    Member
    Join Date
    Nov 2012
    Location
    United States
    Posts
    591
    Downloads
    0
    Uploads
    0

    Default Re: SendText message on errors

    Yeah, in Python, indentation matters.

    Code:
    if something:
        do_thing_one()
    do_thing_two()
    versus

    Code:
    if something:
        do_thing_one()
        do_thing_two()
    mean different things!
    (Also, tabs count as one space, so if you aren't consistent in whether you use space or tab, you'll be quite confused.)



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

SendText message on errors

SendText message on errors