Help: retrieving e-mail from yahoo pop server. what's wrong?

2005-02-09 Thread Andre
Hi guys, newbie question. I am having trouble with a script that is supposed to login me to my account on yahoo pop server. When i do this: import getpass, poplib, re POPHOST = "pop.mail.yahoo.com" POPUSER = "mylogin" POPPASS = "mypass" pop = poplib.POP3(POPHOST) pop.user(POPUSER) up to this

Re: Help: retrieving e-mail from yahoo pop server. what's wrong?

2005-02-09 Thread Andre
are naturally valid, but something else is wrong. Do you know if Netscape also doesn't allow POP access? Is there a free e-mail provider who does? Thanks a mil, Andre "Kartic" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andre, > > Do you have a premi

Re: How to write python plug-ins for your own python program?

2005-03-03 Thread Andre
_import__(pluginName) > plugin.someMethod() > > This avoids the potential security problem that `exec' poses as well as > the need to parse + interpret the string. > What happens if you have: .def someMethod(): .import os .rm * # or whatever other evil thing you might thing of Andre -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding numpy works once, but not twice??

2014-06-04 Thread Andre
Any Solution? -- AL Barbieri http://scholar.google.com/citations?user=tylaKAMJ -- https://mail.python.org/mailman/listinfo/python-list

Generic string import like in strptime?

2008-01-16 Thread Andre
Hi there Is there a function like strptime, which takes a string and converts it into an array depending on a format string I provide. Like: >>> a = '3456\tblub-blib.0.9' >>> b = '%d\t%s-%s.%f' >>> c = mysticalfunction(a,b) >>> print

HTMLgen???

2009-10-15 Thread andre
Hi, Does HTMLgen (Robin Friedrich's) still exsist?? And, if so, where can it be found? -- Andre van der Vlies Certifiable Linux/UNIX engineer (CLUE) Homepage: http://vandervlies.xs4all.nl/~andre Books: http://www.lulu.com/andre1

Zlib: correct checksum but error decompressing

2009-08-26 Thread Andre
I have been trying to solve this issue for a while now. I receive data from a TCP connection which is compressed. I know the correct checksum for the data and both the client and server generate the same checksum. However, in Python when it comes to decompressing the data I get the exception: "Erro

Re: Intermediate Python user needed help

2012-08-05 Thread Andre Ramaciotti
On 08/05/2012 06:12 PM, MRAB wrote: On 05/08/2012 22:03, Tim Chase wrote: On 08/05/12 15:52, John Mordecai Dildy wrote: Current Problem at the moment Traceback (most recent call last): File "ex26.py", line 66, in beans, jars, crates = secret_formula(start-point) NameError: name 'start'

Function declarations ?

2011-06-08 Thread Andre Majorel
Is there a way to keep the definitions of the high-level functions at the top of the source ? I don't see a way to declare a function in Python. Thanks in advance. -- André Majorel http://www.teaser.fr/~amajorel/ J'ai des droits. Les autres ont des devoirs. -- http://mail.python.org/mailman/lis

Re: Function declarations ?

2011-06-12 Thread Andre Majorel
On 2011-06-10, Asen Bozhilov wrote: > Andre Majorel wrote: > >> Is there a way to keep the definitions of the high-level >> functions at the top of the source ? I don't see a way to >> declare a function in Python. > > Languages with variable and function

Language & lib reference in man format ?

2011-04-20 Thread Andre Majorel
If someone has ever written a script to convert the Python Language Reference and Library Reference to man format, I'm interested. Thanks in advance. -- André Majorel http://www.teaser.fr/~amajorel/ "The object of this year's expedition is to see if we can find trace of last year's expedition."

Re: Why no '|' operator for dict?

2018-02-05 Thread Andre Müller
__or__(self, other): if not isinstance(other, (self.__class__, dict)): raise ValueError('Is not a dict!') return {**self, **other} __ror__ = __or__ >>> UDict({'foo': 1, 'bar': 1337}) | UDict({'bar': 43}) {'bar':

Re: Old format with %

2018-02-15 Thread Andre Müller
It can be escaped: "test %d %%" % 7 Terry Reedy schrieb am Mi., 14. Feb. 2018 um 20:53 Uhr: > On 2/14/2018 7:54 AM, ast wrote: > > Le 14/02/2018 à 13:46, ast a écrit : > >> Hello > >> > >> It seems that caracter % can't be escaped > >> > >> >>>"test %d %" % 7 > >> ValueError: incomplete format

Re: Regex on a Dictionary

2018-02-15 Thread Andre Müller
Hello, this question also came up there: https://python-forum.io/Thread-Working-with-Dict-Object Greetings Andre -- https://mail.python.org/mailman/listinfo/python-list

Re: "Programs" folder not found.

2018-02-15 Thread Andre Müller
Look in %localappdata%\Programs\Python Enerel Amgalan via Python-list schrieb am Do., 15. Feb. 2018 um 14:05 Uhr: > > Hello! So I downloaded “Python” program in C:>Users>(my > name)>AppData>Local>Programs>Python.And then in “Local” folder I can’t find > “Programs” folder,but it says it downloade

Re: help me ?

2018-02-27 Thread Andre Müller
tion is to learn and understand Python. You just want to finish your homework, which bother you. Greetings Andre -- https://mail.python.org/mailman/listinfo/python-list

TemplateError

2016-11-20 Thread iivri . andre
THIS error is constantly showing up when I run my python script eloiim:build iivri.andre$ python run.py * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) [2016-11-21 01:15:26,561] ERROR in app: Exception on / [GET] Traceback (most recent call last): File "/usr/local/lib/python2.7/sit

Re: recommends of redesign OO feature of python !!!

2018-10-25 Thread Andre Müller
Troll detected! If you don't like Python, don't use it. Very simple. The concept of Python is good as it is. -- https://mail.python.org/mailman/listinfo/python-list

start python web programming

2005-04-05 Thread Andre Nobre
I should implement a simple http/database page, based on python. I read some texts and it´s strange how python deal with html output. It´s something like Servlet... is there any diferent way to do that? Something like just bussiness code, applied in an MVC framework, or just like it. Thanks and sor

Re: Send commands to USB device in Python

2014-05-26 Thread andre . miras
Hi, I saw your thread on SourceFourge (http://sourceforge.net/p/pyusb/mailman/message/31969943/), but I don't have an account. I also have MTI RU-824 reader. I sniffed the USB communication in the Windows demo program and I saw that the header should be written backward. So rather than: HEADER

Re: How to create python web framework for ERP

2014-09-09 Thread Andre Duarte
Vimal, Django is a more generic framework(was built initialy for content management). Odoo is a valid sugestion but take some time to see Frappe.io. ERPNext was built on top of this framework and is a great application for small bussiness. []'s André -- https://mail.python.org/mailman/listinfo

Stack trace in C

2006-07-25 Thread Andre Poenitz
g/error checking code I left out] The 'Branch 1' version works for a sinmgle frame, but then tmp1 will be None and tmp2 0 at the end of the iteration and so no further frames are found. The 'Branch 2' version creates immediatly tb_frame as None and does not even enter the loop bo

class variables

2006-07-27 Thread Andre Meyer
Hi allI am trying to understand the magic of Python's class variables and tried the following code (see below).Just out of curiosity, I tried to define a property that provides access to a seemingly instancae variable which is in fact a class variable. All seems to work fine (case 4), but when a cu

class variables

2006-07-27 Thread Andre Meyer
Hi allI am trying to understand the magic of Python's class variables and tried the following code (see below).Just out of curiosity, I tried to define a property that provides access to a seemingly instancae variable which is in fact a class variable. All seems to work fine (case 4), but when a cu

singleton decorator

2006-08-07 Thread Andre Meyer
While looking for an elegant implementation of the singleton design pattern I came across the decorator as described in PEP318.Unfortunately, the following does not work, because decorators only work on functions or methods, but not on classes. def singleton(cls):instances = {}def getinstan

Re: class variables

2006-08-08 Thread Andre Meyer
On 7/31/06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Colin J. Williams wrote: > > Andre Meyer wrote: > >> Hi all > >> > >> I am trying to understand the magic of Python's class variables and > >> tried the following code (see belo

Re: Easy to use distributed system?

2006-08-14 Thread Andre Meyer
Hi allWe are using Pyro, too, for our Multi-Agent System framework Spyse (http://spyse.sf.net). We support mobile agents, distributed environments, various threading models and a lot more. Just ask if you are interested, but use the svn version, mot the 0.1 download. Our 1.0 release should be comin

Re: Best IDE for Python

2006-08-15 Thread Andre Meyer
nagement.>> It's strangely ironic. I consider Eclipse to be a lousy Java IDE > especially compared to commercial offerings and yet that's what the> project started out as.--http://mail.python.org/mailman/listinfo/python-list -- Dr. Andre P. Meyerhttp://pytho

Re: state of SOAP and python?

2006-08-16 Thread Andre Meyer
MININT: ##raise OverflowError, "int exceeds XML-RPC limits"write("")write(str(value))write("\n") Thanks,Mark--Mark HarrisonPixar Animation Studios--http://mail.python.org/mailman/listinfo/python-list -- Dr. Andre P. Meyer

Loading module via full path

2006-08-21 Thread Andre Poenitz
Hi all. Is there a way to load a module given a full path to the module without extending sys.path first? Andre' -- http://mail.python.org/mailman/listinfo/python-list

Re: Stack trace in C

2006-08-21 Thread Andre Poenitz
Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 25 Jul 2006 14:20:41 +0200, Andre Poenitz <[EMAIL PROTECTED]> wrote: >> >> >>Bear with me - I am new to Python. (And redirect me to a more suitable >>newsgroup in case this one is not appropriate.) &g

Re: Stack trace in C

2006-08-21 Thread Andre Poenitz
Just <[EMAIL PROTECTED]> wrote: > >> On Tue, 25 Jul 2006 14:20:41 +0200, Andre Poenitz wrote: >> > >> > >> >Bear with me - I am new to Python. (And redirect me to a more suitable >> >newsgroup in case this one is not appropriate.) >> >

Re: Loading module via full path

2006-08-21 Thread Andre Poenitz
Andre Poenitz <[EMAIL PROTECTED]> wrote: > Hi all. > > Is there a way to load a module given a full path to the module > without extending sys.path first? Ok. imp.find_module() and imp.load_module() seem to do what I need. Andre' -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading module via full path

2006-08-22 Thread Andre Poenitz
Gary Herron <[EMAIL PROTECTED]> wrote: > Andre Poenitz wrote: >> Hi all. >> >> Is there a way to load a module given a full path to the module >> without extending sys.path first? > > The standard module named "imp" can help you with this. Tha

Re: wxWindow GetPosition() bug???

2006-08-22 Thread Andre Poenitz
ther than 'never try to access coordinates that are 'much' bigger than what is actually visible'... Andre' -- http://mail.python.org/mailman/listinfo/python-list

Re: How to download a web page just like a web browser do ?

2006-08-23 Thread Andre Meyer
You get websucker.py in the standard Python installation. On Win look at C:\Python24\Tools\webchecker or similar.regardsAndre -- http://mail.python.org/mailman/listinfo/python-list

Dumping the state of a deadlocked process

2006-10-06 Thread andre . naess
Hi all I'm currently having some issues with a process getting deadlocked. The problem is that the only way I can seem to find information about where it deadlocks is by making a wild guess, insert a pdb.set_trace() before this point, and then step until it locks up, hoping that I've guessed right

Re: Dumping the state of a deadlocked process

2006-10-07 Thread andre . naess
MrJean1 wrote: > Did you try using the signal module? If not, a basic example is here > which may need to be > extended. I looks useful. I gave it a try, and the only weakness it has is that when my process locks, it locks so badly that it doesn't respon

Re: Feature Request: Py_NewInterpreter to create separate GIL (branch)

2006-11-03 Thread Andre Meyer
r at the right border-line ? Existing extension code base would remain compatible, as far as there is already decent locking on module globals, which is the the usual case. Robert--http://mail.python.org/mailman/listinfo/python-list-- Dr. Andre P. Meyer http://python.op

dictionaries vs. objects

2006-08-24 Thread Andre Meyer
Hi allI have the following question: I need a representation of a physically inspired environment. The environment contains a large number of objects with varying attributes. There may be classes of objects, but there is not necessarily a strictly defined hierarchy among them. Object access should

performance of dictionary lookup vs. object attributes

2006-08-25 Thread Andre Meyer
use lookup can be precompiled. kind regards Andre import time import random ITERATIONS = 100 ATTRIBUTES = 100 class O(object): pass class Test(object): def __init__(self): self.attributes = [] self.dic = {} self.obj = O() for i in range(

Re: performance of dictionary lookup vs. object attributes

2006-08-25 Thread Andre Meyer
jects, because attribute lookup uses dicts itself. Is that correct? thanks Andre On 8/25/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Andre Meyer wrote: > > > Is the test meaningful and are you surprised by the results? > > surprised by the amount of code you needed to

Re: Learning Python

2006-08-26 Thread Andre Meyer
http://www.python.org/download/releases/2.4/bugs/IDLE now executes code in a separate process. To communicate between the main process and executing processes, IDLE opens a socket to 127.0.0.1 (the local machine). Some firewalls running on Windows machines interfere with this and can cause either

Re: Persistent Session in CGI

2006-08-27 Thread Andre Meyer
re any good guides on how to do Persistent Sessions and Authenticationusing python and CGI. I don't really want too use Zope, because It'sprobably overkill for my tiny project.-- http://mail.python.org/mailman/listinfo/python-list-- Dr. Andre P. Meyerhttp://python.op

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Andre Meyer
Hi allIt might be interesting to watch the videos about Django and Rails (http://www.djangoproject.com/snakesandrubies/). Django makes a good impression, although I would not agree with all of their arguments (eg. templating language, ajax). Most striking, though, is the difference in attitude! Whi

Re: dictionaries vs. objects

2006-08-31 Thread Andre Meyer
On 8/28/06, Steve Holden <[EMAIL PROTECTED]> wrote: Andre Meyer wrote:> Hi all>> I have the following question: I need a representation of a physically> inspired environment. The environment contains a large number of objects> with varying attributes. There may be classes of

Re: threading support in python

2006-09-05 Thread Andre Meyer
This seems to be an important issue and fit for discussion in the context of Py3k. What is Guido's opinion?As a developer of a multi-threaded system I would like to know more about these issues, so it's no time wasted for me... ;-) regardsAndreOn 9/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Re: IDE

2006-09-06 Thread Andre Meyer
http://pydev.sourceforge.net/http://wiki.python.org/moin/PythonEditors -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs java

2006-09-06 Thread Andre Meyer
http://www.ferg.org/projects/python_java_side-by-side.html -- http://mail.python.org/mailman/listinfo/python-list

Re: the first arg to super() must be a type, not a class obj?

2006-09-08 Thread Andre Meyer
t know if that's okay with super.So in your case it would be advisable to useFTPHost.__init__(self)instead ofsuper(ftputilx, self).__init__() Georg--http://mail.python.org/mailman/listinfo/python-list-- Dr. Andre P. Meyer http://python.openspace.nl/meyerTNO Defence, Secu

Re: Building Python Based Web Application

2006-09-09 Thread Andre Meyer
Karrigell can really be recommended. Simple, but powerful. No need for SQL (though it can), just use the pure Python buzhug, Karrigell services and (Cheetah) templates. Works great.regardsAndre -- http://mail.python.org/mailman/listinfo/python-list

Re: best small database?

2006-09-11 Thread Andre Meyer
atabase will likely hold only a few hundred items,including both textfiles and binary files.I would like a pure Python solution to the extent reasonable. Suggestions?Thank you,Alan Isaac--http://mail.python.org/mailman/listinfo/python-list --http://mail.python.org/mailman/listinfo/python-list --

Re: Help me use my Dual Core CPU!

2006-09-17 Thread Andre Meyer
t to check out GHCI (the Glasgow Haskell compiler),> which may be the closest thing to a "winner":>>   - very advanced language, even higher level than Python, once described > by somebody as "what Python should have become">   - native code compilation>  

Re: Porting Tkinter application to JYthon

2006-11-23 Thread Andre Burgaud
Hi Sandip, JPype could be a solution to implement the second option mentioned by Tim: http://jpype.sourceforge.net/ Thanks, Andre http://www.burgaud.com/ On 23 Nov 2006 05:36:46 -0800, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: Hi, sandip desale wrote: > Dear All, > >

synching with os.walk()

2006-11-24 Thread Andre Meyer
Hi all os.walk() is a nice generator for performing actions on all files in a directory and subdirectories. However, how can one use os.walk() for walking through two hierarchies at once? I want to synchronise two directories (just backup for now), but cannot see how I can traverse a second one.

Re: synching with os.walk()

2006-11-24 Thread Andre Meyer
That sounds like a good approach. On 24 Nov 2006 08:27:09 -0800, Paddy <[EMAIL PROTECTED]> wrote: Andre Meyer wrote: > Hi all > > os.walk() is a nice generator for performing actions on all files in a > directory and subdirectories. However, how can one use os.walk() for

Re: synching with os.walk()

2006-11-24 Thread Andre Meyer
What I forgot to mention is that I want this to run unmodified from both Windows and Linux (and Mac). Otherwise, there are enough options to choose from, besides developing it myself, I guess. On 24 Nov 2006 08:37:13 -0800, Paddy <[EMAIL PROTECTED]> wrote: Paddy wrote: > Andre Me

Re: synching with os.walk()

2006-11-24 Thread Andre Meyer
work for your needs? -- Nils -- http://mail.python.org/mailman/listinfo/python-list -- Dr. Andre P. Meyerhttp://python.openspace.nl/meyer TNO Defence, Security and Safety http://www.tno.nl/ Delft Cooperation on Intelligent Systems http://www.decis.nl/ Ah, t

route planning

2006-12-01 Thread Andre Meyer
Hi all Just a very simple question: where can I find a module for route planning? I have looked around and found some implementations of graph theory, e.g. http://sourceforge.net/projects/pynetwork/. But, what I need is not an abstract graph, but one where nodes/vertices have locations (2D), are

Re: Python Plugin for Web Browser

2006-12-06 Thread Andre Meyer
Bonjour ! > > Pour IE, il y a des exemples de plugins, fournis avec PyWin32. > Pour FF (comme pour Opera), je ne sais pas. > > -- > @-salutations > > Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list -- Dr. Andre P. Meyerh

Re: Python Plugin for Web Browser

2006-12-06 Thread Andre Meyer
t have real project at this time but, I like Python and use it every day. Many time I want to make an applet for game, or webcam remote control but I don't understand and I don't want to learn Java when I know the powerful python. Are you a developper? C++ ? Seb 2006/12/6, Andre Meyer <[E

Re: funcs without () like print

2006-12-07 Thread Andre Meyer
print is supposed to become a function in Py3k, though. On 12/7/06, Georg Brandl <[EMAIL PROTECTED]> wrote: iwl wrote: > Hello can I make funktions callable without () like print > at time the interpreter seems to printout the adres when I type the > function without () print is not a functio

Re: Is anyone using Python for embedded applications?

2006-12-13 Thread Andre Meyer
where Python commands can be executed. hth Andre On 12/12/06, Carl J. Van Arsdall <[EMAIL PROTECTED]> wrote: I'm aware of a couple python projects for embedded systems. I am currently considering using Python on an embedded platform to develop a simple application as a personal proje

Re: [Edu-sig] automatically grading small programming assignments

2006-12-14 Thread Andre Roberge
Hello Brian, I do not teach (much to my regrets) but I have been thinking about what you describe. See below. On 12/14/06, Brian Blais < [EMAIL PROTECTED]> wrote: Hello, I have a couple of classes where I teach introductory programming using Python. What I would love to have is for the stude

Re: Python equivilant to msgbox()

2006-02-12 Thread Andre Burgaud
n.net/crew/mhammond/win32/: >>> import win32api>>> win32api.MessageBox(0, "Text", "Title")1>>>   Regards,   Andre http://www.burgaud.com/   On 2/12/06, LittlePython <[EMAIL PROTECTED]> wrote: Is there an equivalent to a msgbox() or wscript.echo (via wc

Re: Python equivilant to msgbox()

2006-02-13 Thread Andre Roberge
On 2/13/06, Peter Decker <[EMAIL PROTECTED]> wrote: > On 12 Feb 2006 17:27:56 -0800, André <[EMAIL PROTECTED]> wrote: > > > It's also possible to something like that with wxPython. Try: > > import wx > > app = wx.PySimpleApp() > > dlg = wx.TextEntryDialog(None, 'Enter value', 'Title', '') > > if d

Re: c[:]()

2007-06-01 Thread Andre Engels
other objects of the same type". And that does not seem to be a case of "We have never needed it yet" - the join method seems to have been specifically tailored so that no such error is needed. -- Andre Engels, [EMAIL PROTECTED] ICQ: 6260644 -- Skype: a_engels -- http://mail.python.org/mailman/listinfo/python-list

Re: error when calling method of class

2007-06-08 Thread Andre Engels
thus the definition should be done with: def splitTime(self,n): -- Andre Engels, [EMAIL PROTECTED] ICQ: 6260644 -- Skype: a_engels -- http://mail.python.org/mailman/listinfo/python-list

Ang roskilde billet

2007-06-09 Thread andre lerche
Hej Jeg er interesseret i at købe din billet, jeg bor selv på amager, så vi kan gøre en hurtig handel. Mvh André -- http://mail.python.org/mailman/listinfo/python-list

Re: skip next item in list

2007-06-11 Thread Andre Engels
would do: flag_last_a = False for a in list: if flag_last_a: flag_last_a = False continue if a=='a': flag_last_a = True # Whatever is done when you don't skip -- Andre Engels, [EMAIL PROTECTED] ICQ: 6260644 -- Skype: a_engels -- http://mail.python.org/mailman/listinfo/python-list

Re: a question about unicode in python

2007-06-13 Thread Andre Engels
just an idea: is your text editor really supporting utf-8? In the mail > it is only displayed as '??' which looks for me as the mail editor did > not send the mail as utf. Try to attach a correct text file. That must be your mail client, not his text editor or mail client. I do see two Chinese characters in the message. -- Andre Engels, [EMAIL PROTECTED] ICQ: 6260644 -- Skype: a_engels -- http://mail.python.org/mailman/listinfo/python-list

Re: web page text extractor

2007-07-12 Thread Andre Engels
extonly(url): # Get the HTML source on url and give only the main text f = urllib2.urlopen(url) text = f.read() r = re.compile('\<[^\<\>]*\>') newtext = r.sub('',text) while newtext != text: text = newtext newtext = r.sub('&#x

Re: web page text extractor

2007-07-12 Thread Andre Engels
2007/7/12, Andre Engels <[EMAIL PROTECTED]>: I forgot to include import urllib2, re here > def textonly(url): ># Get the HTML source on url and give only the main text >f = urllib2.urlopen(url) >text = f.read() >r = re.compile('\<[^\<\>

Re: Coming from delphi - looking for an IDE - willing to spend money

2006-04-24 Thread Andre Burgaud
Hi James,There are many different IDE available for Python, but if you are coming from Delphi, you may find interesting to try PyScripter available at http://mmm-experts.com/Products.aspx?ProductID=4 . For a list of availale Python IDE and editors, you cmay also check this page: http://wiki.python.

Re: Generic string import like in strptime?

2008-01-16 Thread Andre' John
Nice. Thanks a lot. Andre On Wed, 16 Jan 2008, Paul Hankin wrote: > On Jan 16, 8:34 am, Andre <[EMAIL PROTECTED]> wrote: > > Hi there > > > > Is there a function like strptime, which takes a string and converts it > > into an array depending on a fo

psycopg2

2008-01-31 Thread Andre' John
Though, when doing cur.execute("SELECT * FROM names") it works. I am totally helpless here. Does anyone have an idea? Cheers Andre-- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2

2008-02-01 Thread Andre' John
Thanks very much, this was indeed the problem. That column was an array. I created it via GUI and was wondering why it did append a '[]' to the variable type, but didn't bother, because there was no other varchar available. Cheers Andre PS: Weird though how few results turn

Re: Python surpasses Perl in popularity?

2008-12-01 Thread Andre Majorel
On 2008-11-30, Stephane Chazelas <[EMAIL PROTECTED]> wrote: > 2008-11-30, 06:11(+00), Tam Ha: >> Stephane CHAZELAS wrote: >>> There's a common confusion in this in the nature of /bin/sh. >>> There's no standard (neither POSIX nor Unix) that specifies that >>> /bin/sh should be any variant of the Bo

Re: how to find all completely connected sub-graphs?

2009-03-03 Thread Andre Engels
On Tue, Mar 3, 2009 at 7:35 AM, Hyunchul Kim wrote: > How can I find all "completely connected subgraphs" in a graph when node and > edge data are available? > > "completely connected subgraph" is a group, all members of which are > connected to each other. Here is an algorithm I came up with in

Re: Inverse of dict(zip(x,y))

2009-03-04 Thread Andre Engels
On Wed, Mar 4, 2009 at 11:02 AM, lone_eagle wrote: > Can someone suggest a easy method to do the inverse of dict(zip(x,y)) > to get two lists x and y? > > So, if x and y are two lists, it is easier to make a dictionary using > d = dict(zip(x,y)), but if I have d of the form, d = {x1:y1, > x2:y2,

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 6:01 PM, Tino Wildenhain wrote: > Still I'd like to see an application where this really matters (that > keys() and values() match in order) I think there are many such applications, but also that in each of those cases it's a mis-programming of something that would be don

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 7:07 PM, psykeedelik wrote: > I usually get properties that I compute, in a dictionary like property > = [key1: val1, key2:val2, ...] and then I usually want to plot them in > pylab, which AFAIK requires x and y as lists for the plot argument. > Then I need to get the lists

Re: Inverse of dict(zip(x,y))

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 7:46 PM, Andre Engels wrote: > If the dict = {key1: val1, key2: val2, ...}, you can do: > > for key in dict: >    plot(key,dictionary[key]) Of course I meant: for key in dict: plot(key,dict[key]) -- André Engels, andreeng...@gmail.com -- http://mai

Re: While loop

2009-03-05 Thread Andre Engels
On Thu, Mar 5, 2009 at 6:49 PM, Fab86 wrote: > On Mar 5, 5:23 pm, Marco Mariani wrote: >> Fab86 wrote: >> > Is it possible to get the program to catch the exception, wait 10 >> > seconds, then carry of from where it was rather than starting again? >> >> something like this? probably works in PASC

Re: create boolean

2009-03-07 Thread Andre Engels
On Sat, Mar 7, 2009 at 6:03 AM, Grant Edwards wrote: > Putting in the second comparison in makes the code match the > stated requirement.  Otherwise you have to start making > assumptions about what n might be besides None or the empty > list. But the stated requirement already assumes that n is

Re: create boolean

2009-03-09 Thread Andre Engels
On Mon, Mar 9, 2009 at 12:48 AM, Grant Edwards wrote: > I didn't say that he hadn't authorized that assumption.  I just > said that the code does rely on such an assumption.  In my > experience, assumptions like that result broken code down the > road. And assumptions like "when assumptions fail

Re: a problem in datetime.interval()

2009-03-09 Thread Andre Engels
On Mon, Mar 9, 2009 at 10:57 AM, lameck kassana wrote: > hi , > I am writing a scriot which will move old files from one directory to backup > The files are in mode *20090307* mean *mmmdd* to new files. > The script is below is like this > > import os > import datetime > import time > from dat

Re: How to add months to a date (datetime object)?

2009-03-15 Thread Andre Engels
On Sun, Mar 15, 2009 at 7:00 PM, wrote: > Roy Smith wrote: >> In article <49bd3ab8$0$510$bed64...@news.gradwell.net>, tinn...@isbd.co.uk >> wrote: >> >> > I have a date in the form of a datetime object and I want to add (for >> > example) three months to it.  At the moment I can't see any very >

Re: array next pointer

2009-03-17 Thread Andre Engels
On Tue, Mar 17, 2009 at 12:12 PM, Anjanesh Lekshminarayanan wrote: a = ['cat','dog','elephant'] a.next() > Traceback (most recent call last): >  File "", line 1, in > AttributeError: 'list' object has no attribute 'next' > Is there something that imtates PHP's next() ? (http://php.

Re: array next pointer

2009-03-17 Thread Andre Engels
On Tue, Mar 17, 2009 at 12:24 PM, Andre Engels wrote: > On Tue, Mar 17, 2009 at 12:12 PM, Anjanesh Lekshminarayanan > wrote: >>>>> a = ['cat','dog','elephant'] >>>>> a.next() >> Traceback (most recent call last): >>

Re: Python to Perl transalators

2009-03-18 Thread Andre Engels
On Wed, Mar 18, 2009 at 6:27 AM, wrote: > > -Original Message- > From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert > Sent: Wednesday, March 18, 2009 10:53 AM > To: Raju, Abhinayaraj > Cc: python-list@python.org > Subject: Re: Python to Perl transalators > > 20

Re: Crunchy [Was: Preparing teaching materials]

2009-03-21 Thread Andre Roberge
On Sat, Mar 21, 2009 at 5:06 PM, andrew cooke wrote: > André wrote: > > If I may suggest a very different alternative than the ones already > > suggested: use Crunchy. (http://code.google.com/p/crunchy) > > > > You can have you handouts (html or reStructuredText documents) live on > > the web wi

Re: What way is the best to check an empty list?

2009-03-25 Thread Andre Engels
On Wed, Mar 25, 2009 at 3:38 PM, srinivasan srinivas wrote: > > For ex: to check list 'A' is empty or not.. > if A == []: > if A.count == 0: > if len(A) == 0: > if not A: I would go for the last one, because it has the highest likelihood of doing what is intended when fed with something that is '

Re: What way is the best to check an empty list?

2009-03-25 Thread Andre Engels
On Wed, Mar 25, 2009 at 4:21 PM, andrew cooke wrote: > > i will go against the grain slightly and say that "len" is probably the > best compromise in most situations (although i admit i don't know what > count is) because i think it will work when you expect it to and break > when you have a bug i

Re: absolute newbie: divide a list into sublists (nested lists?) of fixed length

2009-04-11 Thread Andre Engels
On Sun, Apr 12, 2009 at 12:05 AM, wrote: > Thanks very much - works fine! Now for a follow-up question:) > > Actually my original list called "mylist" contains 81217 elements - I > shape those into > len(mylist) > 81217 s = N.array(mylist) s.shape = (241,337) > > which works becau

Re: [False,True] and [True,True] --> [True, True]?????

2009-04-20 Thread Andre Engels
On Mon, Apr 20, 2009 at 9:03 AM, bdb112 wrote: > Is there any obvious reason why > [False,True] and [True,True] > gives [True, True] Well, whether the reason is obvious, I do not know, but the way and seems to be implemented is: X and Y = * X if the boolean value of X is false * Y if the boolean

Re:

2009-04-21 Thread Andre Engels
On Tue, Apr 21, 2009 at 3:00 PM, karlos barlos wrote: > hello to everybody... > > having problem withe this code : > > dom = raw_input("The Domain name..:") >   ad_user.Put('userPrincipalName',user['login']+'@(['dom']) > > but it wont change whay ? Well, you don't tell what ad_user is, an

Re: sorted() erraticly fails to sort string numbers

2009-04-28 Thread Andre Engels
On Tue, Apr 28, 2009 at 9:47 AM, uuid wrote: > I would be very interested in a logical explanation why this happens on > python 2.5.1: > > In order to sort an etree by the .text value of one child, I adapted this > snippet from effbot.org: > >> import xml.etree.ElementTree as ET >> >> tree = ET.pa

Re: Why bool( object )?

2009-04-28 Thread Andre Engels
On Tue, Apr 28, 2009 at 2:22 PM, Colin J. Williams wrote: > Lie Ryan wrote: >> >> Aaron Brady wrote: >>> >>> What is the rationale for considering all instances true of a user- >>> defined type? >> >> User-defined objects (or type) can override .__len__() [usually container >> types] or .__nonzero

Re: Generator oddity

2009-05-01 Thread Andre Engels
On Fri, May 1, 2009 at 4:25 PM, Dave Angel wrote: > The problem is in it2, which is initialized only once.  Thus the second time > you're going through the c2 loop, it doesn't have any more values. > > If you need the indirection provided by those it1 and it2, you need to > postpone the function

  1   2   3   >