Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread Kay Schluehr
On Jul 20, 6:45 am, John Nagle <[EMAIL PROTECTED]> wrote: > Juergen Erhard wrote: > > On proving programs correct... from my CS study days I distinctly > > remember thinking "sure, you can prove it correct, but you cannot do > > actual useful stuff with it". We might have come a long way since > >

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread Diez B. Roggisch
Paul Rubin schrieb: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> For example, SPARK does not support dynamic allocation of memory so >> things such as pointers and heap variables are not supported. > > Right, Spark uses a profile intended for embedded systems, so > no unpredictable gc delay

Re: Pickled objects over the network

2007-07-20 Thread Hendrik van Rooyen
Walker Lindley wrote: >Right, I could use Pyro, but I don't need RPC, I just wanted an easy way to send objects across the network. I'm sure >both Pyro and Yami can do that and I may end up using one of them. For the initial version pickle will work because we >have the networking issues figured

Re: Real-time Update

2007-07-20 Thread Hendrik van Rooyen
"Alex Martelli" <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > > > there is a recipe for this sort of thing, but I keep losing links. > > . > thanks - but its probably no use - I predict I will lose

Re: Script to POST to web page with cookies?

2007-07-20 Thread 7stud
On Jul 19, 7:43 pm, Gilles Ganault <[EMAIL PROTECTED]> wrote: > Hello > > I need to write a script to automate fetching data from a web site: > 1. using the POST method, log on, with login/password saved as cookies > 2. download page and extract relevent information using regexes > 3. log off > 4.

Re: Converting between objects

2007-07-20 Thread Bruno Desthuilliers
Nathan Harmston a écrit : > Hi, > > I have being thinking about this and was wondering with built in types > you can do things like > > float(1) or str(200) > > is there way I can define conversion functions like this: > > say i have a class A and a class B > > bobj = B() > aobj = a(bobj) > >

Re: "The basics" difficulties

2007-07-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I'm trying to get this basic sample to work: > http://docs.python.org/ext/dnt-basics.html > > When I get to the last step: > $ python setup.py build > > I get this error: > error: Python was build with Visual Studio version 8.0 and > extensions need to be built with

Re: Pickled objects over the network

2007-07-20 Thread Rustom Mody
Thats just what I was saying: If the IPC issues have been solved on your own terms but the data-serialization -- what you call making strings -- are not so satisfactory, you could use yaml (with safe_load) as a replacement for pickle and continue to use networking and IPC as you are currently doin

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread Paul Rubin
Kay Schluehr <[EMAIL PROTECTED]> writes: > Sure. But knowing that memory is limited doesn't buy you much because > you achieve an existential proof at best: you can show that the > program must run out of memory but you have to run the program to know > where this happens for arbitrary input values

Re: Using eggs or py2exe to distribute apps

2007-07-20 Thread Matthias Vodel
Hey, Use pyInstaller ;) http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi Easier to use in comparison to py2exe ... very good tool - try it! Bye, Matthias -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > What does that buy you - where is "I'm crashed becaus I ran out of > memory trying to evade the seventh mig" better than "sorry, you will > be shot down because I'm not capable of processing more enemie > fighters - but hey, at least I'm still here

Re: class C: vs class C(object):

2007-07-20 Thread [EMAIL PROTECTED]
Aahz wrote: > In article <[EMAIL PROTECTED]>, > James Stroud <[EMAIL PROTECTED]> wrote: > >Aahz wrote: > >> In article <[EMAIL PROTECTED]>, > >> Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>> > >>>It isn't wrong to use the old style, but it is deprecated, [...] > >> > >> > >> Really? Can you p

Re: Using eggs or py2exe to distribute apps

2007-07-20 Thread [EMAIL PROTECTED]
On Jul 20, 5:39 am, Marcus <[EMAIL PROTECTED]> wrote: > Hi, > > I'm to the stage where I need to deploy the app I built with wxPython. > I've been able to successfully build it w/py2exe into a binary (about > 10MB size in total). > > What I'd like to do is create an automatic updater, so that I can

Re: class C: vs class C(object):

2007-07-20 Thread Bruno Desthuilliers
Aahz a écrit : > In article <[EMAIL PROTECTED]>, > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> To make a long story short: Python 2.2 introduced a new object model >> which is more coherent and more powerful than the original one. The old >> one was kept so far for compatibility reasons, b

Re: Converting between objects

2007-07-20 Thread Alex Popescu
"Nathan Harmston" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi, > > I have being thinking about this and was wondering with built in types > you can do things like > > float(1) or str(200) > > is there way I can define conversion functions like this: > > say i have a class A and

Re: How to organize control access to source code ?

2007-07-20 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > How can we organize development team with code source control policy, > > that limit access to some portion of code ? > > The question may be of interest, but I'm afraid I don't understand how > it relates to Python ??? It sounds like a reasonab

code packaging

2007-07-20 Thread Paul Rubin
I've been through this kind of thing a few times in the past and received excellent advice here on clpy about how to deal with specific technical aspects (e.g. how to use setuptools, InnoSetup, etc). I'm now wondering where this type of thing is best addressed in more general terms. What I usua

◙►Watch FREE Satellite TV on your PC◄◙

2007-07-20 Thread Gary RAF
Instantly Turn your Computer into a Super TV • Watch all your favorite shows on your Computer & TV! • Channels you can’t get any other place in the U.S.A! • Watch from anywhere in the world! • Save 1000's of $$$ over many years on cable and satellite bills • INSTANT DOWNLOAD • And much, much more!

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread Jean-Paul Calderone
On Thu, 19 Jul 2007 21:07:55 -0500, alf <[EMAIL PROTECTED]> wrote: > >Hi, > >I need a help with explaining following behavior. Although it is not >python issue per say, python helped me to write sample programs and >originally I encountered the issue using python software. So let's >assume we have

Re: Pickled objects over the network

2007-07-20 Thread Jean-Paul Calderone
On Fri, 20 Jul 2007 09:32:17 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > Walker Lindley wrote: > >>Right, I could use Pyro, but I don't need RPC, I just wanted an easy way to >send objects across the network. I'm sure >both Pyro and Yami can do that and I >may end up using one of them.

Re: How to organize control access to source code ?

2007-07-20 Thread Bruno Desthuilliers
Paul Rubin a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >>> How can we organize development team with code source control policy, >>> that limit access to some portion of code ? >> The question may be of interest, but I'm afraid I don't understand how >> it relates to Python ??? > >

Re: Interpreting os.lstat()

2007-07-20 Thread Sion Arrowsmith
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >> (a) Running 'stat' is *not the same* as a system call. >Why do you say that? It is *exactly* the same [ ... ] Maybe if stat were implemented as int main(int argc, char** argv) { struct stat so_what_am_I_supposed_to_do_

Gmail Error using smtplib

2007-07-20 Thread DJ Fadereu
Hello, can anyone help me with this? What am I doing wrong here? (I've changed private info to /xx) I'm getting an authentication error while using a standard script Gmail: --SCRIPT- import smtplib from email.MIMEText import MIMEText ms

Re: Gmail Error using smtplib

2007-07-20 Thread Tim Williams
On 20/07/07, DJ Fadereu <[EMAIL PROTECTED]> wrote: > Hello, can anyone help me with this? What am I doing wrong here? > > (I've changed private info to /xx) > I'm getting an authentication error while using a standard script > Gmail: > --SCRIPT--

Re: Pickled objects over the network

2007-07-20 Thread Sion Arrowsmith
Rustom Mody <[EMAIL PROTECTED]> wrote: >Since pickle has problems >-- does not interface well with networking In what way does pickle not interface well with networking? Other than, possibly, security issues which you list as a separate problem with it. I've taken a working XML-RPC system and repl

Re: Interprocess communication woes

2007-07-20 Thread Murali
On Jul 19, 4:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Murali <[EMAIL PROTECTED]> wrote: > > After some investigation, I found out that this problem had nothing to > > do with my GUI app not getting refreshed and I was able to reproduce > > this problem with normal python scripts. Here

Re: class C: vs class C(object):

2007-07-20 Thread Hrvoje Niksic
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > In particular, old-style classes are noticeably faster than > new-style classes for some things (I think it was attribute lookup > that surprised me recently, possibly related to the property > stuff...) Can you post an example that we can benchma

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread alf
Jean-Paul Calderone wrote: > > You can avoid this, if you like. Set FD_CLOEXEC on the socket after you > open it, before you call os.system: > > old = fcntl.fcntl(s.fileno(), fcntl.F_GETFD) > fcntl.fcntl(s.fileno(), fcntl.F_SETFD, old | fcntl.FD_CLOEXEC) > thx for responding (I was about to

Re: class C: vs class C(object):

2007-07-20 Thread Steven D'Aprano
On Thu, 19 Jul 2007 10:42:54 -0700, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> >>It isn't wrong to use the old style, but it is deprecated, [...] > > Really? Can you point to some official documentation for this? AFAIK, > new-style classes sti

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread Steve Holden
John Nagle wrote: > Juergen Erhard wrote: >> On proving programs correct... from my CS study days I distinctly >> remember thinking "sure, you can prove it correct, but you cannot do >> actual useful stuff with it". We might have come a long way since >> then (late 80s :P), but I don't hold out mu

Re: Gmail Error using smtplib

2007-07-20 Thread supercooper
This works for me... def SendEmail(msgType,sender,recipient,subject,message): """ Sends either a log file or a string message in email to recipient. Uses Google smtp server to send the mail. CHANGELOG: 2006-12-7:Set sender, recipient, subject as input variables -

Re: Pickled objects over the network

2007-07-20 Thread Steve Holden
Hendrik van Rooyen wrote: > Walker Lindley wrote: > >> Right, I could use Pyro, but I don't need RPC, I just wanted an easy way to > send objects across the network. I'm sure >both Pyro and Yami can do that and > I > may end up using one of them. For the initial version pickle will work because

Re: Compatibility of python2.5 with pytohn2.3

2007-07-20 Thread Gabriel Genellina
En Wed, 18 Jul 2007 08:36:24 -0300, Gerhard Häring <[EMAIL PROTECTED]> escribió: > VISHAL KANAUJIA wrote: >> Hi all, >> I am new member of this post. I have a C application which uses >> Python(version 2.3) extensively with SWIG wrappers. I want to upgrade >> the Python to latest version2.5. >>

DateTime Differance

2007-07-20 Thread Robert Rawlins - Think Blue
Hello Guys, I've used the eGenix date time module to create two date time objects which I'm now looking to compare like so: If date 1 is more than 5 minutes older than date 2: Do something here... After reading through the egenix documentation I'm still a little confuse

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> What does that buy you - where is "I'm crashed becaus I ran out of >> memory trying to evade the seventh mig" better than "sorry, you will >> be shot down because I'm not capable of processing more enemie >> fighters - but hey

Need Help

2007-07-20 Thread pycraze
Hi , I am currently working on NTLM (Windows NT Lan Manager) APS (Authentication Proxy Server ) . NTLM is MS own proprietary protocol that will allow successful authentication for only MS browsers . NTLM APS was successfully cracked by Rosmanov and i am working on NTLM APS python pac

Need Help

2007-07-20 Thread pycraze
Hi , I am currently working on NTLM (Windows NT Lan Manager) APS (Authentication Proxy Server ) . NTLM is MS own proprietary protocol that will allow successful authentication for only MS browsers . NTLM APS was successfully cracked by Rosmanov and i am working on NTLM APS python pac

Re: Pickled objects over the network

2007-07-20 Thread Walker Lindley
It is feasible to an extent since loading each builtin object type is handled by a different function. However, as others have pointed out it makes more sense to use a more robust protocol than try to patch pickle. -Walker On 7/20/07, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: Walker Lindl

Re: class C: vs class C(object):

2007-07-20 Thread George Sakkis
On Jul 20, 5:40 am, Bruno Desthuilliers wrote: > Aahz a écrit : > > > In article <[EMAIL PROTECTED]>, > > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >> To make a long story short: Python 2.2 introduced a new object model > >> which is more coherent and more powerful than the original one. T

Re: Pickled objects over the network

2007-07-20 Thread Walker Lindley
It doesn't interface well because the string you end up with often doesn't fit into a single packet. Therefore you have to add a layer of protocol on top of it that allows you to check to make sure you have the whole string received before trying to unpickle it. This the case even if you use socke

Document creation with odfpy

2007-07-20 Thread DarkBlue
Hello I hope here is the right place to ask this: I use the python odfpy library to create and load an odt file , however, spaces in the passed in text are removed. http://opendocumentfellowship.org/development/projects/odfpy python2.4 from odf.opendocument import OpenDocumentText from odf.s

Re: Break up list into groups

2007-07-20 Thread Ron Adam
Matimus wrote: > Excellent work! One more modification and I get below 10us/pass: > > def getgroups(seq): > groups = [] > push = groups.append > iseq = iter(xrange(len(seq))) > for start in iseq: > if seq[start] & 0x80: > for stop in iseq: >

NTLM APS python version 0.98

2007-07-20 Thread pycraze
Hi , I am working on NTLM (Windows NT Lan Manager )APS (Authentication Proxy Server ) , to port to C language . I am using ethereal to monitor the packets sent between client and server . NTLM is a MS proprietary protocol designed so that will allow authentication only from MS browsers .

Python C Embedded ! Attribute Error

2007-07-20 Thread pycraze
Hi , I am using the below C code so that i can embed a Python Code and get input from a python function and use it in C code . Below is the C Code #include int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc; PyObject *pArgs, *pValue; int i; if

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread Jean-Paul Calderone
On Fri, 20 Jul 2007 08:15:39 -0500, alf <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: > >> >> You can avoid this, if you like. Set FD_CLOEXEC on the socket after you >> open it, before you call os.system: >> >> old = fcntl.fcntl(s.fileno(), fcntl.F_GETFD) >> fcntl.fcntl(s.fileno(), fcnt

Re: Pickled objects over the network

2007-07-20 Thread Jean-Paul Calderone
On Fri, 20 Jul 2007 08:27:13 -0700, Walker Lindley <[EMAIL PROTECTED]> wrote: >It doesn't interface well because the string you end up with often doesn't >fit into a single packet. Therefore you have to add a layer of protocol on >top of it that allows you to check to make sure you have the whole s

exec and CodeObjects

2007-07-20 Thread Prepscius, Colin (IT)
Does anybody know how to pass parameters to 'exec somefunction.func_code'? def f1(): print 'this is f1' def f2(p): print 'this is f2, p =', str(p) exec f1.func_code THIS RESULTS IN: "this is nf1" WHICH IS NICE exec f2.func_code THIS RESULTS IN: TypeError: f2() takes exactly 1 ar

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread Jeff McNeil
The open file descriptor/socket shouldn't "move" between processes when you kill the parent. When os.system forks, anything you've got open in the parent will transfer to the child. Both descriptors reference the same open port. Running the same 'ss' and 'cc' code you've supplied behaves like t

Re: Pickled objects over the network

2007-07-20 Thread Walker Lindley
Right, it's just a big problem with pickle because if you do a recv at the wrong time and try to load it with pickle, you'll start getting weird errors down in the pickle module as opposed to just not getting the full string you expected if you were using plaintext strings. This is probably me bei

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread Hrvoje Niksic
alf <[EMAIL PROTECTED]> writes: > still would like to find out why it is happening (now FD_CLOEXEC > narrowed may yahooing/googling searches). While realize that file > descriptors are shared by forked processes it is still weird why the > port moves to the child process once parent gets killed. w

Re: Open HTML file in IE

2007-07-20 Thread 7stud
On Jul 19, 11:09 pm, gravey <[EMAIL PROTECTED]> wrote: > The URL looks like this: > > file:///C|/Temp/Google%20Maps/linktothis.htm?lat=45.0&lng=-20.0&zoom=4&type =k > > The Javascript gets the URL from the Javascript location object and > parses it. I'm assuming that the location object has some ki

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > The issue I have with correctness proofs (at least as they were > presented in the 1980s - for all I know the claims may have become > more realistic now) is that the proof of correctness can only relate > to some highly-formal specification so complex tha

Images in Tkinter

2007-07-20 Thread Viewer T.
I wrote a class in which I have to use Tkinter images. When I create an image object in the class and reference it with the image attribute of label within the class, it does not dhow the image. It just shows a blank label that conforms to the size of the image. My images is a GIF image. My code t

Data type conversion

2007-07-20 Thread ervin ramonllari
Thank you very much, It was a very helpful tool -- http://mail.python.org/mailman/listinfo/python-list

Re: Images in Tkinter

2007-07-20 Thread Matt McCredie
That code doesn't tell me anything. You are going to have to post a more complete example to get help. Like, enough code so that I can run it and see the same problem. Also, I tried creating the image object outside class but it gives a runtime error saying it is too early to create an image obj

Python MAPI

2007-07-20 Thread kyosohma
Hi, I've been googling all over and can't find any good answers about this problem. I would like to create some kind of MAPI interface with Python such that when I open Microsoft Word (or another Office program) and click File, Send To, Mail Recipient it opens a program I wrote in Python and uses

Re: Trying to choose between python and java

2007-07-20 Thread rvu44vs02
On Sun, 15 Jul 2007 at 22:28:08 -0700, Alex Martelli wrote: > James T. Dennis <[EMAIL PROTECTED]> wrote: >... > > You can start writing all your code now as: print() --- calling > > the statement as if it were a function. Then you're future Python > > ...except that your output format will

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread John Nagle
Paul Rubin wrote: > Kay Schluehr <[EMAIL PROTECTED]> writes: > >>Sure. But knowing that memory is limited doesn't buy you much because >>you achieve an existential proof at best: you can show that the >>program must run out of memory but you have to run the program to know >>where this happens for

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-20 Thread Steve Holden
Hrvoje Niksic wrote: > alf <[EMAIL PROTECTED]> writes: > >> still would like to find out why it is happening (now FD_CLOEXEC >> narrowed may yahooing/googling searches). While realize that file >> descriptors are shared by forked processes it is still weird why the >> port moves to the child proce

path error

2007-07-20 Thread godavemon
I'm on an intel macbook using OS X 10.4 and for some reason my path is being interpreted incorrectly. See the example: [EMAIL PROTECTED] pwd /Users/dave/til/jared <- dirname = jared [EMAIL PROTECTED] python ... >>> import os >>> os.path.abspath('') '/Users/dave/til/Jared' <- dirname

Re: path error

2007-07-20 Thread godavemon
On Jul 20, 11:42 am, godavemon <[EMAIL PROTECTED]> wrote: > I'm on an intel macbook using OS X 10.4 and for some reason my path is > being interpreted incorrectly. See the example: > > [EMAIL PROTECTED] pwd > /Users/dave/til/jared <- dirname = jared > [EMAIL PROTECTED] python > ...>>> impo

Re: Python MAPI

2007-07-20 Thread vasudevram
On Jul 20, 10:57 pm, [EMAIL PROTECTED] wrote: > Hi, > > I've been googling all over and can't find any good answers about this > problem. I would like to create some kind of MAPI interface with > Python such that when I open Microsoft Word (or another Office > program) and click File, Send To, Mail

Re: Python C Embedded ! Attribute Error

2007-07-20 Thread Miki
Hello, > I am using the below C code so that i can embed a Python Code and > get input from a python function and use it in C code . > > Below is the C Code [snipped] > I am getting error > > AttributeError: 'module' object has no attribute 'print' > Cannot find function "print" How do

Weird errors when trying to access a dictionary key

2007-07-20 Thread robinsiebler
I have a data structure that looks like this: #dates = {'2007': {'25': {'06/23/07': {'aerosmith': [{'sweet emotion': 1}, {'dream on': 2}], # 'Metallica': [{'Fade to Black': 1}, {'Master of Puppets': 1}]}, # 'last_song': [Master of Puppets',

Pythonic way for missing dict keys

2007-07-20 Thread Alex Popescu
Hi all! I am pretty sure this has been asked a couple of times, but I don't seem to find it on the archives (Google seems to have a couple of problems lately). I am wondering what is the most pythonic way of dealing with missing keys and default values. According to my readings one can take t

Re: Pythonic way for missing dict keys

2007-07-20 Thread Neil Cerutti
On 2007-07-20, Alex Popescu <[EMAIL PROTECTED]> wrote: > Hi all! > > I am pretty sure this has been asked a couple of times, but I > don't seem to find it on the archives (Google seems to have a > couple of problems lately). > > I am wondering what is the most pythonic way of dealing with missing

Re: Weird errors when trying to access a dictionary key

2007-07-20 Thread Zentrader
> rpt_file.writelines('\t' + [song].keys() \ > + '\t' + > I get the following error: > > Traceback (most recent call last): > AttributeError: 'list' object has no attribute 'keys' All of these messages are correct. The fi

Re: Python MAPI

2007-07-20 Thread kyosohma
On Jul 20, 1:48 pm, vasudevram <[EMAIL PROTECTED]> wrote: > On Jul 20, 10:57 pm, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I've been googling all over and can't find any good answers about this > > problem. I would like to create some kind of MAPI interface with > > Python such that when I open

Re: Pythonic way for missing dict keys

2007-07-20 Thread Carsten Haese
On Fri, 2007-07-20 at 19:08 +, Alex Popescu wrote: > Hi all! > > I am pretty sure this has been asked a couple of times, but I don't seem > to find it on the archives (Google seems to have a couple of problems > lately). > > I am wondering what is the most pythonic way of dealing with missi

Re: path error

2007-07-20 Thread godavemon
On Jul 20, 11:45 am, godavemon <[EMAIL PROTECTED]> wrote: > On Jul 20, 11:42 am, godavemon <[EMAIL PROTECTED]> wrote: > > > I'm on an intel macbook using OS X 10.4 and for some reason my path is > > being interpreted incorrectly. See the example: > > > [EMAIL PROTECTED] pwd > > /Users/dave/til/jar

Re: Python MAPI

2007-07-20 Thread vasudevram
On Jul 21, 12:28 am, [EMAIL PROTECTED] wrote: > On Jul 20, 1:48 pm, vasudevram <[EMAIL PROTECTED]> wrote: > > > > > > > On Jul 20, 10:57 pm, [EMAIL PROTECTED] wrote: > > > > Hi, > > > > I've been googling all over and can't find any good answers about this > > > problem. I would like to create some

Re: Efficiently removing duplicate rows from a 2-dimensional Numeric array

2007-07-20 Thread Zentrader
On Jul 19, 8:35 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Alex Mont" <[EMAIL PROTECTED]> wrote in message > I have a 2-dimensional Numeric array with the shape (2,N) and I want to > remove all duplicate rows from the array. For example if I start out > with: > [[1,2], > [1,3], > [1,2], > [2,3

Re: Pythonic way for missing dict keys

2007-07-20 Thread Alex Popescu
Neil Cerutti <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On 2007-07-20, Alex Popescu <[EMAIL PROTECTED]> wrote: >> Hi all! >> >> I am pretty sure this has been asked a couple of times, but I >> don't seem to find it on the archives (Google seems to have a >> couple of problems lately).

Re: Weird errors when trying to access a dictionary key

2007-07-20 Thread robinsiebler
> You are converting the dictionary to a list on this line, and lists do > not have keys> rpt_file.writelines('\t' + > [song].keys() \ > How am I converting it to a list? > Note the first line has braces, not brackets so it is a > dictionary. Braces? What 1st line

Re: Weird errors when trying to access a dictionary key

2007-07-20 Thread robinsiebler
Ignore my previous response. :p I figured out what my problem was. I had [song].keys() when I really meant song.keys() and really needed str(song.keys()). I just got a little too bracket happy. :p -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way for missing dict keys

2007-07-20 Thread Jakub Stolarski
Version 1 and 2 do different thing than version 3. The latter doesn't add value to dict. As it was mentioned before, use: 1 - if you expect that there's no key in dict 2 - if you expect that there is key in dict -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way for missing dict keys

2007-07-20 Thread Carsten Haese
On Fri, 2007-07-20 at 20:10 +, Alex Popescu wrote: > Carsten Haese <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > On Fri, 2007-07-20 at 19:08 +, Alex Popescu wrote: > >> Hi all! > >> > > > > > [snip...] > > > > > > This is called "Look before you leap." Note that "if key

Re: Trying to choose between python and java

2007-07-20 Thread James Matthews
You can always use jython. ;) On 7/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Sun, 15 Jul 2007 at 22:28:08 -0700, Alex Martelli wrote: > James T. Dennis <[EMAIL PROTECTED]> wrote: >... > > You can start writing all your code now as: print() --- calling > > the statement as if

Re: Pythonic way for missing dict keys

2007-07-20 Thread Carsten Haese
On Fri, 2007-07-20 at 19:39 +, Alex Popescu wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > On 2007-07-20, Alex Popescu <[EMAIL PROTECTED]> wrote: > >> Hi all! > >> > >> I am pretty sure this has been asked a couple of times, but I > >> don't seem to find it

Re: Python MAPI

2007-07-20 Thread kyosohma
> > If Process Monitor has an option to save its output as text files / > CSV files (some of the other SysInternals tools do), you might want to > try using (a Windows version) of grep or awk to filter out the > noise .. > > Vasudev Well, I ran Process Monitor with some filters enabled to only wa

Re: Images in Tkinter

2007-07-20 Thread kyosohma
On Jul 20, 11:37 am, "Viewer T." <[EMAIL PROTECTED]> wrote: > I wrote a class in which I have to use Tkinter images. When I create > an image object in the class and reference it with the image attribute > of label within the class, it does not dhow the image. It just shows a > blank label that con

Re: code packaging

2007-07-20 Thread Miki
Hello Paul, > I'm now wondering where this type of thing is best addressed in more > general terms. What I usually see happening, in projects I've worked > on and in others, is that developers get the code working on their own > computers, using source control tools and (if we're lucky) tests > d

Re: win32com ppt embedded object numbers reverting back to original numbers

2007-07-20 Thread kyosohma
On Jul 19, 4:33 pm, Lance Hoffmeyer <[EMAIL PROTECTED]> wrote: > Hey all, > > I have a script that takes numbers from XL and inserts them into an embedded > MSGRAPH dataset in PPT. The problem is that when I reopen the modified > document > that has been saved as a new filename and activate the e

Re: Pythonic way for missing dict keys

2007-07-20 Thread Alex Popescu
Jakub Stolarski <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Version 1 and 2 do different thing than version 3. The latter doesn't > add value to dict. > > As it was mentioned before, use: > 1 - if you expect that there's no key in dict > 2 - if you expect that there is key in dict >

Python Flagged as a Virus by AVG

2007-07-20 Thread James Matthews
I was reading a Microsoft news group and came across this post Got this during a scan of my computer: infected: object C:\hp\bin\python-2.2.3.exe:\comparisons.html result: trojan horse PHP/MPack.B status: infected embedded object inefected: object C:\hp\bin\python-2.2.3.exe What can/should

Re: Interpreting os.lstat()

2007-07-20 Thread Martin v. Löwis
> But it obviously does a lot of other stuff, including formatting > the results of the system call for display. It most decisively does *not* format the results of the system call "for display". Instead, it converts the C data type holding the stat result into a Python data type. That data type

Sorting dict keys

2007-07-20 Thread montyphyton
Consider the following: >>> a = {1:2, 3:4, 2:5} Say that i want to get the keys of a, sorted. First thing I tried: >>> b = a.keys().sort() >>> print b None Doesn't work. Probably because I am actually trying to sort the keys of the dictionary without copying them first. If that is the case, fin

Re: Sorting dict keys

2007-07-20 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Consider the following: a = {1:2, 3:4, 2:5} > > Say that i want to get the keys of a, sorted. First thing I tried: > b = a.keys().sort() print b > None > > Doesn't work. Probably because I am actually trying to sort the keys > of the dictionary without

Re: Sorting dict keys

2007-07-20 Thread Jean-Paul Calderone
On Fri, 20 Jul 2007 15:27:51 -0700, [EMAIL PROTECTED] wrote: >Consider the following: a = {1:2, 3:4, 2:5} > >Say that i want to get the keys of a, sorted. First thing I tried: > b = a.keys().sort() print b >None > >Doesn't work. Probably because I am actually trying to sort the keys

Re: Sorting dict keys

2007-07-20 Thread Will Maier
On Fri, Jul 20, 2007 at 03:27:51PM -0700, [EMAIL PROTECTED] wrote: > Consider the following: > >>> a = {1:2, 3:4, 2:5} > > Say that i want to get the keys of a, sorted. First thing I tried: > > >>> b = a.keys().sort() > >>> print b > None list's sort() method sorts the list _in_place_: >>>

Re: Sorting dict keys

2007-07-20 Thread Duncan Smith
[EMAIL PROTECTED] wrote: > Consider the following: > a = {1:2, 3:4, 2:5} > > > Say that i want to get the keys of a, sorted. First thing I tried: > > b = a.keys().sort() print b > > None > > Doesn't work. Probably because I am actually trying to sort the keys > of the dictionary

Re: Sorting dict keys

2007-07-20 Thread Alex Popescu
[EMAIL PROTECTED] wrote in news:1184970471.146819.86280 @r34g2000hsd.googlegroups.com: I am not sure about your scenario, but as you discovered the sort() method is modifying the in place list (and doesn't return a new one). If you just want to iterate over your dict in an ordered manner than al

ANN: CharPy, Charlotte, NC Python Group

2007-07-20 Thread Calvin Spealman
I announced the idea earlier, but forgot to mention the state. I started a mailing list, and I want to find who in the area might be interested. Join if you can, even if you don't know you'll stick. We need to see what kind of interest there is in the area. If you are in the area, even if you aren

Re: code packaging

2007-07-20 Thread Ben Finney
Paul Rubin writes: > Is this appropriate? Inappropriate? Do your projects start using > serious packaging and distribution tools very early in development, > before the code is anywhere near usable? Should they? Yes. Test-driven development has taught me that putting

Re: Weird errors when trying to access a dictionary key

2007-07-20 Thread Ben Finney
[EMAIL PROTECTED] writes: > I have a data structure that looks like this: > [...] > rpt_file.writelines('\t' + [song].keys() + '\t' + [song].values() + '\n') Forms the list [song] twice, attempting to call the 'keys()' method and the 'values()' method of that list in turn... > I get the followin

Re: Sorting dict keys

2007-07-20 Thread Miles
On 7/20/07, Alex Popescu <[EMAIL PROTECTED]> wrote: > If you just want to iterate over your dict in an ordered manner than all > you have to do is: > > for k in my_dict.keys().sort(): > # rest of the code I think you meant sorted(my_dict.keys()), since, as you just pointed out, the sort() method

Re: Sorting dict keys

2007-07-20 Thread Roberto Bonvallet
On 20 jul, 18:50, Alex Popescu <[EMAIL PROTECTED]> wrote: > If you just want to iterate over your dict in an ordered manner than all > you have to do is: > > for k in my_dict.keys().sort(): > # rest of the code sort() returns None, so this code won't work either. -- Roberto Bonvallet -- http:

Re: PDF2ODT

2007-07-20 Thread Zentrader
On Jul 17, 12:47 pm, orehon <[EMAIL PROTECTED]> wrote: > Hello, > I need to convert PDF to ODT or PDF to DOC using python! > > I was taking a look > athttp://www.kde-apps.org/content/show.php/show.php?content=18638&vote=... > and this project is outdated. > > So any idea? > > Thank you! I

Re: Sorting dict keys

2007-07-20 Thread montyphyton
On 21 srp, 00:47, Duncan Smith <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Consider the following: > > a = {1:2, 3:4, 2:5} > > > Say that i want to get the keys of a, sorted. First thing I tried: > > b = a.keys().sort() > print b > > > None > > > Doesn't work. Probably be

Re: Sorting dict keys

2007-07-20 Thread Roberto Bonvallet
On 20 jul, 19:34, [EMAIL PROTECTED] wrote: > copy.copy returns a new object: > > >>> copy.copy(a.keys()) > > [1,2,3] > > Then why doesn't copy.copy(a.keys()).sort() work?? It works, but you don't notice it, because you don't save a reference to the new list. Try this: c = copy.copy(a.keys())

  1   2   >