hey there gents,
i am looking for a good place to start learning how to read a web page
with python and pull out bits of information for an app i am doing for
work. i have googled and looked at the docs. i looked at urllib and
httplib so i think this a place to kinda start. Does anyone know
> > Anyone know of a good explanation of either how to perform boolean
> > math in Python? What I am trying to do is AND two numbers together:
> >
> > e = 51 AND 15
> >
> > 00110011
> >
> >
> > 0011
>
> Use '&' rather than "AND":
>
> >>> e = 51 & 15
> >>> e
> 3
For refe
On Sat, 22 Oct 2005, Joe Bennett wrote:
> Anyone know of a good explanation of either how to perform boolean math
> in Python? What I am trying to do is AND two numbers together:
>
> e = 51 AND 15
>
> 00110011
>
>
> 0011
Use '&' rather than "AND":
>>> e = 51 & 15
>>
On Sat, 22 Oct 2005, Shi Mu wrote:
> what is the difference between index and find in the module of string?
> for both "find" and "index", I got the position of the letter.
index raises a ValueError if the string isn't found:
>>> s = "spam"
>>> s.find('m')
3
>>> s.index('m')
3
>>> s.find('z')
-1
Anyone know of a good explanation of either how to perform boolean math
in Python? What I am trying to do is AND two numbers together:
e = 51 AND 15
00110011
0011
In this case the result should be e = 3...
Ideas?
-Joe
_
what is the difference between index and find in the module of string?
for both "find" and "index", I got the position of the letter.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Daniel Watkins wrote:
> Currently, I'm writing a little project which needs to store a
> dictionary in an external file (so it can be accessed by another
> program). However, no matter how much I try, I cannot get Python to
> import the dictionary from the file properly. However, I know the
> probl
Currently, I'm writing a little project which needs to store a
dictionary in an external file (so it can be accessed by another
program). However, no matter how much I try, I cannot get Python to
import the dictionary from the file properly. However, I know the
problem. Whatever format I put the da
Chris Hallman wrote:
>
> I hacked together my first script to learn threading. I'm seeing some
> weird output.
>
> This script will PING approximately 1,000 routers. I added a few print
> commands for debugging so I can see if it runs faster than a single
> threaded script. It blazes through t
Do it yourselfOn 23/10/05,
Patrick Nagle <[EMAIL PROTECTED]> wrote:
please remove me from your tutor mailing list.Cheers--Patrick J. Nagle_Pocket Rocket FX___Tutor maillist -
Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor
__
please remove me from your tutor mailing list.
Cheers
--
Patrick J. Nagle
_
Pocket Rocket FX
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I hacked together my first script to learn threading. I'm seeing some weird output.
This script will PING approximately 1,000 routers. I added a few print
commands for debugging so I can see if it runs faster than a single
threaded script. It blazes through the routers, however I'm seeing
multip
On 10/22/05, Jacob S. <[EMAIL PROTECTED]> wrote:
> >> def nameCheck(self, value):
> >> > import re
> >> > tempREG = re.match('.*:.*',value)
> >> > return str(tempREG) != 'None'
>
> This could be written better.
>
> def nameCheck(self, value):
> tempREG = re.match('.*:.
>> def nameCheck(self, value):
>> > import re
>> > tempREG = re.match('.*:.*',value)
>> > return str(tempREG) != 'None'
>>
>> Still a syntax error here!
>>
> Code is working as I thought it would. What syntax error do I have?
This could be written better.
def nameCheck(s
I knew what he meant, but since most albums have around 12 tracks, 4
tracks per thread gives you 3 threads. In any case, thanks for the
catch on the loop. I'll let you know if it makes a difference.On 10/22/05, Kent Johnson <[EMAIL PROTECTED]> wrote:
Alan means to use two or three threads *total*.O
Steve Haley wrote:
> I am running Python 2.1 which ships with ArcView 9.1. I am going
> through the 2.1 tutorial and came across readlines().
>
> The tutorial seems to be telling me that ‘f.readlines(2) should read out
> 2 bytes plus what is needed to complete the current line. Instead, it
>
Hi Steve,
Here is the python documentation. Hopefully it is a *little* clearer
http://docs.python.org/lib/bltin-file-objects.html
*** readlines ***
readlines( [sizehint])
Read until EOF using readline() and return a list containing the lines thus
read. If the optional sizehint argument
> I wanted to find out whether os.system() calls block other threads.
> It seems that they don't. (That's a good thing, it means it should
> work for you!) Here is a program to test this:
For threads that run longer than a few seconds, you can visibly verify
this with Sysinterals Process Explorer
Folks,
I am running Python 2.1 which ships with ArcView 9.1.
I am going through the 2.1 tutorial and came across readlines(). Simply
put it doesn’t seem to be behaving as the tutorial describes. Specifically,
I created a small text file as shown below:
f=open("c:/python21/sfh_mod
Orri Ganel wrote:
> I'll try doing 3 or 4 tracks per thread, then. Thanks for the advice.
>
>
> If you keep the thread count down to two or three you might get
> a noticable improvement but one thread per track, unless you have
> a lot of separate hard disk spindles to distribute the
Lance E Sloan wrote:
> --On Thursday, October 20, 2005 4:44 PM -0400 Kent Johnson
> <[EMAIL PROTECTED]> wrote:
>
>> Since 2.3 Python includes a datetime module which has some facility for
>> date calculations. I think mxDateTime is more sophisticated but if your
>> needs are simple take a look at
21 matches
Mail list logo