os.path.walk -- Can You Limit Directories Returned?

2008-06-04 Thread Jeff Nyman
Greetings all. I did some searching on this but I can't seem to find a specific solution. I have code like this: = def walker1(arg, dirname, names): DC_List.append((dirname,'')) os.path.walk('vcdcflx006\\Flex\\Sites', walker1, 0) ==

Looking for some good python learning resources on the web

2008-06-04 Thread [EMAIL PROTECTED]
What are the best sites to read to learn python? -- http://mail.python.org/mailman/listinfo/python-list

Re: The Importance of Terminology's Quality

2008-06-04 Thread Robert Maas, http://tinyurl.com/uh3t
> From: [EMAIL PROTECTED] (David Combs) > Lisp is *so* early a language (1960?), preceeded mainly only by > Fortran (1957?)?, and for sure the far-and-away the first as a > platform for *so many* concepts of computer-science, eg lexical vs > dynamic ("special") variables, passing *unnamed* function

Re: can python do some kernel stuff?

2008-06-04 Thread Tim Roberts
sturlamolden <[EMAIL PROTECTED]> wrote: > >On Jun 4, 12:41 am, Ethan Furman <[EMAIL PROTECTED]> wrote: > >> the kernel itself, *is* kernel coding. And as wonderful as Python is, >> it is *not* for kernel coding. > >Not in its present form, no, it would take some porting. But aside >from that, is t

Re: sed to python: replace Q

2008-06-04 Thread Dan Stromberg
On Tue, 06 May 2008 14:55:07 +, Raymond wrote: >>Another approach is to use the split() function in "re" module. > > Ah ha, thar's the disconnect. Thanks for all the pointers, my def is > now working. Still don't understand the logic behind this design > though. I mean why would any program

Re: line continuation for lines ending in "and" or "or"

2008-06-04 Thread Russ P.
On Jun 4, 9:01 pm, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Jun 4, 10:09 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > > > I've always appreciated Python's lack of requirement for a semi-colon > > at the end of each line. I also appreciate its rules for automatic > > line continuation. If a statemen

Re: line continuation for lines ending in "and" or "or"

2008-06-04 Thread Dan Bishop
On Jun 4, 10:09 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I've always appreciated Python's lack of requirement for a semi-colon > at the end of each line. I also appreciate its rules for automatic > line continuation. If a statement ends with a "+", for example, Python > recognizes that the statem

Pylons and memory use?

2008-06-04 Thread John Salerno
Hi everyone. I was thinking about signing up with a web host that supports Pylons (among many other things) and one of the differences between the various plans is application memory for long-running processes. The plan I'd like to sign up for has 80MB. Does anyone know if this is enough for ba

Re: Books for programmers

2008-06-04 Thread Michael H. Goldwasser
Dick Moores <[EMAIL PROTECTED]> writes: > Do not neglect the 2008 book, "Object-Oriented Programming in Python", > by Goldwasser and Letscher. > > > > Dick Moores I'll note that our book is designed as

line continuation for lines ending in "and" or "or"

2008-06-04 Thread Russ P.
I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends with a "+", for example, Python recognizes that the statement obviously must continue. I've noticed, however, that the sam

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > Then what you're really testing is the interactions of the "push the > button" function with its external interface: you're asserting that > the "push the red button" function actually uses the result from "pick > a random ci

Question regarding re module

2008-06-04 Thread Tomohiro Kusumi
Hi, I have a question regarding re module. # By the way I'm not in this list, so I'm sorry but please CC me. I tried following code in Python shell using a regular expression. Why doesn't the result of dir(reg) have 'pattern', 'flags', and 'groupindex' although they exist as members of _sre.SRE_P

Re: How to make py2.5 distutil to use VC2005?

2008-06-04 Thread 甜瓜
2008/6/4 David Cournapeau <[EMAIL PROTECTED]>: > On Wed, Jun 4, 2008 at 11:38 AM, 甜瓜 <[EMAIL PROTECTED]> wrote: > >>Well, IMO, the format of binary files generated by VC2003 and >> VC2005 is compatible in most cases. > > Problem arise with the C runtime, not with object file format. In > partic

Re: How to make py2.5 distutil to use VC2005?

2008-06-04 Thread 甜瓜
2008/6/4 Christian Heimes <[EMAIL PROTECTED]>: > 甜瓜 schrieb: >> Howdy, >> This problem have puzzled me for a long time. I usually use >> python2.5 in Windows, while VC2005 is installed. >> However python25.lib is compiled by VC2003. When I use disutil to >> build some C extensions, it complaint

Re: Import, site packages, my modules, Windows vs. Linux

2008-06-04 Thread Terry Reedy
"John Ladasky" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Windows I found a solution that works, but which may be a kludge. | In the Python "site-packages" folder, I added a sub-folder called "my- | packages". Then I created a text file, "my-packages.pth", containing | the

Re: how should i use this function?

2008-06-04 Thread alex23
On Jun 5, 4:14 am, Gandalf <[EMAIL PROTECTED]> wrote: > I tried to import win32ui.PyCRichEditCtrl, But the shell told me > their's no such module. > > If anyone can show me an example it would be great For starters, you're looking at the documentation for ActivePython 2.2 rather than 2.5. Do you

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Ben Finney
Ethan Furman <[EMAIL PROTECTED]> writes: > I must be missing something in this discussion. Perhaps it's the > appropriate point of view. At any rate, it seems to me that any and > every function should be tested to ensure proper results. I restrict that to "every proper behaviour the system is ex

Re: Tuples part 2

2008-06-04 Thread bearophileHUGS
[EMAIL PROTECTED]: Do you mean something like this? (notice the many formatting differences, use a formatting similar to this one in your code) coords = [] for i in xrange(1, 5): for j in xrange(1, 5): for k in xrange(1, 2): coords.append( (i, j, k) ) coords *= 10 print

Re: how should i use this function?

2008-06-04 Thread Mark
On Jun 4, 6:58 pm, Gandalf <[EMAIL PROTECTED]> wrote: > > > > But I pywin32 use it all the time i havepywinauto > As the author of pywinauto - I can safely say that just because you have and use pywinauto does NOT mean you have pywin32. pywin32 is not needed for pywinauto. (it uses ctypes to acces

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Ethan Furman
Ben Finney wrote: Roy Smith <[EMAIL PROTECTED]> writes: The only externally visible interface is pushTheButton(), yet you don't really want to call that during testing. What you do want to do is test that a random city really does get picked. Then what you're really testing is the interacti

RE: multiprocessing module (PEP 371)

2008-06-04 Thread Delaney, Timothy (Tim)
Christian Heimes wrote: > Can you provide a C implementation that compiles under VS 2008? Python > 2.6 and 3.0 are using my new VS 2008 build system and we have dropped > support for 9x, ME and NT4. If you can provide us with an > implementation we *might* consider using it. You'd have to at leas

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Jeff McNeil
Your args are fine, that's just the way os.path.walk works. If you just need the absolute pathname of a directory when given a relative path, you can always use os.path.abspath, too. A couple more examples that may help, using os.walk: >>> for i in os.walk('/var/log'): ... for j in i[1] + i

Re: how should i use this function?

2008-06-04 Thread Gandalf
On Jun 4, 11:46 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > > Gandalf <[EMAIL PROTECTED]> wrote: > > On Jun 4, 8:21 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > > > On Jun 4, 8:14 pm, Gandalf <[EMAIL PROTECTED]> wrote: > > > > > I tried to import win32u

Re: bit parsing from file

2008-06-04 Thread [EMAIL PROTECTED]
On May 30, 9:16 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 29 May 2008 09:37:54 -0700 (PDT), "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > Thank's for the reply, > > Yes, I have to search for the pattern, the bit offset not always the >

Re: gcc error in Mac OS X

2008-06-04 Thread Tommy Grav
What happens when you run which gcc Cheers Tommy On Jun 4, 2008, at 6:50 PM, Zhaojie Boulder wrote: Hello, I am new to Mac and used python in linux before. What I am trying to do is to install "Ipython" and "PyCogent" in Mac OS X. For PyCogent, after entering the package path, I typed

Re: multiprocessing module (PEP 371)

2008-06-04 Thread Christian Heimes
sturlamolden schrieb: > There is a well known C++ implementation of cow-fork on Windows, which > I have slightly modified and ported to C. But as the new WDK (Windows > driver kit) headers are full of syntax errors, the compiler choke on > it. :( I am seriously considering re-implementing the whole

gcc error in Mac OS X

2008-06-04 Thread Zhaojie Boulder
Hello, I am new to Mac and used python in linux before. What I am trying to do is to install "Ipython" and "PyCogent" in Mac OS X. For PyCogent, after entering the package path, I typed "python setup.py install". The results are as follows: Didn't find Pyrex - will compile from .c files running i

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jun 2008 09:34:58 +, Antoon Pardon wrote: > On 2008-06-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > it makes sense to me to also test if they work as documented. >>> >>> If they affect the behaviour of some public component, that's where >>> the documentation sho

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Hans Nowak
Lie wrote: On May 24, 9:14 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: For example, at Resolver Systems we expose the spreadsheet object model to our users. It hasa public, documented, API - plus a host of undocumented internally used methods. We would really *much* rather hide these, because anyth

Re: python, dlls, and multiple instances

2008-06-04 Thread Patrick Stinson
ahh, ok. Looks like my fundamental understanding of how dlls work was a little messed up. Thanks! On Sun, Jun 1, 2008 at 10:42 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> Is it a correct to assume that you can use multiple instances of >> python altogether if each is loaded from a separate

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> writes: > The only externally visible interface is pushTheButton(), yet you > don't really want to call that during testing. What you do want to > do is test that a random city really does get picked. Then what you're really testing is the interactions of the "push t

Re: readline() & seek() ???

2008-06-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jun 2008 14:30:19 -0700, DataSmash wrote: > I have a text file that contains thousands of lines and each line is > 256 characters long. > > This is my task: > For each line in the file, move to the 25th character, if the > character is a "T", > move to the 35th character of the line an

Re: no module named py

2008-06-04 Thread David Hláčik
most important method inside news class is newsauth which takes username, password and will return 1 if ldap authentification was OK. actually inn will call method authenticate which will call self.newsauth and here comes the problem .. i ve got instead of call self.newsauth error no module named

no module named py

2008-06-04 Thread David Hláčik
Hello, what this beautifull mesage which is messing me whole day means : *python: error , ('No module named py',), No module named py* as a result of class pdg.py which is called from nnrpd_auth.py. To be detailed ... news server inn is calling that when doing autentification , it calls nnrpd_au

Re: multiprocessing module (PEP 371)

2008-06-04 Thread sturlamolden
On Jun 4, 11:29 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > tested the executable on Windows. COW (copy-on-write, for those still > thinking that we're talking about dairy products) would be pretty > desirable if it's feasible, though. There is a well known C++ implementation of cow-fork on Wind

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Paul Lemelle
Jeff, Thanks for your reply. I would like to like the absolute path of a directory. I thought that os.listdir just returns the nam itself in a data list. I noticed that none was being return in my example. Do you think that I have the arguments misplaced? Thanks, Paul --- On Wed, 6/4/0

Tuples part 2

2008-06-04 Thread [EMAIL PROTECTED]
Hi Everyone, i have another question. What if i wanted to make n tuples, each with a list of coordinates. For example : coords = list() for h in xrange(1,11,1): for i in xrange(1, 5, 1) : for j in xrange(1, 5, 1) : for k in xrange(1,2,1) : coords.append((i,j,k))

Re: Tuple of coordinates

2008-06-04 Thread [EMAIL PROTECTED]
On 29 mayo, 17:45, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > i am using a software which uses python as its scripting language. I > > want to generate a list of coordinates more or less this way: > > > for i in (beg, end, step): > >      for j in (beg, end, ste

Re: Import removing first module component

2008-06-04 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, koblas <[EMAIL PROTECTED]> wrote: > Have the following line: > import notewave.runner.LMTP > > Yeilding the following error: > ImportError: No module named runner.LMTP > > For the life of me I don't understand why the first component > "notewave"

Re: how should i use this function?

2008-06-04 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Gandalf <[EMAIL PROTECTED]> wrote: > On Jun 4, 8:21 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > > On Jun 4, 8:14 pm, Gandalf <[EMAIL PROTECTED]> wrote: > > > > > I tried to import win32ui.PyCRichEditCtrl, But the shell told me > > > their's no such module. > > >

Re: re

2008-06-04 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "Russell Blau" <[EMAIL PROTECTED]> wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > David C. Ullrich schrieb: > >> Say I want to replace 'disc' with 'disk', but only > >> when 'disc' is a complete word (don't want to ch

Re: Greetings, fellow Pythonistas!

2008-06-04 Thread Aahz
In article <[EMAIL PROTECTED]>, The Pythonista <[EMAIL PROTECTED]> wrote: > >This post is to announce a new Python-oriented blog. See my .sig for the >URL. > >I also have a question: is there any "official" method for getting listed >on Planet Python? Send e-mail to [EMAIL PROTECTED] -- Aahz

readline() & seek() ???

2008-06-04 Thread DataSmash
Hi group, I have a text file that contains thousands of lines and each line is 256 characters long. This is my task: For each line in the file, move to the 25th character, if the character is a "T", move to the 35th character of the line and read 5 characters from there. Capture these 5 characters

Re: multiprocessing module (PEP 371)

2008-06-04 Thread Paul Boddie
On 4 Jun, 20:06, sturlamolden <[EMAIL PROTECTED]> wrote: > > Even a non-COWfork > would be preferred. I will strongly suggest something is done to add > support for os.fork to Python on Windows. Either create a full cow > fork using ZwCreateProces

Re: Exit from os.chroot()

2008-06-04 Thread Remy Blank
Thomas Bellman wrote: That might not be the best idea... Suddenly the chroot:ed program has access to the real /usr/bin; and since it likely is running as root (it was allowed to call chroot()), it can do bad things to the things in /usr/bin. If a chrooted process is running as root, it can v

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread topher
On Jun 4, 2:58 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > On Jun 4, 4:29 am, NickC <[EMAIL PROTECTED]> wrote: > > > On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: > > > > What is it about leading underscores that bothers me? To me, they are > > > like a small pebble in your shoe while you

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Jeff McNeil
What exactly are you trying to accomplish? If you're just looking for the contents of a directory, it would be much easier to simply call os.listdir(dirinput) as that will return a list of strings that represent the entries in dirinput. As it stands, 'os.path.walk' will return None in your example

Re: php vs python

2008-06-04 Thread Joel Koltner
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I think you are talking about something a little different than Arnaud. Ah, OK. > Other old habits from people coming to Python are: using indexes where they > are not needed, trivial getters and setters, pu

Re: Exit from os.chroot()

2008-06-04 Thread Tobiah
>> So you need some programs in your chroot: Then put a directory >> usr/bin into the chroot directory and bind the system's /usr/bin >> there: > >> mount --bind /usr/bin $chroot/usr/bin > > It is better to make copies of the needed binaries and libraries, > and *only* them. Or symbolic links,

Re: ANN: Sydebar 1.0 - A browser sidebar generator for Python documentation

2008-06-04 Thread Max M
Remy Blank skrev: (I apologize for the poorly formatted message. Something between my news client and the server decided, besides delaying the message for over 17 hours, to add an empty line for every line of text, which obviously messed up some headers. Here's the content again, and hopefully

Re: Import, site packages, my modules, Windows vs. Linux

2008-06-04 Thread Tobiah
On Tue, 03 Jun 2008 17:57:07 -0700, John Ladasky wrote: > Hi folks, > > Running Python 2.5 on both a Windows XP laptop, and an Ubuntu Linux > 7.04 desktop. > > I've gotten tired of maintaining multiple copies of my personal > modules that I use over and over. I have copies of these files in the

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Larry Bates
Paul Lemelle wrote: I Am trying to output the os.path.walk to a file, but the writelines method complains Below is the code, any helpful suggestions would be appreciated. def visit(arg, dirnames, names): print dirnames dirinput = raw_input("Enter directory to read: ")

Unable to write output from os.path.walk to a file.

2008-06-04 Thread Paul Lemelle
I Am trying to output the os.path.walk to a file, but the writelines method complains Below is the code, any helpful suggestions would be appreciated. def visit(arg, dirnames, names): print dirnames dirinput = raw_input("Enter directory to read: ") listdir = os.path.wal

Re: how should i use this function?

2008-06-04 Thread Gandalf
On Jun 4, 8:21 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On Jun 4, 8:14 pm, Gandalf <[EMAIL PROTECTED]> wrote: > > > I tried to import win32ui.PyCRichEditCtrl, But the shell told me > > their's no such module. > > There isn't, as it is a class. win32ui is a module. If you cannot > import that,

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Russ P.
On Jun 4, 4:29 am, NickC <[EMAIL PROTECTED]> wrote: > On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: > > > What is it about leading underscores that bothers me? To me, they are > > like a small pebble in your shoe while you are on a hike. Yes, you can > > live with it, and it does no harm,

python library for passwd suitable blowfish hash generation

2008-06-04 Thread Damon Getsman
I'm working on a utility that needs to be able to generate /etc/shadow suitable hashes on an OpenSuSE 10.3 system. All of the shadowed hashes are blowfish, I believe, from seeing the 'magic' $2a$10$ at the start of each of the entries. Ideally I would like to find a library that will take my stri

python: error , ('No module named py', ), No module named py

2008-06-04 Thread David Hláčik
Hello, what this beautifull mesage which is messing me whole day means : *python: error , ('No module named py',), No module named py* as a result of class pdg.py which is called from nnrpd_auth.py. To be detailed ... news server inn is calling that when doing autentification , it calls nnrpd_au

Re: Books for programmers

2008-06-04 Thread Dick Moores
Do not neglect the 2008 book, "Object-Oriented Programming in Python", by Goldwasser and Letscher. Dick Moores -- http://mail.python.org/mailman/listinfo/python-list

Re: how should i use this function?

2008-06-04 Thread sturlamolden
On Jun 4, 8:14 pm, Gandalf <[EMAIL PROTECTED]> wrote: > I tried to import win32ui.PyCRichEditCtrl, But the shell told me > their's no such module. There isn't, as it is a class. win32ui is a module. If you cannot import that, you don't have pywin32 installed. Go get it from Sourceforge. -- http

Re: ANN: Resolver One 1.1 released

2008-06-04 Thread Giles Thomas
Stefan Behnel wrote: > Giles Thomas wrote: > > We are proud to announce the release of Resolver One, version 1.1 - the > > largest IronPython application in the world, we think, at 38,000 lines > > of production code backed up by 130,000 lines of unit and functional > > tests. > > Is it really Iron

how should i use this function?

2008-06-04 Thread Gandalf
http://aspn.activestate.com/ASPN/docs/ActivePython/2.2/PyWin32/PyCRichEditCtrl__GetSelText_meth.html GetSelText() I tried to import win32ui.PyCRichEditCtrl, But the shell told me their's no such module. If anyone can show me an example it would be great Thanks! -- http://mail.python.org/mai

Re: Exit from os.chroot()

2008-06-04 Thread Thomas Bellman
Wolfgang Draxinger <[EMAIL PROTECTED]> wrote: > So you need some programs in your chroot: Then put a directory > usr/bin into the chroot directory and bind the system's /usr/bin > there: > mount --bind /usr/bin $chroot/usr/bin That might not be the best idea... Suddenly the chroot:ed program ha

Re: re

2008-06-04 Thread Diez B. Roggisch
Whitespace is actually \s. But [\s]disc[whatever] doesn't do the job - then it won't match "(disc)", which counts as "disc appearing as a full word. Ok, then this works: import re test = """ disc (disc) foo disc bar discuss """.split("\n") for t in test: if re.search(r"(^|[^\w])(disc)($|[

Re: ANN: Resolver One 1.1 released

2008-06-04 Thread Stefan Behnel
Giles Thomas wrote: > We are proud to announce the release of Resolver One, version 1.1 - > the largest IronPython application in the world, we think, at 38,000 > lines of production code backed up by 130,000 lines of unit and > functional tests. Is it really IronPython specific code or would it r

multiprocessing module (PEP 371)

2008-06-04 Thread sturlamolden
I sometimes read python-dev, but never contribute. So I'll post my rant here instead. I completely support adding this module to the standard lib. Get it in as soon as possible, regardless of PEP deadlines or whatever. I don't see pyprocessing as a drop-in replacement for the threading module. Mu

ANN: Resolver One 1.1 released

2008-06-04 Thread Giles Thomas
We are proud to announce the release of Resolver One, version 1.1 - the largest IronPython application in the world, we think, at 38,000 lines of production code backed up by 130,000 lines of unit and functional tests. Resolver One is a Rapid Application Development tool for analysing and presenti

Re: how to combine 2 program?

2008-06-04 Thread Mike Driscoll
On Jun 4, 8:53 am, [EMAIL PROTECTED] wrote: > i am a newbe in pyhton. > i am using "Twisted Network Programming Essentials By Abe Fettig" as my > tutorial. in that tutorial, i found 2 example, IMAPDOWNLOAD.py and > requesthandler.py > > my problem is how to combine those program become one program,

Re: Trying to extend Python with C: undefined reference to `Py_BuildValue'

2008-06-04 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I am trying to extend Python with some C code. Have you considered using Cython instead of C? http://cython.org/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [XP] Batch-print bunch of RTF files?

2008-06-04 Thread [EMAIL PROTECTED]
On Wed, 04 Jun 2008 11:37:30 -0500, Larry Bates <[EMAIL PROTECTED]> wrote: >Sure it does, just not the way you think. Thanks guys, that did it. I had to print in smaller batches because 200 in one shot caused Word to crash, but I got the job done. -- http://mail.python.org/mailman/listinfo/python-

Import removing first module component

2008-06-04 Thread koblas
Have the following line: import notewave.runner.LMTP Yeilding the following error: ImportError: No module named runner.LMTP For the life of me I don't understand why the first component "notewave" is being stripped off, when the import is happening. Thanks, -- http://mail.python.

Re: ANN: Sydebar 1.0 - A browser sidebar generator for Python documentation

2008-06-04 Thread Remy Blank
(I apologize for the poorly formatted message. Something between my news client and the server decided, besides delaying the message for over 17 hours, to add an empty line for every line of text, which obviously messed up some headers. Here's the content again, and hopefully this message comes

Re: re

2008-06-04 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > David C. Ullrich schrieb: > > Actually using regular expressions for the first > > time. Is there something that allows you to take the > > union of two character sets, or append a character to > > a character set? >

Re: Books for programmers

2008-06-04 Thread Tommy Nordgren
On 3 jun 2008, at 09.22, V wrote: Hi, I'm a C++, Java and C programmer, and I'm searching for a (preferably printed) book that teaches me the "Python idioms", i.e. the "Python way" of doing something. Ideally, I'm searching for a book like "Effective C++" or "Effective Java", that does not lo

Re: re

2008-06-04 Thread Russell Blau
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David C. Ullrich schrieb: >> Say I want to replace 'disc' with 'disk', but only >> when 'disc' is a complete word (don't want to change >> 'discuss' to 'diskuss'.) The following seems almost >> right: >> >> [^a-zA-Z

Re: Batch-print bunch of RTF files?

2008-06-04 Thread [EMAIL PROTECTED]
On Jun 4, 12:26 pm, "[EMAIL PROTECTED]" wrote: > Hello, > > I have about two hundred individual RTF files to print from an > XP host. Word 2000 doesn't seem to have this feature, so I'm looking > for a way to print those RTF files from an ActivePython script. Would > someone have some work

Re: can python do some kernel stuff?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 11:24:11 -0500, Grant Edwards wrote: >> I can't understand why somebody might want to do kernel stuff in >> Python. > > we choose to put Python in kernel-space and do the other things, not > because they are easy, but because they are hard, because that goal > will

Re: re

2008-06-04 Thread Diez B. Roggisch
David C. Ullrich schrieb: Actually using regular expressions for the first time. Is there something that allows you to take the union of two character sets, or append a character to a character set? Say I want to replace 'disc' with 'disk', but only when 'disc' is a complete word (don't want to

Re: Exit from os.chroot()

2008-06-04 Thread support . intranet
On 4 Giu, 17:08, Wolfgang Draxinger <[EMAIL PROTECTED]> wrote: > support.intranet wrote: > > Hello! I'm writing a small script and I need to call the > > os.chroot function. The problem is, a few lines below I need to > > call a program in /usr/bin. Is there a way to exit from the > > chroot, or to

Re: [XP] Batch-print bunch of RTF files?

2008-06-04 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hello, I have about two hundred individual RTF files to print from an XP host. Word 2000 doesn't seem to have this feature, so I'm looking for a way to print those RTF files from an ActivePython script. Would someone have some working code handy? Thank you. Su

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote: > Hello. > > I am trying to extend my Python program with some C code. > > This thread is sort of a follow-up to another thread of mine, linked > below. I don't know what the conventions are in this newsgroup about > creating new threads

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote: > Hello. > > I am trying to extend my Python program with some C code. > > This thread is sort of a follow-up to another thread of mine, linked > below. I don't know what the conventions are in this newsgroup about > creating new threads

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote: > Hello. > > I am trying to extend my Python program with some C code. > > This thread is sort of a follow-up to another thread of mine, linked > below. I don't know what the conventions are in this newsgroup about > creating new threads

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread spectrumdt
On Jun 4, 6:25 pm, Gerhard Häring <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >   Hello. > > >   I am trying to extend my Python program with some C code. [...] > >   Anyway, my question is this: When compiling my C code to include in > > Python, using a Python script with the function

[XP] Batch-print bunch of RTF files?

2008-06-04 Thread [EMAIL PROTECTED]
Hello, I have about two hundred individual RTF files to print from an XP host. Word 2000 doesn't seem to have this feature, so I'm looking for a way to print those RTF files from an ActivePython script. Would someone have some working code handy? Thank you. -- http://mail.python.org/mailm

Re: Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: Hello. I am trying to extend my Python program with some C code. [...] Anyway, my question is this: When compiling my C code to include in Python, using a Python script with the function distutils.core.setup... can I choose which C compiler to use? On my system it

Re: can python do some kernel stuff?

2008-06-04 Thread Grant Edwards
On 2008-06-04, Ivan Illarionov <[EMAIL PROTECTED]> wrote: >> Didn't somebody once demonstrate how to put a VM into kernel >> space so that you could write kernel code in Python? Maybe it >> was just a discussion about how it could be done in theory. >> >> There have been a few JVM-in-hardware pr

Re: re

2008-06-04 Thread David C. Ullrich
Actually using regular expressions for the first time. Is there something that allows you to take the union of two character sets, or append a character to a character set? Say I want to replace 'disc' with 'disk', but only when 'disc' is a complete word (don't want to change 'discuss' to 'diskuss

Extending Python with C: Can I specify another C compiler?

2008-06-04 Thread spectrumdt
Hello. I am trying to extend my Python program with some C code. This thread is sort of a follow-up to another thread of mine, linked below. I don't know what the conventions are in this newsgroup about creating new threads vs. staying in existing ones, but I figured I'd rather make a new o

Re: can python do some kernel stuff?

2008-06-04 Thread Ivan Illarionov
On Wed, 04 Jun 2008 09:41:07 -0500, Grant Edwards wrote: >>> The answer is yes. IPC and py-pf are examples. If you don't think of >>> packet filtering as kernel coding, I can understand. But clearly the >>> Python interfaces to fork(), waitpid(), signal(), alarm() and so forth >>> are forays int

Re: Import, site packages, my modules, Windows vs. Linux

2008-06-04 Thread John Ladasky
On Jun 3, 6:52 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > John Ladasky <[EMAIL PROTECTED]> writes: > > I want to know what is the *recommended* way to integrate my own > > personal modules with Python. Thanks! > > You want the 'distutils' documentation > http://www.python.org/doc/lib/module-distu

Re: Trying to extend Python with C: undefined reference to `Py_BuildValue'

2008-06-04 Thread spectrumdt
On Jun 4, 4:13 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > Hi! Your C code contains too many errors. I'm lazy to comment them all. > > 2. create 'buildme.py' file with this content: > Thanks for the replies. Maybe I should have read the rest of the guide to extending Python with C before whi

Embedding python a la erb

2008-06-04 Thread PAolo
hello, is there any other tool for embedding python as erb (for ruby) or empy do. In particular I am not too happy about the way loops are made @[for i in range(10)]@ xxx @(i) @[end for] which is different form the way other code is delimited @{print 1+1} I think in PHP there is not this diffe

Re: Zipfile module errors

2008-06-04 Thread John Machin
jwesonga wrote: I've added the line to the script, added a zipped file into the folder. I've made sure the file exists. The error is now this: Please get some clues: (1) Don't reply off-list unless specifically invited. (2) Don't top-post. (3) Do read and try to understand *all* of each reply t

ANN: Sydebar 1.0 - A browser sidebar generator for Python documentation

2008-06-04 Thread Remy Blank
Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable I am pleased to announce the first release of Sydebar, a browser sidebar = generator for Python documentation. For the impatient, sample outputs=20 for all Python versions ever released can be

Re: Exit from os.chroot()

2008-06-04 Thread Wolfgang Draxinger
support.intranet wrote: > Hello! I'm writing a small script and I need to call the > os.chroot function. The problem is, a few lines below I need to > call a program in /usr/bin. Is there a way to exit from the > chroot, or to limit the chroot to a single function or thread? > Thanks in advance N

Re: Distributing 2 python modules with incompatible API

2008-06-04 Thread Diez B. Roggisch
mathieu wrote: > hi there, > > As far as I understand python is not using the usual UNIX system of > soname when two libraries provide incompatible API. So let say I have > a _foo.so version 1.2 and 2.0, all I can (should do) is move them > underneath a subdirectory in site-package: > > pyth

Re: can python do some kernel stuff?

2008-06-04 Thread Grant Edwards
>> The answer is yes. IPC and py-pf are examples. If you don't >> think of packet filtering as kernel coding, I can understand. >> But clearly the Python interfaces to fork(), waitpid(), >> signal(), alarm() and so forth are forays into the once >> private garden of C. The routines listed above

Exit from os.chroot()

2008-06-04 Thread support.intranet
Hello! I'm writing a small script and I need to call the os.chroot function. The problem is, a few lines below I need to call a program in /usr/bin. Is there a way to exit from the chroot, or to limit the chroot to a single function or thread? Thanks in advance -- http://mail.python.org/mailman

Re: How to perform a nonblocking read from a process

2008-06-04 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to perform following operation from inside the python > script > 1. Open a shell ( start a process ) > 2. Send command1 to the process > 3. Get output from the process > 4. Send command2 to the process > 5. Get output from the

Re: ctypes, function pointers and a lot of trouble

2008-06-04 Thread Nick Craig-Wood
Matt <[EMAIL PROTECTED]> wrote: > Hm, thanks, now I can access my data in the functions and also write > them but the program keeps terminating right at the point when the > "open" function finishes. Unfortunately everything closes and I get no > error messages. > > I did some additional w

  1   2   >