problems with tkinter updates

2012-01-23 Thread yves
('finished?') When I do this (input('more?'), it works as expected. If I comment that line out, then the program reads the entire file, then update the window right at the end, even if I put a sleep in there. What can I do inside the loop to give tk a chance?

Re: problems with tkinter updates

2012-01-23 Thread yves
dd buttons to that frame, they are quite unresponsive. I'm starting to think I need to split off the reading part into a different thread. -- Yves. http://www.SollerS.ca/

Re: problems with tkinter updates

2012-01-27 Thread yves
"looney", foreground="RED") text.see(tkinter.END) read_more() root.mainloop() Thank you, this was very useful! -- Yves. http://www.SollerS.ca/

Re: problems with tkinter updates

2012-01-29 Thread yves
In case somebody else is trying to do the same thing, this is what I ended up with to get the concept, that I can now integrate in other scripts: http://projects.zioup.org/scratchpad/python/tkrun.py -- Yves. http://www.SollerS.ca

tkinter.Toplevel

2012-02-16 Thread yves
With a tkinter.Toplevel, how can I "disable" the parent windown and all its widget, in the same fashion as tkinter.messagebox? -- Yves. http://www.SollerS.ca/ http://ipv6.

Re: tkinter.Toplevel

2012-02-18 Thread yves
thon. Look in the __init__ method of Dialog class. My advice is to study the code until you understand every line. Look at the following references when you need more info: http://infohost.nmt.edu/tcc/help/pubs/tkinter/ http://effbot.org/tkinterbook/ ...grab_set() Thanks

Re: py3k: datetime resolution / isoformat

2011-02-26 Thread yves
On 11-02-25 07:49 PM, Ned Deily wrote: datetime.datetime.now().replace(microsecond=0).isoformat() '2011-02-25T18:48:24' Ah, Thanks! -- Yves. http://www.SollerS.ca/ http://blog

suggestions for functional style (singleton pattern?)

2015-02-28 Thread yves
Hi, For some scripts, I write in a a more functional way, using a lot of small functions outside of any class. Although it makes the code clearer for specific cases, I have found that it makes debugging and using the repl in general difficult, as as I have to re-initialise every single objects eve

Re: suggestions for functional style (singleton pattern?)

2015-02-28 Thread yves
On 2015-02-28 19:19, Michael Torrie wrote: > You say you are trying to use a singleton pattern, but your code does > not appear to implement a singleton. From what I can read of your code, I call it a singletone because I only every create one object. I am not trying to use a singleton, I'm tryi

Re: suggestions for functional style (singleton pattern?)

2015-02-28 Thread yves
On 2015-02-28 20:45, Mario Figueiredo wrote: > Problem 1: > With the exception of get_all_files(), all your functions do is to > call another standard function. This decreases performance > unnecessarily and may mislead the users of your API into thinking > these functions perform some different t

with statements does not delete the object

2011-09-21 Thread yves
Is this the expected behaviour: with mylib.token() as t: do_something dir() In the last dir(), after the with "loop" is finished, t still shows up... I expected it to be unreferenced by then. -- Yves. http://www.

bufsize in subprocess

2012-01-21 Thread yves
. import subprocess com = ['/bin/ls', '-l', '/usr/bin'] with subprocess.Popen(com, bufsize=1, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as proc: print('out: ' + str(proc.stdout.read(), 'utf8')) Thanks. -- Yves.

Re: bufsize in subprocess

2012-01-22 Thread yves
proc.stdout.readline(). Yes, or a for loop, this works for me now: import subprocess com = ['/bin/ls', '-l', '/usr/bin'] with subprocess.Popen(com, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as proc: for line in proc: print('out

Re: bufsize in subprocess

2012-01-22 Thread yves
import subprocess com = ['/bin/ls', '-l', '/usr/bin'] with subprocess.Popen(com, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as proc: for line in proc.stdout: print('out: ' + str(line, 'utf8')) -- Yves.

executing a function/method from a variable

2009-10-16 Thread Yves
o = dummy(sys.argv[1]) o.doit() Thanks. -- Yves. http://www.sollers.ca/ -- http://mail.python.org/mailman/listinfo/python-list

Re: executing a function/method from a variable

2009-10-17 Thread Yves
sys class dummy(object): def __init__(self, arg): self.todo = 'print' + arg; def printa(self): print 'a' def printb(self): print 'b' def doit(self): #func = getattr(self, self.todo) #func() getattr(self, self.todo)() o = du

append to non-existing list

2005-11-09 Thread Yves Glodt
the way python works...?!? My question is: Is there no way to append to a non existing list? I am lazy for declaring it first, IMHO it bloats the code, and (don't know if it's good to say that here) where I come from (php) I was used to not-needing it... regards, Yves -- http://ma

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
[EMAIL PROTECTED] wrote: > Yves> My question is: Is there no way to append to a non existing list? > > My question in return is: How is Python supposed to know that pkcolumns is > supposed to be a list instead of some other type of object that happens to > define an appe

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
by the amount of answers that my question rose, in so little time! thanks all! > There is a lot I don't like about python but if you have to use it, you > have to cope with it. > > Yves Glodt wrote: >> My question is: Is there no way to append to a non existing list? >

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
Juho Schultz wrote: > Yves Glodt wrote: >> Hello, >> >> if I do this: >> >> for row in sqlsth: >> pkcolumns.append(row[0].strip()) >> etc >> >> >> without a prior: >> >> pkcolumns = []; >> >>

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: >> Hello, >> >> if I do this: >> >> for row in sqlsth: >> pkcolumns.append(row[0].strip()) >> etc >> >> >> without a prior: >> >> pkcolumns = []; >> >>

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
[EMAIL PROTECTED] wrote: > Thomas Bellman wrote: >> The next time you go shopping at your local super-market, do >> *not* get a shopping-cart (or shopping-basket, or any similar >> container). As you pick up the things you want to buy, try >> to put them into the non-existing cart. Perhaps you wi

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
Max M wrote: > Yves Glodt wrote: >> bruno at modulix wrote: >> >>> Yves Glodt wrote: >>> >>>> Hello, >>>> >>>> if I do this: >>>> >>>> for row in sqlsth: >>>> pkcolumns.append(row[0]

Re: append to non-existing list

2005-11-10 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: > (snip) >> ok I see your point, and python's... >> >> (just FYI, and not to start a flamewar ;-): >> In php, the [] means "append to an array object". > > yes, I know this. > >> If the array

Re: append to non-existing list

2005-11-10 Thread Yves Glodt
[EMAIL PROTECTED] wrote: > Yves Glodt wrote: >> Which raises another question... :-) >> >> Is there a possibility to bring together apache and python in a way that >> I can embed python into html? > What do you mean ? I need this (invalid example-html follows):

iterate over class variables

2005-11-10 Thread Yves Glodt
e,value in test: print name print value fails with of course with: "TypeError: iteration over non-sequence" How can I do that? regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Re: iterate over class variables

2005-11-10 Thread Yves Glodt
Yves Glodt wrote: > Hello list, > > I need to iterate over a class and get all her variable names and > values, e.g. considering this example: > > > class testclass: > var1 = 'ab' > var2 = 'cd' > var3 = 'ef' >

Re: iterate over class variables

2005-11-10 Thread Yves Glodt
Yves Glodt wrote: > Yves Glodt wrote: >> Hello list, >> >> I need to iterate over a class and get all her variable names and >> values, e.g. considering this example: >> >> >> class testclass: >> var1 = 'ab' >> var2 = &

Re: iterate over class variables

2005-11-10 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: >> Yves Glodt wrote: >> >>> Hello list, >>> >>> I need to iterate over a class and get all her variable names and >>> values, e.g. considering this example: >>> >>> >>&g

how to start a process and get it's pid?

2005-11-11 Thread Yves Glodt
id,9) best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Re: how to start a process and get it's pid?

2005-11-11 Thread Yves Glodt
Gerhard Häring wrote: > Yves Glodt wrote: >> Hello, >> >> another question rose for me today... >> >> Is there a way to start an external process, in it's own context (not as >> the exec-() functions do), and get it's pid...? [...] > > Che

Clone an object

2005-11-14 Thread Yves Glodt
Hello, how can I clone a class instance? I have trouble finding that in the documentation... thanks and best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Re: Pregunta sobre python

2005-11-14 Thread Yves Glodt
Andres de la Cuadra wrote: > Hola, me llamo Andres de la cuadra, soy un usuario de python en chile y me > gustaría saber como puedo cerrer un programa a través de python. Yo se que > con la librería os puedo ejecutar programas, pero no e encontrado una > librería para poder cerrarlos Hola Andres,

[Twisted-Python] ssh tunnel

2005-11-16 Thread Yves Glodt
hat tunnel (if that's possible at all...) Thanks in advance and best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Linux, Desktop Environment

2005-11-16 Thread Yves Glodt
d line and ./myscript.py. What can I do to make it a "click and >> run" sort of application in KDE or Gnome on Linux? >> I don't really understand what you mean... Have you tried simply creating a "shortcut" that points to your script.py? That should make i

spawnle & umask

2005-12-08 Thread Yves Glodt
Hi, I tried something like this but the umask part does not work clearly...: newpid = os.spawnle(os.P_NOWAIT,'/usr/bin/touch','/usr/bin/touch','xyz','umask 0113') What would be the correct syntax for setting the umask for the created process...? Best

Re: spawnle & umask

2005-12-08 Thread Yves Glodt
Fredrik Lundh wrote: > Yves Glodt wrote: > >> I tried something like this but the umask part does not work clearly...: >> >> newpid = >> os.spawnle(os.P_NOWAIT,'/usr/bin/touch','/usr/bin/touch','xyz','umask 0113') >&g

Re: spawnle & umask

2005-12-08 Thread Yves Glodt
David Wahler wrote: > Yves Glodt wrote: >> It does, I did like this: >> >> os.umask(0113) >> newpid = >> os.spawnl(os.P_NOWAIT,'/usr/local/bin/wine','/usr/local/bin/wine',executable) >> >> But I wanted to use spawnle and it's

heartbeats

2005-12-09 Thread Yves Glodt
nd this is important, should have a short timeout. If one client does not respond because it's offline, after max. 10 seconds the central server should continue with the next client. Which python functions would be the most convenient for this application? Best regards, Yves -- http://mail.pyt

python-soappy

2006-01-11 Thread Yves Glodt
Hi list, can anybody point me to a tutorial, howto or example code of python-soappy...? google did not have really useful results about... Best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Snapshot+Clipboard

2006-07-19 Thread Yves Lange
Hello, i'm searching a method to take a snapshot and save it in a jpg, bmp or gif file. I tried with win32api and win32con but it save the snapshot to the clipboard, so i tried to redirect this in a file but i have some problems while getting the IMAGE stocked in the clipboard and save it to a

Re: Snapshot+Clipboard

2006-07-19 Thread Yves Lange
Claudio Grondi a écrit : > Yves Lange wrote: >> Hello, >> i'm searching a method to take a snapshot and save it in a jpg, bmp or >> gif file. I tried with win32api and win32con but it save the snapshot >> to the clipboard, so i tried to redirect this in a file bu

Re: Zipping files/zipfile module

2006-08-02 Thread Yves Lange
Simon Forman a écrit : > Brian Beck wrote: >> OriginalBrownster wrote: >>> I want to zip all the files within a directory called "temp" >>> and have the zip archive saved in a directory with temp called ziptemp >>> >>> I was trying to read up on how to use the zipfile module python >>> provides, bu

schedule at specific hours

2006-08-11 Thread Yves Glodt
...) way? Regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

pyqt show wizard

2006-06-07 Thread Yves Glodt
he onclick method of the button does: w = Wizard() w.show() bot nothing happens... How must I do to start the wizard...? Best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Activate a daemon several times a day

2006-07-06 Thread Yves Glodt
: if now(hours) in runat: act() sleep(60) sleep(10) Please enlighten me! Best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Hi there, I seem to be unable to find a way to appends more keys/values to the end of a dictionary... how can I do that? E.g: mydict = {'a':'1'} I need to append 'b':'2' to it to have: mydict = {'a':'1','b':'2'

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Rene Pijlman wrote: > Yves Glodt: >> I seem to be unable to find a way to appends more keys/values to the end >> of a dictionary > > A dictionary has no order, and therefore no end. that means I can neither have a dictionary with 2 identical keys but different values..

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Yves Glodt wrote: > Hi there, > > I seem to be unable to find a way to appends more keys/values to the end > of a dictionary... how can I do that? > > E.g: > > mydict = {'a':'1'} > > I need to append 'b':'2' to it to have

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Paul Rubin wrote: > Yves Glodt <[EMAIL PROTECTED]> writes: >> that means I can neither have a dictionary with 2 identical keys but >> different values...? > > No. > >> I would need e.g. this: >> (a list of ports and protocols, to be treated later in a

test whether 2 objects are equal

2006-01-31 Thread Yves Glodt
; test1.var2 = 'b' test2 = Test() test2.var1 = 'a' test2.var2 = 'b' if test1 == test2: print "equal" else: print "not equal" What am I doing wrong...? best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Re: test whether 2 objects are equal

2006-01-31 Thread Yves Glodt
Rene Pijlman wrote: > Yves Glodt: >> I need to compare 2 instances of objects to see whether they are equal >> or not, > > This prints "equal": thank you! Have a nice day, Yves > class Test(object): > def __init__(self): > self.var1 = &#

Re: test whether 2 objects are equal

2006-01-31 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: >> Hello, >> >> >> I need to compare 2 instances of objects to see whether they are equal >> or not, but with the code down it does not work (it outputs "not equal") >> >> >> #!/usr/bin/python

Re: Python threading, and processes

2006-02-08 Thread Yves Glodt
daemon that runs one thread, and I noticed that on our sarges with kernel 2.4 my daemon creates 4 processes, on the ones with kernel 2.6, only one process. btw, I use the thread module. best regards, Yves > Cheers > > -Rob -- http://mail.python.org/mailman/listinfo/python-list

encoding problem

2006-03-03 Thread Yves Glodt
ems the pysvn.client.diff function returns "bytes" (as I read in the changelog of pysvn: http://svn.haxx.se/dev/archive-2005-10/0466.shtml) How can I convert this string so that I can contatenate it to my "regular" string? Best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

generating a liste of characters

2008-12-03 Thread Yves Dorfsman
ge(0x61, 0x7b) ] # a - z Is there a better, more straight forward way of doing that ? Thanks. Yves. http://www.sollers.ca/blog/2008/swappiness http://www.sollers.ca/blog/2008/swappiness/.fr -- http://mail.python.org/mailman/listinfo/python-list

Unicode (UTF8) in dbhas on 2.5

2008-10-20 Thread Yves Dorfsman
he bsd db library, or there is no way to make it work with python 2.5 ? What about python 2.6 ? Thanks. -- Yves. http://www.sollers.ca/blog/2008/no_sound_PulseAudio http://www.sollers.ca/blog/2008/PulseAudio_pas_de_son/.fr -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode (UTF8) in dbhas on 2.5

2008-10-21 Thread Yves Dorfsman
t know about unicode. What are you talking about ? I just copied this right from my terminal (LANG=en_CA.utf8): >>> print unichr(0x020ac) € >>> Now, I have read that python 2.6 has better support for Unicode. Does it allow to write to file, bsddb etc... without having to encod

Re: How to call a file

2008-05-11 Thread Yves Dorfsman
Gary Herron wrote: First of all, some terminology: You are not *calling* a file, you are *opening* it or reading. Wouldn't it be more correct to say that, in python, you either create a file object, or call a method for that object, once the object has been created ? Yves. --

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Yves Dorfsman
. Do you have a cleaner / python'er alternative ? Do you find the following cleaner: x = 0 while x <= 4: print x x += 1 Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

anonymous assignment

2008-05-11 Thread Yves Dorfsman
, a special keyword that means I don't care about this value. In this particular case, there's got to be a better way than: d = time.local() y = d[0] d = d[1] Thanks. Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous assignment

2008-05-11 Thread Yves Dorfsman
Paul Rubin wrote: Yves Dorfsman <[EMAIL PROTECTED]> writes: import time y, None, d, None, None, None, None = time.localtime() I know you can't assign anything to None, but I'm sure you get what I mean, a special keyword that means I don't care about this value. You ca

Re: anonymous assignment

2008-05-11 Thread Yves Dorfsman
D'Arcy J.M. Cain wrote: On Mon, 12 May 2008 02:28:13 GMT Yves Dorfsman <[EMAIL PROTECTED]> wrote: particular case, there's got to be a better way than: d = time.local() y = d[0] d = d[1] Like this? y, d = time.local()[:2] Sorry this was a typo (again :-), I meant:

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
Gabriel Genellina wrote: Uses Python 2.6! ;) No need of 2.6 - the above code works since Python 2.2 at least: Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. import time t=time.localtime() type(t)

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
able to clean that one up. In this particular case, it doesn't really matter (small size), but imagine in a case where we are talking of a list of list, with potentially large element in the list. Yves. -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
Scott David Daniels wrote: Yves Dorfsman wrote: ... Sorry this was a typo (again :-), I meant: d = time.local() y = d[0] d = d[2] Then: y, d = list(time.localtime())[:4:2] What is this ? Could you point me to a document on this syntax ? I've tried it, it works, but I

Re: anonymous assignment

2008-05-12 Thread Yves Dorfsman
something that looks wrong, or something that could be done better we should just "get over it" ? Yves. -- http://mail.python.org/mailman/listinfo/python-list

How to subclass file

2008-05-14 Thread Yves Dorfsman
s a filename. I can provide the filename, but it will then try to re-open that file, and even if I did manage to create an object file, how do I connect the file descriptor created by os.open to my object ? Thanks. Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Producing multiple items in a list comprehension

2008-05-22 Thread Yves Dorfsman
following more elegant: list1=[1,2,3] list2=[4,5,6] reduce(lambda x, y: x+y, zip(list1, list2)) of course, zip creates tuples, so you end up with a tuple, therefore if you need for your solution to be a list: list(reduce(lambda x, y: x+y, zip(list1, list2))) of reduce(lambda x, y: x+y, list(zip(li

Re: serach file for regexp, return if found?

2008-05-22 Thread Yves Dorfsman
> how do i do: > for rows in file: > print regexp.find ## or something equiavlent Is this what you are trying to do: for row in file('/etc/services'): if re.match('^ssh', row): print row Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Producing multiple items in a list comprehension

2008-05-23 Thread Yves Dorfsman
solutions are faster than loops, that's why I tried hard not to use a loop, and "reduce" is considered functional - I should have timed it. Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove \n in the list

2008-04-14 Thread Yves Dorfsman
ad: > > lines[:] = [line.rstrip('\n') for line in lines] When I saw the original message, I immediately thought: k = [x.strip() for x in l] What is the point of the [:] after lines ? How different is it with or without it ? Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove \n in the list

2008-04-15 Thread Yves Dorfsman
are saving the time it takes to create a new list ? So this is a performance issue ? Thanks. Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

#!/usr/bin/env python vs. #!/usr/bin/python

2008-05-01 Thread Yves Dorfsman
On UNIX, some people use #!/usr/bin/env python While other use #!/usr/bin/python Why is one preferred over the other one ? Thanks. -- Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

help with list comprehension

2008-05-01 Thread Yves Dorfsman
;num': 6}, { 'colour': 'violet', 'num': 7}, { 'colour': 'grey','num': 8}, { 'colour': 'white', 'num': 9} ] def m1(): colours = [ e['colour'] for e in l ] nums= [ e['num']for e in l ] def m2(): colours = [] nums= [] for e in l: colours.append(e['colour']) nums.append(e['num']) #def m3(): # colours, nums = [ e['colour'], e['num'] for e in l ] -- Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

no cleanup on TERM signal

2008-05-01 Thread Yves Dorfsman
the script dies, but I don't get the message, so I am assuming that python isn't taking the time to cleanup, even though that is (was) what TERM was intended for. Has this been discussed before ? Is worth a suggestion (PEP) ? -- Yves. http://www.SollerS.ca -- http://mail.python.org/mai

Re: help with list comprehension

2008-05-02 Thread Yves Dorfsman
George Sakkis wrote: Another alternative is: from operator import itemgetter def m3(): colours, nums = zip(*map(itemgetter('colour','num'), l)) It's slower than m1() but faster than m2(); it's also the most concise, especially if you extract more than two keys. Good you guys gave me som

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-02 Thread Yves Dorfsman
be quite the point of the discussion. And I have to admit, I prefer specifying the version (full path) because I have run into too many problem when users have different PATHs and end up running different version of an interpreter. Yves. -- http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

slicing lists

2008-05-07 Thread Yves Dorfsman
t(':')[0,2:] for e in p ] (getting rid of the password / x field) Thanks. Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

class definition

2008-05-07 Thread Yves Dorfsman
Does it make a difference if you put subclass object or not ? What is the difference between c1 and c2 here: class c1: pass class c2(object): pass Thanks, Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: class definition

2008-05-07 Thread Yves Dorfsman
usy for a while ! Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing lists

2008-05-07 Thread Yves Dorfsman
Miles wrote: On Wed, May 7, 2008 at 7:46 PM, Ivan Illarionov > > Is there a way to do: > > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > > x[0,2:6] > > > > That would return: > > [0, 3, 4, 5, 6] Arg... Yes, this is a typo, I meant: [1, 3, 4, 5, 6] I

Re: python newbie: some surprises

2008-05-08 Thread Yves Dorfsman
if a == 3 do_something() if a == 3: do_something() And surely, it should be easy to parse by the compiler. Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing lists

2008-05-08 Thread Yves Dorfsman
ns (the one defining r and the one defining s), it means that the we're looping twice over the same list instead of once with the e[0,2:] hypotetical notation ; or am I missing something ? Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Grabbing previous iteration in a dict

2008-05-09 Thread Yves Dorfsman
(self.ordered_lines, [ e[1:] for e in x]) ) a = mydict('/some/file') a.ordered_lines a.dictionary Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: python newbie: some surprises

2008-05-09 Thread Yves Dorfsman
But one could make the same argument for curly brackets, and we seem to be doing fine without them ! I have become so used to the power of indenting in python that I keep forgetting the colon, and this is getting worse as I do more python, not better. Maybe I'll write myself a "pre-co

Re: slicing lists

2008-05-09 Thread Yves Dorfsman
,b:c,d is not; x[a,b:c,d]= x[a]+ x[b:c]+ x[d]. I'm not sure what you mean here. Could you give me a simple piece of code to show an example ? Yves. http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problem

2006-03-08 Thread Yves Glodt
#x27;é' as well :-( How am I supposed to print non-ascii characters the correct way? best regards, Yves > Sebastjan > > On 3/3/06, Yves Glodt <[EMAIL PROTECTED]> wrote: >> Hi list, >> >> >> Playing with the great pysvn I get this problem: >>

Why won't Python 2/3 compile when I have valgrind installed?

2013-05-24 Thread Yves S. Garret
This isn't a huge issue, but I'm wondering. I'm running Mac OS X, I tried to configure with --with-valgrind and this is the error that I got: configure: error: Valgrind support requested but headers not available Now, I have valgrind installed, so it should work, yes? If someone has any extra in

Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
Hello all, This is my dilemma, I'm trying to get the generated JSON file using the bing api search. This is the code that I'm executing from inside the shell: http://bin.cakephp.org/view/460660617 The port doesn't matter to me. Thoughts? -- http://mail.python.org/mailman/listinfo/python-list

Re: Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
This is the format that I've been following: http://gavinmhackeling.com/blog/2012/05/using-the-bing-search-api-in-python/ If I execute the specified query from a browser, the JSON file shows up without a problem. Now, I'd like to do that programmatically. On Thu, Jun 13, 2013 at 4:5

Re: Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
, 401, 'The authorization type you provided is not > supported. Only Basic and OAuth are supported', > > > > > > On Jun 13, 2013, at 2:31 PM, Yves S. Garret > wrote: > > This is the format that I've been following: > > http://gavinmhackeling.com/blog/2012/0

Re: Having a hard time to 'get' bing api search results

2013-06-13 Thread Yves S. Garret
r welcome. > > > To be honest I am not 100% on the differences between. > > I could be off, but I recall urllib2 was a more refined version of urllib. > > Yet it seems like urllib works better for me, when I need to do a simple > call like this. > > > -Kevin > >

Re: Having a hard time to 'get' bing api search results

2013-06-14 Thread Yves S. Garret
; so maybe it got messed up moving it around? > > > > > > On Jun 14, 2013, at 10:53 AM, "Yves S. Garret" > wrote: > > Hi Kevin, still more of the same: > http://bin.cakephp.org/view/1358843680 > > The file _is_ there. I did check the JSON file,

n00b question on spacing

2013-06-21 Thread Yves S. Garret
Hi, I have a question about breaking up really long lines of code in Python. I have the following line of code: log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider) Given the fact that it goes off very far to the

Re: n00b question on spacing

2013-06-21 Thread Yves S. Garret
On Fri, Jun 21, 2013 at 5:48 PM, Ray Cote wrote: > > -- > > *From: *"Yves S. Garret" > *To: *python-list@python.org > *Sent: *Friday, June 21, 2013 5:17:28 PM > *Subject: *n00b question on spacing > > > Hi, I have a question abo

Unable to compile Python 2.7.3 in Cygwin

2012-09-11 Thread Yves S. Garret
Hi, I'm trying to compile Python in Cygwin, with little luck. I've posted the ugliness in this link. Thoughts? http://bin.cakephp.org/view/176472400 -- http://mail.python.org/mailman/listinfo/python-list

Good web-development Python book

2012-03-23 Thread Yves S. Garret
Hello, I'm trying to brush up on my Python and would like to -- http://mail.python.org/mailman/listinfo/python-list

Good web-development Python book

2012-03-23 Thread Yves S. Garret
Oooops! Sent my previous e-mail too soon! Didn't mean to. Another try. Hello, I'm trying to brush up on my Python and would like to learn how to make web-apps. I was hoping to get a good book on learning how to make web-applications using Python (as opposed to something like PHP) without a

Re: [TIP] Anyone still using Python 2.5?

2011-12-21 Thread Pierre-Yves David
or almost 1 year now and current LTS (Lucid) ship 2.6. If you don't plan to support 2.4, supporting 2.5 does not seems a priority. -- Pierre-Yves David http://www.logilab.fr/ signature.asc Description: Digital signature -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >