Spyder 0.7.2

2007-08-16 Thread Sjoerd de Vries
I am happy to announce the release Spyder 0.7.2 (beta). It can be freely downloaded at: http://www.spyderware.nl Spyder is a Python-derived data modelling and conversion language. Spyder extends Python with three Spyder-specific statements, which are pre-processed (compiled) to pure

itools 0.16.6 released

2007-08-16 Thread J. David Ibáñez
itools is a Python library, it groups a number of packages into a single meta-package for easier development and deployment: itools.catalogitools.i18n itools.tmx itools.cmsitools.ical itools.uri itools.csvitools.odf

Re: ElementTree surprise

2007-08-16 Thread Torsten Bronger
Hallöchen! Paul Rubin writes: I have a doc with a bunch of fields like: foo bar=spamstuff/foo foo bar=penguinother stuff/foo and sometimes foo bar=parrot/foo I use ElementTree to parse the doc and I use the .text attribute to get stuff or other stuff in the spam and

Re: ElementTree surprise

2007-08-16 Thread Paul Rubin
Torsten Bronger [EMAIL PROTECTED] writes: foo bar=parrot/foo Technically, text is nodes as all other element nodes. In the parrot example, there is no empty textnode but no textnode at all. That is required by the xml standard? If yes, elementtree is doing the right thing, but it

Re: replacement for string.printable

2007-08-16 Thread Marc 'BlackJack' Rintsch
On Wed, 15 Aug 2007 23:15:12 +0100, John K Masters wrote: help('string') DESCRIPTION Warning: most of the code you see here isn't normally used nowadays. Beginning with Python 1.6, many of these functions are implemented as methods on the standard string object. They used to be

Re: Coroutines and argument tupling

2007-08-16 Thread Marshall T. Vandegrift
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Do you really need a generator or co-routine to do this? Maybe you can just use a closure: For my trivial example, sure -- there are lots of ways to do it. Here's a slightly better example: the `read' method of a file-like object which sequentially

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread A.T.Hofkamp
On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: What are they teaching in schools these days? I see questions like this and the equally perplexing why don't floats represent numbers exactly? or the mildy amusing how do I write bytes not characters to a file questions at least once a

Re: Python Book Recommendations

2007-08-16 Thread Laurent Pointal
Azazello a écrit : On Aug 15, 7:47 am, Shawn Milochik [EMAIL PROTECTED] wrote: If I could have only one book, I would buy Core Python, Second Edition, by Wesley Chun. For the record, I own: Core Python, Second Edition (great) wxPython in Action (haven't used yet) Beginning Python (barely

Problem using Optional pyparsing

2007-08-16 Thread Nathan Harmston
Hi, I know this isnt the pyparsing list, but it doesnt seem like there is one. I m trying to use pyparsing to parse a file however I cant get the Optional keyword to work. My file generally looks like this: ALIGNMENT 1020 YS2-10a02.q1k chr09 1295 42141045 142297 C1254 95.06

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Martin v. Löwis
My question is -- are python list operations atomic? If they are not, then I assume I need to put some mutual exclusion around the append() and pop() calls ? They are not, but there is one included in the standard library: http://docs.python.org/dev/lib/module-Queue.html Why do you think

Re: ElementTree surprise

2007-08-16 Thread Stefan Behnel
Paul Rubin wrote: Torsten Bronger [EMAIL PROTECTED] writes: foo bar=parrot/foo Technically, text is nodes as all other element nodes. In the parrot example, there is no empty textnode but no textnode at all. That is required by the xml standard? If yes, elementtree is doing the right

twisted.web's xmlrpc with digest authencitation

2007-08-16 Thread exhuma.twn
I recently found a link[1] which demonstrates how to secure a xml-rpc service with basic HTTP-auth. But this get's send in clear-text over the net. There's also the HTTP-Digest auth mechanism which is apparently supported as well by twisted[2]. How do I secure an xml-rpc service using digest-auth

Re: ElementTree surprise

2007-08-16 Thread Paul Rubin
Stefan Behnel [EMAIL PROTECTED] writes: So it's not even an ElementTree thing. ET just doesn't know what exactly was in the original XML byte stream. A very simple way to make sure you always get a string back is text = element.text or Thanks, I ended up doing something like that. What

python socket usage

2007-08-16 Thread Oğuz Yarımtepe
Is it possible to send a data object like a tuple or a list in socket programming? If so how? It seems with socket module it is only possible to send strings. -- Oğuz Yarımtepe http://www.yarimtepe.com/en -- http://mail.python.org/mailman/listinfo/python-list

ploting issues in program

2007-08-16 Thread yadin
hi every one! can you please help me to fix these polar plot in db's so that the center is at the minimun negative number in voltagedb about [-50] and the maximun is at zero and how can i see values on the axis like showing that the axes start at -50 -40 -30 .and end at zero than you here is

Re: python socket usage

2007-08-16 Thread markacy
On 16 Sie, 09:42, O uz Yar mtepe [EMAIL PROTECTED] wrote: Is it possible to send a data object like a tuple or a list in socket programming? If so how? It seems with socket module it is only possible to send strings. -- O uz Yar mtepehttp://www.yarimtepe.com/en Hi Oguz, why don't you

Re: Problem using Optional pyparsing

2007-08-16 Thread Peter Otten
Nathan Harmston wrote: I know this isnt the pyparsing list, but it doesnt seem like there is one. I m trying to use pyparsing to parse a file however I cant get the Optional keyword to work. My file generally looks like this: ALIGNMENT  1020  YS2-10a02.q1k chr09     1295       42    141045

Re: ploting issues in program

2007-08-16 Thread Peter Otten
yadin wrote: can you please help me to fix these polar plot in db's so that the center is at the minimun negative number in voltagedb about [-50] and the maximun is at zero and how can i see values on the axis like showing that the axes start at -50 -40 -30 .and end at zero You posted

Re: python socket usage

2007-08-16 Thread Paul Rubin
O¿uz YarÑmtepe [EMAIL PROTECTED] writes: Is it possible to send a data object like a tuple or a list in socket programming? If so how? It seems with socket module it is only possible to send strings. Look into something like pyro or JSON. Whatever you do, don't use eval. --

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread baby's happy
I saw your article is very good, I like it very much. I will continue to pay attention to your article, the following are the points I hope that I have similar concerns. http://www.game-win.com http://www.game-win.com/wow-powerleveling.html http://www.game-win.com/faq.html

Re: python socket usage

2007-08-16 Thread Gary Herron
markacy wrote: On 16 Sie, 09:42, O uz Yar mtepe [EMAIL PROTECTED] wrote: Is it possible to send a data object like a tuple or a list in socket programming? If so how? It seems with socket module it is only possible to send strings. -- O uz Yar mtepehttp://www.yarimtepe.com/en Hi

Changing button preferences after beeing pressed

2007-08-16 Thread thomas . lidebrandt
Hello I'm using wxPython to consruct a GUI and want to change a button label and event handler to change after the button have been pressed. The only thing I can think of is a global variable that contrls the state of the program and constructs the button in accordance to the defined state. Is

about: informtion computer...

2007-08-16 Thread angga_cute
To All Members : I have some information for you I would like you to invite to visiting my web, may be you need some information about newest information about computer, laptop, and than printer. I have little bit information on my web http://www.komputer - djogja.blogspot .com/ and

Re: python socket usage

2007-08-16 Thread Paul Rubin
Gary Herron [EMAIL PROTECTED] writes: be able to recover the original object accurately. Worse yet, an eval of an arbitrary string is a HUGE security hole. If you really want to send any Python object through a socket, look up the Pickle and cPickle modules. These are also security holes.

Re: python socket usage

2007-08-16 Thread Oğuz Yarımtepe
On Thursday 16 August 2007 11:20:38 Gary Herron wrote: If you really want to send any Python object through a socket, look up the Pickle and cPickle modules.  These will marshal (as it's called) any Python object of any type and complexity into a byte string which can be sent across a socket.  

Re: Combinatorial of elements in Python?

2007-08-16 Thread Mikael Olofsson
Sebastian Bassi wrote: On 8/15/07, Mikael Olofsson [EMAIL PROTECTED] wrote: What is unclear here is in what order the keys should be visited. The following assumes that the keys should be considered in alphanumeric order. Yes, my fault. The orden should be given by a string, like:

Re: Changing button preferences after beeing pressed

2007-08-16 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: I'm using wxPython to consruct a GUI and want to change a button label = wx.Button.SetLabel (also have a look at the button examples) and event handler to change after the button have been pressed. I'm not sure if those bindings can easily be changed at runtime.

clarification

2007-08-16 Thread Beema shafreen
hi every body, i have compared two files: code: fh = open('HPRD_MAIN_20.txt','r') for line in fh.readlines(): data = line.strip().split('#') fh1 = open('NOMENCLATURE_MAIN_20.txt','r') for line1 in fh1.readlines(): data1 = line1.strip().split('#')

Re: Coroutines and argument tupling

2007-08-16 Thread Bjoern Schliessmann
Marshall T. Vandegrift wrote: Without the decorator that becomes: gen = nextn(2) print gen.next() # = [0, 1] print gen.send(3) # = [2, 3, 4] print gen.send(1) # = [5] The former is just that smidgen nicer, and allows you to continue to make use of argument defaults and

Re: python socket usage

2007-08-16 Thread Gary Herron
Oğuz Yarımtepe wrote: On Thursday 16 August 2007 11:20:38 Gary Herron wrote: If you really want to send any Python object through a socket, look up the Pickle and cPickle modules. These will marshal (as it's called) any Python object of any type and complexity into a byte string which can

Re: Hijack! Different book: (was: Opinions about this new Python book?

2007-08-16 Thread Paul Boddie
On 15 Aug, 19:52, Dennis Lee Bieber [EMAIL PROTECTED] wrote: Hopefully it isn't quite as annoying as some of what I've found in the Turbogears book that recently arrived from Amazon. (Rapid Web Applications with TurboGears) Is this the book that came out before TurboGears even reached

Re: ploting issues in program

2007-08-16 Thread Steve Holden
Peter Otten wrote: yadin wrote: can you please help me to fix these polar plot in db's so that the center is at the minimun negative number in voltagedb about [-50] and the maximun is at zero and how can i see values on the axis like showing that the axes start at -50 -40 -30 .and end

Re: Coroutines and argument tupling

2007-08-16 Thread Marshall T. Vandegrift
Bjoern Schliessmann [EMAIL PROTECTED] writes: The solution I'd use is a decorator that calls next automatically one time after instantiation. Then you can use send normally, and don't have to care about any initial parameters, which makes the code clearer (initial parameters should be used

Re: Changing button preferences after beeing pressed

2007-08-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hello I'm using wxPython to consruct a GUI and want to change a button label and event handler to change after the button have been pressed. The only thing I can think of is a global variable that contrls the state of the program and constructs the button in

Re: Layer 2 socket connection

2007-08-16 Thread [EMAIL PROTECTED]
On Aug 15, 7:21 pm, alisonken1 [EMAIL PROTECTED] wrote: Hello all - I'm looking at trying to write a python script to connect to a layer 2 bridge (no IP available). Looking at the sockets function, it's not clear if I can connect using only the mac address - it appears to want either a

ctypes and C99 complex numbers

2007-08-16 Thread Eugen Wintersberger
Hi there I want to use ctypes in connection with C functions that use complex datatypes defined in the C99 standard. Does someone know a simple way how to implement this? Are there any plans to integrate the C99 complex data types in the ctypes module? best regards Eugen Wintersberger --

Re: Hijack! Different book: (was: Opinions about this new Python book?

2007-08-16 Thread Carsten Haese
On Thu, 2007-08-16 at 04:21 -0700, Paul Boddie wrote: [...] I pity the people writing Python books given continuous changes to the language and the associated recommended development practices as new features go in, but tracking a target prior to any kind of stable release seems a bit too

Re: Variable variable name or variable lvalue

2007-08-16 Thread mfglinux
The solution with the dictionary worked perfectlly well, my script is running and even produces data with sense!!! Thank you very much indeed to all of you answering. Cheers! -- http://mail.python.org/mailman/listinfo/python-list

Re: Coroutines and argument tupling

2007-08-16 Thread Bjoern Schliessmann
Marshall T. Vandegrift wrote: I'd seen the consumer decorator, and it certainly is cleaner than just using a generator. I don't like how it hides the parameter signature in the middle of the consumer function though, and it also doesn't provide for argument default values. Mh, that may

Localizing numbers in python

2007-08-16 Thread Heba Farouk
Hello i would like to localize numbers in python according to the current selected language of the web page (English, french, arabic, ...), is there any options in python?? thanks in advance Yours Heba - Take the Internet to Go: Yahoo!Go puts the

Re: Python Book Recommendations

2007-08-16 Thread 55rebels
On Aug 15, 11:47 pm, Laurent Pointal [EMAIL PROTECTED] wrote: Azazello a écrit : On Aug 15, 7:47 am, Shawn Milochik [EMAIL PROTECTED] wrote: If I could have only one book, I would buy Core Python, Second Edition, by Wesley Chun. For the record, I own: Core Python, Second Edition

Re: (Re)announcing APL 2007

2007-08-16 Thread glarocque
On Aug 10, 12:40 pm, [EMAIL PROTECTED] wrote: On Aug 6, 9:20 am, Paul Mansour [EMAIL PROTECTED] wrote: APL2007 Roll Call: Is anyone going to this? I'm thinking about going, but I don't want to the only one to show up, as in San Diego. Here here. Sorry to mention the elephant in the

Re: Python Book Recommendations

2007-08-16 Thread Shawn Milochik
I should add that Dive Into Python is also available for free online: http://www.diveintopython.org/ It's a great book. It is not a linear book -- it doesn't start you off talking about variable types and structure. It starts you right off with a piece of working code. If you already have some

How do you guys convert a tuple into a Set in ABAQUS?

2007-08-16 Thread Baisong Du
A function is defined to get a tuple. def searchObjectByRange(partObject, objectType, xRange, yRange, zRange): In the partObject, search objects (edge, face, etc.) within the given region TOLERANCE_GLOBAL = 1.0E-6 INFINITE_RANGE = (-1.0E309, 1.0E309) tolerance =

Re: FM synthesis using Numpy

2007-08-16 Thread Joost Molenaar
Thanks/bedankt Bas for the educative reply. I think I got misleaded by Max/MSP's tutorial[1], because MSP seems to automatically adjust the phase when you combine two oscillators in the way that I did. Joost [1] page 112 of http://www.cycling74.com/download/MSP45TutorialsAndTopics.pdf --

Re: Problem using Optional pyparsing

2007-08-16 Thread Paul McGuire
On Aug 16, 2:09 am, Nathan Harmston [EMAIL PROTECTED] wrote: Hi, I know this isnt the pyparsing list, but it doesnt seem like there is one. I m trying to use pyparsing to parse a file however I cant get the Optional keyword to work. snip Thanks, Peter, your comments are dead-on.

Car Air Conditioners

2007-08-16 Thread tunedstyle
All the informations about car air conditioners, how to install, repair, service all can be found on this website... http://car-air-conditioning.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

A problem with Time

2007-08-16 Thread special_dragonfly
Hello, I need to return the date yesterday in the form DDMM. I looked through the modules: time, datetime and calendar but can't find anything that leaps out at me. The problem I'm having is that although I can use time.localtime and get a tuple of the year, month, day and so forth, I

Re: ctypes and C99 complex numbers

2007-08-16 Thread Thomas Heller
Eugen Wintersberger schrieb: Hi there I want to use ctypes in connection with C functions that use complex datatypes defined in the C99 standard. Does someone know a simple way how to implement this? Are there any plans to integrate the C99 complex data types in the ctypes module? I have

Re: A problem with Time

2007-08-16 Thread Shawn Milochik
import time oneDay = 60 * 60 * 24 #seconds in one day date = time.time() yesterday = date - oneDay -- http://mail.python.org/mailman/listinfo/python-list

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread John Nagle
A.T.Hofkamp wrote: On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one that Python didn't do quite right. Remember, in the

Re: A problem with Time

2007-08-16 Thread syndrowm
On 8/16/07, special_dragonfly [EMAIL PROTECTED] wrote: Hello, I need to return the date yesterday in the form DDMM. I looked through the modules: time, datetime and calendar but can't find anything that leaps out at me. The problem I'm having is that although I can use time.localtime

Re: A problem with Time

2007-08-16 Thread Diez B. Roggisch
special_dragonfly schrieb: Hello, I need to return the date yesterday in the form DDMM. I looked through the modules: time, datetime and calendar but can't find anything that leaps out at me. The problem I'm having is that although I can use time.localtime and get a tuple of the

Re: A problem with Time

2007-08-16 Thread Neil Cerutti
On 2007-08-16, Shawn Milochik [EMAIL PROTECTED] wrote: import time oneDay = 60 * 60 * 24 #seconds in one day date = time.time() yesterday = date - oneDay Or use a timedelta. import datetime yesterday = datetime.datetime.today() - datetime.timedelta(days=1) yesterday.strftime('%m%d%Y')

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Neil Cerutti
On 2007-08-16, John Nagle [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one that Python didn't do quite right. Remember, in the beginning, Python had

Re: A problem with Time

2007-08-16 Thread Gary Herron
special_dragonfly wrote: Hello, I need to return the date yesterday in the form DDMM. I looked through the modules: time, datetime and calendar but can't find anything that leaps out at me. The problem I'm having is that although I can use time.localtime and get a tuple of the year,

Re: ploting issues in program

2007-08-16 Thread Gerard Flanagan
On Aug 16, 9:48 am, yadin [EMAIL PROTECTED] wrote: hi every one! can you please help me to fix these polar plot in db's so that the center is at the minimun negative number in voltagedb about [-50] and the maximun is at zero and how can i see values on the axis like showing that the axes

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Diez B. Roggisch
John Nagle schrieb: A.T.Hofkamp wrote: On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one that Python didn't do quite

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Matt McCredie
Why do you think they are not? Because they aren't. You even mentioned that a few operations that aren't atomic. If operations are atomic it isn't necessarily because of the design of the list, but the design of CPython. More specifically the GIL. I don't mean to imply that you can't get a

Re: Who told str() to round my int()'s!!!

2007-08-16 Thread Chris Mellon
On 8/16/07, John Nagle [EMAIL PROTECTED] wrote: A.T.Hofkamp wrote: On 2007-08-15, Larry Bates [EMAIL PROTECTED] wrote: or the mildy amusing how do I write bytes not characters to a file questions at least once a week on this forum. Actually, that's a reasonable question, and one

Re: threads, mutual exclusion, and lists

2007-08-16 Thread Martin v. Löwis
Why do you think they are not? Because they aren't. You even mentioned that a few operations that aren't atomic. OTOH, the OP specifically asked for .append() and .pop(), which are atomic. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Layer 2 socket connection

2007-08-16 Thread alisonken1
On Aug 16, 5:03 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: snip I use impacket for stuff like that, seehttp://oss.coresecurity.com/projects/impacket.html Cheers Rich. Thanks, Rich - I'll have a look -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes and C99 complex numbers

2007-08-16 Thread Martin v. Löwis
Thomas Heller schrieb: Eugen Wintersberger schrieb: Hi there I want to use ctypes in connection with C functions that use complex datatypes defined in the C99 standard. Does someone know a simple way how to implement this? Are there any plans to integrate the C99 complex data types in the

Re: A problem with Time

2007-08-16 Thread BartlebyScrivener
On Aug 16, 10:54 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: RTFM is the answer... I don't know. I remember scratching my head for a day or two over the module explanations and instructions until I found a little howto with a lot of explicite examples.

Re: Module imports during object instantiation

2007-08-16 Thread Ritesh Raj Sarraf
Steve Holden wrote: Ritesh Raj Sarraf wrote: On Aug 16, 12:16 am, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: On Aug 15, 11:42 pm, Neil Cerutti [EMAIL PROTECTED] wrote: [...] Oops!!! Looks like I completely missed this. It _did_ print the error message. Apologies to all for not keeping a

Re: ploting issues in program

2007-08-16 Thread Peter Otten
Steve Holden wrote: I might ask just exactly what is being plotted to give those answers. It sounds like field strength, but I am having difficulty envisaging a field that is weakest at its center - is this some sort of alternative universe you are plotting :-) ? I believe the OP is trying

Accessing Windows Network Share?

2007-08-16 Thread frikk
I previously posted about accessing SharePoint over the web. Well I have since given up any easy means of doing this, since something else has perked my interest. Instead of going to http://sharepoint/site, why not just access \\sharepoint\site\ directly? So my question is this - How do I access

Tuning - Styling

2007-08-16 Thread [EMAIL PROTECTED]
Cool cars, tuning styling, modified cars, many upgrades here... http://tuning-styling.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing Windows Network Share?

2007-08-16 Thread Chris Mellon
On 8/16/07, frikk [EMAIL PROTECTED] wrote: I previously posted about accessing SharePoint over the web. Well I have since given up any easy means of doing this, since something else has perked my interest. Instead of going to http://sharepoint/site, why not just access \\sharepoint\site\

Re: Accessing Windows Network Share?

2007-08-16 Thread frikk
On Aug 16, 2:43 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 8/16/07, frikk [EMAIL PROTECTED] wrote: I previously posted about accessing SharePoint over the web. Well I have since given up any easy means of doing this, since something else has perked my interest. Instead of going

Re: Accessing Windows Network Share?

2007-08-16 Thread Chris Mellon
On 8/16/07, frikk [EMAIL PROTECTED] wrote: On Aug 16, 2:43 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 8/16/07, frikk [EMAIL PROTECTED] wrote: I previously posted about accessing SharePoint over the web. Well I have since given up any easy means of doing this, since something

Help me!!

2007-08-16 Thread Rohan
I have the following piece of code a = len(ab_file) b= 0 while(ba): c= 0 d = len(cd_files) while(cd): if cd_files[c] == ab_file[b]: files.append(ab_file[b].upper()) else: files.append(ab_file[b]) c = c + 1 b = b

Idea for joined() builtin

2007-08-16 Thread Rhamphoryncus
I know similar things have been argued before, but little things (like the joined name implying a copy) can make a big difference. That and I'm providing a simple implementation that works right now, so you don't have to wait for it to ever become a builtin. ;) joined([], [[1,2,3], [4,5,6]])

Re: Help me!!

2007-08-16 Thread beginner
Some one help me so that If ab = [a,b,c,d] and cd = [a,c] my global list file should be [A,b,C,d] If there is a lot of entries in the list, I would consider using an indexed data structure such as dict. ab=['a','b','c','d'] cd=['a','c'] common=[x.upper() for x in ab if x in cd]

Re: Help me!!

2007-08-16 Thread beginner
On Aug 16, 2:26 pm, beginner [EMAIL PROTECTED] wrote: Some one help me so that If ab = [a,b,c,d] and cd = [a,c] my global list file should be [A,b,C,d] If there is a lot of entries in the list, I would consider using an indexed data structure such as dict. ab=['a','b','c','d']

wxpython log redirect

2007-08-16 Thread vedrandekovic
Hello, Why this wx example don't return \nHELLO WORLD and other text in same window: import wx import logging import sys def nekaj(): print \nHELLO WORLD class WxLog(logging.Handler): def __init__(self, ctrl): logging.Handler.__init__(self) self.ctrl = ctrl def

Re: (sort of) deterministic timing in Python

2007-08-16 Thread Paul Rubin
[EMAIL PROTECTED] (John Fisher) writes: mark start time start event event finishes count time until next interval start second event… rather than this: start event event finishes sleep for interval start second event ... So how do I accomplish this in Python with

Re: Help me!!

2007-08-16 Thread Gerardo Herzig
Anhoter HURRA for list comprehensions: a = ['a', 'b', 'c', 'd'] b = ['a','c'] [x in b and x.upper() or x for x in a] ['A', 'b', 'C', 'd'] Is what you want? Cheers Gerardo I'm trying to compare the list with another list and if it is there in both I'm changing it to upper case and adding

Re: A problem with Time

2007-08-16 Thread MRAB
On Aug 16, 4:30 pm, special_dragonfly [EMAIL PROTECTED] wrote: Hello, I need to return the date yesterday in the form DDMM. I looked through the modules: time, datetime and calendar but can't find anything that leaps out at me. The problem I'm having is that although I can use

Re: Accessing Windows Network Share?

2007-08-16 Thread frikk
On Aug 16, 3:03 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 8/16/07, frikk [EMAIL PROTECTED] wrote: On Aug 16, 2:43 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 8/16/07, frikk [EMAIL PROTECTED] wrote: I previously posted about accessing SharePoint over the web. Well I have

advice about `correct' use of decorator

2007-08-16 Thread Gerardo Herzig
Hi all. I guess i have a conceptual question: Im planing using a quite simple decorator to be used as a conditional for the execution of the function. I mean something like that: @is_logued_in def change_pass(): bla bla And so on for all the other functions who needs that the user is

Re: sub-classing the types in the builtin module datetime

2007-08-16 Thread [EMAIL PROTECTED]
On Aug 15, 5:54 pm, Colin J. Williams [EMAIL PROTECTED] wrote: I posted this about 5 hours ago, but it seems to have gone astray. (snipped) I wish to sub-class (if that's the right word) datetime and to use a different signature for the constructor. The second part has gone

Haskell lambdas in python

2007-08-16 Thread Michael Speer
Hello python-list, I decided to have some fun and altered a copy of python to use a Haskell-like syntax for declaring lambdas. filter( \ x - x == 3 or x 8 , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) [3, 9, 10] ( \- Hello World! )() 'Hello World!' While doing this I found something

Re: advice about `correct' use of decorator

2007-08-16 Thread Laszlo Nagy
Gerardo Herzig wrote: Hi all. I guess i have a conceptual question: Im planing using a quite simple decorator to be used as a conditional for the execution of the function. I mean something like that: @is_logued_in def change_pass(): bla bla And so on for all the other functions

Re: A problem with Time

2007-08-16 Thread Roger Miller
On Aug 16, 9:46 am, MRAB [EMAIL PROTECTED] wrote: As well as the other replies, this also works (as far as I can tell!): import time today = time.localtime() yesterday = today[ : 2] + (today[2] - 1, ) + today[3 : ] yesterday = time.localtime(time.mktime(yesterday)) This is something I have

Re: Hijack! Different book:

2007-08-16 Thread Steve Holden
Dennis Lee Bieber wrote: On Thu, 16 Aug 2007 04:21:07 -0700, Paul Boddie [EMAIL PROTECTED] declaimed the following in comp.lang.python: Is this the book that came out before TurboGears even reached 1.0, probably having diminished relevance now that there are 1.1 and 2.0 Not sure

Re: ploting issues in program

2007-08-16 Thread Steve Holden
Peter Otten wrote: Steve Holden wrote: I might ask just exactly what is being plotted to give those answers. It sounds like field strength, but I am having difficulty envisaging a field that is weakest at its center - is this some sort of alternative universe you are plotting :-) ? I

Pass by reference or by value?

2007-08-16 Thread Robert Dailey
Hi, I previously created a topic named Pass by reference or by value where I inquired on how python's function parameters work. I received a lot of nice responses, however I'm still confused on the topic. Note that I come from a C++ background to Python, so any comparisons to C++ would be very

Re: advice about `correct' use of decorator

2007-08-16 Thread Gerardo Herzig
Gerardo Herzig wrote: Hi all. I guess i have a conceptual question: Im planing using a quite simple decorator to be used as a conditional for the execution of the function. I mean something like that: @is_logued_in def change_pass(): bla bla And so on for all the other

Re: sub-classing the types in the builtin module datetime

2007-08-16 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: On Aug 15, 5:54 pm, Colin J. Williams [EMAIL PROTECTED] wrote: I posted this about 5 hours ago, but it seems to have gone astray. (snipped) I wish to sub-class (if that's the right word) datetime and to use a different signature for the constructor.

Re: Pass by reference or by value?

2007-08-16 Thread Steve Holden
Robert Dailey wrote: Hi, I previously created a topic named Pass by reference or by value where I inquired on how python's function parameters work. I received a lot of nice responses, however I'm still confused on the topic. Note that I come from a C++ background to Python, so any

Re: advice about `correct' use of decorator

2007-08-16 Thread Steven Bethard
Gerardo Herzig wrote: Hi all. I guess i have a conceptual question: Im planing using a quite simple decorator to be used as a conditional for the execution of the function. I mean something like that: @is_logued_in def change_pass(): bla bla And so on for all the other functions

Re: Pass by reference or by value?

2007-08-16 Thread Robert Dailey
So immutable objects cannot be modified directly? I guess this means integers are immutable and the act of assigning to one is a completely new definition? So if I were to create a class called Integer and give it a .set() method, this would allow me to create mutable integers, and thus passing in

Re: advice about `correct' use of decorator

2007-08-16 Thread Gerardo Herzig
Steven Bethard wrote: Gerardo Herzig wrote: Hi all. I guess i have a conceptual question: Im planing using a quite simple decorator to be used as a conditional for the execution of the function. I mean something like that: @is_logued_in def change_pass(): bla bla And so on for all

Re: Pass by reference or by value?

2007-08-16 Thread Steve Holden
Robert Dailey wrote: So immutable objects cannot be modified directly? I guess this means integers are immutable and the act of assigning to one is a completely new definition? Correct. A new value is bound to the name or item on the left-hand side - remember, all variables are pointers to

Canceling events from COM objects

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod =

Canceling events from COM Objects

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod =

Re: Pass by reference or by value?

2007-08-16 Thread Robert Dailey
Thanks Steve for your explanation. It was very helpful. I think I understand it now. By the way, by the .set method I meant: class Integer: def __init__( self, number=0 ): self._int = number def set( self, number ): self._int = number # later on mutableInt = Integer(

Canceling events from COM Objects

2007-08-16 Thread Oliver Nelson
I have MapPoint working in Python, and I'm trying to cancel events on the map, but I can't seem to make that happen. I'm responding to the events successfully in my panel object. My code is like this: global MapPointMod MapPointMod =

How to say $a=$b-{A} ||={} in Python?

2007-08-16 Thread beginner
Hi All. I'd like to do the following in more succint code: if k in b: a=b[k] else: a={} b[k]=a a['A']=1 In perl it is just one line: $a=$b-{A} ||={}. Thanks, Geoffrey -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >