his stack/heap is somehow getting altered from outside python (or
inside, I suppose)
So Mike, can you provide a screenshot of your code/execution? Sending it
directly (at least to me) will prevent it getting delayed while the
attachment is approved.
-Wayne
>
> On Mon, Jun 8, 2009 at 16
On Mon, Jun 8, 2009 at 10:53 AM, The Green Tea Leaf <
thegreenteal...@gmail.com> wrote:
> On Mon, Jun 8, 2009 at 17:26, Wayne wrote:
> > On Mon, Jun 8, 2009 at 10:07 AM, The Green Tea Leaf
> > wrote:
> >>
> >> Could it be some import statement? That the g
On Tue, Jun 9, 2009 at 6:34 AM, The Green Tea Leaf <
thegreenteal...@gmail.com> wrote:
> I got an email from him that he had a gzip.pyc file in that folder.
> Once he deleted that everything works OK.
Heh... I think I've made that mistake before;
"My import statement doesn't work right! When I
s what you have told it to do.
If it's the latter, I'm not sure what the problem is, unless it has
something to do with your debug level.
HTH,
Wayne
>
>
> Pointers, anyone?
>
> Thanks!
> Albert-Jan
>
> import smtplib, email.utils
> from email.mime.text im
at the BDFL would/has said.
/me wanders off to see what he can find...
-Wayne
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its enn
hat Popen
can't find the the file.
The other problem is that what you're thinking of really makes no sense.
Pygame doesn't need (and shouldn't) run a program "inside" the window. You
should have all of your game processes available to the main program and
when you
so the funtions.
> Please help me
check this out:
http://pyserial.wiki.sourceforge.net/pySerial
and there are plenty of tutorials online.
HTH,
Wayne
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every we
ime to really look over my code I find the
solution to my problem.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
7;t be a whole lot more complex
than that. And that's really the most simple example I could think of and
it's really not very good. For instance you could put the original code into
a "game" function and then call it if the choice was P.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
y dbs on my host, all I need is to
> be pointed in the right direction. Anyone?
>
It looks like it should be straightforward. I don't have the sqlobject
library installed though, so it complains to me.
Traceback (most recent call last):
File "C:\Documents and Settings\Wayne\My
JPG, for example, as a background?
>
I don't *think* the turtle module allows loading a jpg as a background, but
definitely allows you to draw a line.
Tkinter's canvas
PyGTK's DrawingArea
Pygame
pyglet
matplotlib
and even just using the PIL (Python Image(ing?) Library)
could all ac
ad the games
> images which couse this error is there a subprocess command to fix thisTried
> python.org btw
The last error specifically tells you what it is and what is wrong:
pygame.error: Couldn't open data\up-1-.png
it can't find that file. Are yo
On Wed, Jun 10, 2009 at 4:21 PM, Essah Mitges wrote:
>
> The problem I am have now is that once my game is initiated from the menu
> file the modules that are with cannot import the imagesthe folder looks like
> thisWODDSdataAll images and sound for gamegamelib
> ObjectsU
really only if you start switching to Python 3 that you'll
have a problem - specifically a lot of statements have turned into
functions... but that's a discussion for a different day :)
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ike something is wrong with the way I am redirecting stdin,
> but I have no idea what the problem is. Any suggestions gratefully received
>
I've not done much with subprocess, but I know you can use the
subprocess.PIPE to redirect stdin/stdout.
This may be of some help too,
http://www.oreillynet.com/onlamp/blog/2007/08/pymotw_subprocess_1.html
-Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
l the last part...
so what you might say is:
after the user enters a guess, if the number of guesses is over 5, then
check if the guess is correct. If the guess is correct, print "You win!" and
finish the game. Otherwise, print "You lose!" and ask the user if they would
like to try again.
Now see if you can translate that into code.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
it
> to install this program". What should i do? I am new in python.
>
>
Do you have administrator privileges on your Windows box? If not, you need
to get your system administrator to install python for you. Nothing to do
with Python, everything to do with Windows.
HTH,
Wayne
--
To be c
ime today I'll
have to try that.
-Wayne
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation
ith
and enjoy. And of course I believe that everyone should enjoy vim ;)
But you should give all the aforementioned tools a try and see what works
best for you.
HTH!
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
hat's probably the case for a few people - and certainly the
reason those tools exist in the first place. If I were working on a quite
large program I might consider using an IDE, but in reality I'm probably
just as comfortable jumping around code to look for the information I need
as
;
Python has a slice operator the colon, so mystr[0] gives me the character at
0, and mystr[1:] gives me everything from the first character to the end (if
you add something after the colon it will only return whatever is up to that
point:
In [10]: mystr[2:5]
Out[10]: '
hard to use a real mouse for anything except graphics
editing. The mouse wins there, and gaming, and that's really it for me.
-Wayne
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every
in the other? Do you have an audio
file you want to link with a video file?
If you can give us a good idea about what you want, you will likely get a
helpful response.
-Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
s
them in a big-endian (most important) first, or without reverse if I wanted
the least important value. This assumes that you can't have two values of
the same weight, of course.
If you're looking for speed, I'd look at timeit:
http://docs.python.org/l
[23]: int('Man', 2)
---
ValueErrorTraceback (most recent call last)
/home/wayne/ in ()
ValueError: invalid literal for int() with base 2: 'Man'
Or do you mean this?
In [24]: mystr = 'some
# 255
34.
35. print
36.
37. # check the exceptions
38. print Denary2Binary(0)
39. print Denary2Binary(-5) # should give a ValueError
from http://www.daniweb.com/code/snippet285.html#
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
window:
f = open('somefile.txt', 'r')
for line in f.readlines():
print line
Just translate that.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
add that (or substitute xrange) to the loop:
for i in xrange(len(msg)-1, -1,-1): print msg[i]
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
is:
http://www.siber-sonic.com/mac/charsetstuff/Soniccharset.html
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
extend(range(3, itemsin+1,2))
Which would save you at least half the time in your generation. Since your
first step should be removing multiples of two, that should be a big help.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
mydict.get('spam')
In [99]: mydict.get('knights')
Out[99]: 'say ni'
In [100]: if mydict.get(3):
.: print 'Hi'
.:
.:
In [101]: if mydict.get('death'):
.: print mydict['death']
.:
.:
pointy teeth
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
lbl.config(text='Bar'))
Am I missing something essential here? Or is this a bug that nobody has
encountered yet?
I appreciate any help!
TIA,
Wayne
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: ev
)
I used a program called AxCrypt ( http://www.axantum.com/AxCrypt/ ) that
seemed to work alright.
If you want the most basic encryption you could simply XOR the file. It's
fairly easy to break, though, because the same character patterns will be
present as with your original file.
HTH,
er formatting (or use variables in place of
string constants... of course some of us know that string objects really are
references to constant strings...) - you just have to add %% where you want
the final one:
In [45]: 'some numbers %%.%sd' % 8 % 4
Out[45]: 'some numbers 0004'
can define functions, classes, etc.
you call them as whatever.function(), unless you say
from module import * - then it willl import everything into the namespace of
your original file.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
the namespaces name for the object it's useless because there's nothing you
can do with it. (And really it shouldn't be the responsibility of an outside
function to modify the value of a variable anyway! It's also bad from a data
security POV. You don't want functions messing with your data just by
accident)
Anyway... that's as far as I've been taught (and taught myself)... anyone
notices any errors, please correct them!
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Oops, forgot my reply-to-all
On Tue, Jun 30, 2009 at 2:20 PM, Wayne wrote:
> On Tue, Jun 30, 2009 at 1:06 PM, Bob Rea wrote:
>
>>
>> If I input my own name and dob, it works:
>> b...@gandalf:~/python/MakingUse/Chapter05> python code1.py
>> Enter your first n
right after line 4 or right after line 11. When you're incrementing a value
it's best to do it at the beginning or end of a loop. (and certainly never
in between an if and else!)
So with this in mind, what could you do once it prints "Password confirmed"
to make sure t
uitous 'Why?'
Normally I would lean towards the first method because reassigning a value
in a list seems more natural than string concatenation. In this particular
application I'm not exactly worried about performance - on even an archaic
computer I don't think one would notice.
On Thu, Jul 16, 2009 at 5:50 AM, Kent Johnson wrote:
> On Thu, Jul 16, 2009 at 4:29 AM, Wayne wrote:> I have
> two different ways I can put _ in the word:
> > word = 'cat'
> >
> > ''.join(list(word)[1] = '_')
>
> Not in any Pyt
f one
single reason that it would be a) a good idea, or b) necessary. Of course I
may be wrong and there is a single reason, but your case is not it.
> Whatever code could make this happen I could loop through it several
times, create various array names, and when the operator > > wa
eserve the log from the previous run), seek to the
beginning and write whatever is in the lines. Each time I add a line I'd
check len(lines) > 1000: del(lines[0]), then write the lines and seek back
to the front of the file.
I don't know if
On Fri, Jul 17, 2009 at 5:10 PM, wrote:
>
>
> On Fri Jul 17 17:51 , Wayne sent:
>
> >On Fri, Jul 17, 2009 at 1:55 PM, wrote:
> >
> >
> >
> >
> >I have a form and script that works. I can enter values into the fields,
> however
> >
&g
about the pyweek games is when you download them you can
examine the source code so you can see exactly how many lines of code went
into writing the games.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ee if you can make the
program stop once the user makes it to 21.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
r own
method to read a few kilobytes at a time, you can easily update a status
bar. Otherwise if you know the file it's downloading to (i.e. not a temp
file) you could continually call os.stat to update the status bar
(especially if you know the size it's sup
erver's policy forbids it.
> Perhaps I need to chdir on the local host?
That shouldn't make a difference as far as getting the file is concerned -
unless you're trying to put it in a file on your computer that doesn't
exist!
I'd really recommend playing around in the interpreter - especially if you
have ipython.
Good luck, HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
usually need to crteate collection
> classes, we can just use a standard collection type. Maybe File would be
> better although it could be confused with a comuter file... Maybe Record
> would be best?
If the candidate can file reports, p
On Wed, Jul 22, 2009 at 3:33 PM, Sander Sweers wrote:
> 2009/7/22 Dave Angel :
> > Anyone else seeing these?
>
> Unfortunately yes. Very annoying... :(
Yep, and not the only ones I've seen
___
Tutor maillist - Tutor@python.org
http://mail.python.org/
id to the middle. I don't know any of
the pygame methods, but here's what it might look like:
def draw_pixel(x, y):
w = screen.get_width()
h = screen.get_height()
screen.draw_pixel(w/2+x, h/2+y)
That should give you what you need. It starts right in the middle of the
screen (w/2
a lot easier to use than some of the
bigger GUIs, like GTK, but it also sacrifices a lot of features to go with
that simplicity.
A couple of folks on this mailing list have python tutorials that are
certainly worth a read.
HTH,
Wayne
___
Tutor mai
Any feedback is appreciated.
>
There's a spot in your code that could be turned into a function. I'm not
sure what you'd call it, but where you "lay down" 1-4 cards. Since you're
doing the same thing for each stack, you may as well turn
2, do you want it to return nothing? Or
both 192.168.1.1 and 192.168.1.10? Or only 192.168.1.1 as it's the closest
match?
Also, I don't know if I'd do re.compile on the raw sys.argv data, but
perhaps filter it - just compiling is error prone and possibly a security
hole. Even
ile)
This goes back to pythons objects. If something is an object in python, you
can probably pass it to help(), otherwise you need to pass a string.
>>> operator = 'foo'
>>> help(operator)
Welcome to ASCII Assassin!
(1) Start Game
)]
for ip in iplist:
if ip.startswith(ipnet):
matches.append(ip)
and that should give you a list of all IPs within that same subnet.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
le
def xor_crypt_string(data, key):
return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(data, cycle(key)))
On the page provided someone also gave their code that can encrypt files.
Of course any of these methods presume you're just trying to keep the casual
snoop from getting a
l name '_Cripto__compress' is not defined
>
You're trying to call a method __compress which doesn't exist.
self.__compress exists, but __compress doesn't. HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
7;python', 'asdf.py'], stdout=subprocess.PIPE,
stdin=subpro
cess.PIPE)
p.stdin.write('\r\n')
print p.stdout.readlines()
- the contents of asdf.py are just these:
raw_input("Press enter to continue")
print "Works!"
HTH!
-Wayne, who just learned a little s
on/temp/theQuicktimeCommandTest.sh')
You really just want a while loop:
while imagecount >= framecount:
time.sleep(60)
# Call script here
I guess that's the easiest way. Probably not the most effective, but I'm not
sure if the implementation of an alternate solution w
Forgot reply-all
-- Forwarded message --
From: Wayne
Date: Thu, Aug 6, 2009 at 3:32 PM
Subject: Re: [Tutor] Noobish Syntay Error?
To: Anna - Sophie Maeser
On Thu, Aug 6, 2009 at 2:08 PM, Anna - Sophie Maeser <
annasop...@dautzenberg.org> wrote:
> Hi!
> I want
'll go and have a hunt in my MacOS books but sadly I don't have my iBook
> available just now to try anything.
I'm not sure if this will be of any help:
http://docs.python.org/library/carbon.html
http://sourceforge.net/projects/appscript/
But that's all I could come up wit
[r1, r2, r3]
(incidentally you could just do robots = [Robot(), Robot(), Robot()] ), and
lists don't have x y attributes, which you're trying to access. I presume
you're really trying to access the x y attributes of your Robot() class,
which is an entirely different object from your list.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
asiest thing - you'd probably have to use an os module call to check
the system to determine the proper course of action or something otherwise
technically advanced.
-Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ave images. IIRC that feature may be included in
matplotlib.
I don't know what other methods are available, but I'd probably do a quick
google search for the options.
-Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
iles" for some specific pointers. Are you
familiar with comma separated value (.csv) files? It's fairly trivial to
import those into a spreadsheet program, and if you're the one writing the
.csv it's not too difficult to get them written the right way.
HTH,
Wayne
>
>
&g
(which means I could write my own installer in the time it would take me to
learn these), or produce massive files (in the case of py2exe).
Does anyone know of any guides/resources, or are these my best bet?
Thanks,
Wayne
--
To be considered stupid and to be told so is more painful than being ca
r] >mainword[letter]:
return False
else:
return False
I think that should work. First you're looping over each letter in cmpword.
Because mainword is also a dictionary the order isn't terribly important.
Then you check if the letter is in mainword. If it's not, obviously cmpword
isn't in mainword, so return False. If the letter is, compare the counts. If
cmpword has more letters than mainword, it's not in the word so again return
False.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Mon, Aug 24, 2009 at 10:48 AM, kreglet wrote:
>
> Wayne,
>
> The reason I used print sorted is that using just print throws a syntax
> error:
>
> print (lettercount.iteritems(), key=itemgetter(1)) ---> error
> print lettercount.iteritems(), key=itemgetter(1
On Mon, Aug 24, 2009 at 8:58 PM, kreglet wrote:
>
> Wayne,
>
> > def myfunc(cmpword, mainword):
> > for letter in cmpword:
> > if mainword.gets(letter):
> > if cmpword[letter] >mainword[letter]:
> > return False
> >
On Tue, Aug 25, 2009 at 2:14 PM, kreglet wrote:
>
> Wayne,
> I appreciate your patience with me. I still can't get this to work:
>
>
> from operator import itemgetter
> class testwords:
> def __init__(self):
>
following code evaluates as expected, indeed.
>
> def fone():
> ftwo()
> def ftwo():
> print "hello"
> fone()
Try it with a class definition instead:
In [1]: class One:
...: Two()
...:
...:
-----
o the location on disk. AFAIK it's the
latter, in which case opening the file and seeking to the correct place,
reading a specific size, and saving that data would be all you need to do.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
T
y flexible or permanent?
A bit more info would be helpful in finding a solution.
-Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ach incoming integer to the closest one available. I know,
> it is idiosyncratic. I also need to be able to do this with other
> idiosyncratic gap toothed sets.
I think the simplest way is to use a dictionary. You could, of course, use a
sort to fi
t following the tutorials you can pretty much
figure out everything you need to know. It's basically a simplified version
of C++.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
, 2
and I'm wondering if there are any included ways to sort data like this.
I've currently got a 2d list by columns, but I could easily convert that to
rows if it would work better.
I'm about to check if sorting a list of lists will work in that fashion.
Thanks for any help/advice
On Sun, Sep 13, 2009 at 7:27 AM, Rich Lovely wrote:
> 2009/9/13 Lie Ryan :
> > Wayne wrote:
> >>
> > if your data is like this:
> > mylist = [
> >[3, 2, 4, 1],
> >[4, 1, 2, 3],
> >[3, 1, 2, 1],
> >[2, 1, 1, 1],
> >
nput() made things work, so I think it's the implicit eval().
On python3 they changed input to work like raw_input, or am I mistaken?
But as I test, my 2.6 gives an identical error so I'm suspecting there's a
problem with that shebang line. I also suspect if the OP puts
import pl
x27;t defined here. I think you should be declaring a self.btnStat
in the __init__ method (which I usually put as the first function in my
class - I'm honestly not sure if it makes a difference), and calling
self.btnStat
Unlike C/C++, python is explicit when dealing with mem
s (on Ubuntu):
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/wayne/.bin
I don't remember the syntax for adding files to the path, but a quick google
search should yield plenty of results.
HTH,
Wayne
___
Tutor maillist
helloworld.py (or whatever the filename is)
You also need the "shebang" line at the top:
#!/usr/bin/env python
is one of the variations.
HTH,
Wayne
(included the list in reply... Hit reply-all when replying to list)
--
To be considered stupid and to be told so is more painful tha
ly because of the rather extensive documentation. I've
used both Tkinter and PyGTK and the latter is much easier to deal with when
using images, though YMMV.
The most difficult task would be analyzing the image and possibly some of
the graph generation.
HTH,
Wayne
___
I think you forgot to hit Reply-all, so forwarding on to the list with my
response
On Mon, Oct 5, 2009 at 11:38 AM, Nicola De Quattro <
lead.express...@gmail.com> wrote:
> Wayne ha scritto:
>
>> The most difficult task would be analyzing the image and possibly some of
>&
ribly clear or makes much sense, it's a bit of a
difficult concept to wrap my head around, but I *think* I've got it.
Hopefully you can get it, too,
Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
have
issues.
For beginning there's probably nothing wrong with 3.1, but I think I'd
recommend sticking with 2.6.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
"if not returncode == 0"
> shows clearer what is going on than "if returncode".
>
If it's checking the returncode against a value, Vern makes a good point:
if returncode != 0 makes a whole lot more sense than "if not returncode ==
0"
Though when dealing
popped into my mind :)
I kinda hopped around to various tutorials, especially since I've programmed
before (and am a CS major), so a lot of the concepts were a bit easier for
me to grasp.
Alan's tutorial does a great job explaining a lot of concepts behind
programming in general and ties t
quot;
>> directive.
>>
>> Is there a prettier way or is this fine?
>
>
Is there anything wrong with using this?
import sys
if sys.version < '2.4':
sys.exit("Need at least Python 2.4")
AFAIK the string comparison is reliable
-Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby wrote:
> On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
> > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts >wrote:
> > if sys.version < '2.4':
> >sys.exit("Need at least Python 2.4")
On Tue, Oct 6, 2009 at 9:57 AM, Steve Willoughby wrote:
> On Tue, Oct 06, 2009 at 09:47:43AM -0500, Wayne wrote:
> > On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby
> wrote:
> >
> > > On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
> > > > On Tue,
case - checking a return code against zero, should it
still be considered unreliable? The only case that you are looking for
correctness is 0 == 0, any other case should evaluate as false, so I guess
the question is does python always optimize for zero? Any other optimization
is i
, just use a regex (google can give you explicit examples if
you don't want to make your own)
hth,
wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
t I haven't found the correct python module that
> does it ;)
>
The datetime module exists... you could easily write a function that does
something along the lines of:
def date_range(startdate, enddate):
#do something here to make a range of dates
though you may want to write a fu
try:
n1 = int(n1)
n2 = int(n2)
except ValueError:
print "Error! Cannot convert values to int!"
return n1+n2
Or do something similar.
HTH,
Wayne
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious,
tion if you get stuck.
For an explanation of /how/ to ask a good question, check out this:
http://catb.org/~esr/faqs/smart-questions.html#examples
HTH,
Wayne
>
> Here's my code:
>
> class Ship(object):
>"""A spaceship"""
>to
much as windows/linux. IIRC, Linux only
uses a newline, while windows uses a CRLF. There's the dos2unix util:
http://linuxcommand.org/man_pages/dos2unix1.html
that may help.
-Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
these for?
I haven't read the book, but I'm sure Dawson gives a good explanation of if
statements and loops.
HTH,
Wayne
--
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every
PyQt seem to
> have a reasonable learning curve for this application?
>
I've never used PyQT so I don't know about that. I mainly use PyGTK+, but
for something this simple I'd just use Tkinter.
HTH,
Wayne
___
Tutor maillist
e aggressively come summer of '10.
HTH,
Wayne
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
e, 25), so
I would have:
mask = 'secretsecretsecretsecrets'
The way I'm currently doing it is:
mask = mask * (len(message)/len(mask))
for l, m in zip(message, mask):
word += chr(ord(l) ^ ord(m))
but I'm wondering if there are any easier/more pythonic ways.
Thanks,
Wayne
--
To be consid
1 - 100 of 893 matches
Mail list logo