Reputation: 820 Master
- Active Posts:
- 2,234 (0.94 per day)
- 23-December 08
- Profile Views:
- Last Active:
- Jun 18 2015 07:56 PM
- OS Preference:
- Who Cares
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
- Expert In:
Posts I've Made
Posted 9 Jun 2015you basically have to write a parser that will read it and intelligently substitute symbols. It's easy to make a simple one, but a robust one that will always work would take a bit more time and effort.
Posted 9 Jun 2015So, a couple of things. Firstly, I personally don't like printing in this style
print("ok,so the bill was " , bill , " thanks")because the commas add extra whitespace.
Secondly, this is perfectly acceptable
print("ok,so the bill was " + bill + " thanks")However, if 'bill' is not a string, it'll break, as the OP would have experienced.
The workaround for that would be
print("ok,so the bill was " + str(bill) + " thanks")which should work most of the time.
Granted, I don't particularly like any of these approaches. It's a shame no one ever wrote a handy Python String formatting tutorial that would walk you through how it works more properly. Maybe someday...
Posted 30 May 2015
def ball(x,y): gameDisplay.blit(ballImg,(ballx,bally))
There is no value called ballx or bally. However, there are values called x and y. Try
def ball(x,y): gameDisplay.blit(ballImg,(x,y))You make the same type of mistake numerous times, so you'll need to make a lot of changes to fix it.
Posted 30 May 2015It will let me to change the time to 30 mins back, e.g: from `1:30AM` to `1:00AM`. When I have the time `1:00AM`, it will not find the strings of `1:00AM` to change it to `12:30PM`. The reason for this is because I have two different type of `AM` and `PM`.
Can you please show me an example of how can I find the time between AM and PM before changing the strings in the object to the time that I actually want?
Sooo... you just want to know if the time is AM or PM? Like this?
if self.getControl(344).getLabel()[-2] == "P": #PM stuff else: #AM stuff
Honestly, I'm baffled as to what you're trying to ask.
Posted 28 May 2015i don't think anyone, at any point, advocated writing a class for this. Are you just copying and pasting stuff you find online? You can't be a programmer if you don't understand what these statements are doing. Read a book, like this one, if you want to start advancing your skills. Right now, you're setting yourself up for complete failure.
- Member Title:
- Age Unknown
- October 24
- Forum Leader:
- Full Name:
- Years Programming:
- Programming Languages:
- Python, Java, C/C++, C#, VB.net, PHP, SQL