Print to printer

2005-10-28 Thread avnit
I can't seem to figure out how to print with my printer using python.
I'm using Mac OSX 10.4. I was thinking maybe something with
applescript. Does anyone know?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Print to printer

2005-10-31 Thread avnit
I just want to print text. I'll try macpython. Thanks for the help.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Print to printer

2005-10-31 Thread avnit
I just want to print text. I'll try macpython. Thanks for the help.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: random number generator

2005-11-03 Thread avnit
import random
print random.randint(1,20)

#prints random integer from 1 to 20

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Print to printer

2005-11-05 Thread avnit
Wow. That worked perfectly. Thanks a lot.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Print to printer

2005-11-05 Thread avnit
Do you know if there's a way to print a file? I'm trying to print an
HTML file, so your solution is good, but doesn't really work for me.
Just reading the HTML file and the printing the content obviously
wouldn't work. I also tried:

>>> printer.write(file('path/to/file.ext'))

but apparently this function only takes strings as parameters.

Thanks.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Command line

2005-11-20 Thread avnit
What OS are you using. I'm not sure about anything else but on a mac
it's:

>>import os
>>os.system("ls -la")

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: hex string to hex value

2005-11-22 Thread avnit
If you just want to convert a string to an integer, it would be:

>>> int(n)

in your case it would be:

>>> m=66
>>> n=int(hex(m))

-- 
http://mail.python.org/mailman/listinfo/python-list