said:you could just do the following:print "\n\nWelcome to the Backwards Message Display."printmessage = raw_input("\nPlease Enter a Message.")print message[::-1]Interesting. I forgot about the 'step' option when slicing.This is the equivalent of print ''.join(reversed(messa...
Fred said:[snip]I've got another question I think you may have come across before.I'm planning on purchasing a license to use some stock icons in anapplication I'm developing. The problem is the license requires this:"Where an application is to be distributed, the graphical media...
>list() takes any iterable and returns a list object.Hmm, I did not know that the list(str) thing worked that way.That'll reducethe list comprehensions, but is it intuitive? Would a newbie see that andthink that list("Hi") returns ["Hi"] or ["H","i"] ?>reversedMessage = ''.j...
Liam said:How about -print "\n\nWelcome to the Backwards Message Display."printmessage = raw_input("\nPlease Enter a Message.")msgAsList = [ char for char in message]You could also do:msgAsList = list(message)list() takes any iterable and returns a list object.msgAsList.reverse()reversedMessage...
Hehe,Sounds like someone's license was designed for C/C MessageFrom: tutor-bounces (AT) python (DOT) org [mailto:tutor-bounces (AT) python (DOT) org] Behalf Fred LionettiSent: Friday, 18 November 2005 8:29 a.m.To: tutor (AT) python (DOT) orgSubject: [Tutor] compiled imagesHi everyone,Thanks...
I've used Boa Constructor's Designer to add widgets to a wx.Panel that willeventually be on a wx.Notebook page. However, after getting totally losttrying to use sizers in BC, I decided to add them manually. Here in modModel,py I have initiated a wx.Panel and widgets:class modModel(wx.P...
Hi everyone,Thanks everyone for the help with lambda expressions! Yoursuggestions and discussions were great!I've got another question I think you may have come across before.I'm planning on purchasing a license to use some stock icons in anapplication I'm developing. The problem...
Aha! That fixed the problem I was having where the TreeCtrl was notreturning the correct label text after being edited. Beautiful!Ron GriswoldCharacter TDR!T Picturesrgriswold (AT) rioting (DOT) com MessageFrom: jiwu liu [mailto:liujiwu (AT) msu (DOT) edu]Sent: Thursday, November 17, 2005 8:37 A...
Is there an easy way to slice the last set of characters off a string when Idon't know the length of the string? For example say I have a list of wordslikethisthoughweatherI want to get the last 2 characters from each. But so far nothing I havetried has seemed to work. Currently I am doing...
Blah brain freeze I saw my mistake as I hit send.It should just be word[-2:]So#!/usr/bin/pythonimport sysfor word in sys.argv[1:]:print word[-2:]Works now. Thanks! 11/17/05, Will Harris <mosinu (AT) gmail (DOT) comwrote:Is there an easy way to slice the last set of characters off a string whe...
Hello Alexander & NG,>Umm sorry that wasn't my mind. I really like your ANNs, especially your>NotebookCtrl can be really useful - images can show more the 1000 words.>And I'm sure that I'll use FoldPanelBar in one of my next apps.>if you think in this way, probably>...
Hi *,I have a listctrl centered inside a boxsizer, and when I resizethe window the list expands only on the right (yuk!), and I want it toexpand on both sides. def allUsers (self, data): box = wx.BoxSizer (wx.VERTICAL) list = wx.ListCtrl ( self.edit_panel, -1, style = wx.LC_REPRT | wx.SUNKEN_BRD...