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

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

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: 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

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: 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,

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-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
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

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

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

Re: [Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Yves S. Garret
On Monday, March 18, 2013 2:39:57 PM UTC-4, Lele Gaifax wrote: > "Yves S. Garret" writes: > > > I have. This is what I did and the result that I'm seeing. > > > > $ sudo apt-get install python3-tk > > You installed a "custom" python 3.3

Re: [Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Yves S. Garret
PM, Ritchie Flick wrote: > Seems tkinter is missing in standard installation in ubuntu. Try: > sudo apt-get install python3-tk > > > On Mon, Mar 18, 2013 at 6:17 PM, Yves S. Garret < > yoursurrogate...@gmail.com> wrote: > >> Hi. I'm having a problem trying to

[Python 3.3.0] Getting tkinter to work on Python 3

2013-03-18 Thread Yves S. Garret
Hi. I'm having a problem trying to get this to work well. Basically, whenever I try to import tkinter, this is the issue that I have: >>> import tkinter Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.3/tkinter/__init__.py", line 40, in import _tkint

Re: What are some other way to rewrite this if block?

2013-03-18 Thread Yves S. Garret
On Monday, March 18, 2013 9:56:16 AM UTC-4, Santosh Kumar wrote: > This simple script is about a public transport, here is the code: > > > > def report_status(should_be_on, came_on): > > if should_be_on < 0.0 or should_be_on > 24.0 or came_on < 0.0 or > > came_on > 24.0: > > retur

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
I don't get why it's posting what I said twice... -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
On Sunday, March 17, 2013 9:28:56 PM UTC-4, Roy Smith wrote: > In article <485a3093...@googlegroups.com>, > > "Yves S. Garret" wrote: > > > > > N00b question. But here is the code: > > > > > > http://bin.cakephp.org/view/7092018

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
On Sunday, March 17, 2013 9:18:12 PM UTC-4, Gary Herron wrote: > On 03/17/2013 05:58 PM, Yves S. Garret wrote: > > > N00b question. But here is the code: > > > > > > http://bin.cakephp.org/view/709201806 > > > > > > In the first example

[Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
N00b question. But here is the code: http://bin.cakephp.org/view/709201806 In the first example, the first for-loop is run and then the list is assigned to the tricky variable. But, what happens in the second example? Does the loop after "in" get run only once or multiple number of times? -

Having a hard time installing pygame on Win7.

2013-03-16 Thread Yves S. Garret
Hi all, got a small problem. As I'm going through "Python Programming for the Absolute Beginner", I got to chapter 11 and as I'm working through it, I can't seem to get pygame/livewires installed... I don't even know how to go about installing it (the book is skimpy on details). I'm using Pyt

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
On Saturday, March 16, 2013 11:23:07 AM UTC-4, Chris Angelico wrote: > On Sun, Mar 17, 2013 at 2:16 AM, Yves S. Garret > > wrote: > > > In the example that I have posted from the book it works just fine. > > > > Yep, I just checked the book's version aga

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
On Saturday, March 16, 2013 11:08:24 AM UTC-4, Chris Angelico wrote: > On Sun, Mar 17, 2013 at 1:53 AM, Yves S. Garret > > wrote: > > > Hi all, I'm well into "Python Programming for the Absolute Beginner" in > > order to > > > become more acqua

Re: What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
On Saturday, March 16, 2013 11:10:07 AM UTC-4, Mitya Sirenef wrote: > On 03/16/2013 10:53 AM, Yves S. Garret wrote: > > > Hi all, I'm well into "Python Programming for the Absolute Beginner" in > > order to > > > become more acquainted with the langu

What am I doing wrong in this simple tkinter example?

2013-03-16 Thread Yves S. Garret
Hi all, I'm well into "Python Programming for the Absolute Beginner" in order to become more acquainted with the language. However, when I got to page 304 and did my first example: http://bin.cakephp.org/view/1107093008 And this is the error that I'm getting: http://bin.cakephp.org/view/3997

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
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

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

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

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: 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

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-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/

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: 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.

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

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: [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

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.

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

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

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

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

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

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: 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: 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-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

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: 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

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
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
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-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-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

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: 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

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: 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: 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: 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: 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: 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-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: 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

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

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

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

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

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

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

#!/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

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

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

UML reverse engineering

2008-04-04 Thread pierre-yves . dupont
Hello, Do you know a free software witch can compute a UML class diagram from a python code. I tested many free UML softwares like BoUML, ArgoUML, Dia, PNSource (not found), UMLet and others ... But I didn't found what I needed. -- Pierre-Yves Dupont-- http://mail.python.org/ma

HELP PARAMETERS IN SQL QUERY

2007-04-13 Thread pierre-yves guido
hello, I'm doing a training course and I'm a newbie in Python. My problem : I have a form, and when I click, I make an update. But all the parameters are all required to make the update. So I'd like to put in my code something like [optional]... My code (simplyfied) : prg.ev_ind_update(wf_pk_ev_

help

2007-04-13 Thread pierre-yves guido
hello (I hope my english is not so bad), I'm doing a training course and I'm a newbie in Python. My problem : I have a form, and when I click, I make an update. But all the parameters are all required to make the update. So I'd like to put in my code something like [optional]... My code (simply

schedule at specific hours

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

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

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

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

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

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

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: >>

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

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

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: 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 = &#

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: 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

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
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..

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'

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

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

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

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

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: 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

[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: 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,

  1   2   >