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
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
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
[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
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
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
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
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
[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
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
___
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
[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
>
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
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
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']}
>
>
[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)]
>
>
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
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
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
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[
[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
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
[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
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
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
[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
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
>> 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
[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
> 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:
&
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
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
>> 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
[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
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
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).
[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
[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://
[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
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
[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
[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
> 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
[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
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
>> 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
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
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
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
> 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
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
51 matches
Mail list logo