Perfect! Thanks!
On Nov 17, 4:16 pm, Albert Hopkins <[EMAIL PROTECTED]> wrote:
> On Mon, 2008-11-17 at 13:59 -0800, godavemon wrote:
> > I'm using urllib2 to pull pages for a custom version of a web proxy
> > and am having issues with 404 errors. Urllib2 does a great
I'm using urllib2 to pull pages for a custom version of a web proxy
and am having issues with 404 errors. Urllib2 does a great job of
letting me know that a 404 happened with the following code.
import urllib2
url = 'http://cnn.com/asfsdafsadfasdf/'
try:
page = urllib2.urlopen( url )
except u
Great thanks!
On Jun 19, 5:37 pm, Matimus <[EMAIL PROTECTED]> wrote:
> On Jun 19, 4:27 pm, godavemon <[EMAIL PROTECTED]> wrote:
>
>
>
> > I need to calculate the Hamming Distance of two integers. The hamming
> > distance is the number of bits in two integ
Awesome! Thanks a lot.
On Jun 19, 5:00 pm, Mensanator <[EMAIL PROTECTED]> wrote:
> On Jun 19, 6:27 pm, godavemon <[EMAIL PROTECTED]> wrote:
>
>
>
> > I need to calculate the Hamming Distance of two integers. The hamming
> > distance is the number of bits
I need to calculate the Hamming Distance of two integers. The hamming
distance is the number of bits in two integers that don't match. I
thought there'd be a function in math or scipy but i haven't been able
to find one. This is my function but it seems like there should be a
faster way. I do t
Hopefully you've found it by now and didn't have a frustrating
christmas :).
Get the source from sourceforge and then follow the instructions here.
http://www.davidcramer.net/code/57/mysqldb-on-leopard.html
Worked perfectly for me on OSX 10.5, python 2.5. Was frustrating to
find. Good luck!
On Jul 20, 11:45 am, godavemon <[EMAIL PROTECTED]> wrote:
> On Jul 20, 11:42 am, godavemon <[EMAIL PROTECTED]> wrote:
>
> > I'm on an intel macbook using OS X 10.4 and for some reason my path is
> > being interpreted incorrectly. See the example:
>
> &g
On Jul 20, 11:42 am, godavemon <[EMAIL PROTECTED]> wrote:
> I'm on an intel macbook using OS X 10.4 and for some reason my path is
> being interpreted incorrectly. See the example:
>
> [EMAIL PROTECTED] pwd
> /Users/dave/til/jared <- dirname = jar
I'm on an intel macbook using OS X 10.4 and for some reason my path is
being interpreted incorrectly. See the example:
[EMAIL PROTECTED] pwd
/Users/dave/til/jared <- dirname = jared
[EMAIL PROTECTED] python
...
>>> import os
>>> os.path.abspath('')
'/Users/dave/til/Jared' <- dirname
Hey, I've done similar things.
You can use system comands with the following
import os
os.system('command here')
You'd maybe want to do something like
dir_name = 'mydirectory'
import os
os.system('ls ' +dir_name + ' > lsoutput.tmp')
fin = open('lsoutput.tmp', 'r')
file_list = fin.readlines()
fi
Hey, I've done similar things.
You can use system comands with the following
import os
os.system('command here')
You'd maybe want to do something like
dir_name = 'mydirectory'
import os
os.system('ls ' +dir_name + ' > lsoutput.tmp')
fin = open('lsoutput.tmp', 'r')
file_list = fin.readlines()
fi
ile's case it wrote out an
extra 4 bytes in the middle somewhere. Strange.
Thanx for your help.
Grant Edwards wrote:
> On 2006-08-08, godavemon <[EMAIL PROTECTED]> wrote:
>
> > I'm using python's struct and binascii modules to write some values
> > from my p
I'm using python's struct and binascii modules to write some values
from my parser to binary floats. This works great for all of my binary
files except one. For some reason this file is saving to 836 (stated
by my command shell) bytes instead of 832 like it should. It sounds
like an issue with w
I've been a member for a while but I had no idea how helpful this form
is. I had a one hour meeting and when I came back there were 4
replies. Thanks for your help!
Scott David Daniels wrote:
> godavemon wrote:
> > I need to take floats and dump out their 4 byte hex representatio
I need to take floats and dump out their 4 byte hex representation.
This is easy with ints with the built in hex function or even better
for my purpose
def hex( number, size ):
s = "%"+str(size) + "X"
return (s % number).replace(' ', '0')
but I haven't been able to find anything f
15 matches
Mail list logo