hello i am a beginner programmer and i am planning a project that will take
a keyword enter that in google and start searching through links ans saving
web pages
if anyone can help or might know of any tutorials about:
writing to websites
searching links
creating files
and web spiders in general
does anyone know of a tutorial for finding links in a web site with python.
or creating files and asking ware to create a file.
thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
hello i am looking into writing a simple python port scanner but i cant find
any good tutorials online if anyone can help or knows of any tutorials that
could help it would be great. this would be my first program like this so i
might need a little extra help
thanks
_
thanks evryone for your help am starting on the project :)
On 6/25/07, János Juhász <[EMAIL PROTECTED]> wrote:
Dear dos,
>>hello i am looking into writing a simple python port scanner but i cant
find
>>any good tutorials online if anyone can help or knows of any tutorials
that
>>could help it
onary password tester"
__author__="max baseman ([EMAIL PROTECTED])"
__version__="0.1"
__discription__="tests a password against a dictonary"
#
print
print
password=raw_input("password >")
passlist=o
hello i am writing a population script and was wondering if i can just keep
writing to the same line instead of printing a new line every second
thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
thank you so much :)
On 7/10/07, Bob Gailer <[EMAIL PROTECTED]> wrote:
max . wrote:
> hello i am writing a population script and was wondering if i can
> just keep writing to the same line instead of printing a new line
> every second
import time
for i in range(5):
p
hello all sorry but i just cant seem to get my head around curses iv read a
few of the tuts out there and get what there saying but i cant write my own
if any one can point me in the right direction easer is better i only need
something very simple right now just writting and refreshing
thanks
__
i cant understand the open command i tried the help command but still
dont get i am trying to write twi programs one to keep track of money
phone numbers... and another to randomly print a statmint from a file
pleas dont just send a program i would like it if you could explain
the command so that
hello i cant understand how to open text files with python
i have tried tutorials and evrything i just cant get pleas help
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
first off i just started looking for Tkinter tutorials but havent found much
and what i have found was not very good if anyone knows og any Tkinter
tutorials pleas let me know
second is thair anyway to change the path that python looks for a program in
ex: if i enter python hello into the comm
hello i have a myspace and a blog both of wich allow me to input html and i
know a little html not much i can make a page with backround coler a title
words and pictures as well as links
but i cant find any tutorials on embedding python useing html i found some
that use c++ and i think one that
i am starting a small useless program i got from the show lost but cant find
a module on mac to make beeping noises i know windows has winsound *never
used it but heard about it* but eather way is thair anything like winsound
for mac
^_^" s33 y4
_
read your file in as a dictionary. You can
then do searches through lists of the keys:
mydict = LoadConfig(file.ini)
for key in mydict.keys():
if re.search(key,"_at"): do_something(mydict[key])
Given the size of the file, I don't think that's a good idea...
-- Max
m
x27;s probably cleaner.
(and yes, there are some versions of cron for Windows -- I don't know
where they can be found, but I used one called nnCron Lite at my job
this summer)
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bon
o implement and more intuitive (not to mention way
faster to both input and compute) once you've gotten the hang of it.
You can probably do a very basic RPN calculator in less than a hundred
lines of code, using raw_input() and a stack (well, a list's append()
and pop() methods).
-- Max
max
d try replacing your first line with
"#!/usr/bin/env python" , and see what happens.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How
lculators are concerned, you don't have a
choice anymore -- HP stopped producing calculators a few years ago,
having basically done nothing in 15 years to improve the design of the
48/49 series. A shame, really. I call it the "Commodore effect".
P.S.
Nice Shodan quote Max ;)
- [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
#!/usr/bin/env python
import sre
reStart = sre.compile('^\s*\')
reEnd = sre.compile('\\s*$')
inBlock = False
fileSource = open('foobar.txt')
for line in fileSource:
if reStart.match(line): inBlock =
uot; means. Can someone help?
Basically, when you try to execute your first line, the program tries
to call the function 2 on the argument (a**3.0). Which of course fails,
because 2 is an int, not a "callable" object (function, method, lambda
or class). Hence "'int' obj
irrelevant as I would be
better off trying some other approach altogether?
Can we see your code for the *GlassCost classes?
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my cor
On Dec 16, 2004, at 04:20, Max Noel wrote:
def glass_type(glasstype):
if glasstype == 'Red':
myglass = RedGlassCost()
elif glasstype == 'Blue':
myglass = BlueGlassCost()
elif glasstype == 'Yellow':
".*". So far I have tried the following regular
expressions:
"\d+"
"\d*"
"\W+"
"\W*"
"[1-9]+"
and more...
I think you have to escape the backslashes.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pat
w, but I thought that maybe it would hold
its
own because it doesn't have to import the re module, everything's
builtin,
etc.
HTH,
Jacob
A faster way to do this would be to use something like:
if thing.beginswith("Name"): del a[index]
-- Max
--
maxnoel_fr at yahoo dot fr -
e
simplified to:
for line in commands.getoutput('ls -la').split('\n'):
print line
Or, of course, the obvious:
print commands.getoutput('ls -la')
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone,
py of the world. We can talk about this in more
detail if anyone is interested.)
I am.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfe
erson.
- For each week, generate a random number (the draw) and compare it to
each person's number.
- If there is a match, do something.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run throu
did you mean make the world a class (and thus avoid the sort of
passing the world dict up and down as I did here?) Either way, a quick
word or two will be great; I'm not asking for you to take the time to
code it up for me :-)
Probably, but I don't think that's relevant.
-- Max
obvious choices when you're implementing Life using a 2D
matrix (the other being a finite rectangular plane).
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating
in Java). http://www.eclipse.org
I'm also told people are currently developing a Python plugin for
Eclipse. That'd be the Best Thing Ever(TM).
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweati
MPTY" and "return PERSON" instead
of what you have right now (have you been using Ruby recently?).
Also, the function still doesn't return anything when randwal == perc.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of mea
ore with Notepad -- it
comes down to whichever language requires the least (keyboard) typing
being the least unpleasant to use. And Java, unlike Python, requires a
lot of typing.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic c
(*bangs head on keyboard* gah, I clicked Reply instead of Reply to All
again -- sorry!)
Begin forwarded message:
From: Max Noel <[EMAIL PROTECTED]>
Date: January 11, 2005 00:09:11 GMT
To: "Alan Gauld" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Slightly OT - Python/Java
On
On Jan 11, 2005, at 01:38, Kent Johnson wrote:
Max Noel wrote:
A good follow-up to that would be McMillan & Wiggleswrorth's
"Java Programming - Advanced Topics", through which I'm currently
reading. It has some really good stuff, including things about XML
parsing w
dom4j? What is it? Is it part of the standard Java distribution? If
not, where can it be found?
Update: Okay, looks like it's time to go to bed. The link was in
bright blue and somehow I didn't see it. D'oh.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you
the range. It's the comma that's right in the
middle of the number. Yuck.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, i
(yes, forgot to CC the list again -- argh!)
Begin forwarded message:
From: Max Noel <[EMAIL PROTECTED]>
Date: January 11, 2005 23:33:44 GMT
To: Liam Clarke <[EMAIL PROTECTED]>
Subject: Re: [Tutor] More and more OT - Python/Java
On Jan 11, 2005, at 23:15, Liam Clarke wrote:
Out o
external dependencies
(as a database).
You should stick to SQLite. After all, it was designed exactly for
what you're doing. Well, AFAIK at least.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you
y
(doesn't build a tree out of it), it uses less memory than DOM, and
scales much better (obviously).
I haven't tried Python's XML parsers yet, but I understand Python
supports both SAX and DOM, so it should be okay...
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Loo
key + '.wav'
The elegant way is to do use string formatting:
print '\nsiday_q%s.wav' % (key)
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run
enjoy seeing an
example.
Here's an obvious one:
j = [foobar(item)/0 for item in x]
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, i
en it will also
raise an exception.
You have a point, I hadn't thought of it that way.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
l (more or less) there, but it occurs
within a
# 'in' operator, and is therefore executed in C -- much faster.
if element.split()[0] in headers:
print element
Also, it's shorter -- 4 lines, comments aside. Nevertheless, as Danny
suggested, an approach using dictionaries wo
to the string that's before it. I suppose you want to
display the result of the expression right after the string, don't you?
Then you might want to use the string concatenation operator: +
It should be easy to correct, now...
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"
of foo. Can it? I had a poke around the
namespace yesterday, and got lost in hordes of methods that look like
__this__, which is ugly.
Watch out, you seem to be confusing classes and objects, there.
What are you trying to achieve there, exactly? Could you give us an
example?
-- Max
maxnoel_fr
ttribute(), 'Charisma': Attribute(), 'Intelligence':
Attribute(), 'Willpower': Attribute()}
Ah, things would be so much easier if McMackie would release the NSRCG
source code (despite this abomination being written in Visual Basic),
wouldn't they? ;)
-- Max
maxnoel_fr at
te's modified Rating."""
return self._baseRating + self._augCyber + self._augMagic
def getBaseRating(self):
"""Return the attribute's base Rating (unmodified by magic or
cyber)."""
return self._baseRating
def se
hat's what Alan means by
class-oriented programming.
However, all the Java programming I've done so far has been true OOP
(hopefully; it was for a Uni module called Object-Oriented Software
Engineering), and I fail to see what in its design does not encourage
this practice.
-- Max
m
is exactly the same thing as using a function
from Python module.
I hope that answers your question...
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors...
iles by hand.
Hmm, I really should try to start working again on this web-based SRCG
idea of mine... The whole thing just screams "database". Daaargh, so
many things to do, so little time. I suppose no good mod_python
tutorials have spawned since last time I asked, right?
-- Max
max
r than CGI.
http://www.modpython.org/
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
_
use string formatting in the print
line. But that's not really important.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal
on.org/doc/2.2.3/whatsnew/sect-
rellinks.html#SECTION00034
I have to admit, this is brilliant. Thanks for the pointer, Kent.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run throu
a normal human being
to write a program that uses this data.
Comments, criticism, improvements, suggestions, [whatever]... Would be
appreciated. Feel free to use it if you wish.
Thanks for your attention.
xmldict.py
Description: Binary data
-- Max
maxnoel
o create a dict from a
DOM. From a Python perspective, that seems more "Pythonic" to me as
well. I guess it's just a different way of looking at it.
I can't help but think that from the perspective of any other
language, that would feel more [language]-ic as well ;)
-- Max
maxnoel_
organize my OOP code, especially given the
absence of a "real" IDE for Python?
Thanks for your attention,
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... Ho
print line # or whatever
break
f.close()
Of course, to do that, you must know the number of lines in the file
beforehand. If you're running a UNIX system (Linux, OS X, *BSD...),
that's easily done by calling the command "wc -l " (use
os.popen to do that).
-- Max
maxnoel_
abase access (especially if the DB is not on a remote server)
3) File I/O, if any
Could you give us a few more specs?
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... H
er, and use a type check to decide
whether or not you're appending/adding/whatever.
>>> type("abc")
>>> type(123)
>>> type(None)
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
a
d programming languages (and
mathematicians), counts starting from 0. Thus, the first element in a
list is foo[0].
foo[len(foo)] will raise an IndexError.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as
just fine.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
___
Tuto
url in urllib seems to do what you want:
>>> import urllib
>>> urllib.pathname2url('2005-01-24 00:00:00.0')
'2005-01-24%2000%3A00%3A00.0'
And urllib.url2pathname does the opposite conversion.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look
each record only appears once, you'll find
yourself with the whole 2GB file loaded into memory.
(or do you have a "smarter" way to do this?)
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you r
ere, which makes sense :D ).
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
_
r not it's positive or negative depends on which side of
GMT/UTC
you are, of course :) Note that the result in is seconds, too:
Of course. What I meant was that I didn't know which "side" returns a
positive offset (IOW, whether Paris (GMT+1) returns -3600 or +3600 --
it's
33 25 Jan 18:58 /etc/localtime ->
/usr/share/zoneinfo/Europe/London
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
pe
non-experienced; and chances are it's slower
than the original version since it has to iterate through 4 lists
instead of 2.
In any case, when in doubt, do what you think will be easier to
maintain.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic
so?
Eeh? Peeks and pokes? Are you even allowed to do that? I mean, doesn't
Windows have a protected memory mechanism, like any OS should have
nowadays?
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweat
ual to its first 256
characters".
Also, I don't think you have to worry about buffer overflows in
Python, unless you're using a seriously broken implementation of it.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, pan
r",
The trailing comma is NOT a typo, it is intentional. It prevents print
from appending a newline.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors
it,
I would be grateful.
HTH,
Jacob
It *is* possible, that's exactly what my code does (well, as long as
you don't run it on Mac OS 9). The carriage return (\r, as opposed to
the linefeed \n) moves the cursor to the beginning of the *current*
line.
-- Max
maxnoel_fr at yahoo dot fr -- I
ry useful.
Oh, and make sure you mention iterators and list comprehensions at
some point.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challeng
erties.
Oh, and the best classes are those you create yourself, of course :D
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors...
87BE & 0xFF)
'0xbe'
>>> hex((0x87BE & 0xFF00) / 0xFF)
'0x87'
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect
d be, in an
inequality test.
This is consistent with UNIX redirection. ./foo > bar.txt executes the
command foo, and redirects its STDOUT to the file bar.txt. ./foo >>
bar.txt does the same, but appends to bar.txt instead f overwriting it.
-- Max
maxnoel_fr at yahoo
Perl is still the fastest
scripting language around. I value debugging time more than CPU time
these days.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challe
as if((not $d) eq "a").
Use == and !=, they work on strings as well. Or (and?) use parens.
Also, don't forget that Perl, like Python, uses lazy evaluation.
Once again, illumination is welcomed, as I have a finally that some
subtlety of Boolean logic is eluding me, and a 'x != a
our
code to run it on a different platform. But most existing Java projects
have platform-specific versions, if only to make the GUI (try to) look
native. You can spot a Java app from a hundred meters away.
(then again, the same critic could be made of Python's and Perl's
"stan
#x27;s the most intuitive
yet.
C is very good for a number of things (chief among those: speed). But
string manipulation is definitely not one of them.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run
On Feb 3, 2005, at 22:21, Smith, Jeff wrote:
Perl and Python both resist the introduction of a switch statement
which
I (and many others) feel is the most elegant way to express what it
does.
I echo that.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pat
;m using Simon Thompson's "Haskell: The Craft of
Functional Programming", which I find quite good. However, it's a bit
odd, in that it almost reads like a mathematics book, which is
something you may or may not like.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at
ed it -- INTERCAL uses COME FROM instead") are
already quite impressive, but the very idea of Befunge makes my brain
want to explode. Especially that extension to the language that allows
one to write N-dimensional programs. :D
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at
{
bar();
}
Is not K&R style, but Allman style. K&R style (also known as One True
Brace Style or 1TBS) is this:
if(foo) {
bar;
}
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as y
by breaking it up to several
statements, but I would like to know.
It's quite easy: evaluation starts from left to right. The program
opens item for writing (thus deleting it), creating a file object, then
executes its write method on the argument in the parens. However, since
at that point ite
whether or not to use braces
for single-line blocks. (the latter issue being why I think The
Whitespace Thing is an instance of Best Thing Ever(TM))
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as
oach
we get 100.
Regards,
Liam Clarke
Yes, it is 100. The most significant bit (i.e. the highest power of 2)
is on the left, just as the most significant digit (matching the
highest power of 10) is on the left when representing base-10 numbers:
415 is 4*10^2 + 1*10^1 + 5*10^0.
-- Max
maxnoel_fr
alled f(5))
and call f(10):
if L == [5]: # L == defVal == [5] (they are the same variable)
L = [] # Re-binding the name: a new var is created. L == []; defVal
== [5]
L.append(a) # L == [10]; defVal == [5].
See what I mean?
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Loo
256.
Is that clearer now?
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
oo is an instance variable
@@foo is a class variable
FOO is a constant (which can be modded into global, instance or class
with the appropriate use of $, @ or @@)
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweat
On Feb 14, 2005, at 10:37, Lobster wrote:
- I am trying to call up an external program
with something like a "Shell" command - can not find a way of doing
this
(in windows)
Any hints?
What about os.system('your_command_here')?
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #8
T and Amiga emulators for pretty much
any system nowadays. :-p
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immort
D" in the Finder) is mounted as the root
of the filesystem. IOW, it's referred to as /, not /Macintosh HD.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can
ymbol]', '')), and to remove the case of each word
(foo.upper() or foo.lower() will do).
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you chall
nteger division in Python, a / b (a // b in 2.4+)
gives you the quotient, and a % b gives you the remainder.
See the other posts for examples of use :p
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating
ectly sequential, with no element of
simultaneity whatsoever...
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridors... How can you challenge a
perfect, immortal machine?"
__
eems that a Thread object
evaluates to False once it's terminated.
That's probably what you're looking for, Bernard, my "threads won't be
of any use here" argument notwithstanding.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A path
line with:
if not name.endswith(' '):
called = ((name + ' ') * 5).strip()
else:
called = (name * 5).strip()
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run throu
user hits Enter to validate his input, the newline
character is echoed to the terminal and the cursor goes down one line.
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting
and sweating as you run through my corridor
read. That end() method just sets a flag
(say, isToTerminate) to True.
Since the thread is running a loop, all you then have to do is have it
check the isToTerminate flag at the beginning of each loop. If it's
True, exit the loop (thus terminating the thread as it reaches the end
of its run()
Some day I'm actually going to learn how to hit the "Reply All" button.
I swear.
Begin forwarded message:
From: Max Noel <[EMAIL PROTECTED]>
Date: February 23, 2005 18:42:37 GMT
To: Shitiz Bansal <[EMAIL PROTECTED]>
Subject: Re: [Tutor] threads
On Feb 23, 2005, at 17:
1 - 100 of 296 matches
Mail list logo