Python Forum
My First Script - Looking For Help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My First Script - Looking For Help
#2
This section if for completed scripts.

However...
I presume that you want this:

def get_hostname():
    response = raw_input("Please enter your name: ")
    body = '[{"hostname": response}]' # without the quotes response will contain the input. Do you want body to be a string?
    return body
The print function returns None. Do not use it that way but just for output. Print is a function in Python 3. You are using raw_input which is deprecated in v3.x. Just input works the same way as raw_input in Python 3.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
My First Script - Looking For Help - by dsorci - May-08-2018, 05:52 PM
RE: My First Script - Looking For Help - by wavic - May-08-2018, 06:03 PM
RE: My First Script - Looking For Help - by buran - May-09-2018, 07:17 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020