Twisted: 1 thread in the reactor pattern

2009-09-22 Thread jacopo
I am diving into Twisted and Perspective Broker (PB) in particular and I would like to understand more about what happens behind the curtains. Say I have a client and a server on two different machines, the server gets callRemote()’s in an asynchronous way, these requests are parked in a queue and

Twisted 100% event driven or hybrid?

2009-09-22 Thread jacopo
I am diving into Twisted and Perspective Broker (PB) in particular. I am designing a system having several models running on different machines, they need to be recalculated periodically, I have to collect the results, process them and start again from the beginning. It is not clear to me if I ca

Logging question

2009-09-22 Thread Gabor Urban
Hi guys, I have embarassing problem using the logging module. I would like to encapsulate the creation and setting up of the logger in a class, but it does not seem working. Here are my relevant parts of the code: -- import sys import logging class LogClass: def __init__(self, fileName, lo

Very simple finite automaton (?)

2009-09-22 Thread kpp9c
Very simple finite automaton (?) I am not sure if this is and example of Finite Automaton or a Finite State Machine or perhaps it is related to a transition table or markov process. I am not a math person so i am not sure what it is called. I googled around and got lots of super complicated gobble

Socket Programming through Proxy

2009-09-22 Thread Arnab Chakraborty
I have written client-server programs in python. They seem to be working fine in the same computer, even on two different computers when directly connected through a Lan wire, but it wouldn't work in my college LAN. I think it is due to the proxy server through which all the computers in our LAN ne

Re: Dynamic Form

2009-09-22 Thread BJ Swope
If you are trying to avoid the browser caching the pages so that they fetch a new copy of the page every time, add the following 2 meta tags to the header of the html page: Those don't guarantee that the browser won't cache the page but it should help the situation. If on the other hand, you o

Re: socket send O(N**2) complexity

2009-09-22 Thread Steven D'Aprano
On Wed, 23 Sep 2009 00:25:52 +0100, Nobody wrote: > On Mon, 21 Sep 2009 16:33:08 -0400, Jack Diederich wrote: > >>> AIUI, as a python string is imutable, a slice of a string is a new >>> string which points (C char *) to the start of the slice data and with >>> a length that is the length of the

Re: Combining sets/dictionaries

2009-09-22 Thread alex23
On Sep 23, 12:44 pm, alex23 wrote: > Alfons Nonell-Canals wrote: > > finally I've solved it using a "combinatorics" library which allows to > > do this kind of things. > > If you're using a version of Python > 2.6 you might find that > itertools.combinations does what you want without requiring t

Re: Combining sets/dictionaries

2009-09-22 Thread alex23
Alfons Nonell-Canals wrote: > finally I've solved it using a "combinatorics" library which allows to > do this kind of things. If you're using a version of Python > 2.6 you might find that itertools.combinations does what you want without requiring the additional code. -- http://mail.python.org/

Re: pygui - showing an image

2009-09-22 Thread David Robinow
On Tue, Sep 22, 2009 at 9:26 PM, kyle schalm wrote: > hello, i wonder what the chances are that anyone here uses pygui? > it looks pretty good, but i just started using it (version 2.05) and > can't figure out how to just display a window with an image in it. i > tried: > > image = Image('foo.png'

pygui - showing an image

2009-09-22 Thread kyle schalm
hello, i wonder what the chances are that anyone here uses pygui? it looks pretty good, but i just started using it (version 2.05) and can't figure out how to just display a window with an image in it. i tried: image = Image('foo.png') window.place(image) -- error message window.add(image) -- no

Re: custom data warehouse in python vs. out-of-the-box ETL tool

2009-09-22 Thread snfctech
Thanks for your replies, Sean and Martin. I agree that the ETL tools are complex in themselves, and I may as well spend that learning curve on a lower-level tool-set that has the added value of greater flexibility. Can you suggest a good book or tutorial to help me build a data warehouse in pytho

Re: set breakpoint in another module/file

2009-09-22 Thread millerdev
> I think winpdb ( nothing todo with windows-OS ) can do that and much more. The problem with winpdb (which I played with a long time ago) is that it's much heavier than the built-in pdb--it's a GUI debugger. It requires the beast called wx, which I do not use for web (or GUI) development. I'm do

Re: Searching a large dictionary

2009-09-22 Thread Dave Angel
Support Desk wrote: I need help searching a large python dictionary. The dictionary is setup like so Key[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}] Key2[{'item':value,'item2':value,'item3':value,'item4':value,

Re: How can I tell if variable is defined

2009-09-22 Thread Dave Angel
Mel wrote: This is an artifact of the interactive interpreter, True. You can avoid the artifact by wrapping the test in a function: Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

Re: difficulty in understanding rsplit(None,1)[1]

2009-09-22 Thread nopsidy
lol -nop nop nop -- http://mail.python.org/mailman/listinfo/python-list

Re: socket send O(N**2) complexity

2009-09-22 Thread Jack Diederich
On Tue, Sep 22, 2009 at 7:25 PM, Nobody wrote: > On Mon, 21 Sep 2009 16:33:08 -0400, Jack Diederich wrote: > >>> AIUI, as a python string is imutable, a slice of a string is a >>> new string which points (C char *) to the start of the slice data >>> and with a length that is the length of the slic

Re: difficulty in understanding rsplit(None,1)[1]

2009-09-22 Thread Martin P. Hellwig
John Machin wrote: On Sep 22, 7:10 pm, hrishy wrote: Hi Martin Many thanks And by the way great way to explain that thing great way to find out for yourself faster than waiting for a response from the internet ;-) I have been called many things in the past but being labeled 'the internet'

Re: socket send O(N**2) complexity

2009-09-22 Thread Nobody
On Mon, 21 Sep 2009 16:33:08 -0400, Jack Diederich wrote: >> AIUI, as a python string is imutable, a slice of a string is a >> new string which points (C char *) to the start of the slice data >> and with a length that is the length of the slice, about 8 bytes >> on 32 bit machine. > > Not in CPy

Solved - Python: automate input to MySQL query

2009-09-22 Thread Threader Slash
Hi Dennis, You're right. Putting """ allows indentation. Great! About putting the name of the table: x.travelerID, etc.. I think it keep the query more documented, specially when you are dealing with 5 tables in a same query, like this query. Cheers.. Threader. -- Forwarded message -

Re: Searching a large dictionary

2009-09-22 Thread Chris Rebert
> -Original Message- > From: Chris Rebert > Sent: Tuesday, September 22, 2009 5:35 PM > To: Support Desk > Cc: python-list@python.org > Subject: Re: Searching a large dictionary >> On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: >>> On Tue, Sep 22, 2009 at 2:50 PM, Support Desk >>>

Re: Searching a large dictionary

2009-09-22 Thread Chris Rebert
> On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: >> On Tue, Sep 22, 2009 at 2:50 PM, Support Desk >> wrote: >> > I need help searching a large python dictionary. The dictionary is setup >> > like so >> > >> > >> > Key[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','i

Re: .h files?

2009-09-22 Thread rogerdpack4
> What python distributions are you referring to? The ones I know don't > make this distinction; there is only a single set of header files that > you can choose to install. Ok good to know. -r -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching a large dictionary

2009-09-22 Thread Simon Forman
On Tue, Sep 22, 2009 at 6:30 PM, Support Desk wrote: > Chris,  Yes that is the correct syntax, thanks > Okay, but correct syntax of what? Help us help you. > On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: >> >> On Tue, Sep 22, 2009 at 2:50 PM, Support Desk >> wrote: >> > I need help se

Re: Searching a large dictionary

2009-09-22 Thread Support Desk
Chris, Yes that is the correct syntax, thanks On Tue, Sep 22, 2009 at 5:22 PM, Chris Rebert wrote: > On Tue, Sep 22, 2009 at 2:50 PM, Support Desk > wrote: > > I need help searching a large python dictionary. The dictionary is setup > > like so > > > > > Key[{'item':value,'item2':value,'item3'

Re: Searching a large dictionary

2009-09-22 Thread Simon Forman
On Tue, Sep 22, 2009 at 5:50 PM, Support Desk wrote: > I need help searching a large python dictionary. The dictionary is setup > like so > > Key[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}] > > Key2[{'item':value,

Re: Searching a large dictionary

2009-09-22 Thread Chris Rebert
On Tue, Sep 22, 2009 at 2:50 PM, Support Desk wrote: > I need help searching a large python dictionary. The dictionary is setup > like so > > Key[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}] > > Key2[{'item':value,

Re: Not this one the other one, from a dictionary

2009-09-22 Thread Vlastimil Brom
Thanks for the elaboration; in retrospect, given the simple requirement, that there are only two dict keys, one of which is know and the other to be determined, maybe just the direct dict methods are appropriate, e.g. d = {'a': 'bob', 'b': 'stu'} d_copy = dict(d) d_copy.pop("a") 'bob' d_copy.popit

Re: DBHandler class for logging?

2009-09-22 Thread Diez B. Roggisch
kj schrieb: In <7hsukcf2tqht...@mid.uni-berlin.de> "Diez B. Roggisch" writes: kj schrieb: I've come across mentions of a mythical class of logging handlers called DBHandler, but I can't find it anywhere. Could someone please point me in the right direction? (FWIW, I'm looking for ways to l

Re: Read header and data from a binary file

2009-09-22 Thread MRAB
Jose Rafael Pacheco wrote: Hello, I want to read from a binary file called myaudio.dat Then I've tried the next code: import struct name = "myaudio.dat" f = open(name,'rb') f.seek(0) chain = "< 4s 4s I 4s I 20s I I i 4s I 67s s 4s I" s = f.read(4*1+4*1+4*1+4*1+4*1+20*1+4*1+4*1+4*1+4*1+4*1+67*1+

Re: Read header and data from a binary file

2009-09-22 Thread Simon Forman
On Tue, Sep 22, 2009 at 4:30 PM, Jose Rafael Pacheco wrote: > Hello, > > I want to read from a binary file called myaudio.dat > Then I've tried the next code: > > import struct > name = "myaudio.dat" > f = open(name,'rb') > f.seek(0) Don't bother to seek(0) on a file you just opened. > chain = "

Re: custom data warehouse in python vs. out-of-the-box ETL tool

2009-09-22 Thread Sean DiZazzo
On Sep 22, 1:00 pm, snfctech wrote: > Does anyone have experience building a data warehouse in python?  Any > thoughts on custom vs using an out-of-the-box product like Talend or > Informatica? > > I have an integrated system Dashboard project that I was going to > build using cross-vendor joins o

Searching a large dictionary

2009-09-22 Thread Support Desk
I need help searching a large python dictionary. The dictionary is setup like so Key[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6':value,'item7':value,'item8':value,'item9':value}] Key2[{'item':value,'item2':value,'item3':value,'item4':value,'item5':value','item6'

Re: DBHandler class for logging?

2009-09-22 Thread kj
In <7hsukcf2tqht...@mid.uni-berlin.de> "Diez B. Roggisch" writes: >kj schrieb: >> I've come across mentions of a mythical class of logging handlers >> called DBHandler, but I can't find it anywhere. >> >> Could someone please point me in the right direction? >> >> (FWIW, I'm looking for ways t

Re: DBHandler class for logging?

2009-09-22 Thread Diez B. Roggisch
kj schrieb: I've come across mentions of a mythical class of logging handlers called DBHandler, but I can't find it anywhere. Could someone please point me in the right direction? (FWIW, I'm looking for ways to log messages to PostgreSQL RDBMS.) I'm not aware such a thing is part of the stand

DBHandler class for logging?

2009-09-22 Thread kj
I've come across mentions of a mythical class of logging handlers called DBHandler, but I can't find it anywhere. Could someone please point me in the right direction? (FWIW, I'm looking for ways to log messages to PostgreSQL RDBMS.) TIA! kynn -- http://mail.python.org/mailman/listinfo/pyth

Re: How can I tell if variable is defined

2009-09-22 Thread Mel
Peter Otten wrote: > Mel wrote: >> Grant Edwards wrote: >>> On 2009-09-22, Brown, Rodrick wrote: >>> How could I do the following check in Python In Perl I could do something like if ((defined($a)) { ... } >>> [ ... ] > This is an artifact of the interactive interpreter, True.

Re: set breakpoint in another module/file

2009-09-22 Thread Stef Mientki
Daniel wrote: Is there a way with pdb to set a breakpoint in another module directly using a command similar to set_trace() ? For example, I'd like to do something like this in my source code: import pdb pdb.setbreak(42, "/path/to/universe.py", "name == 'hitchhiker'") I think winpdb ( nothi

Re: How can I tell if variable is defined

2009-09-22 Thread Peter Otten
Mel wrote: > Grant Edwards wrote: > >> On 2009-09-22, Brown, Rodrick wrote: >> >>> How could I do the following check in Python >>> >>> In Perl I could do something like if ((defined($a)) { ... } >> >> try: >> yourNameHere >> except NameError: >> print "undefined" >> else: >> print

set breakpoint in another module/file

2009-09-22 Thread Daniel
Is there a way with pdb to set a breakpoint in another module directly using a command similar to set_trace() ? For example, I'd like to do something like this in my source code: import pdb pdb.setbreak(42, "/path/to/universe.py", "name == 'hitchhiker'") Is there a way to do (something like) that

Re: How can I tell if variable is defined

2009-09-22 Thread Peter Otten
Brown, Rodrick wrote: > How could I do the following check in Python > > In Perl I could do something like if ((defined($a)) { ... } > > I tried if var is not None: > However this doesn't seem to work as described. But in Python this often is the most idiomatic way to check whether a variable

Read header and data from a binary file

2009-09-22 Thread Jose Rafael Pacheco
Hello, I want to read from a binary file called myaudio.dat Then I've tried the next code: import struct name = "myaudio.dat" f = open(name,'rb') f.seek(0) chain = "< 4s 4s I 4s I 20s I I i 4s I 67s s 4s I" s = f.read(4*1+4*1+4*1+4*1+4*1+20*1+4*1+4*1+4*1+4*1+4*1+67*1+1+4*1+4*1) a = struct.unpack(

Re: How can I tell if variable is defined

2009-09-22 Thread Mel
Grant Edwards wrote: > On 2009-09-22, Brown, Rodrick wrote: > >> How could I do the following check in Python >> >> In Perl I could do something like if ((defined($a)) { ... } > > try: > yourNameHere > except NameError: > print "undefined" > else: > print "defined" This being Pytho

Re: How can I tell if variable is defined

2009-09-22 Thread Dave Angel
Brown, Rodrick wrote: How could I do the following check in Python In Perl I could do something like if ((defined($a)) { ... } I tried if var is not None: However this doesn't seem to work as described. Thanks. try/except Or look up the attribute in the appropriate dictionary(ies). de

custom data warehouse in python vs. out-of-the-box ETL tool

2009-09-22 Thread snfctech
Does anyone have experience building a data warehouse in python? Any thoughts on custom vs using an out-of-the-box product like Talend or Informatica? I have an integrated system Dashboard project that I was going to build using cross-vendor joins on existing DBs, but I keep hearing that a data w

Re: Module inspection by name

2009-09-22 Thread Dave Angel
Jean-Michel Pichavant wrote: Nadav Chernin wrote: Hi all, a have easy question for python developers. Assume I have list of all objects: obj=dir() Now I want to know which object from “obj” list is module. I searched some method in module inspection, but there is not any method that get ‘s

Re: Substitute for KConfig in Qt4

2009-09-22 Thread nusch
On Sep 22, 3:43 pm, David Boddie wrote: > On Sat Sep 19 12:18:40 CEST 2009, nusch wrote: > > > On Sep 19, 3:53 am, David Boddie wrote: > > > On Thursday 17 September 2009 13:04, nusch wrote: > > > > I want to remove pyKDE dependencies from my app to make it pure PyQt. > > > > What will be the bes

Re: How can I tell if variable is defined

2009-09-22 Thread Grant Edwards
On 2009-09-22, Brown, Rodrick wrote: > How could I do the following check in Python > > In Perl I could do something like if ((defined($a)) { ... } try: yourNameHere except NameError: print "undefined" else: print "defined" > I tried if var is not None: > However this doesn't seem t

Re: How can I tell if variable is defined

2009-09-22 Thread Rami Chowdhury
On Tue, 22 Sep 2009 11:03:25 -0700, Brown, Rodrick wrote: How could I do the following check in Python In Perl I could do something like if ((defined($a)) { ... } I tried if var is not None: However this doesn't seem to work as described. Thanks. Could you let us know in what context yo

Re: How can I tell if variable is defined

2009-09-22 Thread Sean DiZazzo
On Sep 22, 11:03 am, "Brown, Rodrick " wrote: > How could I do the following check in Python > > In Perl I could do something like if ((defined($a)) { ... } > > I tried if var is not None: > However this doesn't seem to work as described. > > Thanks. try: var except NameError: handle_it()

How can I tell if variable is defined

2009-09-22 Thread Brown, Rodrick
How could I do the following check in Python In Perl I could do something like if ((defined($a)) { ... } I tried if var is not None: However this doesn't seem to work as described. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Set literal confusion

2009-09-22 Thread Peter Otten
Dennis Lee Bieber wrote: > range() is what used to be xrange() -- an on-demand generator of > values. You created a set containing a single generator. Try something > like: > > 5 in {list(range(10))} No. {expr} is always a set with a single element. >>> {range(10)} {range(0, 10)} That element

Re: Set literal confusion

2009-09-22 Thread Vlastimil Brom
2009/9/22 kaoruAngel : > I recently decided to implement a small project in python after being > away from the language for a while, so, in learning the language over > again, I experimented. > > --- > Python 3.1.1 (r311:74483, Aug 17 2009, 16:45:59) [MSC v.1500

Re: Set literal confusion

2009-09-22 Thread Peter Otten
kaoruAngel wrote: > I recently decided to implement a small project in python after being > away from the language for a while, so, in learning the language over > again, I experimented. > > --- > Python 3.1.1 (r311:74483, Aug 17 2009, 16:45:59) [MSC v.1500 64

Re: Not this one the other one, from a dictionary

2009-09-22 Thread Jean Daniel
Building on the answers of the others, a simple one liner, no side effect, not the fastest I guess: >>> d={'a': 'bob', 'b': 'stu'} >>> set( d.keys() ).difference( [ 'a' ] ).pop() 'b' Note the square brackets for the parameter of difference(). 'The string 'a' and the list [ 'a' ] are both iterable

Re: easy question, how to double a variable

2009-09-22 Thread Xavier Ho
On Tue, Sep 22, 2009 at 11:58 PM, Mahmoud Abdelkader wrote: > hi looking for help catching up in a class and overall to get me better > than i am now. I can pay you by the week or per hour. > Wow. I'd feel guilty getting paid doing that. Sounds all too easy. I hope he is actually learning, not j

Set literal confusion

2009-09-22 Thread kaoruAngel
I recently decided to implement a small project in python after being away from the language for a while, so, in learning the language over again, I experimented. --- Python 3.1.1 (r311:74483, Aug 17 2009, 16:45:59) [MSC v.1500 64 bit (AMD64)] on win32 >>> 5 in

Re: Dynamic Form

2009-09-22 Thread Victor Subervi
Well it's Web stuff, sure, but it's written in python :) The code follows. The problem is that I haven't figured out how to tell the program that the user has entered data and to clear the cache of that data so that it's not re-entered. How do I do that? TIA, Victor #!/usr/bin/python import cgitb

Re: entry widget won't validate

2009-09-22 Thread Mike
On Sep 22, 4:29 am, Peter Otten <__pete...@web.de> wrote: > Mike wrote: > > On Sep 21, 12:47 pm, Peter Otten <__pete...@web.de> wrote: > >> Mike wrote: > >> > I'm trying to arrange for an Entry widget to check whether its data > >> > is all digits and whether the number represented is small enough.

Re: Finding application data after install - a solution?

2009-09-22 Thread Wolodja Wentland
On Tue, Sep 22, 2009 at 07:42 -0700, Aahz wrote: > >I want to: > > > >1. Give administrators the freedom to install the data wherever they > > want > >2. Adhere to the FHS (installing data within modules breaks it) > >3. Be able to find that data again regardless of the installati

Re: Module inspection by name

2009-09-22 Thread Jean-Michel Pichavant
Nadav Chernin wrote: Hi all, a have easy question for python developers. Assume I have list of all objects: obj=dir() Now I want to know which object from “obj” list is module. I searched some method in module inspection, but there is not any method that get ‘string’ as parameters Any rep

Module inspection by name

2009-09-22 Thread Nadav Chernin
Hi all, a have easy question for python developers. Assume I have list of all objects: obj=dir() Now I want to know which object from "obj" list is module. I searched some method in module inspection, but there is not any method that get 'string' as parameters Any reply will be

Re: Dynamic Form--Potential purge cache?

2009-09-22 Thread bouncy...@gmail.com
Personally that sounds like the data needs to be deliberately oveerittren in the form. That or the cache has to be cleared by a remote instruction. Unfortunately I know how to do neither :[ --Original Message-- From: Simon Forman To: Date: Tue, 22 Sep 2009 11:34:25 AM -0400 Subject: Re

Re: Dynamic Form

2009-09-22 Thread Simon Forman
On Tue, Sep 22, 2009 at 10:46 AM, Victor Subervi wrote: > Hi; > I have a dynamic form in which I do the following: > 1) Request two fields (company name, number of entries). That is sent back > to the form. > 2) If the two fields are not None, the form requests other data. That, too, > is sent bac

Re: easy question, how to double a variable

2009-09-22 Thread Hyuga
On Sep 22, 9:57 am, Grant Edwards wrote: > On 2009-09-22, Mel wrote: > > > Tim Roberts wrote: > > >> daggerdvm wrote: > > >>>carl banks.you are a dork > > >> What are you, eleven years old? > > >> Look, you asked us to answer for you what is CLEARLY a homework question. > >> It is unethi

Re: OK to memoize re objects?

2009-09-22 Thread Hyuga
On Sep 21, 11:02 am, Nobody wrote: > On Mon, 21 Sep 2009 07:11:36 -0700, Ethan Furman wrote: > > Looking in the code for re in 2.5: > > _MAXCACHE = 100 > > On the other hand, I (a > > re novice, to be sure) have only used between two to five in any one > > program... it'll be a while before I hit

Dynamic Form

2009-09-22 Thread Victor Subervi
Hi; I have a dynamic form in which I do the following: 1) Request two fields (company name, number of entries). That is sent back to the form. 2) If the two fields are not None, the form requests other data. That, too, is sent back to the form. 3) That new data is then entered into a MySQL table. T

Re: Finding application data after install - a solution?

2009-09-22 Thread Aahz
In article , Wolodja Wentland wrote: > >I want to: > >1. Give administrators the freedom to install the data wherever they > want >2. Adhere to the FHS (installing data within modules breaks it) >3. Be able to find that data again regardless of the installation > scheme use

Re: Combining sets/dictionaries

2009-09-22 Thread Alfons Nonell-Canals
Hello, finally I've solved it using a "combinatorics" library which allows to do this kind of things. Here, here is an example: http://automatthias.wordpress.com/2007/04/28/cartesian-product-of-multiple-sets/ Thanks for your suggestions. Regards, Alfons. Carl Banks wrote: > On Sep 22, 3:

Re: easy question, how to double a variable

2009-09-22 Thread Grant Edwards
On 2009-09-22, Mel wrote: > Tim Roberts wrote: > >> daggerdvm wrote: >>> >>>carl banks.you are a dork >> >> What are you, eleven years old? >> >> Look, you asked us to answer for you what is CLEARLY a homework question. >> It is unethical for you to ask that, and it is unethical for us

Re: easy question, how to double a variable

2009-09-22 Thread Mahmoud Abdelkader
http://codingforums.com/showthread.php?s=e26b8b0aabc69745ef24a855b1a0fc83&t=177529 It seems that this dude really is looking for how to double a variable... """ hi looking for help catching up in a class and overall to get me better than i am now. I can pay you by the week or per hour. everythin

Re: Combining sets/dictionaries

2009-09-22 Thread Carl Banks
On Sep 22, 3:08 am, Alfons Nonell-Canals wrote: > Hello, > I have different sets/dictionaries/lists (whatever you want because I > can convert them easily) and I would like to combine them. I don't want > a consensus and something like it. I'd need to combine all elements of > the first one with t

Re: Substitute for KConfig in Qt4

2009-09-22 Thread David Boddie
On Sat Sep 19 12:18:40 CEST 2009, nusch wrote: > On Sep 19, 3:53 am, David Boddie wrote: > > On Thursday 17 September 2009 13:04, nusch wrote: > > > I want to remove pyKDE dependencies from my app to make it pure PyQt. > > > What will be the best substitute for KConfig? > > > > What exactly do you

Re: problem in encryption

2009-09-22 Thread Piet van Oostrum
> jayshree (j) wrote: >j> hello , >j> The community members, >j> Using following code : >j> fileHandle = open ('jay1key.py','wb') >j> #fileHandle = open ('jay1key.pem',rb).read() >j> print fileHandle.write (data) #data variable is contains the key >j> fileHandle.close() >j> otp = 'jyshri

Re: easy question, how to double a variable

2009-09-22 Thread Ben Finney
Mel writes: > Tim Roberts wrote: > > Look, you asked us to answer for you what is CLEARLY a homework > > question. It is unethical for you to ask that, and it is unethical > > for us to answer it. > > Forget ethical. We can do his homework for him, we can perhaps pass > exams for him, maybe gradu

Re: Not this one the other one, from a dictionary

2009-09-22 Thread Sion Arrowsmith
Vlastimil Brom wrote: other_key = (set(data_dict.iterkeys()) - set([not_wanted_key,])).pop() other_key = set(data_dict.iterkeys()).difference([not_wanted]).pop() saves you the construction of an unnecessary set instance. At the cost of a bit more verbosity, you can get rid of a second set:

Re: Combining sets/dictionaries

2009-09-22 Thread Mel
Alfons Nonell-Canals wrote: > Hello, > I have different sets/dictionaries/lists (whatever you want because I > can convert them easily) and I would like to combine them. I don't want > a consensus and something like it. I'd need to combine all elements of > the first one with the all elements of t

Re: easy question, how to double a variable

2009-09-22 Thread Mel
Tim Roberts wrote: > daggerdvm wrote: >> >>carl banks.you are a dork > > What are you, eleven years old? > > Look, you asked us to answer for you what is CLEARLY a homework question. > It is unethical for you to ask that, and it is unethical for us to answer > it. Forget ethical. We c

Re: Combining sets/dictionaries

2009-09-22 Thread Adrien
Hi, Did you try the list.update() builtin function ? Regards Peter Otten a écrit : > Alfons Nonell-Canals wrote: > >> I have different sets/dictionaries/lists (whatever you want because I >> can convert them easily) and I would like to combine them. I don't want >> a consensus and something lik

Re: socket send O(N**2) complexity

2009-09-22 Thread Antoine Pitrou
twistedmatrix.com> writes: > > To the OP, you can get view-like behavior with the "buffer" builtin. And, on Python 3 (or even the 2.7 in development), you can use the "memoryview" builtin for similar effect. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter - Text - bullets

2009-09-22 Thread eb303
On Sep 22, 7:45 am, Thomas Lehmann wrote: > > This is probably why you had all these alignment problems. But it's > > weird, because the script I posted is copied and pasted from a really > > script that I've run, and which doesn't cause any error. What is the > > version of tcl/tk used by your Tk

Re: easy question, how to double a variable

2009-09-22 Thread koranthala
On Sep 21, 1:27 am, daggerdvm wrote: >  Write the definition of a function  twice , that receives an  int > parameter and returns an  int that is twice the value of the > parameter. > > how can i do this Please note that most mails here are humorous - as should be expected for a language named af

Re: Combining sets/dictionaries

2009-09-22 Thread Peter Otten
Alfons Nonell-Canals wrote: > I have different sets/dictionaries/lists (whatever you want because I > can convert them easily) and I would like to combine them. I don't want > a consensus and something like it. I'd need to combine all elements of > the first one with the all elements of the second

Combining sets/dictionaries

2009-09-22 Thread Alfons Nonell-Canals
Hello, I have different sets/dictionaries/lists (whatever you want because I can convert them easily) and I would like to combine them. I don't want a consensus and something like it. I'd need to combine all elements of the first one with the all elements of the second one and third,... the numbers

Re: entry widget won't validate

2009-09-22 Thread Peter Otten
Mike wrote: > On Sep 21, 12:47 pm, Peter Otten <__pete...@web.de> wrote: >> Mike wrote: >> > I'm trying to arrange for an Entry widget to check whether its data >> > is all digits and whether the number represented is small enough. >> > The validate function seem to be called once at startup and n

Re: difficulty in understanding rsplit(None,1)[1]

2009-09-22 Thread hrishy
Hi Martin Many thanks And by the way great way to explain that thing --- On Tue, 22/9/09, Martin P. Hellwig wrote: > From: Martin P. Hellwig > Subject: Re: difficulty in understanding rsplit(None,1)[1] > To: python-list@python.org > Date: Tuesday, 22 September, 2009, 9:52 AM > hrishy wrote: >

Re: easy question, how to double a variable

2009-09-22 Thread Donn
On Monday 21 September 2009 22:49:50 daggerdvm wrote: > you brain needs error checking! try: return response() except Troll,e: raise dontFeed(anymore=True) \d -- home: http://otherwise.relics.co.za/ 2D vector animation : https://savannah.nongnu.org/projects/things/ Font manager : https://savann

Re: difficulty in understanding rsplit(None,1)[1]

2009-09-22 Thread Martin P. Hellwig
hrishy wrote: Hi What does rsplit(None,1)[1] accomplish. Can somebody please decompose that to me. regards Sure: >>> test = 'This is a test' >>> help(test.rsplit) Help on built-in function rsplit: rsplit(...) S.rsplit([sep [,maxsplit]]) -> list of strings Return a list of the word

Re: problem in encryption

2009-09-22 Thread jayshree
On Sep 22, 1:44 pm, jayshree wrote: > hello , > The community members, > > Using following code  : > > fileHandle = open ('jay1key.py','wb') > #fileHandle = open ('jay1key.pem',rb).read() > print fileHandle.write (data) #data variable is contains the key > fileHandle.close() > > otp = 'jyshri69' >

problem in encryption

2009-09-22 Thread jayshree
hello , The community members, Using following code : fileHandle = open ('jay1key.py','wb') #fileHandle = open ('jay1key.pem',rb).read() print fileHandle.write (data) #data variable is contains the key fileHandle.close() otp = 'jyshri69' pub_key = M2Crypto.RSA.load_pub_key('jay1key.py') enc

Re: easy question, how to double a variable

2009-09-22 Thread Andreas Waldenburger
On Mon, 21 Sep 2009 13:46:31 -0700 (PDT) daggerdvm wrote: > u don't want to answerthen why post?...get lost. You're not doing yourself a favor with this attitude, much less displaying it. You asked a question that you could have solved with 1 hour's worth of reading at most (much

Re: easy question, how to double a variable

2009-09-22 Thread daggerdvm
you brain needs error checking! -- http://mail.python.org/mailman/listinfo/python-list

difficulty in understanding rsplit(None,1)[1]

2009-09-22 Thread hrishy
Hi What does rsplit(None,1)[1] accomplish. Can somebody please decompose that to me. regards -- http://mail.python.org/mailman/listinfo/python-list

Re: recommendation for webapp testing?

2009-09-22 Thread Ryan Kelly
> >I need to do some basic website testing (log into account, add item to > >cart, fill out and submit forms, check out, etc.). What modules would > >be good to use for webapp testing like this? > > Windmill is an option, but I haven't tried it myself I'll second Windmill as an option, have had

Re: easy question, how to double a variable

2009-09-22 Thread Tim Chase
daggerdvm wrote: what are you retarded? this is not a test you moron, i can ask all the questions i want about it. You seem to have forgotten to CC the list. Let me help show the world your "mad skillz" -- at replying, at programming, at orthography, at interpersonal communication... Sur

Re: Looking for a pure Python chart drawing module

2009-09-22 Thread Nick Craig-Wood
John Nagle wrote: > I'm looking for something that can draw simple bar and pie charts > in Python. I'm trying to find a Python package, not a wrapper for > some C library, as this has to run on both Windows and Linux > and version clashes are a problem. > > Here's the list from the Python w

Re: passing object between classes

2009-09-22 Thread Duncan Booth
daved170 wrote: > Is there any existing python Log object that do so? There is. See Jean-Michel Pichavant's reply. > I no, I created my > own Log object that only open file and write a line to it, > how can I make it be global? You could assign it to a global name. > Should I use it as a sta

Re: where is ctrl+newline handled in pywin editor?

2009-09-22 Thread Roger Upole
"C or L Smith" wrote: >I use the pywin environment on Windows for python code editing and >interactive environment. > > I've been able to find the place in the editor files where the enter key > is handled and where the whitespace is stripped from a line and I've been > able to get it to not lea

Re: easy question, how to double a variable

2009-09-22 Thread Hendrik van Rooyen
On Monday, 21 September 2009 22:50:31 daggerdvm wrote: > carl banks.you are a dork No mister_do_my_homework, he is not. He is actually a respected member of this little community. You, however, are beginning to look like one. Why do you not come clean - tell us what you are doing, sho

Re: using python 2.5

2009-09-22 Thread Dave Angel
kunal.k wrote: I have installed python 2.5 for a particular code. Now i have 2.6 already installed. How do i direct this code to use the 2.5 modules?? I can think of two different questions you might be asking. 1) How do I get the add-on modules installed with 2.6 to also work in 2.5? or 2

  1   2   >