Re: get Windows file type

2006-05-08 Thread dwelch
BartlebyScrivener wrote: Using Python on Windows XP, I am able to get almost all file and path info using os.path or stat, but I don't see a way to retrieve the file type? E.g. Microsoft Word file, HTML file, etc, the equivalent of what is listed in the Type column in the Windows Explorer box.

A SANE scanner backend written in Python?

2006-03-28 Thread dwelch
I've read many times on this newsgroup over the years that you can write just about anything in Python, except perhaps a full operating system (maybe even that...?). So, with this spirit in mind, I would like to try to write a SANE scanner backend that I need to write, in Python rather than C.

Re: Probelem about image size and dimensions

2006-03-23 Thread dwelch
[EMAIL PROTECTED] wrote: I got a piece of python script to upload file and it can upload it to different folders on server depend on the type of file is image or not. but I also want to restrict the size and dimensions of file if it is a image file.Could anyone help me out? Parameter

Re: Handling yes/no questions from the User

2006-03-21 Thread dwelch
[EMAIL PROTECTED] wrote: I'm writing a scipt that need to interact with the user. Lets say I have the: Do you want to continue [Y|n] Where just pressing return means Yes (since its uppercase). Its easy to write a function for this, but perhaps something like this already exists. Could

Re: pythonic exec* spawn*

2006-02-09 Thread dwelch
[EMAIL PROTECTED] wrote: You could possibly pickle an object and send it, but that could be a bit messy... pickle it (or shelve?) and then pass the pickle/shleve filename to the other process as a command line parameter? Not sure if this would work or not, but that's where I would start.

Re: How to ping in Python?

2005-12-05 Thread dwelch
Nico Grubert wrote: Hi there, I could not find any ping Class or Handler in python (2.3.5) to ping a machine. I just need to ping a machine to see if its answering. What's the best way to do it? Kind regards, Nico # Derived from ping.c distributed in Linux's netkit. That code is #

Re: newbie question concerning formatted output

2005-11-29 Thread dwelch
Thomas Liesner wrote: Hello all, i am having some hard time to format the output of my small script. I am opening a file which containes just a very long string of hexdata seperated by spaces. Using split() i can split this string into single words and print them on stdout. So far so good.

Re: PyQt layout question: QScrollView and QGridLayout?

2005-11-17 Thread dwelch
Volker Lenhardt wrote: Phil Thompson schrieb: On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote: prefer to use QGridLayout, but cannot add it to the scroll view. sc=QScrollView(self) layout=QGridLayout(..., sc.viewport()) sc.addChild(layout) results in a TypeError. Is there

Re: How to write an API for a Python application?

2005-11-16 Thread dwelch
Gary Kshepitzki wrote: Hello I would like to create an API for a piece of Python code. The API is for use by non Python code. It should support interaction in both directions, both accessing functions on the API and the ability for the API to raise events on its client. What is the best