Re: [Tutor] hello.py: line 1: print: command not found

2004-12-04 Thread Bill Burns
On Saturday 04 December 2004 11:53 pm, Cullen Newsom wrote: > Max, > > Thanks for your reply. I have already tried to set my > confirmation that this is not a file permission problem, I > should say that I can run hello.py as root, and get the expected > result. I can also run it as normal us

Re: [Tutor] networking

2004-12-28 Thread Bill Burns
On Monday 27 December 2004 4:22 pm, Marco wrote: > Hi python tutors, > Im interested on learning python but i would like to focus in a specific > topic, networking, where can i find documention networking in python? > sockets and all that stuff? i looked for some information but all of them > were

[Tutor] Sorting/filtering data, dictionary question & Re:OT

2005-01-02 Thread Bill Burns
Hi, I have a couple of questions about a program I've been working on. Here's a overview of what the program does. Calculates the following data about HVAC/Plumbing pipe: A). Total volume of water inside the pipe (US gallons). B). The weight of the water inside the pipe. C). The actua

Re: [Tutor] Sorting/filtering data, dictionary question & Re:OT

2005-01-03 Thread Bill Burns
[Kent] > This is actually a common approach to sorting a list in Python - add enough > fields to the list so it sorts the way you want, then filter out the fields > you don't need any more. It even has a name, it's called Decorate - Sort - > Undecorate. In your case the 'decorate' step is built-in

Re: [Tutor] Re: Sorting/filtering data, dictionary question

2005-01-03 Thread Bill Burns
On Monday 03 January 2005 8:35 am, Bob Gibson wrote: > Bill: > > Could you have the "LineEdit#" be your sortable field? If each # after > the "LineEdit" prefix were the same length, then you could easily sort on > it. Bob, Using your suggestion, I did a little test on a modified version of my

Re: [Tutor] Sorting/filtering data, dictionary question & Re:OT

2005-01-04 Thread Bill Burns
On Monday 03 January 2005 11:09 pm, Jacob S. wrote: > You're thinking right. The syntax is supposed to be something like > > [ altereditem for item in iterable if condition ] > > So, > to get all the even numbers between 1 & 10 > > >>> a = [x for x in range(1,11) if x % 2 == 0] > >>> print a > > [2

[Tutor] Posting a large amount of code?

2005-01-15 Thread Bill Burns
Hello, I've been working on a small GUI program (on & off) for a little while now and I'd love to have the group (or anyone for that matter) take a look at it and give me some pointers. Since I'm not a programmer and I don't do this continuously, I don't now if I'm on the right track or not. I'd l

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
I accidentally sent my reply to Kent only. So I'm forwarding it to the list. Bill -- Forwarded Message -- Subject: Re: [Tutor] Posting a large amount of code? Date: Sunday 16 January 2005 10:14 am From: Bill Burns <[EMAIL PROTECTED]> To: Kent Johnson <[EMAIL PROT

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
[Bill] > I guess my question is, would it be acceptable to post this much code to > the list? [Alan] > Probably about the limit for posting, but if you can put it on > a web site somewhere and post a URL that would be fine... [Bill] Kent had made the same suggestion as well but alas I have no si

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
On Sunday 16 January 2005 10:53 am, Orri Ganel wrote: > For future reference, you can always post code to paste: > > http://rafb.net/paste/ > > Cheers, > Orri Thanks Orri! I didn't know there was a site like that. I'll check it out and see how it works! Thanks again. Bill ___

Re: [Tutor] Posting a large amount of code?

2005-01-16 Thread Bill Burns
On Sunday 16 January 2005 1:28 pm, Alan Gauld wrote: > Some quick feedback based on a quick scim through. > > It looks like your pipe logic is all mixed up with the GUI vpde. > > It would be a god excercise to extract all the p[ipe code into > a separate class and the GUI methods call those class m

Re: [Tutor] Posting a large amount of code?

2005-01-17 Thread Bill Burns
[Jacob] > > Actually according to the above paragraph, he suggests putting them > > all in > > > a seperate class. So pseudo-code... > > > > class Pipe: > > All things related to pipe program here. > > > > class GUI: > [Alan] > Exactly so. The rationale for that was that you could work with >

Re: [Tutor] Importing C,C++,Asm modules

2005-05-04 Thread Bill Burns
On Wednesday 04 May 2005 4:39 am, Ali Polatel wrote: > Dear friends, > Is there a way to import C,C++ or Asm modules to python scripts? > If yes how? > Thanks and regards, Hi Ali, If you're asking if you can take C or C++ code and compile it in such a way as to be able to import i

Re: [Tutor] OT self-implementation?

2005-07-02 Thread Bill Burns
Brian, If you've never read this before, you may find it interesting: http://cm.bell-labs.com/who/ken/trust.html Bill ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] priting keys and its values of a dictionary in a single row

2007-04-27 Thread Bill Burns
Srinivas Iyyer wrote: > Dear group, > > I have a dictionary (huge) and there are 19K keys for > this dictionary. The values for the could be a max 19K > again. > > simpler version of it: > > mydict= > {'a':['apple','ant','anchor','arrow'],'b':['ball','baby',boy','bus'],'c':['cat','call']} > >

Re: [Tutor] Bundle help!

2007-07-09 Thread Bill Burns
[Sara Johnson] > Sorry to be so confusing. Just realized a dumb mistake I made. It > doesn't need to be resorted alphabetically and numerically. I need one > list alphabetical and one numerical. > > > (Alphabetical) List 1, [('Fred', 20), ('Joe', 90), ('Kent', 50), > ('Sara', 80)] > >

Re: [Tutor] making aaa.txt in notepad focused.

2007-07-11 Thread Bill Burns
elis aeris wrote: > import time > from ctypes import * > > # Load up the Win32 APIs we need to use. > GetForegroundWindow = windll.user32.GetForegroundWindow > > > foreground_window = GetForegroundWindow() > > > > > > this is a part of a code I from a separate project. > > > I am trying t

Re: [Tutor] making aaa.txt in notepad focused.

2007-07-12 Thread Bill Burns
elis aeris wrote: > is it possible to do patial window title? Partial window title? ;-) Sure, have a look at this thread: http://aspn.activestate.com/ASPN/Mail/Message/python-win32/3012629 and take a look at pywinauto, as well: http://sourceforge.net/projects/pywinauto https://lists.sourceforg

Re: [Tutor] Platform-independent Excel reader

2007-07-13 Thread Bill Burns
encore jane wrote: > Hi, > > Does anyone know about a good native Excel file reader that is platform > independent? > > Thanks, > > AJ > Take a look at this, it's platform independent and reads excel files :-) http://cheeseshop.python.org/pypi/xlrd Bill

Re: [Tutor] Getting single values of a tuple & storing them

2007-10-31 Thread Bill Burns
Trey Keown wrote: > Hey all, > I was wondering, how could I get each value inside of a tuple, say it's > (2,4) . > The only value I really need is the second one (the tuple will always have > only two values. > > Thanks for any help. > Try one of these approaches: In [1]: t = (2, 4) In [2]: t[

Re: [Tutor] Spaces and tabs messing up code

2008-01-08 Thread Bill Burns
[EMAIL PROTECTED] wrote: > my friend uses vim > and i use xemacs > so our shared python code is a mix of tabs and spaces and it is hard for > him to edit it in vim > > any idea on how to make it clean > convert it all to 4 spaces? > > Thanks > Take a look at reindent.py. This script lives in

[Tutor] Parsing os.popen(command) output

2005-09-11 Thread Bill Burns
Hi, I'm parsing some output from a command that I execute with os.popen. This command (tiffinfo) displays information about Tiff images. The solution I'm using does work, but I'm wondering there's a 'better' way to do it. Here's the typical output from the command: [start output] TIFF Directory a

Re: [Tutor] Parsing os.popen(command) output

2005-09-11 Thread Bill Burns
[Bill] >>Here's the typical output from the command: >>[start output] >>TIFF Directory at offset 0x8 >> >> Subfile Type: (0 = 0x0) >> >> Image Width: 12000 Image Length: 16800 >> >> Resolution: 400, 400 pixels/inch >> >> Bits/Sample: 1 >> >> Compression Scheme: CCITT Group 4 >> >> Photo

Re: [Tutor] Parsing os.popen(command) output

2005-09-11 Thread Bill Burns
Bill wrote: >> So I opted for this >> >> wRes = float(data[1].strip(',')) >> >> which seems to work fine. Orri wrote: > You could just do > > wRes = float(data[1][:-1]) (up to the last digit, which would be the comma) Orri, Thank you! I had never used slicing before (until today). I learn some

[Tutor] Threading in a for loop

2005-09-20 Thread Bill Burns
I've got a few questions regarding Threading. I've never used threads before and I want to make sure I'm doing it correctly ;-) I have a GUI app and it processes Tiff files to PDF (or PostScript). The GUI has a ListBox which the user populates with files to convert. You click on a Button and the f

Re: [Tutor] Threading in a for loop

2005-09-23 Thread Bill Burns
[Kent Johnson] Here are some more resources for you. This cookbook recipe is very similar to what you want to do, just customize workerThread1 to do the actual work. It shows how to use a Queue to communicate back to the GUI thread. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965

[Tutor] Regex help

2005-10-09 Thread Bill Burns
I'm looking to get the size (width, length) of a PDF file. Every pdf file has a 'tag' (in the file) that looks similar to this Example #1 MediaBox [0 0 612 792] or this Example #2 MediaBox [ 0 0 612 792 ] I figured a regex might be a good way to get this data but the whitespace (or no whitespac

Re: [Tutor] Regex help

2005-10-10 Thread Bill Burns
>> I'm looking to get the size (width, length) of a PDF file. Every pdf >> file has a 'tag' (in the file) that looks similar to this >> >> Example #1 >> MediaBox [0 0 612 792] >> >> or this >> >> Example #2 >> MediaBox [ 0 0 612 792 ] >> >> I figured a regex might be a good way to get this data but

Re: [Tutor] Regex help

2005-10-10 Thread Bill Burns
[Andrew] > If the format is consistent enough, you might get away with something like: > > >>> p = re.compile('MediaBox \[ ?\d+ \d+ (\d+) (\d+) ?\]') > >>> print p.search(s).groups() > ('612', '792') > > The important bits being: ? means "0 or 1 occurences", and you can use > parentheses to

Re: [Tutor] Regex help

2005-10-10 Thread Bill Burns
> On Mon, 10 Oct 2005, Bill Burns wrote: > > >>I'm looking to get the size (width, length) of a PDF file. > > Hi Bill, > > Just as a side note: you may want to look into using the 'pdfinfo' utility > that comes as part of the xpdf package: &

Re: [Tutor] testing for modules?

2005-10-24 Thread Bill Burns
Ed Hotchkiss wrote: > i have a generic script that is using several modules on windows and > linux boxes. i need to have the scripts test if a module is installed, > and then if not - then to install the module. can anyone give me a > headsup on how to test for a module, returning something to i

[Tutor] Find multiple lines in a file

2005-11-08 Thread Bill Burns
I have a PostScript file which contains the following lines (the numbers are for reference only and are *not* in the file): 1 << 2 /Policies << 3 /PageSize 3 4 >> 5 >> setpagedevice These lines never change and are always formatted like this (at least in the PostScript files that I'm gene

Re: [Tutor] Find multiple lines in a file

2005-11-09 Thread Bill Burns
>> I have a PostScript file which contains the following lines (the numbers >> are for reference only and are *not* in the file): >> >> 1 << >> 2 /Policies << >> 3 /PageSize 3 >> 4 >> >> 5 >> setpagedevice >> >> I want to open the the file and read it, find these five lines and then >> re

Re: [Tutor] Multi-Dimensional Dictionary that contains a 12 element list.

2005-12-30 Thread Bill Burns
[snip] Paul Kraus wrote: > Now I have to find a way to take the output at the end and pipe it > out to an external Perl program that creates an excel spreadsheet ( > no real clean easy way to do this in python but hey each tool has its > usefullness). I wish I could hide this in the object though

Re: [Tutor] Python & MP3

2006-03-21 Thread Bill Burns
Johanna wrote: > Hallo > > > > This is my first post, so hallo to everyone. Im just a newbee with > python so I hope my msg will make some sense. J > > > > Is it possible to work with MP3 in python? > > I’m looking for a library to modify MP3s (like fade in, fade out, > etc..). I know th

[Tutor] Watch and control access to an executable

2006-04-07 Thread Bill Burns
Hi Tutors! I have a problem that I've solved using Python, and I want to know if I've done a good job :-) Here's the problem: At my work we have a Windows network. On a network drive lives a program that a couple people need to access (there's a shortcut on each user's Desktop to the executable).

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Bill Burns
[Bill] >> Desktop to the executable). The problem is, only *one* person at a time >> should run the program. > [Alan] > The usual way of doing this is simply to create an empty file > when the program starts and delete it when the program closes > In python: > > ## > # File : exRun.p

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Bill Burns
[Bill] >>>Desktop to the executable). The problem is, only *one* person at a time >>>should run the program. > [Snip some good advise about file problems (that I'll look in to)] [André] > However, there is a Cookbook solution that does, I believe, that what > the original poster asked: > http://

Re: [Tutor] Watch and control access to an executable

2006-04-08 Thread Bill Burns
[Bill] >> If I'm not mistaken (and I certainly could be) I believe this recipe >> is used to control instances of an already running *script*. While I'm >> trying to control a completely different executable (program) written >> by someone else. [Alan] > Nope, its si8mply creating an arbitrary

Re: [Tutor] Wondering is there a pyQT list

2006-06-12 Thread Bill Burns
johnf wrote: > Hi, > I was wondering if there is a pyqt list like the > [EMAIL PROTECTED] list? > http://mats.imk.fraunhofer.de/mailman/listinfo/pykde ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How would I make a program that password protects on aninactivity timer?

2006-08-29 Thread Bill Burns
[Alan Gauld] > I'd try the screen saver settings first, its much easier! > As Alan has stated above, the screen saver idea is probably the easiest way to go, but personally... I always to do it the the hard way :-) Using ideas from eariler posts (regarding Windows events and ctypes), here's my a

Re: [Tutor] How would I make a program that password protects on aninactivity timer?

2006-08-29 Thread Bill Burns
[Bill Burns] > import pythoncom > import ctypes > import win32api You can lose the win32api import in my code. Initially, I was using `win32api.ExitWindowsEx(0, 0)` to logout, but after Kent posted the link to ctypes.windll.user32.LockWorkStation(), I switched to the cytpes metho

Re: [Tutor] making independent program?

2006-09-04 Thread Bill Burns
> I've tried to follow the py2exe wiki instructions on how to trim this > out, http://www.py2exe.org/index.cgi/TkInter, but I seem to be doing > something wrong. Here's my setup.py--- > > from distutils.core import setup > import py2exe > > excludes = ["pywin", "pywin.debugger", "pywin.debugg

Re: [Tutor] how do I find where my program is installed?

2006-09-07 Thread Bill Burns
[Jeff] > I read the link you sent, and I am not sure what they mean by "You > cannot rely on __file__, because __file__ is not there in the py2exed > main-script." can't I use _file_ in my application though? This is what > I just added to my application and it seems to do the trick... is there

[Tutor] Threaded FTP class

2006-10-09 Thread Bill Burns
Hi all, I'm trying to make a small, threaded FTP app and I'm running into a problem. My program has a GUI (I use PythonCard) and I want the GUI to be responsive while network operations are going on. I assumed that if I made a class (shown below) which was sub-classed from threading.Thread - I w

Re: [Tutor] Threaded FTP class

2006-10-09 Thread Bill Burns
>> I'm trying to make a small, threaded FTP app and I'm running into >> a problem. >> >> My program has a GUI (I use PythonCard) and I want the GUI to be >> responsive while network operations are going on. >> >> I assumed that if I made a class (shown below) which was sub-classed >> from threading

Re: [Tutor] Zipfile and File manipulation questions.

2006-10-14 Thread Bill Burns
Chris Hengge wrote: > First question.. > > This is the code that I have: > for filename in zfile.namelist(): > outfile = open(filename, 'w') > outfile.write(zfile.read(filename)) > outfile.close() > > Is there a way to say : > for filename in zfile.namelist() contains '.tx

Re: [Tutor] Zipfile and File manipulation questions.

2006-10-15 Thread Bill Burns
Chris Hengge wrote: > After getting some sleep and looking at my code, I think I was just to > tired to work through that problem =P > > Here is my fully working and tested code.. > Thanks to you all for your assistance! > > if "/" in afile: > aZipFile = afile.rsplit('/', 1)[-1] # Split file

Re: [Tutor] Print Screen

2006-11-02 Thread Bill Burns
Chris Hengge wrote: > I posted this in a similar thread a few days ago, and no replies so I > think it needs its own listing. > > Anyone know of a way to capture special keys like "Print Screen"? > I have a small script to grab all they keycodes, but it doesn't seem to > catch several keys on th

Re: [Tutor] pysvn samples

2006-12-16 Thread Bill Burns
> I am looking to experiment with pysvn and was wondering if anyone knew > of a location for code samples/snippets using it? > > I'm reviewing the pysvn programmers guide and tutorial but some live > examples would be great. > > If anyone can point me at something, it would be appreciated. > Hi

Re: [Tutor] Problems with Gauge Bar.

2008-08-22 Thread Bill Burns
Olrik Lenstra wrote: It works! :) My program is now as good as done, only one thing that bothers me a bit. When I click the scan button the GUI Freezes because it is handling the onScan function. Is there any way to prevent this? Regards, Olrik You might try adding wx.SafeYield(self, True) i