woooee 814 Nearly a Posting Maven

Don't know if you are aware of Python's webbrowser class. It allows you to display web-based docs, etc. You can choose a particular browser or use the default browser. I don't know if it will tell you what the default browser is though.

scru commented: you've been helpful +3
woooee 814 Nearly a Posting Maven

You don't have a compiler installed so you can't compile the source. There has to be pre-compiled binaries for the Mac. Search for something like "py-pil" in whatever Mac's use to install software. If you don't find anything then you will have to install XCode developer tools, which contain the compiler, etc (I think). This question is better asked on the Mac forums since it deals with installing software and not Python.

woooee 814 Nearly a Posting Maven

could not call command gcc

Which Linux distro are you using. PIL may be in the repositories for your distro and you can install the normal way. To compile from source you will have to install the libraries used to compile. Again that depends on the distro you are using.

woooee 814 Nearly a Posting Maven

Use endswith. fnmatch is specific to *nix (I think) and so won't work if you are using MS Windows.

if os.path.isfile(fullname):
     # Only work on VOBs and MPGs (for now)
     if filename.endswith('.vob') or filename.endswith('.mpg'):
         f.write('dgindex.exe -IF=[%s] -FO=0 -OM=0 -OF=[%s] -MINIMIZE -EXIT \n' % \
                   (fullname, fullname))
##
##   You could also slice off the end if you have a lot of different endings
ending_tuple=( ".mpg", ".vob" )
ending = filename[-4:]
if ending in ending_tuple:
     ##write to file
woooee 814 Nearly a Posting Maven

AFAIK you use the Python Imaging Library http://www.pythonware.com/library/index.htm Perhaps someone else will know more.

woooee 814 Nearly a Posting Maven

It's 1.5 * rate

if hours <= 40:
            print "Total Pay", (rate * hours)
else:     ## can only be > 40
            print "Total Pay", (rate * 40) +((hours - 40) * 1.5*rate)

            ## or - if this is more understandable 
            ## the computer does one calc at a time anyway
            ot_rate = rate*1.5
            ot_hours = hours-40
            print "Total Pay", (rate*40) + (ot_rate * ot_hours)
woooee 814 Nearly a Posting Maven

For viewing and editing, try passing data to TableListWrapper, http://tkinter.unpythonic.net/wiki/TableListWrapper The edittest() function is the one to try.

woooee 814 Nearly a Posting Maven

An indention problem

def findpay(hours, rate):
         if hours <= 40:
             pay = hours * rate
         overtime = 1.5
         if hours > 40:
             pay = hours * rate

         ##  the next line should be indented so it 
         ##   executes under "if hours > 40"
         overtime = (hours - 40) * (rate * 1.5)
         totalpay = pay + overtime

##   possibly would be simplier
def findpay(hours, rate):
         pay = hours * rate
         overtime = 0 
         if hours > 40:
              ## overtime=rate * 0.5 because the
              ## pay = hours * rate line above already
              ## paid for regular time
              overtime = (hours - 40) * (rate * 0.5)
         totalpay = pay + overtime
woooee 814 Nearly a Posting Maven

The only caveat, you have to program in TCL, not Python.

Sorry, I was assuming too much. I use PMW most of the time and not Tkinter. BLT is available through PMW. For anyone who wants to know if they have BLT installed, you can test for it with the following code, at least on my Ubuntu machine. And installing BLT installs PMW and the python wrappers as well on Ubuntu, so I'm not familiar with a manual install or dependencies. Goolge for pmw.blt if you are interested.

import Tkinter
import Pmw

top = Tkinter.Tk()
if not Pmw.Blt.haveblt(top):
   print "BLT is not installed!"
else:
   print "Good BLT install"
woooee 814 Nearly a Posting Maven

Just to be complete, BLT adds graphing to the TCL/Tk toolkit. Use whichever of the suggestions seems best to you. They will all work. http://incrtcl.sourceforge.net/blt/

woooee 814 Nearly a Posting Maven

It's not possible to tell without a line number for the error. I do see that there isn't a comma after overtime in this line
print "You earned", pay, "regular pay and", overtime "overtime pay which is a total of", totalpay

woooee 814 Nearly a Posting Maven

If this is a line of data from the file
28.618382 27.631520 44, followed by
28.618382 27.631520 22
etc, then you can use split() instead of checking for tabs. Also, you can pass a string as a parameter to file open()

##   simulate a file read
data = [ "28.618382   27.631520    44",
          "28.618382	   27.631520    22"]
for line in data:
   substrs = line.split()
   for each_column in substrs:
      print each_column
      print
##
##The T2000901.txt is one of maybe 15 different values
##   using file open
filenames= [ "T2000901.txt", "T2000902.txt", "T2000903.txt"]
for name in filenames:
   print name
   fp=open(name, "r")
   ##   process this file
   fp.close()
woooee 814 Nearly a Posting Maven

Actualy that didnt work. I changed the statements to
if sex == "M" or "m":

An if() statement with an "or" is the same as two if statements (or an elif), so the above equates to
if sex == "M":
elif "m":
I think you want --> if sex=="m"
"if m" is always true, since it is not==zero/False, so this always executes. BTW an if() statesment with an "and" equates to nested if statements. You might want to take another look at the basic design. Python has containers for a reason. You can use a list for the question, and a dictionary for the answer. Next, try adding a third option to the code below to help understand how it works.

literal_list = [ ["Please choose your hero", "(M)ale or (F)emale: "],
                 ["Now for your body build", "Are you (S)lim, (A)verage, (M)uscular, or (H)eavy: "]]
##           dictionary key=M+0 is necessary because you also use M for Muscular
##           The zero relates to the zero element of literal_list=Male
##           M+1 is the "1" element of literal_list=Muscular
answer_dic ={"M0":"A young and adventerous lad out to save the world!",
             "F0":"Look out Lara Croft, there is a new show in town",
             "S1":"Thin and wiry, your (you're) a willow in the wind",
             "A1":"You could pass by him and never notice him, or his gun.",
             "M1":"Tall and hulking, you wouldnt want to run into him in a dark alley",
             "H1":"Hey, big people need love too!"}

j=0
stop=len(literal_list)
while j < …
woooee 814 Nearly a Posting Maven

Use string.find

##   This code assumes that "blah is always in the string before "notblah"
##   and that the sequence is "blah" then "notblah" and not some variation 
##   of "blah", "blah", "notblah"
some_string="ab-blah-cde-notblah-fghij-blah-klm-notblah-no-blah-stu-notblah-xyz"
result=0
while result > -1:      ## -1 = not found
   result=some_string.find("blah", result)
   result2=some_string.find("notblah", result+1)
   if (result > -1) and (result2 > -1):
      print "blah =", result, "and notblah =", result2
      result =result2 + len("notblah")
woooee 814 Nearly a Posting Maven
while y < (t - 1):
    if y == t:

Note that (t-1) < t, so y is always less than t and the if() portion will never be executed. You can also use a for loop

t = len(myint)
##while y < (t - 1):
for y in range(0, t):
woooee 814 Nearly a Posting Maven

This is the only one that I know of, although I think there is something that uses ncurses as well. Also, you want double equals here if x == "w", and if you have a lot a compares, you can use a dictionary with the function name, or the print literal as the value.

import termios, sys, os
#import termios, TERMIOS, sys, os
TERMIOS = termios
def getkey():
        fd = sys.stdin.fileno()
        old = termios.tcgetattr(fd)
        new = termios.tcgetattr(fd)
        new[3] = new[3] & ~TERMIOS.ICANON & ~TERMIOS.ECHO
        new[6][TERMIOS.VMIN] = 1
        new[6][TERMIOS.VTIME] = 0
        termios.tcsetattr(fd, TERMIOS.TCSANOW, new)
        c = None
        try:
                c = os.read(fd, 1)
        finally:
                termios.tcsetattr(fd, TERMIOS.TCSAFLUSH, old)
        return c

if __name__ == '__main__':
        print 'type something'
        s = ''
        while 1:
                c = getkey()
                if c == '\n':     ## break on a Return/Enter keypress
                        break
                print 'got', c
                s = s + c

        print s
woooee 814 Nearly a Posting Maven

Reverse the two for() statements so you only read the file once (and don't use i, l, or o as variable names. They look like numbers).

for line in f:
   for j in scorelist
      if j in line:
         print j
         score = score + 1
woooee 814 Nearly a Posting Maven

You will have to use unicode strings. Here is Guido's tutorial http://docs.python.org/tut/node5.html#SECTION005130000000000000000 From the tutorial, you would use
word=u"3ÇáäíÇÈÉ".encode('utf-8') if arabic uses 8 bits per byte.

woooee 814 Nearly a Posting Maven

If the file has Python code, then it should end with a ".py" not ".txt". If it is not a Python file, but a file with text you want to read in the program then you open the file and read it. See #6 here for how to open and read a file http://www.daniweb.com/forums/thread20774.html

woooee 814 Nearly a Posting Maven

One comment first. You have 2 redundant lines in the original code

n = int(input("Give me an integer: "))
list1 = []
##i = 1     ## this line is redundant-the for() loop handles initializing i
for i in range(1,n+1):
     print "i =", i     ## this will show what the for() loop is doing
     list1 = list1 + [i]
     #i = i + 1     ## this line is redundant-the for() loop also handles incrementing
print list1

To do what I think you want, you have to ask the user for the maximum number to count to, and the "grouping number" or whatever you want to call how many numbers to put in one group. You then use a second, nested for loop underneath the one you have to put the "grouping number" of numbers in a list which you append to the original once the inner loop has finished. Hence a list of lists [[1,2,3], [4,5,6]].

woooee 814 Nearly a Posting Maven

The code only gives one message on my computer so you'll have to post the code you are using. The problem has to be in a loop since you are getting more than one message. Are you calling the function "test_for_even()" after the "for p in range(3, n/2, 2):"? Also, do a search for "is not even". You might have it in more than one place.

woooee 814 Nearly a Posting Maven

return prime is still incorrectly indented. Try the code below. When you can't figure something out, break it down into smaller, bite sized chunks. Test the first part and when you are satisfied that it works, test the second part, etc. I may have gone overboard with the functions here, but the principle is to get it into digestible chunks. I also added print statements for testing, to see what is going on.

import math

##---------------------------------------------------------------------
def is_prime(p):
##----------  first part
        if p == 2 :     ## why can't we have 2+3=5
            print "p == 2"
##  return out of the function here
            return True
##----------  second part
        else:
            result = test_for_prime(p)
##  return out of the function here
            return result 
#
##   you had "return prime" indented so it only executed with the "else" 
##   clause i.e. (p % 2 != 0).  We no longer use it since we return in
##   both the if() and else()
#
##   this is just a "safety".  We should never reach here
        return False

##---------------------------------------------------------------------
def test_for_even(num):
     if n %2 == 0:
          return True     ## is even
     else:
          print n,"is not even. Please enter only even numbers."
          return False

##---------------------------------------------------------------------
def test_for_prime(p):
##   you calculate sqrt(p/2) every time you cycle through
##   the for() loop.  Once is enough.  Also it has to be
##   an integer--I don't know what math.sqrt returns
     stop = int(math.ceil(math.sqrt(p/2)))+1
     for i in range(3, stop, 2):
          print "testing", i, p, p%i
          if p % i == 0: …
woooee 814 Nearly a Posting Maven

"return prime" is not indented correctly. For the "print a message if the number isn't even" you already test for even with
if n % 2 == 0: ## even
.
else: ## not even
#do what you want here for numbers that aren't even

Note that 5 is not even but has two primes, 2 and 3 that add up to 5. Same for 7 (2+5). There are probably more. I have the flu so you'll have to figure it out. Also WTF is main() there for? Eliminate def main() and the main() call at the bottom and you have the same program. Do you have to allow for more than one pair of prime numbers adding up to the input value. Hopefully not, as then you would have to store the results in a list.

woooee 814 Nearly a Posting Maven

You can also use a function. Also you calculate math.sqrt(n) on every while loop. Once is enough.

import math

def test_for_prime(n):
    n = abs(n)
    j = 2
    stop=math.sqrt(n):
    while j <= stop:
        if n % j == 0:
            return False
        j += 1
    return True

if __name__ == "__main__":
    print "This program determines if a number you enter is prime or not.\n"
    n_input = input ("Please enter a number greater than 1: ")

    result=test_for_prime(n_input)
    if result:
       print n_input, "Is prime"
    else:
       print n_input, "is Not prime"

    ##  or a shortcut
    if test_for_prime(n_input):
       print n_input, "Is prime"
    else:
       print n_input, "is Not prime"

If you want to speed this up you can test for if n % 2 == 0:, then start at 3 and increment the counter by two each time, skipping the even numbers.

woooee 814 Nearly a Posting Maven

Program should accept a file name as input

Do you want the program to ask the user to key in a file name, or do you want to provide it as an argument when the program is called, or do you want to use a GUI that allows the user to browse the file system and choose a file?

woooee 814 Nearly a Posting Maven

FWIW this will find all occurrences of a word in a string. Also note that if you are looking for "the" it will give a hit for "then". If you only want the word, you have to search with spaces added, " the " -assuming string.lower() and that punctuation is removed

found=the_string.find(word)
while found > -1:
     print word, "found at location", found
     found=the_string.find(word, found+1)
woooee 814 Nearly a Posting Maven

You have def playCk(self): indented incorrectly again. It should be at the same level as __init__

class EntryDemo :

    def __init__( self ) :
        self.top = Tkinter.Tk()
        self.top.geometry("225x100+10+10" )
        self.text=""

        self.text_tk = Tkinter.StringVar()
        label1 = Tkinter.Label(self.top, text = "Enter Filename" )
        label1.pack()

        frame_s = Tkinter.Frame( self.top )
        label_s = Tkinter.Label( frame_s, text = "Text " )
        label_s.pack( side = "left" )
        entry_s = Tkinter.Entry(frame_s, width=25, textvariable=self.text_tk)
        entry_s.pack( side = "right")
        frame_s.pack()
      
        cont = Tkinter.Button(self.top, text='Play File',
               command=self.get_text, bg='blue', fg='white' )
        cont.pack(fill=Tkinter.X, expand=1)

        exit=  Tkinter.Button(self.top, text='FORGET IT',
               command=self.top.quit, bg='red', fg='white' )
        exit.pack(fill=Tkinter.X, expand=1)

        entry_s.focus_set()
        self.top.mainloop()

    def get_text( self ) :
        self.text = self.text_tk.get()
        print "get_text --> text entered was", self.text
        ##os.system( "chuck " + self.text )     ## you could also play from here
        self.top.destroy()

##----------------------------------------------------------------------
if __name__ == "__main__":
   ED=EntryDemo()
   print "Class's text =", ED.text
   os.system( "chuck " + ED.text )
woooee 814 Nearly a Posting Maven

Not very elegant, but try to do anything within a try/except?

try:
     Tkinter.Label(root).pack()
except:
     print "No window exists"

## Edit:  Modifing a well known label example
##        Uncomment the root.destroy() line
from Tkinter import *
root=Tk()

def changeLabel():
    myString.set("I'm, a-fraid we're fresh out of red Leicester, sir. ")
    ##root.destroy()
    try:
         label2=Label(root).pack()
    except:
         print "No window exists"
    
myString=StringVar()
Label(root,textvariable=myString).pack()
myString.set("Well, eh, how about a little red Leicester.")
Button(root,text='Click Me',command=changeLabel).pack()
root.mainloop()
vegaseat commented: nice idea +8
woooee 814 Nearly a Posting Maven

Note the number of times you have "ord(letter) + rotate". A little algebra

## substituting ascii_val for ord(letter) + rotate
def rotate_word(s,num):
    rotate = num % 26
    newword = ' '
    word=s.upper()
    for letter in word:
        if  ascii_val > 90:     ## ascii_val doesn't exist; this is just for demonstration
            ascii_val = ascii_val - 26
        else:
            ascii_val = ascii_val
        newword = newword + chr(ascii_val)
    return newword

## stripped down it becomes
def rotate_word(s,num):
    rotate = num % 26
    newword = ' '
    word=s.upper()
    for letter in word:
        ascii_val = ord(letter) + rotate
        if  ascii_val > 90:
            ascii_val -= 26
        newword += chr(ascii_val)
    return newword
woooee 814 Nearly a Posting Maven

The class can not find playCk, should be
def playCk(self):
and the command should be
command=self.playCk()
If you really do want to define playCk outside of the class, then the def playCk() et al must come before the class.

woooee 814 Nearly a Posting Maven

Here is something I had lying around. It's not all that good but does what you want

class EntryDemo :

    def __init__( self ) :
        self.top = Tkinter.Tk()

        self.text=""

        self.text_tk = Tkinter.StringVar()
        label1 = Tkinter.Label(self.top, text = "Enter Text" )
        label1.pack()

        frame_s = Tkinter.Frame( self.top )
        label_s = Tkinter.Label( frame_s, text = "Text " )
        label_s.pack( side = "left" )
        entry_s = Tkinter.Entry(frame_s, width=5, textvariable=self.text_tk)
        entry_s.pack( side = "right")
        frame_s.pack()
      
        cont = Tkinter.Button(self.top, text='PRINT',
               command=self.get_text, bg='blue', fg='white' )
        cont.pack(fill=Tkinter.X, expand=1)

        exit=  Tkinter.Button(self.top, text='FORGET IT',
               command=self.top.quit, bg='red', fg='white' )
        exit.pack(fill=Tkinter.X, expand=1)

        self.top.mainloop()

    def get_text( self ) :
        self.text = self.text_tk.get()
        print "text entered was", self.text

##----------------------------------------------------------------------
if __name__ == "__main__":
   ED=EntryDemo()
   print "Class's text =", ED.text
woooee 814 Nearly a Posting Maven

Pardon me for over-posting. This is likely the final post. The problem gets easier if you use functions IMHO because you don't have loops within loops, and you break it into logical thought parts
1. get the input string
2. break the string into letters
3. test each letter against the phonebook

def letter_test(letter):
     phonebook = 'bcdfghjklmnpqrstvwxyz'
     count = 0
     for ph_char in phonebook:
          count += 1
          if ph_char > letter:     ## phonebook letter is greater
               return False, count
          elif ph_char == letter:
               return True, count
     ##--- for oddball stuff like "{" > "z"
     return False, count

if __name__ == "__main__":
   inp=raw_input("Enter string ")
   print inp, "entered"
   for ip_char in inp:
      found, count = letter_test(ip_char)
      print ip_char, 
      if found:
           print "found in", count, "tries"
      else:
            print "NOT found in", count, "tries"

That same "break it into functions=logical parts" is true for the "test the middle letter of phonebook" problem. So you should post your parts and any problems you have implementing an individual part.

woooee 814 Nearly a Posting Maven

Without the lambda (which you probably haven't covered)

input_str=raw_input("Enter a string of digits ")

##-------------- Simple way --------------------------------------------------
input_list = [int(x) for x in input_str]
print sum(input_list), input_list

##-------------- Check that it is a digit and sum manually -------------------
input_list=[]
errors=0
for chr in input_str:
   if chr.isdigit():
      input_list.append(int(chr))
   else:
      print "Only the numbers 0 through 9 are allowed"
      errors=1
if not errors:
   total=0
   for x in input_list:
      total += x
   print "total =", total, input_list
woooee 814 Nearly a Posting Maven

1.Alter #3 above. Your first compare is the letter in phonebook at the halfway point. The second compare will be halfway above or below the first compare point.

You have to convert phonebook to a list, then you can compare the_list[len_list/2] to the letter. Depending on the result, you either split the first half in two and compare, or the last half, and then continue until you get an equal condition. Break it down into simple parts. It's not as difficult as it sounds.

woooee 814 Nearly a Posting Maven

Take your first post and apply the same logic to both strings, phonebook and inp (for individual character in string). I think you can do the averages, etc.

inp = (raw_input('Input: '))
 
phonebook = 'bcdfghjklmnpqrstvwxyz'
 
for ip_char in inp:
     found = 0     ## reset these variables for each letter in inp
     count = 0
     for ph_char in phonebook:
          if ph_char <= ip_char:
               count += 1
               if ph_char == ip_char:
                    print "found", ph_char, ip_char, "in", count, "tries"
                    found = 1
     if not found:     ## Here we have processed the entire phonebook string
          print ip_char, "not found in", count, "tries"
woooee 814 Nearly a Posting Maven

It will Only proceed to execute background.start() when I press "Control + C" to terminate, and it then spews out the ls and then the final print statement.

Can you run the thread from GTK, say when someone presses a button? Obviously GTK's locks prevent what you are doing. Running it in the background works if that helps. There are probably solutions on the GTK boards as well.

if __name__ == "__main__":
	#objCaller = Caller()
        print "Tag 1", datetime.datetime.now()
        os.system( "ls &")
        print "Tag 2", datetime.datetime.now()
        gtk.main()
woooee 814 Nearly a Posting Maven

I know very little about UTF, but have always seen files opened this way
import codecs
fp = codecs.open( fname, "w", "utf-8" )
I don't know if the filename used has to be a unicode string, and would assume that the records written to the file would be unicode strings.

woooee 814 Nearly a Posting Maven

We all have programs that are out to get us. This one is yours. See anything unusual here

def __init__(self, master):
    	filename=StringVar()
		def playCk():

When you can't find a problem on the line of the error, look at the previous line as well.

woooee 814 Nearly a Posting Maven

Python variables are different from Tkinter variables. You have to use .get

def playCk():
     python_var=filename.get()
     os.system("chuck " + python_var)
woooee 814 Nearly a Posting Maven

You will likely want to use a Tkinter StringVar() with the .get() to get the contents of the entry box. If memory serves - a Google for "Tkinter StringVar Entry" will yield thousands of hits as well
var = Tkinter.StringVar()
entry_box = Tkinter.Entry(frame_name, width=5, textvariable=var)
python_var=var.get() [Under def playCk(self): for your app]
http://infohost.nmt.edu/tcc/help/pubs/tkinter/control-variables.html
You can run the command using os.system() or subprocess.
os.system("chuck $HOME/Apps/Source/ChucK/" + python_var)

woooee 814 Nearly a Posting Maven

if count <= count1: Is count1 delared somewhere? If so, which line is the error referencing. Also, use CODE tags, see this post http://www.daniweb.com/forums/announcement114-3.html

woooee 814 Nearly a Posting Maven

Not sure what you are asking but try this and see if it helps any. You have to test each individual character and replace the ones that match your criteria.

for line in self.map:                      ## one line at a time
     spaces=""                             ## move each character over one space
     for character in line:                ## print each character in each line
          print spaces, character
          spaces += " "
woooee 814 Nearly a Posting Maven

I use easyGUI for quick and dirty apps http://www.ferg.org/easygui/

woooee 814 Nearly a Posting Maven

Also you only add 12 to the hour if it is 1:00pm through 11:00pm.

woooee 814 Nearly a Posting Maven

Are you using Samba to connect to MS files? It seems no one here uses unixODBC 2.2.12 or FreeTds 0.64, so you might have more luck asking on the mailing list/forum for those programs, especially since it has to do with ini files and not python.

woooee 814 Nearly a Posting Maven

There is no way to tell since the code you use to import is not included. Here is a link to the "Dive Into Python" chapter on import http://diveintopython.org/object_oriented_framework/importing_modules.html

woooee 814 Nearly a Posting Maven

The problem is line 2
fin = open ('E:/words.txt')
You open the file as a global and in line 23 process each record in the file via a for() loop, leaving the pointer at the end of the file. So the second time through you read the file starting at the end of the file, that is no records are read. You can use vegaseat's solution, or move the open into the function and then close the file (which does the same thing as vegaseat). That is somewhat inefficient since you read the same file every time the function is called but if the file is not large it is not much of a difference. has_none() would become

def has_none():

###Function to take a string of letters from the user and search a list of words. 
##The number of words that do not cotain any of the letters will be given###

     contain=0
     notcontain=0

     input=raw_input("Please input a string of letters i.e. jdheu")

     fin = open ('E:/words.txt')
     for line in fin:
          if avoid(line,input)=='True':
               notcontain+=1
          elif avoid(line,input)=='False':
               contain+=1
     fin.close()
     print str(notcontain) +" out of " + str(contain+notcontain) + " did not contain the letters " + input
woooee 814 Nearly a Posting Maven

There is generally 8, 10, or 12 characters printed per inch using "normal" fonts. If you want the columns to line up then you have to use a monospaced/fixed width font instead of a proportional font. With a proportional font you can align the columns by inserting tabs but how it prints depends on the default tab size. You will have to print a test line or two to see what the default font for your printer does. i.e. send something like
....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
the above is for characters available per line (including margins) so length=available-margins
ilili
mwmwm <----- The "i" will be over the "m" if it is a fixed width font, and "l" over "w"

To get fancier than your printer's default type style, you would have to use a markup language like postscript or html, although some printers have their own control language and can print more than one default font.

woooee 814 Nearly a Posting Maven

In Linux, one can use popen to access the print spooler, which then takes care of scheduling and printing the job. Does anyone know if this works on Windows using the "print" command?
pr=os.popen("lpr", "w")
pr.write("Write this line directly to the print spooler\n")
pr.close()

woooee 814 Nearly a Posting Maven

There is a slight flaw in ZZucker's post, but the OP should have reason this out for themselves.

sneekula commented: good eyes +3