Re: How to better pickle an extension type

2007-04-16 Thread Ziga Seilnacht
dgdev wrote: > I would like to pickle an extension type (written in pyrex). I have > it working thus far by defining three methods: > > class C: > # for pickling > __getstate__(self): > ... # make 'state_obj' > return state_obj > > __reduce__

Re: Queue enhancement suggestion

2007-04-16 Thread Antoon Pardon
On 2007-04-17, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Antoon Pardon" <[EMAIL PROTECTED]> wrote: > > >> The problem is this doesn't work well if you have multiple producers. >> One producer can be finished while the other is still putting values >> on the queue. >> >> The solution I have b

Re: Queue enhancement suggestion

2007-04-16 Thread Antoon Pardon
On 2007-04-17, Paul Rubin wrote: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> The problem is this doesn't work well if you have multiple producers. >> One producer can be finished while the other is still putting values >> on the queue. > > Right, you'd wait for all the producers to finish, then

Re: strange behaviour sys.argv

2007-04-16 Thread Charles Sanders
schnupfy wrote: > > ok, thanks for the answers. I try to hand over the 3rd part (the long > trap) as one cmd argument. I will ask in a shell ng. Thanks again. > > Cheers Should be as simple as removing the backslashes /root/mk/services.py $HOST $SEVERITY "$TRAP" should pass TRAP as a s

python-list@python.org

2007-04-16 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Once in while I too have something to ask. This is a little problem > that comes from a Scheme Book (I have left this thread because this > post contains too much Python code for a Scheme newsgroup): > For fun I have tried to make it lazy, if may be useful if seq is a >

how to copy the contents of pygtk into a file

2007-04-16 Thread PARIMALA KALAVALA
hi, I want to know how to copy the contents of a pygtk application into a file and include that in other applications. Pls reply to this . bye. -- http://mail.python.org/mailman/listinfo/python-list

python-list@python.org

2007-04-16 Thread attn . steven . kuo
On Apr 16, 5:14 pm, [EMAIL PROTECTED] wrote: > Once in while I too have something to ask. This is a little problem > that comes from a Scheme Book (I have left this thread because this > post contains too much Python code for a Scheme > newsgroup):http://groups.google.com/group/comp.lang.scheme/br

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-16 Thread Tim Roberts
"Beliavsky" <[EMAIL PROTECTED]> wrote: > >Fortran has allowed a user-specified base since at least the 1977 >standard -- see for example >http://www.umiacs.umd.edu/~jhu/DOCS/SP/docs/essl/essl159.html >. You can strike "at least"; this extension was introduced in FORTRAN 77. FORTRAN 66 didn't do t

Re: script for seconds in given month?

2007-04-16 Thread Hendrik van Rooyen
"Paul McGuire" <[EMAIL PROTECTED]> wrote: > On Apr 16, 11:22 am, "edfialk" <[EMAIL PROTECTED]> wrote: > > Hi, does anyone happen to know of a script that would return the > > number of seconds in a month if I give it a month and a year? > > > > My python is a little weak, but if anyone could offer

Re: Queue enhancement suggestion

2007-04-16 Thread Hendrik van Rooyen
"Antoon Pardon" <[EMAIL PROTECTED]> wrote: > The problem is this doesn't work well if you have multiple producers. > One producer can be finished while the other is still putting values > on the queue. > > The solution I have been thinking on is the following. > > Add an open and close operation.

Re: Queue enhancement suggestion

2007-04-16 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > The problem is this doesn't work well if you have multiple producers. > One producer can be finished while the other is still putting values > on the queue. Right, you'd wait for all the producers to finish, then finish the queue: for p in producer_th

Re: How to better pickle an extension type

2007-04-16 Thread Alex Martelli
dgdev <[EMAIL PROTECTED]> wrote: > I would like to pickle an extension type (written in pyrex). I have > it working thus far by defining three methods: > > class C: > # for pickling > __getstate__(self): > ... # make 'state_obj' > return state_obj > >

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-16 Thread Alex Martelli
Paul Boddie <[EMAIL PROTECTED]> wrote: > > Now I hear that the word "with" is being discussed for a different > > purpose in Py 3 as a result of a PEP and I don't want to conflict with > > that. > > The "with" keyword appears in 2.5 onwards. ...but needs a "from __future__ import with_statement"

python-list@python.org

2007-04-16 Thread Paul Rubin
[EMAIL PROTECTED] writes: > So I have tried to create two iterables for the fun function scanning > seq once only, but I haven't succed so far (to do it I have tried to > use two coroutines with the enhanced generators, sending el to one or > to the other according to the value of x == el, this tim

Re: script for seconds in given month?

2007-04-16 Thread Alex Martelli
edfialk <[EMAIL PROTECTED]> wrote: > Hi, does anyone happen to know of a script that would return the > number of seconds in a month if I give it a month and a year? > > My python is a little weak, but if anyone could offer some suggestions > I think I could handle it myself, or if anyone happens

Re: strange behaviour with keyword arguments and inheritance

2007-04-16 Thread Alex Martelli
Steve Holden <[EMAIL PROTECTED]> wrote: ... > > livibetter has a better solution. the reason is that you need to > > create a new list object everytime, am I right? > > > Yes, specifically on every *call*. ...and livibetter's solution also creates a new list on every call to Child (that [] pas

python-list@python.org

2007-04-16 Thread Paddy
On Apr 17, 1:14 am, [EMAIL PROTECTED] wrote: > Once in while I too have something to ask. This is a little problem > that comes from a Scheme Book (I have left this thread because this > post contains too much Python code for a Scheme > newsgroup):http://groups.google.com/group/comp.lang.scheme/br

How to Passs NULL as a IDispatch Pointer to method?

2007-04-16 Thread ZhaoYingpu
Hello,all I am using win32com to use com. and invoke a method as follows: void AddShapeInfo(LPCTSTR name, LONG type, IDispatch* pDisp); but i pass 0 or None to third parameter and get error info: >>> x.AddShapeInfo("who", 10, 0) Traceback (most recent call last): File "", line 1, in x.Ad

Re: is laziness a programer's virtue?

2007-04-16 Thread Markus E Leypold
"Xah Lee" <[EMAIL PROTECTED]> writes: > • Please remind yourself what is on-topic and off-topic. Unless you You, Sir, ARE off-topic. I suggest you make the experiment to post your drivel on your web site and let your fans come to you. Should be an eye opener, this experiment. Regards -- Markus

python-list@python.org

2007-04-16 Thread James Stroud
[EMAIL PROTECTED] wrote: > Once in while I too have something to ask. This is a little problem > that comes from a Scheme Book (I have left this thread because this > post contains too much Python code for a Scheme newsgroup): > http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/a

regarding tree iterators

2007-04-16 Thread PARIMALA KALAVALA
hi , I wanted to know how to move data from one row to another row or how to copy contents of one row to another row if we click any button in a table in pygtk. Do we need to use get value and set value methods in tree iterators. pls reply to this as early as possible. Thank you. -- http:/

Re: strange behaviour sys.argv

2007-04-16 Thread schnupfy
On Apr 17, 3:00 pm, Charles Sanders <[EMAIL PROTECTED]> wrote: > Michael Hoffman wrote: > > schnupfy wrote: > > >> I am not used to python and I am wondering about this thing: > > > This is not a Python question. It is a question about how to use bash. > > [snip] > > Michael is correct, it is a bas

Re: list insertion question

2007-04-16 Thread Paul Rubin
[EMAIL PROTECTED] writes: > hi > i have a list (after reading from a file), say > data = [ 'a','b','c','d','a','b','e','d'] > > I wanted to insert a word after every 'a', and before every 'd'. so i > use enumerate this list: > for num,item in enumerate(data): > if "a" in item: > data.in

Re: list insertion question

2007-04-16 Thread attn . steven . kuo
On Apr 16, 6:05 pm, [EMAIL PROTECTED] wrote: > hi > i have a list (after reading from a file), say > data = [ 'a','b','c','d','a','b','e','d'] > > I wanted to insert a word after every 'a', and before every 'd'. so i > use enumerate this list: > for num,item in enumerate(data): > if "a" in item

question of easyExcel (<>)

2007-04-16 Thread Tommy Zong
Hi, class easyExcel: def __init__(self, filename=None): self.xlApp = Dispatch('Excel.Application') if filename: self.filename = filename self.xlBook = self.xlApp.Workbooks.Open(filename) else: self.xlBook = self.xlApp.Workbooks.Add() self.filename =

Re: strange behaviour sys.argv

2007-04-16 Thread Charles Sanders
Michael Hoffman wrote: > schnupfy wrote: > >> I am not used to python and I am wondering about this thing: > > This is not a Python question. It is a question about how to use bash. > [snip] Michael is correct, it is a bash thing, nothing to do with python. bash (and other *nix like shells) gen

Re: Python and SSL

2007-04-16 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > It means that these modules can do encrypted communication for their > respective protocol. They cannot validate that they are really talking > to the server they think they talk to (so they are prone to a > man-in-the-middle attack), however, as comm

Re: Queue enhancement suggestion

2007-04-16 Thread Paul Rubin
Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > Instead of putting multiple sentinels, just pre-construct the iterator > object. > work = iter(q.get, sentinel) > Re-use the same iterator in each thread, and you'll get the behavior > you're after. Whaaat??? Can I do that? It looks l

Re: strange behaviour with keyword arguments and inheritance

2007-04-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 17, 9:36 am, livibetter <[EMAIL PROTECTED]> wrote: >> On Apr 17, 8:56 am, "matthewperpick" <[EMAIL PROTECTED]> wrote: >> >>> Check out this toy example that demonstrates some "strange" behaviour >>> with keyword arguments and inheritance. >>> ==

Re: yield, curry, mix-in, new.function, global, closure, .... what will work?

2007-04-16 Thread ecir . hana
On Apr 17, 3:51 am, [EMAIL PROTECTED] wrote: > I'm reading the docs now and I stumbled upon something: > section "15.3 threading -- Higher-level threading interface" mensions > a class "local", in which "... Thread-local data are data whose values > are thread specific. ..." > > Does it mean, I can

Re: strange behaviour with keyword arguments and inheritance

2007-04-16 Thread [EMAIL PROTECTED]
On Apr 17, 9:36 am, livibetter <[EMAIL PROTECTED]> wrote: > On Apr 17, 8:56 am, "matthewperpick" <[EMAIL PROTECTED]> wrote: > > > Check out this toy example that demonstrates some "strange" behaviour > > with keyword arguments and inheritance. > > > = > > > class Par

Re: list insertion question

2007-04-16 Thread [EMAIL PROTECTED]
On Apr 17, 9:47 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > hi > > i have a list (after reading from a file), say > > data = [ 'a','b','c','d','a','b','e','d'] > > > I wanted to insert a word after every 'a', and before every 'd'. so i > > use enumerate this list:

Re: yield, curry, mix-in, new.function, global, closure, .... what will work?

2007-04-16 Thread ecir . hana
I'm reading the docs now and I stumbled upon something: section "15.3 threading -- Higher-level threading interface" mensions a class "local", in which "... Thread-local data are data whose values are thread specific. ..." Does it mean, I can create global variables whose changing is thread- safe?

Re: list insertion question

2007-04-16 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > hi > i have a list (after reading from a file), say > data = [ 'a','b','c','d','a','b','e','d'] > > I wanted to insert a word after every 'a', and before every 'd'. so i > use enumerate this list: > for num,item in enumerate(data): > if "a" in item: > data.inse

Re: combination function in python

2007-04-16 Thread [EMAIL PROTECTED]
On Apr 16, 6:40 pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Isn't that what docstrings are for? Can't you leave > > the function name noverk() and add something to the > > effect of "this function calculates combinations"? > > Then it would show up in searches, wou

Re: strange behaviour sys.argv

2007-04-16 Thread Michael Hoffman
schnupfy wrote: > I am not used to python and I am wondering about this thing: This is not a Python question. It is a question about how to use bash. I would try to help anyway, but I am unsure what results you actually want. Your example is too complicated as well. You should strip down your

Re: strange behaviour with keyword arguments and inheritance

2007-04-16 Thread livibetter
On Apr 17, 8:56 am, "matthewperpick" <[EMAIL PROTECTED]> wrote: > Check out this toy example that demonstrates some "strange" behaviour > with keyword arguments and inheritance. > > = > > class Parent: > def __init__(self, ary = []): > self.ary = ary > T

strange behaviour sys.argv

2007-04-16 Thread schnupfy
Hi, I am not used to python and I am wondering about this thing: If I execute this from the shell: /root/mk/services.py 192.168.1.101 critical "192.168.1.101 192.168.1.101 SNMPv2-MIB::sysUpTime.0 14:13:02:57.06 SNMPv2- MIB::snmpTrapOID.0 SNMPv2-SMI::enterprises.789.0.13 SNMPv2- SMI::enterprises.

Re: strange behaviour with keyword arguments and inheritance

2007-04-16 Thread [EMAIL PROTECTED]
On Apr 17, 8:56 am, "matthewperpick" <[EMAIL PROTECTED]> wrote: > Check out this toy example that demonstrates some "strange" behaviour > with keyword arguments and inheritance. > > = > > class Parent: > def __init__(self, ary = []): > self.ary = ary > >

list insertion question

2007-04-16 Thread eight02645999
hi i have a list (after reading from a file), say data = [ 'a','b','c','d','a','b','e','d'] I wanted to insert a word after every 'a', and before every 'd'. so i use enumerate this list: for num,item in enumerate(data): if "a" in item: data.insert(num+1,"aword") if "d" in item:

Re: unittest assertRaises Problem

2007-04-16 Thread john
On Apr 16, 6:35 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 16 Apr 2007 15:13:42 -0700, john <[EMAIL PROTECTED]> wrote: > > > > >All: > > >Hi. I am an experienced developer (15 yrs), but new to Python and have > >a question re unittest and assertRaises. No matter what I raise, > >assert

strange behaviour with keyword arguments and inheritance

2007-04-16 Thread matthewperpick
Check out this toy example that demonstrates some "strange" behaviour with keyword arguments and inheritance. = class Parent: def __init__(self, ary = []): self.ary = ary def append(self): self.ary.append(1) class Child(Parent): def __

python-list@python.org

2007-04-16 Thread bearophileHUGS
Once in while I too have something to ask. This is a little problem that comes from a Scheme Book (I have left this thread because this post contains too much Python code for a Scheme newsgroup): http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/a059f78eb4457d08/ The function mu

Re: combination function in python

2007-04-16 Thread Anton Vredegoor
[EMAIL PROTECTED] wrote: > Isn't that what docstrings are for? Can't you leave > the function name noverk() and add something to the > effect of "this function calculates combinations"? > Then it would show up in searches, wouldn't it? Yes, a doc string would help finding it in searches, however

UpdateLayeredWindow in pywin32

2007-04-16 Thread livibetter
Hi! I am trying to making an On-Screen Display, which is implemented by wx.Frame. Basically I created a wx.Frame with style like super(OSDBase, self).__init__(parent, id, title, style = wx.STAY_ON_TOP |

Re: Queue enhancement suggestion

2007-04-16 Thread Jean-Paul Calderone
On 15 Apr 2007 23:12:34 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: >I'd like to suggest adding a new operation > > Queue.finish() > >This puts a special sentinel object on the queue. The sentinel >travels through the queue like any other object, however, when >q.get() encounters

Re: Really badly structured Python Books.

2007-04-16 Thread Klaas
On Apr 14, 11:37 am, "Andre P.S Duarte" <[EMAIL PROTECTED]> wrote: > I started reading the beginning Python book. It is intended for people > who are starting out in the Python world. But it is really > complicated, because he tries to explain, then after a bad explanation > he puts out a bad examp

Re: Queue enhancement suggestion

2007-04-16 Thread Klaas
On Apr 15, 11:12 pm, Paul Rubin wrote: > I'd like to suggest adding a new operation > >Queue.finish() > > This puts a special sentinel object on the queue. The sentinel > travels through the queue like any other object, however, when > q.get() encounters the sentinel

Re: script for seconds in given month?

2007-04-16 Thread Paul McGuire
On Apr 16, 12:49 pm, "edfialk" <[EMAIL PROTECTED]> wrote: > Jim: I need years too, basically from 1960-2000. Don't want to > hardcode all those days :) > > Matt: Thanks, I will try this out. > > Paul: I don't believe we need leap seconds. Leap days definitely. > > I'll let you know how Matt's cod

Re: unittest assertRaises Problem

2007-04-16 Thread Jean-Paul Calderone
On 16 Apr 2007 15:13:42 -0700, john <[EMAIL PROTECTED]> wrote: >All: > >Hi. I am an experienced developer (15 yrs), but new to Python and have >a question re unittest and assertRaises. No matter what I raise, >assertRaises is never successful. Here is the test code: > > >class Foo: >def testExc

Re: unittest assertRaises Problem

2007-04-16 Thread attn . steven . kuo
On Apr 16, 3:13 pm, "john" <[EMAIL PROTECTED]> wrote: > All: > > Hi. I am an experienced developer (15 yrs), but new to Python and have > a question re unittest and assertRaises. No matter what I raise, > assertRaises is never successful. Here is the test code: > > class Foo: > def testExceptio

unittest assertRaises Problem

2007-04-16 Thread john
All: Hi. I am an experienced developer (15 yrs), but new to Python and have a question re unittest and assertRaises. No matter what I raise, assertRaises is never successful. Here is the test code: class Foo: def testException(self): raise ValueError class FooTestCase(unittest.TestCa

Re: Pyqt calling a custom dialog and returning the vars

2007-04-16 Thread David Boddie
On Monday 16 April 2007 22:06, Marcpp wrote: > I call a dialog from a principal program but cannot return the value > of the > variables (text box's). Here is a example... [...] > class ag (Agenda): > ... > ... > def _slotAddClicked(self): > d=dialogo1() > d.exec_() >

Re: OverflowError: mktime argument out of range ???

2007-04-16 Thread John Machin
On Apr 17, 1:02 am, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > > Maybe it does. It sure would be nice to get a definite answer. Pity > > nobody documented the time module. > > "The epoch is the point where the time starts. On January 1st of that > year, at 0 hours, the ``time

Re: Pyqt calling a custom dialog and returning the vars

2007-04-16 Thread Diez B. Roggisch
Marcpp schrieb: > I call a dialog from a principal program but cannot return the value > of the > variables (text box's). Here is a example... > > > > from ui import Agenda > from dialog1 import dialogo1 > from PyQt4 import * > import dbm > import sys > > class principal (QApplication): > >

[OT] Re: is laziness a programer's virtue?

2007-04-16 Thread D Herring
Xah Lee wrote: > In a couple of posts in the past year i have crossed-posted (e.g. > recently “What are OOP's Jargons and Complexities”, “is laziness a > programer's virtue?”, “On Java's Interface (the meaning of interface > in computer programing)” ), there are a some controversy, and lots of > of

Re: Python editor/IDE on Linux?

2007-04-16 Thread Bruno Desthuilliers
Ali a écrit : > On 14 Apr, 05:48, "Jack" <[EMAIL PROTECTED]> wrote: > >>That's a good one. I got to find out what's special with Emacs :) > > > The users. > +10 OT-QOTW !-) (ouch, it hurts...) -- http://mail.python.org/mailman/listinfo/python-list

Re: C++ extension problem

2007-04-16 Thread Martin v. Löwis
> Now this is what confuses me: Why does it say that I have the wrong > type when it's the same type as it suggests? When referring to the type, you must *always* form the address of the type structure, including, but not limited to, the line > if (!PyArg_ParseTuple(args, "O!", SillyStringTyp

Re: Python and SSL

2007-04-16 Thread Martin v. Löwis
> - I noticed that socket module provides an SSL class (socket.ssl) but > even if documentation reports that it does not do any certificate > verification a lot of stdlib modules (imaplib, poplib, smtplib, > httplib and urllib2) provides SSL extension classes wherein socket.ssl > is used. What does

Re: Compare regular expressions

2007-04-16 Thread Adam Atlas
On Apr 16, 1:50 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > It's not. For the simplest of expressions one might come up with a > relation between them, but even that would be hard. General case? No chance. I wouldn't say there's 'no chance'. It would require external parsing, for sure, but

is laziness a programer's virtue?

2007-04-16 Thread Xah Lee
2007-03-29 Dear tech geekers, In a couple of posts in the past year i have crossed-posted (e.g. recently “What are OOP's Jargons and Complexities”, “is laziness a programer's virtue?”, “On Java's Interface (the meaning of interface in computer programing)” ), there are a some controversy, and lot

Re: Python + ogr module?

2007-04-16 Thread kyosohma
On Apr 16, 11:36 am, Szkandera.Karel <[EMAIL PROTECTED]> wrote: > Hi, > I need to do web service, which will be convert vector formats, like > shapefile, dgn, mapinfo..(and other formats, which are supported in gdal - > ogr2ogr). I want to do it with using ogr2ogr in the ogr python module, but i

Re: looking for library to read ppt files

2007-04-16 Thread kyosohma
On Apr 16, 1:42 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Aljosa Mohorovic wrote: > > i'm looking for a way to read ppt (powerpoint) files using python and > > to convert slides into jpeg files. > > any links or tips how to do this? > > Not really a Python question but Google turned up: > > http

Re: Printing Using Python

2007-04-16 Thread kyosohma
On Apr 16, 2:13 pm, "Raja" <[EMAIL PROTECTED]> wrote: > Hi, > Attached is the code . I want my program to save the current printer > job properties and , when I reconnect the printer at a latter date , i > need to print the saved job . Can you please help with my code ? How > to print a document

Re: moving multiple directories

2007-04-16 Thread ici
On Apr 16, 9:36 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > DataSmash wrote: > > Hi, > > I need to organize thousands of directories full of files. > > I want to move these directories into other subdirectories. > > For example, all the directories that start with 01, move to > > a directory named

Re: Python editor/IDE on Linux?

2007-04-16 Thread Joshua J. Kugler
On Friday 13 April 2007 10:20, Jack wrote: > I wonder what everybody uses for Python editor/IDE on Linux? > I use PyScripter on Windows, which is very good. I'm using WingWare's WingIDE. Visual debugger, python-scriptable, projects, code-completion that is second-to-none (I LOVE it.). And a ve

Pyqt calling a custom dialog and returning the vars

2007-04-16 Thread Marcpp
I call a dialog from a principal program but cannot return the value of the variables (text box's). Here is a example... from ui import Agenda from dialog1 import dialogo1 from PyQt4 import * import dbm import sys class principal (QApplication): def __init__(self, args): """ In the

Re: Compare regular expressions

2007-04-16 Thread Paddy
On Apr 16, 10:50 am, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > Hi, I'm writing a program with a large data stream to which modules can > connect using regular expressions. > > Now I'd like to not have to test all expressions every time I get a line, > as most of the time, one of them having

Re: script for seconds in given month?

2007-04-16 Thread Shane Geiger
import datetime def first_day_of_next_month( year, month ): """returns the first day of the next month >>> first_day_of_next_month(2007,5) datetime.datetime(2007, 6, 1, 0, 0) >>> first_day_of_next_month(2007,12) datetime.datetime(2008, 1, 1, 0, 0) """ oneday = datetime.timed

Re: C++ extension problem

2007-04-16 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > I'm having a bit of trouble when writing a python extension. I can't > seem to figure out what I did wrong. > I tried to make a minimal example, but it's still quite a bit of > code. > It would be very appreciated if anyone could tell me what I've done > wrong. I can't

Re: moving multiple directories

2007-04-16 Thread DataSmash
Thanks Larry, I'll give that a try... R.D. > > Use win32.moveFile method instead. This links directly to the Windows > MoveFile method that just moves the directory entries around. > > From Win32 Documentation: > > win32api.MoveFile > MoveFile(srcName, destName) > > Renames a file, or a directo

Printing Using Python

2007-04-16 Thread Raja
Hi, Attached is the code . I want my program to save the current printer job properties and , when I reconnect the printer at a latter date , i need to print the saved job . Can you please help with my code ? How to print a document at a later stage and any errors in my code ? import win32ui imp

Re: getting from command line options to file

2007-04-16 Thread Michael Hoffman
CSUIDL PROGRAMMEr wrote: > hi folks > I am new to python. I have a module does call a os.command(cmd) where > cmd is a rpm command. > Instead of using os.command and getting the results on command line , > i would like to dump the output in a file. Is os.command(cmd > > filename) the most efficien

Re: how to check the 'content/type' using urlopen

2007-04-16 Thread John J. Lee
Michael Bentley <[EMAIL PROTECTED]> writes: > On Apr 15, 2007, at 6:25 PM, John wrote: > > > > > i have the following code to open a URL address, but can you please > > tell me how can I check the content type of the url response? > > > > Thank you. > > > > try: > > req = Request(url, t

Re: looking for library to read ppt files

2007-04-16 Thread Larry Bates
Aljosa Mohorovic wrote: > i'm looking for a way to read ppt (powerpoint) files using python and > to convert slides into jpeg files. > any links or tips how to do this? > Not really a Python question but Google turned up: http://www.sharewareconnection.com/ppt-to-jpeg-jpg-tiff-bmps-converter.htm

Re: moving multiple directories

2007-04-16 Thread Larry Bates
DataSmash wrote: > Hi, > I need to organize thousands of directories full of files. > I want to move these directories into other subdirectories. > For example, all the directories that start with 01, move to > a directory named "one", all directories that start with 02, move > to a directory name

getting from command line options to file

2007-04-16 Thread CSUIDL PROGRAMMEr
hi folks I am new to python. I have a module does call a os.command(cmd) where cmd is a rpm command. Instead of using os.command and getting the results on command line , i would like to dump the output in a file. Is os.command(cmd > filename) the most efficient command?? thanks -- http://mail

Re: subprocess confusion

2007-04-16 Thread Michael Hoffman
Tim Arnold wrote: > If 'machine' value is different than the current machine name, I want to > remsh the command to that machine, but obviously I misunderstood the > preexec_fn arg. I don't think the return value of preexec_fn is used for anything. You can use to do things like set process gro

looking for library to read ppt files

2007-04-16 Thread Aljosa Mohorovic
i'm looking for a way to read ppt (powerpoint) files using python and to convert slides into jpeg files. any links or tips how to do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: script for seconds in given month?

2007-04-16 Thread attn . steven . kuo
On Apr 16, 10:18 am, [EMAIL PROTECTED] wrote: > Matt> from time import mktime > Matt> def secondsInMonth(year, month): > Matt> s1 = mktime((year,month,1,0,0,0,0,0,-1)) > Matt> s2 = mktime((year,month+1,1,0,0,0,0,0,-1)) > Matt> return s2-s1 > > Probably won't work if

Re: Compare regular expressions

2007-04-16 Thread Karthik Gurusamy
On Apr 16, 2:50 am, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > Hi, I'm writing a program with a large data stream to which modules can > connect using regular expressions. > > Now I'd like to not have to test all expressions every time I get a line, > as most of the time, one of them having a

Re: Compare regular expressions

2007-04-16 Thread Diez B. Roggisch
Thomas Dybdahl Ahle schrieb: > Hi, I'm writing a program with a large data stream to which modules can > connect using regular expressions. > > Now I'd like to not have to test all expressions every time I get a line, > as most of the time, one of them having a match means none of the others >

Re: script for seconds in given month?

2007-04-16 Thread edfialk
Jim: I need years too, basically from 1960-2000. Don't want to hardcode all those days :) Matt: Thanks, I will try this out. Paul: I don't believe we need leap seconds. Leap days definitely. I'll let you know how Matt's code works. Any other suggestions feel free to let me know. Thanks all!

subprocess confusion

2007-04-16 Thread Tim Arnold
Hi, Just discovered that my subprocess call with the preexec_fn wasn't doing what I thought. If 'machine' value is different than the current machine name, I want to remsh the command to that machine, but obviously I misunderstood the preexec_fn arg. Should I just put the remsh in the actual co

Re: script for seconds in given month?

2007-04-16 Thread Paul McGuire
On Apr 16, 11:22 am, "edfialk" <[EMAIL PROTECTED]> wrote: > Hi, does anyone happen to know of a script that would return the > number of seconds in a month if I give it a month and a year? > > My python is a little weak, but if anyone could offer some suggestions > I think I could handle it myself,

Re: swig win32 scons

2007-04-16 Thread myheartinamerica
It turns out I didn't need the DEF file for exports. -- http://mail.python.org/mailman/listinfo/python-list

Re: script for seconds in given month?

2007-04-16 Thread skip
Matt> from time import mktime Matt> def secondsInMonth(year, month): Matt> s1 = mktime((year,month,1,0,0,0,0,0,-1)) Matt> s2 = mktime((year,month+1,1,0,0,0,0,0,-1)) Matt> return s2-s1 Probably won't work if month==12. ;-) Skip -- http://mail.python.org/mailman/li

swig win32 scons

2007-04-16 Thread myheartinamerica
Hello, I spent the morning figuring out how to use SWIG on Microsoft Windows. I compiled the example from the SWIG tutorial on http://www.swig.org. The biggest stumbling block was not knowing that I needed to rename the DLL created to have a PYD extension. I also ended up writing a .def file for e

Re: yield, curry, mix-in, new.function, global, closure, .... what will work?

2007-04-16 Thread ecir . hana
On Apr 16, 5:36 pm, "Jason" <[EMAIL PROTECTED]> wrote: > On Apr 16, 7:28 am, [EMAIL PROTECTED] wrote: > > > > > On Apr 16, 3:05 am, Paul Rubin wrote: > > > > [EMAIL PROTECTED] writes: > > > > > Please, can you elaborate further, I'm not sure if I understood. > > > > Shoul

Re: script for seconds in given month?

2007-04-16 Thread pythoncurious
On Apr 16, 6:22 pm, "edfialk" <[EMAIL PROTECTED]> wrote: > Hi, does anyone happen to know of a script that would return the > number of seconds in a month if I give it a month and a year? > something like this might work, it should event handle DST correctly. You could read up on mktime() if you w

Re: tuples, index method, Python's design

2007-04-16 Thread Chris Mellon
On 4/12/07, Alan Isaac <[EMAIL PROTECTED]> wrote: > Chris Mellon said: > > Sure. I have never done this. In fact, I have only ever written code > > that converted a tuple to a list once, and it was because I wanted > > pop(), not index() > > Well then you apparently made a *mistake*: you chose a tu

Re: script for seconds in given month?

2007-04-16 Thread Jim
On Apr 16, 12:22 pm, "edfialk" <[EMAIL PROTECTED]> wrote: > Hi, does anyone happen to know of a script that would return the > number of seconds in a month if I give it a month and a year? > > My python is a little weak, but if anyone could offer some suggestions > I think I could handle it myself,

Re: tuples, index method, Python's design

2007-04-16 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Donn Cave" <[EMAIL PROTECTED]> wrote: > > > > > Well, yes - consider for example the "tm" tuple returned > > from time.localtime() - it's all integers, but heterogeneous > > as could be - tm[0] is Year, tm[1] is

C++ extension problem

2007-04-16 Thread pythoncurious
Hi, I'm having a bit of trouble when writing a python extension. I can't seem to figure out what I did wrong. I tried to make a minimal example, but it's still quite a bit of code. It would be very appreciated if anyone could tell me what I've done wrong. First a short description of what I've do

Python + ogr module?

2007-04-16 Thread Szkandera . Karel
Hi, I need to do web service, which will be convert vector formats, like shapefile, dgn, mapinfo..(and other formats, which are supported in gdal - ogr2ogr). I want to do it with using ogr2ogr in the ogr python module, but i am newbie in python, so here is my questions. Is here anybody, who wrot

Re: Authenticating clients and servers

2007-04-16 Thread Goldfish
On Apr 15, 2:40 pm, Chaz Ginger <[EMAIL PROTECTED]> wrote: > Thomas Krüger wrote: > > Chaz Ginger schrieb: > >> I am writing a distributed server system using Python. I need to support > >> authentication and was wondering what approaches are available under > >> Python and what are the best practi

script for seconds in given month?

2007-04-16 Thread edfialk
Hi, does anyone happen to know of a script that would return the number of seconds in a month if I give it a month and a year? My python is a little weak, but if anyone could offer some suggestions I think I could handle it myself, or if anyone happens to know of a script already written that perf

Re: Lame wrapper for Python

2007-04-16 Thread kyosohma
On Apr 16, 11:04 am, "Harlin Seritt" <[EMAIL PROTECTED]> wrote: > Is there any type of lame_enc.dll wrapper for Python that's available? > > Thanks, > > Harlin Seritt If you are talking about the LAME codec, then you might be able to use py-lame: http://sourceforge.net/project/showfiles.php?group

moving multiple directories

2007-04-16 Thread DataSmash
Hi, I need to organize thousands of directories full of files. I want to move these directories into other subdirectories. For example, all the directories that start with 01, move to a directory named "one", all directories that start with 02, move to a directory name "two", and so on I can't

Re: Python and SSL

2007-04-16 Thread kyosohma
On Apr 16, 10:24 am, "billiejoex" <[EMAIL PROTECTED]> wrote: > Hi, > I developed an ftp-server library and now I would like to add support > for SSL/TLS as described in RFC 2228:http://tools.ietf.org/html/rfc2228 > Currenlty I'm searching for documentation about this subject and I > would like to s

  1   2   >