ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi there i am hoping some one could help me out with a small problem i am in the process of learning python.I am trying to write an interactive programme,
This is a short example.
if s = raw_input ("hello whats your name? ")
if s=='carmel':
print "Ahh the boss,s wife"
What i would like to know is what if she dont write carmel she rights say carm short of me writing if s=='carm': on a new line is there a shorter way of doing this so i can cover all angles on how she might write her name.
Thanks nige
Thanks for your responses,i have signed up with "python list"
some times it takes a while to get an opinion from there,so i like to ask here as well.The programme i am attempting to write is going slowly but well.I am now trying to add a small amount of tk to it i copied the basics from a tutorial it goes like this.
from Tkinter import *
root = Tk()
w = Label(root, text="Congratulations you have made it this far,just a few more questions")
w.pack()
root.mainloop()
The problem i have is where i have wrote my text it fits it all on to 1 line.I need to know how to start a second line so i can add more text.I f any of you folks find yourself with nothing to do i would appreciate some feedback.
Thanks again, nige.
to start a second line is quite easy all you do,here is my example.
from Tkinter import *
root = Tk()
w = Label(root, text="Line 1 Congratulations you have made it this far,just\n what next")
w.pack()
root.mainloop()
You will notice all i added was where it says "text=" i added "line 1"
Then to continue my sentance on to a second line i added "\n " without the quotes.
Thanks nige
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.