Re: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven which is described in the Holy Bible as a beautiful place with no death, sorrow, sickness or pain. (newsgroup-post 140)

2005-04-16 Thread Craig
Lord... forgive the Holy Roller, spammers for they know not what they do -- http://mail.python.org/mailman/listinfo/python-list

Re: inheriting a large python code base

2014-02-21 Thread craig
Look at the algorithms and see if there are faster ways. Great advice with the comments of writing test cases, getting into version control, taking passes through the code with tools, understanding what is slow and why it is considered slow. Then you should invest the time to understand the in

Generating header information using ElementTree

2006-11-26 Thread Craig
t find any documentation or examples on how you can do this. Any help would be appreciated. Thank you and good luck. Craig Williamson -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating header information using ElementTree

2006-11-26 Thread Craig
Fredrik Lundh wrote: > Craig wrote: > > > I'm only new to Python so please bear with me. I using ElementTree to > > generate an XML file that will reference a DTD and an XSL file. The > > header information I want at the start of the file is as follows: > > &g

Re: Generating header information using ElementTree

2006-11-26 Thread Craig
Diez B. Roggisch wrote: > Craig schrieb: > > Fredrik Lundh wrote: > > > >> Craig wrote: > >> > >>> I'm only new to Python so please bear with me. I using ElementTree to > >>> generate an XML file that will reference a DTD and an XSL

Re: Generating header information using ElementTree

2006-11-26 Thread Craig
John Machin wrote: > Craig wrote: > > > Great. Got that sorted. The problem I have now is that some of the > > XML data is not copied across to the file when I have the text > > information included. The number of characters that is lost is equal > > to the numbe

ElementTree xmlns:xsi question

2006-11-28 Thread Craig
ly. What can I do to make the code correct and the output being 100% correct as well. Any help would be greatly appreciated. Craig -- http://mail.python.org/mailman/listinfo/python-list

Open 16-bit/24-bit windows bitmap using PIL

2006-11-30 Thread Craig
raise IOError("Unsupported BMP compression (%d)" % compression) IOError: Unsupported BMP compression (1) I can open a windows monochrome bitmap fine using PIL but the colour options are more desirable. I am using Windows 2000 if that is any help and I am saving the different BMP's using Microsoft Paint. If you could help that would be great. Craig -- http://mail.python.org/mailman/listinfo/python-list

Convert PNG files to BMP files using PIL

2006-12-04 Thread Craig
can be used to fulfil the task. If you could let me know that would be great. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Opening colour BMPs with PIL

2006-12-04 Thread Craig
packages\PIL\BmpImagePlugin.py", line 164, in _open self._bitmap(offset=offset) File "C:\python25\lib\site-packages\PIL\BmpImagePlugin.py", line 96, in _bitmap raise IOError("Unsupported BMP header type (%d)" % len(s)) IOError: Unsupported BMP header type (108) >>> I am using Windows XP with Python 2.5. I can open monochrome BMPs fine but I don't want that. If you could help that would be greatly appreciated. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Opening colour BMPs with PIL

2006-12-05 Thread Craig
Fredrik Lundh wrote: > Craig wrote: > > > I'm trying to open colour BMPs using PIL and I'm getting the following > > errors. > > what program did you use to produce those BMP files? can you prepare > reasonably small samples using the same program and post

X11 bitmap image conversion problem

2006-12-05 Thread Craig
1000(0xBC). Is there an easy way to flip the bits after the im.tobitmap() conversion has been done or do I have to find another way? If you could help that would be greatly appreciated. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Mirror imaging binary numbers

2006-12-06 Thread Craig
Hi there, I'm trying to switch binary numbers around so that the MSB becomes the LSB etc. Is there an easy way of doing this as I can't seem to find anything. If you could help that would be great. Thanks and good luck. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Mirror imaging binary numbers

2006-12-06 Thread Craig
Matimus wrote: > Craig wrote: > > I'm trying to switch binary numbers around so that the MSB becomes the > > LSB etc. > > What do you mean 'binary numbers'? They are all binary. If you mean the > int type, they are 32 bits long and there are 16 bit

Re: Mirror imaging binary numbers

2006-12-06 Thread Craig
Terry Reedy wrote: > "Craig" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Thanks so much for the response. I have an array of individual bytes > > which will eventually make up a binary bitmap image that is loaded onto > > an LCD sc

Adding extra modules to a Pyinstaller build

2007-10-08 Thread Craig
project? Regards, Craig -- http://mail.python.org/mailman/listinfo/python-list

Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
I use a proprietary dll from Software Source (vbis5032.dll). I have successfully used it from Visual Basic 6, Fujitsu Cobol and from Perl. I would now like to use it from Python. The following is the C++ prototype for one of the functions: short FAR PASCAL VmxOpen(BSTR*Filespec,

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 2:29 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote: > > The culprit i here: > > > Before - X = 0, CacheSize = 0, OpenMode = 3, vHandle = 0 > > This binds these names to Python ints, but byref ex

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 2:38 pm, Craig <[EMAIL PROTECTED]> wrote: > On Mar 20, 2:29 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > > > On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote: > > > The culprit i here: > > > > Before - X = 0, CacheSize = 0, OpenMo

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 4:55 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Thu, Mar 20, 2008 at 3:42 PM, Craig <[EMAIL PROTECTED]> wrote: > > > On Mar 20, 2:38 pm, Craig <[EMAIL PROTECTED]> wrote: > > > On Mar 20, 2:29 pm, sturlamolden <[EMAIL PROTECTED

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Craig
On Mar 20, 6:26 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote: > > > The following is the C++ prototype for one of the functions: > > short FAR PASCAL VmxOpen(BSTR*Filespec, > >

Re: Need help calling a proprietary C DLL from Python

2008-03-21 Thread Craig
On Mar 21, 4:04 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 20 Mar 2008 16:50:18 -0700 (PDT), Craig <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > I received a direct email from someone, and I came up with the > >

Re: Need help calling a proprietary C DLL from Python

2008-03-22 Thread Craig
On Mar 22, 3:13 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Fri, 21 Mar 2008 23:21:48 -0700 (PDT), Craig <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Sorry, I wasn't trying to exclude any credit from Dennis, I just > >

Re: Need help calling a proprietary C DLL from Python

2008-03-22 Thread Craig
On Mar 22, 9:40 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sat, 22 Mar 2008 15:12:47 -0700 (PDT), Craig <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > > > Anyway, I have the following for "types": > >

Re: Anomaly in time.clock()

2008-03-22 Thread Craig
On Mar 22, 10:03 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > Godzilla <[EMAIL PROTECTED]> wrote: > > >Just found out that win32api.GetTickCount() returns a tick count in > >milli-second since XP started. Not sure whether that is reliable. > >Anyone uses that for calculating elapsed time? > > What

Re: Need help calling a proprietary C DLL from Python

2008-03-23 Thread Craig
On Mar 23, 4:48 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sat, 22 Mar 2008 19:05:31 -0700 (PDT), Craig <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > I got back exactly what I expected for TypeDef, but SecKey and PriKey > >

Re: Need help calling a proprietary C DLL from Python

2008-03-24 Thread Craig
On Mar 23, 7:59 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > This dll was designed to be used from either C or Visual Basic 6. > &

Re: Need help calling a proprietary C DLL from Python

2008-03-24 Thread Craig
On Mar 24, 12:27 pm, Craig <[EMAIL PROTECTED]> wrote: > On Mar 23, 7:59 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > > > On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: >

Re: Need help calling a proprietary C DLL from Python

2008-03-24 Thread Craig
On Mar 24, 3:45 pm, Craig <[EMAIL PROTECTED]> wrote: > On Mar 24, 12:27 pm, Craig <[EMAIL PROTECTED]> wrote: > > > > > On Mar 23, 7:59 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > > On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig <

Re: Need help calling a proprietary C DLL from Python

2008-03-25 Thread Craig
On Mar 25, 2:02 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 24 Mar 2008 15:21:11 -0700 (PDT), Craig <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > And this is what I got: > > VmxGet test - looking for valid record... &g

Re: Need help calling a proprietary C DLL from Python

2008-03-26 Thread Craig
On Mar 26, 12:24 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 25 Mar 2008 08:24:13 -0700 (PDT), Craig <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > 41 0 0 0 > > 7 0 0 0 > > Which makes sense for two reasons: > >

Re: what IDE is the best to write python?

2009-02-01 Thread Craig
eclipse --- On Sun, 2/1/09, Dennis Lee Bieber wrote: From: Dennis Lee Bieber Subject: Re: what IDE is the best to write python? To: python-list@python.org Date: Sunday, February 1, 2009, 3:31 AM On Sat, 31 Jan 2009 23:42:42 -0800 (PST), "mcheun...@hotmail.com" declaimed the following in comp.

Re: python in emacs

2009-02-15 Thread Craig
I would go to ubuntu linux if you can. --- On Sun, 2/15/09, Diez B. Roggisch wrote: From: Diez B. Roggisch Subject: Re: python in emacs To: python-list@python.org Date: Sunday, February 15, 2009, 9:23 AM kentand...@sbcglobal.net schrieb: > When I visit a file with extension .py, emacs says "lo

Re: Sending SMS using python script

2009-04-03 Thread Craig
There's a Python wrapper to the Skype API here: http://sourceforge.net/projects/skype4py/ On Linux I've used the PyGTK GUI that uses this. It's called SkySentials here: http://www.kolmann.at/philipp/linux/skysentials/ Craig On Apr 3, 6:50 am, "ISF (Computer Scientists with

Re: What IDE support python 3.0.1 ?

2009-04-16 Thread Craig
Well i use netbean is alot better i think and it work with 2.6 and 3.0 --- On Thu, 4/16/09, mousemeat wrote: From: mousemeat Subject: Re: What IDE support python 3.0.1 ? To: python-list@python.org Date: Thursday, April 16, 2009, 4:41 AM Use eclipse with the pydev module.  I use python(x,y) whi

python question

2009-05-21 Thread Craig
How do i install this.i never seen a python write in c before. -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2009-05-21 Thread Craig
http://downloads.emperorlinux.com/contrib/pyiw http://downloads.emperorlinux.com/contrib/pywpa Sorry fro the 2 post.How do i install a python moudles write en in C? -- http://mail.python.org/mailman/listinfo/python-list

Re: python question

2009-05-22 Thread Craig
I use python 2.6.2 and i useing ubuntu 9.04 not windows. --- On Thu, 5/21/09, Dave Angel wrote: > From: Dave Angel > Subject: Re: python question > To: "Craig" > Cc: python-list@python.org > Date: Thursday, May 21, 2009, 2:22 PM > Craig wrote: > > How do i

Re: www.python.org website is down?

2009-08-08 Thread Craig
Yes the same prob. --- On Sat, 8/8/09, Mark Lawrence wrote: > From: Mark Lawrence > Subject: Re: www.python.org website is down? > To: python-list@python.org > Date: Saturday, August 8, 2009, 8:41 AM > Caezar wrote: > > I cannot connect to the official Python website. I get > the following > >

Re: Python on Crays

2009-08-27 Thread Craig
Who the one from wisconsin and did you try the python group in madison maybe they can help. Well i from madison are and i just a newbie with python.What OS you useing? --- On Thu, 8/27/09, Mark Dickinson wrote: > From: Mark Dickinson > Subject: Re: Python on Crays > To: python-list@python.org

Re: IDE for python similar to visual basic

2009-08-28 Thread Craig
Try wingware i have it and i like it. --- On Fri, 8/28/09, qwe rty wrote: > From: qwe rty > Subject: IDE for python similar to visual basic > To: python-list@python.org > Date: Friday, August 28, 2009, 5:19 PM > i have been searching for am IDE for > python that is similar to Visual > Basic but

Re: RIse and fall of languages in 2012

2013-01-10 Thread Craig Yoshioka
At one point or another I'm pretty sure I've googled "_ sucks" for every language I've ever used- even the ones I like. ie: Python easily more than once. Craig reporting from the road 10550 N Torrey Pines Rd La Jolla CA 92037 work: 858 784 9208 cell: 619 623 2233

Re: Beowulf clusters

2013-01-13 Thread Craig Yoshioka
When you write HPC code the GIL isn't an issue, but you'll have plenty of others. Craig reporting from the road 10550 N Torrey Pines Rd La Jolla CA 92037 work: 858 784 9208 cell: 619 623 2233 On Jan 13, 2013, at 6:22 PM, Mark Janssen wrote: > On Sun, Jan 13, 2013 at 8:19 PM, O

alternative to with statement?

2012-02-28 Thread Craig Yoshioka
I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. The best I've found is to abuse the for notation: for _ in cachingcontext(x): # create cached resources here # return

Re: alternative to with statement?

2012-02-28 Thread Craig Yoshioka
till coordinate their activity, by waiting for each other to finish, and reusing the cached results, etc. On Feb 28, 2012, at 1:04 PM, Craig Yoshioka wrote: > I see that there was previously a PEP to allow the with statement to skip the > enclosing block... this was shot down, and I

AUTO: Craig Churchill is out of the office (returning 27/07/2011)

2011-07-18 Thread craig . churchill
I am out of the office until 27/07/2011. I will respond to your message when I return. If you require assitance in relation to the SPEAR Integration project please contact Terry Mandalios. Note: This is an automated response to your message "Re: Tabs -vs- Spaces: Tabs should have won." sent on

This is a test

2021-01-07 Thread Craig Hatch
I have added you to the EMAIL list, so when I have questions. Just learn for fun. Craig Hatch -- https://mail.python.org/mailman/listinfo/python-list

Re: more newbie help needed

2005-11-14 Thread Craig Marshall
(although it's probably longer): fruit="banana" fruit = list(fruit) fruit.reverse() fruit = ''.join(fruit) print fruit It turns the string into a list, reverses it, joins it back together (back into a string), then prints it. Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: Parse file into array

2005-11-14 Thread Craig Marshall
e.strip().split(":") d[ext] = mime print d Craig -- http://mail.python.org/mailman/listinfo/python-list

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Craig Ringer
s, etc. In my case, its easier to execute snippets as shown above than it is to worry about the module search path and wrapping things using a Python module. If you're doing substantial amounts of Python coding for your module, you'll almost certainly be better off writing a Python module that uses your C module internally (see PIL for a good example of this). -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: exposing C array to python namespace: NumPy and array module.

2005-01-01 Thread Craig Ringer
le approach to me, but I'm hardly an expert. The code's license permits you to do so, and it's hardly worth repeating the work if you don't have to. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: screen clear question

2005-01-01 Thread Craig Ringer
t clear' or '/usr/bin/clear' on many UNIX systems; no idea about Windows. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: emulating an and operator in regular expressions

2005-01-03 Thread Craig Ringer
7;not (not A or not B)' I thought I could try something along those lines, > but can't crack it. My first thought would be to express your 'A and B' regex as: (A.*B)|(B.*A) with whatever padding, etc, is necessary. You can even substitute in the sub-regex for A and B to avoid

Re: Developing Commercial Applications in Python

2005-01-03 Thread Craig Ringer
plication. You'd simply need to keep an eye on the licenses of any extensions you used, like ReportLab, PIL, mx, database interfaces, twisted, etc. Many are licensed under the same license as Python or an MIT-like license, but of course some Python extensions are not and you would need to con

RE: removing comments form a file

2005-01-03 Thread Craig Ringer
27;d be interested if you could clarify what you mean there. As far as I know, the whole file will only be read into memory if you use file.read () or file.readlines(). If you use an iterator it does internal readahead, but won't read the lot at once. If you use read() it reads only what

Re: Bad Interpreter

2005-01-03 Thread Craig Ringer
say something like : > > python sock.py > > but ./sock.py results in a :bad interpreter error > how do i troubleshoot something like this? You probably have Windows-style line endings in the file. The kernel sees the ^M at the end of the line and gets all confused. -- Craig Ringer -- http:/

Re: Embedding a restricted python interpreter

2005-01-04 Thread Craig Ringer
> I do not know if it is possible to disable or override 'import'.. You can do a fair bit to it by wrapping/replacing __builtin__.__import__ . Preventing people from getting around what you've done, though... not sure. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a restricted python interpreter

2005-01-06 Thread Craig Ringer
On Thu, 2005-01-06 at 23:05, Peter Maas wrote: > Craig Ringer schrieb: > It would certainly be difficult to track all harmful code constructs. > But AFAIK the idea of a sandbox is not to look at the offending code > but to protect the offended objects: files, databases, URLs, socket

Re: Python C Object Comparison

2005-01-06 Thread Craig Ringer
a class and make the class own and manage the C++ object (and pointer to it) that it owns. Perhaps that's a better solution for you too? If you want any opinions from folks here about the best way to solve your problem, you'll probably need to explain a bit more of your problem - like

Re: File Handling Problems Python I/O

2005-01-06 Thread Craig Ringer
r not there are trailing path separators on the input strings. os.path.join can take more than two arguments, too. os.path has lots of other handy tools, so I strongly recommend checking it out. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a restricted python interpreter

2005-01-06 Thread Craig Ringer
Apache might well be able to respawn failed subprocesses, it's not > something that most hosting providers would like to have to do all the > time for many hosted sites. I wonder if SCGI or a similar "persistent CGI" solution might be more practical for running CGI scripts under spec

Re: curses is not imported under Linux (and Python 2.4)

2005-01-06 Thread Craig Ringer
ckages (providing the ncurses header files and static libs) installed. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: missing sys.setappdefaultencoding

2005-01-07 Thread Craig Ringer
e...;-) Agreed. I prefer to use explicit str.encode(), str.decode() and unicode() calls where appropriate. On a side note, PEP 263 handles the text encoding interpretation of Python program source, and is well worth reading and following. http://python.org/peps/pep-0263.html -- Craig Ringer --

Re: sorting on keys in a list of dicts

2005-01-07 Thread Craig Ringer
e-sorting by a different key... but you didn't know what key was last used for sorting. A stable sort algorithm means you don't need to care, because the order will be maintained for you not randomized. Well, that's several hundred more words than were probably required, but I hope I made sense. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: how to extract columns like awk $1 $5

2005-01-07 Thread Craig Ringer
t;)[4:6] ['something', 'about'] so if 'x' is your string, the rough equivalent of that awk statement is: .>>> x_words = x.split() .>>> print x_words[4], x_words[5] or perhaps .>>> print "%s %s" % tuple(x.split()[4:6]) -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Help uninstalling/installing Python 2.4

2005-01-07 Thread Craig Ringer
in ? > import readline > ImportError: No module named readline > > I think some paths are screwed up.. can someone take pity on me and give > me a hand. I'd say that'll be the same as with Tkinter - you probably didn't have the GNU readline development headers installed, so Python disabled readline support when it was compiled. That's just a guess, but seems pretty likely. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: _tkinter problem

2005-01-07 Thread Craig Ringer
(Yes, I know yours isn't Python 2.4 - it doesn't matter). -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: C structure in the Python extension

2005-01-10 Thread Craig Ringer
x27;t too hard, though the Python/C API does make creating types a bit cumbersome. (Most of this seems to be because you're playing pretend-we-have-objects in C, rather than issues specific to the Python/C API). -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: here document

2005-01-11 Thread Craig Ringer
t;) > print >>f , """CategoryY = GRIB > etc. > """ You mean "os.popen" not "open" I assume? The former opens a pipe to a command, the latter overwrites the file. I'd use: os.popen("/bin/exe.x", "w").write("""\ CategorY = GRIB etc. """) myself, but that's just taste (well, and performance I suspect). -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Python.org, Website of Satan

2005-01-12 Thread Craig Ringer
> or, if you haven't upgraded to 2.4, yet: That'll work fine in Python 2.3. I think you meant: print sum(ord(x) for x in "PyPy") which is a different matter entirely (well, regarding compatibility anyway). -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Craig Ringer
one obvious way than what we have now. And then we have iteration (generator expressions, list comprehensions, for loops, ...?) over (sequences, iterators, generators) I happen to be extremely fond of the flexibility this provides, but one obvious way to do it there is not. -- Craig Ringer

Re: counting items

2005-01-13 Thread Craig Ringer
lice__(0, 0, > x[1:]))) > or (not x and rest and cur.append(rest.pop(0] > > ;-) If it means I _never_ have to see that list comprehension again, then seeing 'flatten' go into itertools would make me very, very happy :-P -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Free python server.

2005-01-13 Thread Craig Ringer
e in the cgi-bin, not public_html, (b) be flagged executable ("chmod a+x file.py"), and (c) begin with the line: '#!/usr/bin/env python' If the server doesn't provide you with CGI (or, strongly preferable, SCGI or mod_python), you're probably out of luck. -- Craig

Re: [Fwd: Re: Embedding Multiplr Python interpreter in C++]

2005-01-15 Thread Craig Ringer
e thread per sub-interpreter, or if it can support multiple sub interpreters in a single thread. Any ideas? I'm pretty sure it's the former, but it'd be nice to be sure. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Executing a script created by the end user

2005-01-16 Thread Craig Howard
I am working on a python project where an object will have a script that can be edited by the end user: object.script If the script is a simple one with no functions, I can easily execute it using: exec object.script But if the object script is a bit more complicated, such as the example belo

Re: lambda

2005-01-17 Thread Craig Ringer
the Python/C API. That said, I do think "the rules" deserve consideration and respect - they're usually there because of many others' experience over time. It's interesting to learn those lessons first hand, but it's nice to be able to avoid repeating every single one

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread Craig Ringer
can avoid the "sometimes works, sometimes doesn't" fun of referencing deleted memory by accident. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: need help on generator...

2005-01-21 Thread Craig Ringer
in xrange(2, len(x)) for offset in xrange(0, len(x) + 1 - subset_size) ) -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: need help on generator...

2005-01-21 Thread Craig Ringer
On Fri, 2005-01-21 at 22:38 +0800, Craig Ringer wrote: > consecutive_sets = ( x[offset:offset+subset_size] > for subset_size in xrange(2, len(x)) > for offset in xrange(0, len(x) + 1 - subset_size) ) Where 'x' is list to operate

Re: Dynamic properties

2005-01-21 Thread Craig Ringer
s though, personally. I'd want to look into using a class factory or metaclass to do the job if __getattr__ and __setattr__ are insufficient or unacceptable. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: need help on need help on generator...

2005-01-21 Thread Craig Ringer
er handy. I'm not sure how many Python built-in functions and library modules return generators for things. > I know this is now the case for reading lines in a file or with the > new "iterator" package. But what else ? Does Craig Ringer answer mean > that list comprehensi

Re: need help on generator...

2005-01-21 Thread Craig Ringer
ttp://www.python.org/peps/pep-0289.html http://docs.python.org/whatsnew/node4.html http://www.python.org/dev/doc/newstyle/ref/genexpr.html for details. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Configuring Python for Tk on Mac

2005-01-21 Thread Craig Ringer
n't build Python with Tk support. > What do I do to set it up so I can use Tkinter? Try Google - this seems to be a moderately FAQ for MacOS/X. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple size and memory allocation for embedded Python

2005-01-21 Thread Craig Ringer
LL (meaning a failure, probably of memory allocation). I also don't see anything in there to resize the tuple. http://docs.python.org/api/tupleObjects.html -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple size and memory allocation for embedded Python

2005-01-21 Thread Craig Ringer
). > Python is pretty stable, so it's usually best to suspect our own code > unless you're heavily into using the C API (which I'm not, so feel free > to ignore me). That's been my experience - stability issues in my Python/C code have almost always come down to refcounting bugs and/or failing to detect and handle or propagate an exception. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: finding name of instances created

2005-01-21 Thread Craig Ringer
ct: > >> do_stuff(name) > > Any help, pointers, sketches or outline of solution would be greatly > appreciated. I'm not really able to grasp what you're trying to do (but others might). It wouldn't hurt if you could post a description of what you're actually trying to achieve - /why/ you want this - as that can often be very helpful both in understanding what you're thinking and in suggesting a suitable approach or alternative. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: need help on need help on generator...

2005-01-22 Thread Craig Ringer
his than: .>>> inpath = '/tmp/msg.eml' .>>> infile = open(inpath) .>>> initer = iter(infile) .>>> headers = [] .>>> for line in initer: if not line.strip(): break headers.append(tuple(line.split(':',1))) .&

Re: need help on need help on generator...

2005-01-22 Thread Craig Ringer
t the cost of making it less clear what's going on and having someone later go "duh, why isn't he using read() here instead" but can't seem to do much more than that. Might it be worth providing a way to have file objects seek back to the current position of the iterator when r

Re: need help on need help on generator...

2005-01-22 Thread Craig Ringer
On Sat, 2005-01-22 at 12:20 +0100, Alex Martelli wrote: > Craig Ringer <[EMAIL PROTECTED]> wrote: > > > .>>> data = ''.join(x for x in infile) > > Maybe ''.join(infile) is a better way to express this functionality? > Avoids 2.4 dependen

Re: how to write a tutorial

2005-01-26 Thread Craig Ringer
quot; moron who appears to have nothing to do with either, or any knowledge of them. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-26 Thread Craig Ringer
so small and approachable. I also love the way I can chuck a bunch of objects into a functionally styled processing pipeline, say a series of functions that each just return the result of a listcomp/genexp. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: exclude binary files from os.walk

2005-01-26 Thread Craig Ringer
()? > > > > > > Sure, assuming you can provide a rigorous definition of 'binary > > files'. :) > > non-ascii That's not really safe when dealing with utf-8 files though, and IIRC with UCS2 or UCS4 as well. The Unicode BOM its self might (I'm not sure) qualify as ASCII. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Hello

2005-01-27 Thread Craig Ringer
newsreader to use that. Once your newsread is talking correctly to your ISP's news server, *then* you can subscribe to comp.lang.python. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: example needed: sip + Qt

2005-01-28 Thread Craig Ringer
the PyQt/PyKDE list (and search its archives first). -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic class methods misunderstanding

2005-01-28 Thread Craig Ringer
create another type. Well, a type is essentially a class (in the OOP sense, not the python- specific classobj sense). You can call a type or class to create an instance of that class or type. Here, you call the 'instancemethod' type to create an instance of type 'instancemethod'.

Dr. Dobb's Python-URL! - weekly Python news and links (Feb 9)

2005-02-09 Thread Craig Ringer
QOTW: "Such infrastructure building is in fact fun and instructive -- as long as you don't fall into the trap of *using* such complications in production code, where Python's simplicity rules;-)." -- Alex Martelli http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/41a6c

Dr. Dobb's Python-URL! - weekly Python news and links (Feb 9)

2005-02-09 Thread Craig Ringer
QOTW: "Such infrastructure building is in fact fun and instructive -- as long as you don't fall into the trap of *using* such complications in production code, where Python's simplicity rules;-)." -- Alex Martelli http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/41a6c

Re: Protecting Python source

2004-11-29 Thread Craig Ringer
bit more practical IMO, and may be a good place to look at digital signing. > - Your customer demands closed source because the code contains trade >secrets. My understanding is that that's never guaranteed safe, no? Or are restrictions against reverse engineering now commonly enforcable? -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Class methods in Python/C?

2004-11-30 Thread Craig Ringer
hanks to Qt the bindings are going to be both simple and quite powerful. However, I need a way to do class methods... If anybody has any tips on this, It'd be much appreciated. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

Re: Class methods in Python/C? [ANSWER]

2004-11-30 Thread Craig Ringer
on. New in version 2.3. Sorry for the noise everybody, I could've sworn I looked over that already. -- Craig Ringer -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   >