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
#1
Hello Everybody,

This is my first script, and I am looking for advice...

I am trying to get the variable "response" to populate in another variable called body.

You can see here what I'm trying to do. I tried the following

def get_hostname():
    response = raw_input("Please enter your name: ")
	body = '[{"hostname": "response"}]'
...and...

def get_hostname():
    response = raw_input("Please enter your name: ")
	body = '[{"hostname": "print(response)"}]'
And I tried other variations but I can't seem to find the right way to do this.

Any help would be appreciated.
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