Re: Embedding Python in C

2007-06-05 Thread mistabean
now then... where's the edit button...? oh well, double-posting. Problem solved, thanks for pointing out that I am needing a numeric array built instead of building a normal list/ tuple. For those who are curious, steps to solving: ... #include "libnumarray.h" /*from numpy*/ ... ... ... void Cal

Re: Python Memory Leak using SWIG

2007-06-05 Thread Pierre Sangouard
[EMAIL PROTECTED] wrote: > Versions: > Python 2.5.1 (r251:54863, May 14 2007, 10:50:04) > SWIG Version 1.3.20 > > Hello I have some code that wraps a C++ library so I may use it in > python. The code basically just gets some data and puts it in the > PyArrayObject* which is returned as a PyObject*

Re: magic names in python

2007-06-05 Thread per9000
On 4 Juni, 10:19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > [...] > > Now I'm a little confused. What does this have to do with magic names? I > thought you are talking about names that start and end with two > underscores (`__magic__`)!? Indeed I am talking about two things at onc

Re: another thread on Python threading

2007-06-05 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 10:11 pm, Josiah Carlson <[EMAIL PROTECTED]> > wrote: > >> lock = threading.Lock() >> >> with lock: >> #synchronized block! >> pass > > True, except that the lock has to be shared among the threads. This > explicit initiation of an reent

Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
Mitko Haralanov schrieb: > Hi, I am trying to find a way to figure out whether a certain remote > filesystem is mounted using tcp vs. udp in Python. I've looked at the > statvfs call and module but they don't give me anything useful (the > F_FLAGS field for both a tcp and a udp filesystem is the sa

Re: another thread on Python threading

2007-06-05 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 10:11 pm, Josiah Carlson <[EMAIL PROTECTED]> > wrote: > >> However, locking isn't just for refcounts, it's to make sure that thread >> A isn't mangling your object while thread B is traversing it. > > >> With >> object locking (course via the GIL, or fine via obje

Re: Who uses Python?

2007-06-05 Thread Hongtian
We use Python in our VOIP server. :-) Python is a very good script language and can be very easy to embed into our server. It is great! -- http://mail.python.org/mailman/listinfo/python-list

Re: magic names in python

2007-06-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, per9000 wrote: > Still, I have problems with "magic" functions, similar to magic > numbers: http://en.wikipedia.org/wiki/Magic_number_%28programming%29 > f.x. calling all member-functions of a class to close files as > illustrated in a previous post, or PyUnits magic "test*

Re: Tkinter - resize tkMessageBox

2007-06-05 Thread Glenn Hutchings
On 4 Jun, 21:29, [EMAIL PROTECTED] wrote: > Is there a way to resize the width of the "tkMessageBox.askyesno" > dialog box, so that the text does not wrap to the next line. You can use the Tk option database, either explicitly or from a file. For example, to set the wrap length of all dialogs to 1

want to get free things from microsoft?

2007-06-05 Thread justpratik
visit my site http://justpratik.blogspot.com if u want to win from microsoft -- http://mail.python.org/mailman/listinfo/python-list

please help a newbie

2007-06-05 Thread Pieter Potgieter
Hi all I have a binary file of about 600kbytes - I want to break it up in file chunks of 1085 bytes - every file must have a new file name. The data is binary video frames (370 frames) - I want to play the data back into an embedded system frame/file by file. I am a complete Python newby - but hav

Please help on Binary file manipulation

2007-06-05 Thread Pieter Potgieter
Hi all I have a binary file of about 600kbytes - I want to break it up in file chunks of 1085 bytes - every file must have a new file name. The data is binary video frames (370 frames) - I want to play the data back into an embedded system frame/file by file. I am a complete Python newby - but have

CFP: 2008 International Workshop on Multi-Core Computing Systems

2007-06-05 Thread Sabri . Pllana
We apologize if you receive multiple copies of this call for papers. *** 2008 International Workshop on Multi-Core Computing Systems (MuCoCoS'08) Barcelona, Spain, March 4 - 7, 2008; in conjunction with CISIS'08.

Re: Who uses Python?

2007-06-05 Thread Maria R
I tend to agree with some earlier poster that if you use Python you are, in a sense, a programmer :o) But seriously, we use Python for controlling fully automated logistics solutions (conveyors and stacker cranes), for generating PLC code etc etc. We are also about to start using FactoryCAD (a th

Re: magic names in python

2007-06-05 Thread ai
I don't think it is magic. If you think it is magic, can you talk about what's the better way and how can you implement the functions without any magic. I can't image a lauguage without special names. There are some special names even in Lisp. I guess you just hate the '__'. On Jun 4, 2:43 pm, per

html 2 image script or library

2007-06-05 Thread baur79
Hi everyone can you help me to find script or library for making website (from url) 2 image (png, jpg no matter). thanks a lot -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help on Binary file manipulation

2007-06-05 Thread km
Hi, I assume ur on a linux/unix box... pls check the manual for 'split' command in linux/unix this does ur job regards, KM --- On 6/5/07, Pieter Potgieter <[EMAIL PROTECTED]>

Re: Strange behavior in Windows

2007-06-05 Thread Douglas Woodrow
On Mon, 4 Jun 2007 21:34:36, David Stockwell wxp <[EMAIL PROTECTED]> wrote > >in DOS you can try this to see what your path is: > >echo "My path is %PATH%" or more simply: , | C:> path ` -- Doug Woodrow -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-05 Thread ai
I am not a native English speaker. But I totally do not support PEP 3131. If a program is written in English and commented by other language, I am read it. But if a program is written in other language, it will be full unreadable by me even it is commented by English. I think language is just a too

Re: Beginner question: module organisation

2007-06-05 Thread Mail . To . Nathaniel
Thank you for all your help! I'll study the proposals to chose the one I prefer or to create something new :) Anyway, this is a perfect start-up for me. Nathaniel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Who uses Python?

2007-06-05 Thread montyphyton
i use it for text mining, processing large text corpora for scientific purposes. i'm also working on some neat data mining tools written in python (called orange, in case someone's interested) walterbyrd je napisao/la: > I mean other than sysadmins, programmers, and web-site developers? > > I have

Regression testing with Python

2007-06-05 Thread Almad
Hi, I'd like to ask how do You resolve "resources" issue when writing regression tests in Python. When doing functional tests, I have some resources that might not be available (like database, HTTP server, Selenium testing proxy) and I'd like then to skip test gracefully (not either failing nor gr

Re: html 2 image script or library

2007-06-05 Thread Thomas Jollans
"baur79" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > can you help me to find script or library for making website (from > url) 2 image (png, jpg no matter). complex business that is, you'll want to look at fully-fledged HTML redering engines like Gecko. You might also want to r

Re: magic names in python

2007-06-05 Thread per9000
On 5 Juni, 11:02, ai <[EMAIL PROTECTED]> wrote: > I don't think it is magic. If you think it is magic, can you talk > about what's the better way and how can you implement the functions > without any magic. [...] Well, in a sense I guess all reserved words can be considered magic, but in Python yo

url encode

2007-06-05 Thread Lee Jones
Hello, I am trying to urlencode a string. In python the only thing I can see is the urllib.urlencode(). But this takes a dictionary, and returns "key=value", which is not what I want. I only want to url-encode a string. Does any one know how to do this in python Thanks Lee Lee Jone

Re: excel library without COM

2007-06-05 Thread John Machin
On Jun 5, 1:04 pm, james_027 <[EMAIL PROTECTED]> wrote: > On Jun 4, 8:16 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > On Jun 4, 3:52 pm, yuce <[EMAIL PROTECTED]> wrote: > > > > i think this one works pretty nice:http://www.python.org/pypi/xlrd > > > Sure does :-) However the "rd" in "xlrd" is s

Memory Leak in Python 2.5.1?

2007-06-05 Thread Suresh Kumar
Hi, I am currently investigating what seems to be a memory leak in python. (version 2.5.1). I have made python work with a custom memory sub-allocator (pool). The idea is to preallocate a pool of memory during initialization of my application and ensure that Python doesn't make any system malloc

Feature request: New string conversion type to ignore list item

2007-06-05 Thread thomas . pohl
Hi, let's assume you want to nicely print the content of a list except for one (or some) individual item. You could do it like this: t = ["foo", "skip me", 1, 2, 3] print("text: %s\nvalues: %i %i %i" % (t[0], t[2], t[3], t[4])) If there was a conversion type which simply ignores the corresponding

Re: Feature request: New string conversion type to ignore list item

2007-06-05 Thread Peter Otten
[EMAIL PROTECTED] wrote: > let's assume you want to nicely print the content of a list except for > one (or some) individual item. You could do it like this: > t = ["foo", "skip me", 1, 2, 3] > print("text: %s\nvalues: %i %i %i" % (t[0], t[2], t[3], t[4])) or like this: >>> "%s %.s %s" % ("fir

mxtextools, py2app, and intel vs. PPC

2007-06-05 Thread Ian A. York
I've been packaging a set of scripts using py2app, and until now the app that results has run without issues on MacOS10.4, either intel or ppc. The latest version made by py2app, however, only runs on intel (on which I made the py2app package). The problem seems to be with eGenix mx base pac

Re: Who uses Python?

2007-06-05 Thread Maurice LING
[EMAIL PROTECTED] wrote: > i use it for text mining, processing large text corpora for scientific > purposes. i'm also working on some neat data mining tools written in > python (called orange, in case someone's interested) > Hi, I am very interested with your use of Python. I am into text minin

Re: Feature request: New string conversion type to ignore list item

2007-06-05 Thread thomas . pohl
On 5 Jun., 13:12, Peter Otten <[EMAIL PROTECTED]> wrote: > or like this: > > >>> "%s %.s %s" % ("first", "second", "third") > > 'first third' Hey, that's great, thanks Peter! Tom -- http://mail.python.org/mailman/listinfo/python-list

Refactoring test units after an extract method

2007-06-05 Thread Virgil Dupras
This is not strictly python related, but it's not strictly TDD related either. Anyway, here it goes. There's something that I was never quite sure how to handle with test units: How to handle the test unit refactoring after a method extraction. Let's say that you have a function foo() that does A

how to convert a bitmap file to an array ?

2007-06-05 Thread stef
hello I can find all kind of procedures to convert an array to a bitmap (wxPython, PIL), but I can't find the reverse, either - convert a bitmap to an array or - read a bitmap file to an array thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

subprocess leaves child living

2007-06-05 Thread Thomas Dybdahl Ahle
Hi, When I do a small program like from subprocess import Popen popen = Popen(["ping", "google.com"]) from time import sleep sleep(100) start it and kill it, the ping process lives on. Is there a way to ensure that the ping process is always killed when the python process is? I can't use atexit,

Re: how to convert a bitmap file to an array ?

2007-06-05 Thread Stefan Sonnenberg-Carstens
stef schrieb: > hello > > I can find all kind of procedures to convert an array to a bitmap > (wxPython, PIL), > but I can't find the reverse, > either >- convert a bitmap to an array > or > - read a bitmap file to an array > > thanks, > Stef Mientki > Take a look at the "struct" module. T

Re: c[:]()

2007-06-05 Thread Steve Holden
Warren Stringer wrote: > Oops, forgot to cut and paste the point, to this: > >>> - there is no Python error for "you >>> cannot do this with this object, but you can do it with other objects >>> of the same type". >> Yes there is: >> >> # >> def yo(): print "yo" >> def no(

Re: subprocess leaves child living

2007-06-05 Thread Stefan Sonnenberg-Carstens
Thomas Dybdahl Ahle schrieb: > Hi, When I do a small program like > > from subprocess import Popen > popen = Popen(["ping", "google.com"]) > from time import sleep > sleep(100) > > start it and kill it, the ping process lives on. > Is there a way to ensure that the ping process is always killed whe

Re: how to convert a bitmap file to an array ?

2007-06-05 Thread Diez B. Roggisch
stef wrote: > hello > > I can find all kind of procedures to convert an array to a bitmap > (wxPython, PIL), > but I can't find the reverse, > either >- convert a bitmap to an array > or > - read a bitmap file to an array Not true for PIL, Image.getdata and Image.putdata are your friends.

Re: Embedding Python in C

2007-06-05 Thread Joe Riopel
This seems like a pretty good resource, although I didn't read it all yet: http://www.ibm.com/developerworks/edu/l-dw-linux-pythonscript-i.html -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert a bitmap file to an array ?

2007-06-05 Thread stef
Stefan Sonnenberg-Carstens wrote: > stef schrieb: >> hello >> >> I can find all kind of procedures to convert an array to a bitmap >> (wxPython, PIL), >> but I can't find the reverse, >> either >>- convert a bitmap to an array >> or >> - read a bitmap file to an array >> >> thanks, >> Stef Mi

Re: how to convert a bitmap file to an array ?

2007-06-05 Thread stef
Diez B. Roggisch wrote: > stef wrote: > > >> hello >> >> I can find all kind of procedures to convert an array to a bitmap >> (wxPython, PIL), >> but I can't find the reverse, >> either >>- convert a bitmap to an array >> or >> - read a bitmap file to an array >> > > Not true for PIL,

*args and **kwargs

2007-06-05 Thread JonathanB
Ok, this is probably definitely a newbie question, but I have looked all over the Python library reference material and tutorials which I can find online and I cannot find a clear definition of what these are and more importantly how to use them. From what I can tell from their use in the examples

Re: *args and **kwargs

2007-06-05 Thread Diez B. Roggisch
JonathanB wrote: > Ok, this is probably definitely a newbie question, but I have looked > all over the Python library reference material and tutorials which I > can find online and I cannot find a clear definition of what these are > and more importantly how to use them. From what I can tell from

Re: *args and **kwargs

2007-06-05 Thread Thomas Jollans
"JonathanB" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ok, this is probably definitely a newbie question, but I have looked > all over the Python library reference material and tutorials which I > can find online and I cannot find a clear definition of what these are > and more

Re: *args and **kwargs

2007-06-05 Thread Wildemar Wildenburger
JonathanB wrote: > Ok, this is probably definitely a newbie question, but I have looked > all over the Python library reference material and tutorials which I > can find online and I cannot find a clear definition of what these are > and more importantly how to use them. From what I can tell from t

Re: *args and **kwargs

2007-06-05 Thread JonathanB
> I hope this example code will help you understand: >>Code Snipped<< OOH!! That makes perfect sense, thanks!, *args are passed as a turple, **kwargs are passed as a dictionary. That means **kwargs is probably what I want. JonathanB -- http://mail.python.org/mailman/listinfo/python-list

RE: Graph plotting module

2007-06-05 Thread Sells, Fred
www.vpython.org might be overkill, but it was easy to do simple 2d charts. > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Behalf Of Grant Edwards > Sent: Monday, June 04, 2007 11:23 AM > To: python-list@python.org > Subject: Re: Graph plotting module > > > O

Re: *Naming Conventions*

2007-06-05 Thread Neil Cerutti
On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Wildemar Wildenburger wrote: >> While that is true, I guess it is commonplace to use i, j, k >> and n (maybe others) in constructs like >> >> for i in range(len(data)): >>do_stuff(data[i]) >> >> Or should the good python hacker do th

Re: Who uses Python?

2007-06-05 Thread Neil Cerutti
On 2007-06-04, walterbyrd <[EMAIL PROTECTED]> wrote: > I mean other than sysadmins, programmers, and web-site > developers? I manage the database application, data integration, and reporting for a financial aid office, and I use Python every day. Though I only seldom have to write new programs or

Re: subprocess leaves child living

2007-06-05 Thread Thomas Dybdahl Ahle
Den Tue, 05 Jun 2007 14:07:44 +0200 skrev Stefan Sonnenberg-Carstens: > Thomas Dybdahl Ahle schrieb: >> Hi, When I do a small program like >> >> from subprocess import Popen >> popen = Popen(["ping", "google.com"]) from time import sleep >> sleep(100) >> >> start it and kill it, the ping process l

Re: Refactoring test units after an extract method

2007-06-05 Thread Steve Howell
--- Virgil Dupras <[EMAIL PROTECTED]> wrote: > How to you handle the tests? Copy over the tests you > had for foo() and > apply them to bar()? I don't like copy and pasting > code. Move the B > related tests to baz()'s tests? Then your tests > wouldn't fail if you > stopped calling baz() in foo()

Embedding interactive interpreter

2007-06-05 Thread Ryan K
Hi. I am trying to embed an interactive interpreter in a C++ application. I need to capture the output of int PyRun_InteractiveOne(FILE *fp, const char *filename). Is redirecting sys.stdout and sys.stderr after initializing the interpreter the best way to do this? Thanks, Ryan -- http://mail.pyt

Logging: how to suppress default output when adding handlers?

2007-06-05 Thread Chris Shenton
I am setting up handlers to log DEBUG and above to a rotating file and ERROR and above to console. But if any of my code calls a logger (e.g., logging.error("foo")) before I setup my handlers, the logging system will create a default logger that *also* emits logs, which I can't seem to get rid of.

Re: subprocess leaves child living

2007-06-05 Thread Rob Wolfe
Thomas Dybdahl Ahle wrote: > Problem is - I can't do that when I get killed. > Isn't it possible to open processes in such a way like terminals? If I > kill the terminal, everything open in it will die too. On POSIX platform you can use signals and ``os.kill`` function. Fo example: import os,

otsu threshold in python

2007-06-05 Thread azrael
Hy guys. I'd like to ask you for a favour. I tried several times to implement the otsu threshold filter in python. but I failed every time. I found the soucre code i n Java from the ImageJ project but I never worked in Java and there have been used some built in Java functions which I don't know ho

Basic Auth for simple web server

2007-06-05 Thread Marco Aloisio
Hi, I'm a Python newbie; I have to write a simple webserver, and I need to implement a basic authentication as specified in the RFC2617. I wonder if there is a Python library for doing that. Thanks! -- Marco Aloisio -- http://mail.python.org/mailman/listinfo/python-list

Beginning Python

2007-06-05 Thread abhiee
Hello , I have just begun learning python...and I'm loving it...Just wanted to ask you that how much time would it take me to learn python completely and which languages should i learn alongwith python to be a good professional programmer?...Now i only know C thanx in advance! -- http://mail.

Re: Logging: how to suppress default output when adding handlers?

2007-06-05 Thread Vinay Sajip
On Jun 5, 2:44 pm, Chris Shenton <[EMAIL PROTECTED]> wrote: > I am setting up handlers to log DEBUG and above to a rotating file and > ERROR and above to console. But if any of my code calls a logger > (e.g.,logging.error("foo")) before I setup my handlers, thelogging > system will create a defaul

Re: *Naming Conventions*

2007-06-05 Thread Michael Hoffman
Neil Cerutti wrote: > I find i and j preferable to overly generic terms like "item." Well, I probably wouldn't use "item" in a real example, unless it were for a truly generic function designed to act on all sequences. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5.1 broken os.stat module

2007-06-05 Thread Joe Salmeri
> But that perspective is not directly relevant to *your* topic line. When > you make a claim that os.stat is 'broken' and bugged, you are making a > claim about the *programmer* experience -- in particular, experiencing a > discrepancy between performance and reasonable expectation based on the >

Re: subprocess leaves child living

2007-06-05 Thread Thomas Dybdahl Ahle
Den Tue, 05 Jun 2007 07:06:15 -0700 skrev Rob Wolfe: > Thomas Dybdahl Ahle wrote: > >> Problem is - I can't do that when I get killed. Isn't it possible to >> open processes in such a way like terminals? If I kill the terminal, >> everything open in it will die too. > > On POSIX platform you can

Re: *args and **kwargs

2007-06-05 Thread BartlebyScrivener
On Jun 5, 7:31 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > JonathanB wrote: > > Ok, this is probably definitely a newbie question, but I have looked > > all over the Python library reference material and tutorials which I > > can find online and I cannot find a clear definition of what thes

Re: Basic Auth for simple web server

2007-06-05 Thread Michele Simionato
On Jun 5, 4:28 pm, Marco Aloisio <[EMAIL PROTECTED]> wrote: > Hi, I'm a Python newbie; > I have to write a simple webserver, and I need to > implement a basic authentication as specified in the RFC2617. > I wonder if there is a Python library for doing that. > > Thanks! > > -- > Marco Aloisio Hav

RE: Please help on Binary file manipulation

2007-06-05 Thread Looney, James B
Pieter, I've found when I have questions like this, that thinking about how I'd do it in C/C++, then searching on some of those key words leads me to a Python equivalent solution, or at least heading down the right path. In this case, I believe you'll find the "file" module helpfull. You can rea

Re: *Naming Conventions*

2007-06-05 Thread Ninereeds
Google Groups appears to have thrown away my original reply, so sorry if this appears twice... On Jun 4, 9:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > 'i' and 'j' are the canonical names for for loops indices in languages > that don't support proper iteration over a sequence. Using th

Re: Beginning Python

2007-06-05 Thread kyosohma
On Jun 5, 9:29 am, abhiee <[EMAIL PROTECTED]> wrote: > Hello , I have just begun learning python...and I'm loving it...Just > wanted to ask you that how much time would it take me to learn python > completely and which languages should i learn alongwith python to be a > good professional programmer

Re: Beginning Python

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 9:29 AM, abhiee wrote: > Hello , I have just begun learning python...and I'm loving it...Just > wanted to ask you that how much time would it take me to learn python > completely and which languages should i learn alongwith python to be a > good professional programmer?...Now i

Re: otsu threshold in python

2007-06-05 Thread Hyuga
On Jun 5, 10:19 am, azrael <[EMAIL PROTECTED]> wrote: > Hy guys. > I'd like to ask you for a favour. > I tried several times to implement the otsu threshold filter in > python. but I failed every time. I found the soucre code i n Java from > the ImageJ project but I never worked in Java and there h

Sending cookies with python. When download with python

2007-06-05 Thread moishyyehuda
I need to download files off a password protected website. So if I try to download files off the site with python I will be blocked. Is there anyway to send cookies with python. So I will be authenticated. -- http://mail.python.org/mailman/listinfo/python-list

Tkinter, tkMessagebox and overrideredirect

2007-06-05 Thread marcoberi
Hi everybody. I have this code snippet that shows a window without a titlebar (using overrideredirect) and two buttons on it: one quits and the other one brings up a simple tkMessageBox. On Windows (any flavour) the tkMessagebox brings up over the underlying window. On Linux (apparently any flavou

Re: itertools.groupby

2007-06-05 Thread [EMAIL PROTECTED]
On May 27, 7:50 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > The groupby itertool came-out in Py2.4 and has had remarkable > success (people seem to get what it does and like using it, and > there have been no bug reports or reports of usability problems). With due respect, I disagree. Bug

Re: Who uses Python?

2007-06-05 Thread walterbyrd
On Jun 5, 3:01 am, Maria R <[EMAIL PROTECTED]> wrote: > I tend to agree with some earlier poster that if you use Python you > are, in a sense, a programmer :o) > Yes, in a sense. But, in another sense, that is sort of like saying that people who post on message boards are "writers." I should have

Re: Who uses Python?

2007-06-05 Thread [EMAIL PROTECTED]
walterbyrd wrote: > On Jun 5, 3:01 am, Maria R <[EMAIL PROTECTED]> wrote: > > I tend to agree with some earlier poster that if you use Python you > > are, in a sense, a programmer :o) > > > > Yes, in a sense. But, in another sense, that is sort of like saying > that people who post on message board

Re: itertools.groupby

2007-06-05 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > On May 27, 7:50 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > The groupby itertool came-out in Py2.4 and has had remarkable > > success (people seem to get what it does and like using it, and > > there have been no bug reports or reports of usability problems). > >

Re: Sending cookies with python. When download with python

2007-06-05 Thread Yongjian Xu
yes. urllib2 has Request class that compose html headers (dict object) into a request object where you can put Cookie: header into it. Also, there are a few Cookie related modules you can use too. An example using urllib2 can be something like this: def myrequest(url): req = urllib2.Request(ur

ANN: matplotlib 0.90.1 graphing package

2007-06-05 Thread [EMAIL PROTECTED]
matplotlib-0.90.1 has just been released. matplotlib is a graphing package for python which can be used interactively from the python shell ala Mathematica or Matlab, embedded in a GUI application, or used in batch mode to generate graphical hardcopy, eg in a web application server. Many raster a

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
On Tue, 05 Jun 2007 09:19:08 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > I'm not quite sure what you want to achieve. You are on machine B, > and you want to find out whether a remote file system (on machine A) > is mounted remotely (say, from machine C)? Ok, let me try to explain: I am

Re: magic names in python

2007-06-05 Thread Lenard Lindstrom
Steven D'Aprano wrote: > On Mon, 04 Jun 2007 22:19:35 +, Lenard Lindstrom wrote: > >> What is "magic" about __init__ and __repr__? They are identifiers just >> like "foo" or "JustAnotherClass". They have no special meaning to the >> Python compiler. The leading and trailing double underscore

Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
> I am on machine A, which has a NFS mounted filesystem hosted on machine > B. All I need to find out is whether the NFS filesystem is mounted > using tcp or udp. Ah, ok. I recommend to parse /proc/mounts. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: url encode

2007-06-05 Thread Yongjian Xu
you can take a look urlib.quote or quote_plus methods. Jim On 6/5/07, Lee Jones <[EMAIL PROTECTED]> wrote: Hello, I am trying to urlencode a string. In python the only thing I can see is the urllib.urlencode(). But this takes a dictionary, and returns "key=value", which is not what I wan

Re: Sending cookies with python. When download with python

2007-06-05 Thread Matimus
On Jun 5, 9:14 am, [EMAIL PROTECTED] wrote: > I need to download files off a password protected website. So if I try > to download files off the site with python I will be blocked. Is there > anyway to send cookies with python. So I will be authenticated. Yes. I haven't done it but I know you shou

Re: Python for embedded systems with memory constraints

2007-06-05 Thread Jürgen Urner
Who else is using python (programmers, scientists, finance)? Me! Graduated in fine arts. Python is what I do when I am fed up with all those colors. Much easier to manufacture sense with. -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools.groupby

2007-06-05 Thread BJörn Lindqvist
On 27 May 2007 10:49:06 -0700, 7stud <[EMAIL PROTECTED]> wrote: > On May 27, 11:28 am, Steve Howell <[EMAIL PROTECTED]> wrote: > > The groupby method has its uses, but it's behavior is > > going to be very surprising to anybody that has used > > the "group by" syntax of SQL, because Python's groupb

RE: c[:]()

2007-06-05 Thread Warren Stringer
Roland Puntaier [mailto:[EMAIL PROTECTED] > Warren, can you please restate your point. Hey Roland, where were you a few days ago ;-) I think most suggestions were valid, in their own context. Only yesterday, was I finally able to get it in perspective, so here goes: There are two idioms: a domain

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
On Tue, 05 Jun 2007 20:14:01 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Ah, ok. I recommend to parse /proc/mounts. I was looking for something that reminded me less of Perl and more of C but haven't been able to find such a method. -- Mitko Haralanov [

Re: How do you htmlentities in Python

2007-06-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Matimus <[EMAIL PROTECTED]> wrote: >On Jun 4, 6:31 am, "js " <[EMAIL PROTECTED]> wrote: >> Hi list. >> >> If I'm not mistaken, in python, there's no standard library to convert >> html entities, like & or > into their applicable characters. >> >> htmlentitydefs prov

Python for industrial control (was: Who uses Python?)

2007-06-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "walterbyrd" <[EMAIL PROTECTED]> wrote: > >> Anything else? Finance? Web-analytics? SEO? Digital art? > >Industrial control and alarm annunciation . .

Re: web development without using frameworks

2007-06-05 Thread Christoph Haas
On Tue, Jun 05, 2007 at 03:01:01PM -0400, Chris Stewart wrote: > I'm interested in learning web based python without the use of fancy > frameworks > that are out there. I'm having a hard time coming up with resources and > examples for this. Does anyone have anything that could be helpful? I'd

web development without using frameworks

2007-06-05 Thread Chris Stewart
I'm interested in learning web based python without the use of fancy frameworks that are out there. I'm having a hard time coming up with resources and examples for this. Does anyone have anything that could be helpful? -- Chris Stewart [EMAIL PROTECTED] http://www.compiledmonkey.com -- http:/

Re: Python 3000: Standard API for archives?

2007-06-05 Thread Chuck Rhode
Tim Golden wrote this on Mon, 04 Jun 2007 15:55:30 +0100. My reply is below. > Chuck Rhode wrote: >> samwyse wrote this on Mon, 04 Jun 2007 12:02:03 +. My reply is >> below. >>> I think it would be a good thing if a standardized interface >>> existed, similar to PEP 247. This would make i

Does Boost.Python participate in cyclic gc?

2007-06-05 Thread skip
We encountered a situation today where it appeared that a Boost.Python-provided class didn't participate in Python's cyclic garbage collection. The wrapped C++ instance held a reference to a method in the Python object which referenced the Boostified C++ instance, e.g.: class Foo: def

Re: Getting mount stats for filesystems

2007-06-05 Thread Martin v. Löwis
Mitko Haralanov schrieb: > On Tue, 05 Jun 2007 20:14:01 +0200 > "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> Ah, ok. I recommend to parse /proc/mounts. > > I was looking for something that reminded me less of Perl and more of C > but haven't been able to find such a method. You could try to

Re: Logging: how to suppress default output when adding handlers?

2007-06-05 Thread Chris Shenton
Vinay Sajip <[EMAIL PROTECTED]> writes: > The default handler is created because you are calling the convenience > functions of the logging package: logging.error, etc. If you don't > want the default handler to be created, either > > (a) Configure the logging system yourself before any logging ca

Re: Who uses Python?

2007-06-05 Thread Stef Mientki
walterbyrd wrote: > On Jun 5, 3:01 am, Maria R <[EMAIL PROTECTED]> wrote: >> I tend to agree with some earlier poster that if you use Python you >> are, in a sense, a programmer :o) >> > > Yes, in a sense. But, in another sense, that is sort of like saying > that people who post on message boards

Re: web development without using frameworks

2007-06-05 Thread [EMAIL PROTECTED]
On Jun 5, 9:24 pm, Christoph Haas <[EMAIL PROTECTED]> wrote: > On Tue, Jun 05, 2007 at 03:01:01PM -0400, Chris Stewart wrote: > > I'm interested in learning web based python without the use of fancy > > frameworks > > that are out there. I'm having a hard time coming up with resources and > > exa

Re: subprocess leaves child living

2007-06-05 Thread Rob Wolfe
Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes: > But you can't ever catch sigkill. There is no protection against sigkill. > Isn't there a way to make sure the os kills the childprocess when the > parrent dies? If the parent dies suddenly without any notification childprocesses become zombies

Re: subprocess leaves child living

2007-06-05 Thread Michael Bentley
On Jun 5, 2007, at 3:01 PM, Rob Wolfe wrote: > Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes: > >> But you can't ever catch sigkill. > > There is no protection against sigkill. > >> Isn't there a way to make sure the os kills the childprocess when the >> parrent dies? > > If the parent dies sudd

Strange errors on exit

2007-06-05 Thread Thomas Dybdahl Ahle
When I close my (gtk) program, I get errors like the below. It seams that when the interpreter shuts down, it sets every variable to None, but continues running the threads, (seems only in cases where they've just been asleep) I don't think this would be intended behavior? Exception in thread Th

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
On Tue, 05 Jun 2007 21:32:21 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > You could try to invoke getmntent(3). I'm not aware of a Python wrapper > for it, so you either try to write one yourself in C, or use ctypes to > write it in Python. I am looking at ctypes and it might do what I ne

  1   2   >