Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cant newline

4 REPLIES 4
Reply
Message 1 of 5
sherlockyeah79
508 Views, 4 Replies

cant newline

sherlockyeah79
Participant
Participant

Hi, my question is when I type "\tInsert tab \nInsert newline" in my script editor it cant show a new line.

Its result always is:

 

# Result: '\tInsert tab \nInsert newline' #

 

how to solve it?1613226699919.jpg

 

thank you!

0 Likes

cant newline

Hi, my question is when I type "\tInsert tab \nInsert newline" in my script editor it cant show a new line.

Its result always is:

 

# Result: '\tInsert tab \nInsert newline' #

 

how to solve it?1613226699919.jpg

 

thank you!

Labels (1)
4 REPLIES 4
Message 2 of 5
osidedan
in reply to: sherlockyeah79

osidedan
Advocate
Advocate

hmm. I tried the exact same thing and got the result you expected.  Might be a Maya or python version issue?
tab_new_line_test.png

To clarify, I am on Maya 2018 and Maya is using python 2.7.11. Hope that helps narrow it down!

hmm. I tried the exact same thing and got the result you expected.  Might be a Maya or python version issue?
tab_new_line_test.png

To clarify, I am on Maya 2018 and Maya is using python 2.7.11. Hope that helps narrow it down!

Message 3 of 5
sherlockyeah79
in reply to: osidedan

sherlockyeah79
Participant
Participant

Hi, thank you!

maybe it's Maya's version problem, mine is 2020.04 and python is 2.7.11

 

I tried to type print("\tInsert tab \nInsert newline") and showed the ideal resault.

Hi, thank you!

maybe it's Maya's version problem, mine is 2020.04 and python is 2.7.11

 

I tried to type print("\tInsert tab \nInsert newline") and showed the ideal resault.

Message 4 of 5
osidedan
in reply to: sherlockyeah79

osidedan
Advocate
Advocate

Nice! glad you found a work around.

 

Side note/fun fact, if you want your print statement to show up in the main UI as well, you can just add a comma after your print statement, and it will show up there (at least for 2018 maya, not sure if it is still the same for newer versions):

 

print_to_command_respose.png

 

print_to_command_response_output.png

0 Likes

Nice! glad you found a work around.

 

Side note/fun fact, if you want your print statement to show up in the main UI as well, you can just add a comma after your print statement, and it will show up there (at least for 2018 maya, not sure if it is still the same for newer versions):

 

print_to_command_respose.png

 

print_to_command_response_output.png

Message 5 of 5
sherlockyeah79
in reply to: osidedan

sherlockyeah79
Participant
Participant

I try it, its useful! thank u.

I try it, its useful! thank u.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report