Re: how to fit a gamma distribution

2009-04-13 Thread Kushal Kumaran
On Tue, Apr 14, 2009 at 6:51 AM, ning luwen wrote: > i already have tried. > > and try to  use the module scipy.optimize.leastsq to fit, but neither > get a good return or just break out like this. > > is there any other good way?or something wrong with my code? > I suggest you try the scipy lis

Re: zProblem

2009-04-13 Thread Gabriel Genellina
En Mon, 13 Apr 2009 15:13:53 -0300, norseman escribió: Gabriel Genellina wrote: Now, if ... summarizes your problem, I think you should use the "place" geometry manager, not grid (nor pack). The Tkinter documentation [1] is rather short but the Tcl docs [2] have more info. [1] http://e

Re: Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Gary Herron
Matthew Wilson wrote: I want to have .foo directory that contains some python code. I can't figure out how to import code from that .foo directory. Is this even possible? TIA Matt -- http://mail.python.org/mailman/listinfo/python-list Python starts up with a list of directories to search w

Re: Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Jason Scheirer
On Apr 13, 5:51 pm, Matthew Wilson wrote: > I want to have .foo directory that contains some python code.  I can't > figure out how to import code from that .foo directory.  Is this even > possible? > > TIA > > Matt Yes, but it's not a particularly recommended thing to do as it is CRAZY. You can

Re: sharing/swapping items between lists

2009-04-13 Thread Aaron Brady
On Apr 13, 10:04 am, Ross wrote: > On Apr 11, 1:10 pm, a...@pythoncraft.com (Aahz) wrote: > > > > > In article > > <4fd78ac3-ba83-456b-b768-3a0043548...@f19g2000vbf.googlegroups.com>, > > > Ross   wrote: > > > >I'm trying to design an iterator that produces two lists. The first > > >list will be

Re: any(), all() and empty iterable

2009-04-13 Thread Peter Pearson
On Sun, 12 Apr 2009 06:53:24 -0500, Tim Chase wrote: >>>From the docs: >> >> all(iterable) >> >> Return True if all elements of the iterable are true. Equivalent >> to: >> >> def all(iterable): >> for element in iterable: >> if

Re: Pass ID and password to the server

2009-04-13 Thread Steven D'Aprano
On Mon, 13 Apr 2009 21:02:39 -0700, larryzhang wrote: > Hi, > > I am trying to grab webpages from a site that requires user ID and > password, is there a way that I can pass my ID and password to the > server? Thanks. It depends on what the server is expecting. Some *really bad* systems encode

Pass ID and password to the server

2009-04-13 Thread larryzhang
Hi, I am trying to grab webpages from a site that requires user ID and password, is there a way that I can pass my ID and password to the server? Thanks. Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: storing variable value

2009-04-13 Thread Daniel Dalton
Yes. I used a file, thanks. On Sat, Apr 11, 2009 at 09:30:40AM -0400, Dave Angel wrote: > > > Daniel Dalton wrote: >> Hi! >> >> I'm writing a program to provide me with battery warnings when my >> battery hits certain levels. It just checks the current level and does >> something. I plan to call

Re: sharing/swapping items between lists

2009-04-13 Thread Ross
On Apr 13, 9:08 am, a...@pythoncraft.com (Aahz) wrote: > In article , > > Ross   wrote: > > >I'm sorry...my example was probably a bad one. A better example of > >output I would like would be something like [[1,2],[3,4],[5,6]] and > >then for the leftovers list [7,8,9,10 etc]. What I'm trying to do

path to executing .py file

2009-04-13 Thread tiefeng wu
Hello everybody! I'm working on my code repository (svn) auto-backup script which get hotcopy of svn repository directory to a directory named by date in same location where script file is, it executed by a timer program every 00:00 clock. Everything works fine when I'm testing by double click it.

Re: Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Terry Reedy
Matthew Wilson wrote: I want to have .foo directory that contains some python code. I can't figure out how to import code from that .foo directory. Is this even possible? Did you try putting '.foo' on sys.path? -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython question

2009-04-13 Thread Clemens Anhuth
isam uraiqat wrote: I HATE VISTA!! it just needed to be installed on the site packages library, because it was installed by default on program files, hope this might help another poor vista user Hello. Can you explain? Does the installer default to the wrong directory (installer fault)?

Re: binary file compare...

2009-04-13 Thread Grant Edwards
On 2009-04-13, Peter Otten <__pete...@web.de> wrote: > But there's a cache. A change of file contents may go > undetected as long as the file stats don't change: Good point. You can fool it if you force the stats to their old values after you modify a file and you don't clear the cache. -- Gra

Re: How to convert \n and \t symbols to new lines and tabs?

2009-04-13 Thread AggieDan04
On Apr 13, 6:30 pm, DSblizzard wrote: > How to convert string with \n and \t symbols to natural string - with > new lines and tabs? 'String with tab\\t and newline\\n'.decode('string-escape') -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting -i in a script

2009-04-13 Thread Christian Heimes
Marek Szuba wrote: > Is there any way of detecting in a script whether the interpreter > session running it has been launched with the -i option? My Google fu > has failed me on this subject... Thanks in advance. There is no direct way to detect the interactive flag. However sys.ps1 and sys.ps2 ar

Re: Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Ben Finney
Matthew Wilson writes: > I want to have .foo directory that contains some python code. I can't > figure out how to import code from that .foo directory. Is this even > possible? Packages and modules need to have names that are valid Python identifiers. That precludes the ‘.’ character (among man

Re: Detecting -i in a script

2009-04-13 Thread Chris Rebert
On Mon, Apr 13, 2009 at 6:10 PM, Static Vagabond wrote: > Chris Rebert wrote: >>> >>> Marek Szuba wrote: On 2009-04-13, Chris Rebert wrote: > The sys.flags.interactive bool. > > Details: http://docs.python.org/library/sys.html#sys.flags Hmm, "New in version 2.

Re: Detecting -i in a script

2009-04-13 Thread Static Vagabond
Chris Rebert wrote: Marek Szuba wrote: On 2009-04-13, Chris Rebert wrote: The sys.flags.interactive bool. Details: http://docs.python.org/library/sys.html#sys.flags Hmm, "New in version 2.6"... Are you aware of any way of extracting this information in older versions of Python? My code need

Re: binary file compare...

2009-04-13 Thread Dave Angel
SpreadTooThin wrote: On Apr 13, 2:37 pm, Grant Edwards wrote: On 2009-04-13, Grant Edwards wrote: On 2009-04-13, SpreadTooThin wrote: I want to compare two binary files and see if they are the same. I see the filecmp.cmp function but I don't get a warm fuzzy feeling that i

Re: possible pairings in a set

2009-04-13 Thread Alan G Isaac
I cannot access this thread right now so my answer my be rednundant, but anyway: http://docs.python.org/library/itertools.html#itertools.combinations >>> from itertools import combinations >>> print(list(combinations(range(4),2))) [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)] hth,

Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Matthew Wilson
I want to have .foo directory that contains some python code. I can't figure out how to import code from that .foo directory. Is this even possible? TIA Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3143 and daemon process

2009-04-13 Thread Alfredo Deza
On Mon, Apr 13, 2009 at 8:33 PM, Ben Finney > wrote: > On 13-Apr-2009, Alfredo Deza wrote: > > By "compliant", I do mean to reference PEP 3143 for building the app. > > I'm still not sure what you mean by this. I can only assume you mean > that your program will assume the existence of a PEP 3143

Re: Detecting -i in a script

2009-04-13 Thread Chris Rebert
> Marek Szuba wrote: >> >> On 2009-04-13, Chris Rebert wrote: >> >>> The sys.flags.interactive bool. >>> >>> Details: http://docs.python.org/library/sys.html#sys.flags >> >> Hmm, "New in version 2.6"... Are you aware of any way of extracting >> this information in older versions of Python? My code

Re: PEP 3143 and daemon process

2009-04-13 Thread Ben Finney
On 13-Apr-2009, Alfredo Deza wrote: > By "compliant", I do mean to reference PEP 3143 for building the app. I'm still not sure what you mean by this. I can only assume you mean that your program will assume the existence of a PEP 3143 implementation (like the ‘python-daemon’ library), and your pro

Re: Detecting -i in a script

2009-04-13 Thread Static Vagabond
I think getopt will help you achieve what you need. http://docs.python.org/library/getopt.html Here's a quick example: import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "-i:vo:vhb?") except getopt.GetoptError, err: helpCommand() # defined elsewhere. sys.exit()

Re: binary file compare...

2009-04-13 Thread Steven D'Aprano
On Mon, 13 Apr 2009 15:03:32 -0500, Grant Edwards wrote: > On 2009-04-13, SpreadTooThin wrote: > >> I want to compare two binary files and see if they are the same. I see >> the filecmp.cmp function but I don't get a warm fuzzy feeling that it >> is doing a byte by byte comparison of two files t

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Aaron Brady
On Apr 13, 6:50 pm, Steven D'Aprano wrote: > On Mon, 13 Apr 2009 19:12:21 +0200, Diez B. Roggisch wrote: > >> Can the Parser object know who its Daddy is? > > > Yes, by Daddy telling him so. That's how nature does it, and how you > > should do it. Or do you think that because DNA-tests are availab

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Steven D'Aprano
On Mon, 13 Apr 2009 19:12:21 +0200, Diez B. Roggisch wrote: >> Can the Parser object know who its Daddy is? > > Yes, by Daddy telling him so. That's how nature does it, and how you > should do it. Or do you think that because DNA-tests are available to us > we should just put all kids into a big

Re: How to convert \n and \t symbols to new lines and tabs?

2009-04-13 Thread MRAB
DSblizzard wrote: How to convert string with \n and \t symbols to natural string - with new lines and tabs? You'll need to explain what you mean. A string literal represents newline and tab with \n and \t. Are you talking about that, or does the string actually contain the characters \n and \n

Re: ValueError: I/O operation on closed file

2009-04-13 Thread dj
On Apr 11, 12:30 am, Dennis Lee Bieber wrote: > On Fri, 10 Apr 2009 13:25:25 -0700 (PDT), dj > declaimed the following in gmane.comp.python.general: > > > > > I have a handler which I use with a set of log levels for the python > > logging module. > > > --- myhandl

How to convert \n and \t symbols to new lines and tabs?

2009-04-13 Thread DSblizzard
How to convert string with \n and \t symbols to natural string - with new lines and tabs? -- http://mail.python.org/mailman/listinfo/python-list

Re: binary file compare...

2009-04-13 Thread Peter Otten
Grant Edwards wrote: > On 2009-04-13, Grant Edwards wrote: >> On 2009-04-13, SpreadTooThin wrote: >> >>> I want to compare two binary files and see if they are the same. >>> I see the filecmp.cmp function but I don't get a warm fuzzy feeling >>> that it is doing a byte by byte comparison of two

How to run jython WSGI applications on Google AppEngine.

2009-04-13 Thread Alan Kennedy
Hi all, You can find instructions about how to run jython Web applications on Google AppEngine, using WSGI and modjy, here. http://jython.xhaus.com You can see the jython 2.5 Demo WSGI application running, here. http://jywsgi.appspot.com Regards, Alan Kennedy. -- http://mail.python.org/mailma

Re: binary file compare...

2009-04-13 Thread SpreadTooThin
On Apr 13, 2:37 pm, Grant Edwards wrote: > On 2009-04-13, Grant Edwards wrote: > > > > > On 2009-04-13, SpreadTooThin wrote: > > >> I want to compare two binary files and see if they are the same. > >> I see the filecmp.cmp function but I don't get a warm fuzzy feeling > >> that it is doing a by

Re: PIL, and Parts of tuples

2009-04-13 Thread Vistro
Actually, I screwed up. See 60, 30? That's actually the range. The tuple to be checked will look like (40, 25, 51) So yeah. Sorry for the bad info. For a good time, go to Start:Run and type in format C On Mon, Apr 13, 2009 at 3:41 PM,

Re: PIL, and Parts of tuples

2009-04-13 Thread Chris Rebert
On Mon, Apr 13, 2009 at 1:34 PM, Vistro wrote: > I have two problems, and I can't find anything about either of them. > The first is that PIL does not seem to have any way to search each and every > pixel for a value, like > for pixel in img: >     if pixel = ((60, 30), (58, 23), (87 57)): > see

Re: binary file compare...

2009-04-13 Thread Grant Edwards
On 2009-04-13, Grant Edwards wrote: > On 2009-04-13, SpreadTooThin wrote: > >> I want to compare two binary files and see if they are the same. >> I see the filecmp.cmp function but I don't get a warm fuzzy feeling >> that it is doing a byte by byte comparison of two files to see if they >> are t

PIL, and Parts of tuples

2009-04-13 Thread Vistro
I have two problems, and I can't find anything about either of them. The first is that PIL does not seem to have any way to search each and every pixel for a value, like for pixel in img: if pixel = ((60, 30), (58, 23), (87 57)): # Get out of the for loop # Also, save the pixel

Re: GUI Programming

2009-04-13 Thread Lawson English
Gabriel wrote: Hello, I'm python newbie and i need to write gui for my school work in python. I need to write it really quick, because i haven't much time .) So question is, which of gui toolkits should i pick and learn? I heard PyGTK and Glade are best for quick gui programming? Is it good for

Re: Imports in python are static, any solution?

2009-04-13 Thread norseman
AJ Mayorga wrote: For something like this I generally create a superclass to hold configuration variables that will change overtime, doing that will save you from insanity. Class configVar: #set initial values Def __init__(self): Self.A = 5 Self.B

Re: binary file compare...

2009-04-13 Thread SpreadTooThin
On Apr 13, 2:03 pm, Grant Edwards wrote: > On 2009-04-13, SpreadTooThin wrote: > > > I want to compare two binary files and see if they are the same. > > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > > that it is doing a byte by byte comparison of two files to see if they

Re: Overflow error (was Vol 67, Issue 192)

2009-04-13 Thread Scott David Daniels
Dave Angel wrote: Ryniek90 wrote: But i've still haven't got answer for question: "What's the max. length of string bytes which Python can hold?" sys.maxsize The largest positive integer supported by the platform’s Py_ssize_t type, and thus the maximum size lists, strings, dicts, and many

Re: binary file compare...

2009-04-13 Thread Grant Edwards
On 2009-04-13, SpreadTooThin wrote: > I want to compare two binary files and see if they are the same. > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > that it is doing a byte by byte comparison of two files to see if they > are they same. Perhaps I'm being dim, but how el

Re: binary file compare...

2009-04-13 Thread SpreadTooThin
On Apr 13, 2:00 pm, Przemyslaw Kaminski wrote: > SpreadTooThin wrote: > > I want to compare two binary files and see if they are the same. > > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > > that it is doing a byte by byte comparison of two files to see if they > > are they

Re: binary file compare...

2009-04-13 Thread Przemyslaw Kaminski
SpreadTooThin wrote: > I want to compare two binary files and see if they are the same. > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > that it is doing a byte by byte comparison of two files to see if they > are they same. > > What should I be using if not filecmp.cmp? W

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 2:29 pm, Alan G Isaac wrote: > > On Apr 13, 11:26 am, Alan G Isaac > > wrote: > >> Why do I get the ImportError below? > >> What is the right way to do this? > >> Thanks, > >> Alan Isaac > >> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC > >> v.1310 32 bit (Intel)] on win32 Typ

Re: cx_Oracle - DLL load failed

2009-04-13 Thread Martin P. Hellwig
cwurld wrote: Hi, I am having some trouble getting cx_Oracle to work. When I try to import cx_Oracle, I get the following error message: ImportError: DLL load failed: %1 is not a valid Win32 application. I am using Python 2.6 on WIndows. Oracle Client 10g. Any ideas? Thanks Hmm some time a

Re: Detecting -i in a script

2009-04-13 Thread Marek Szuba
On 2009-04-13, Chris Rebert wrote: > The sys.flags.interactive bool. > > Details: http://docs.python.org/library/sys.html#sys.flags Hmm, "New in version 2.6"... Are you aware of any way of extracting this information in older versions of Python? My code needs to be 2.3-compatible. -- MS -- http

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Alan G Isaac
On Apr 13, 11:26 am, Alan G Isaac wrote: Why do I get the ImportError below? What is the right way to do this? Thanks, Alan Isaac Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

Re: Detecting -i in a script

2009-04-13 Thread Chris Rebert
On Mon, Apr 13, 2009 at 12:09 PM, Marek Szuba wrote: > Hello there, > > Is there any way of detecting in a script whether the interpreter > session running it has been launched with the -i option? My Google fu > has failed me on this subject... Thanks in advance. The sys.flags.interactive bool.

Detecting -i in a script

2009-04-13 Thread Marek Szuba
Hello there, Is there any way of detecting in a script whether the interpreter session running it has been launched with the -i option? My Google fu has failed me on this subject... Thanks in advance. -- MS -- http://mail.python.org/mailman/listinfo/python-list

Re: REG: python c++ bindings

2009-04-13 Thread Diez B. Roggisch
ext-golla.anil-ku...@nokia.com schrieb: Hi Please don't reply to existing posts. People read news and mails threaded, and this makes a post appear below other, non-related posts & causes confusion. Create a new thread instead, by directly posting to the group or ML. I need some materia

Re: ANN: PyGUI 2.0.1

2009-04-13 Thread Andrew MacKeith
Greg Ewing wrote: PyGUI 2.0.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes some problems in setup.py affecting installation on Linux and Windows. What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly

REG: python c++ bindings

2009-04-13 Thread ext-golla.anil-ku...@nokia.com
Hi I need some material or link contain examples on python C++ bindings( calling C++ methods in python) Can any body share the information. Thanks, Anil kumar. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and XML Help

2009-04-13 Thread Scott David Daniels
ookrin wrote: I'm in the process of learning python and PyQt4. I had decided to make myself a simple app and soon discovered that I needed to crash into xml to use some of the data I was going to be getting off of the server. I picked up enough xml to use the sax parser to get the data out of th

Re: GUI Programming

2009-04-13 Thread norseman
Gabriel wrote: r wrote: On Apr 12, 8:07 am, Gabriel wrote: Hello, I'm python newbie and i need to write gui for my school work in python. I need to write it really quick, [snip] Tkinter is built-in, why not start there? from Tkinter import * root = Tk() root.mainloop() -- http:

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 11:26 am, Alan G Isaac wrote: > Why do I get the ImportError below? > What is the right way to do this? > Thanks, > Alan Isaac > > Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] > on win32 > Type "help", "copyright", "credits" or "license" for more informa

Re: zProblem

2009-04-13 Thread norseman
Steven D'Aprano wrote: On Fri, 10 Apr 2009 10:50:57 -0700, norseman wrote: Moderator: I apologize for attaching anything. This newsgroup has no moderator. However, in order to explain my problem, I need to control the font since text graphics only work for a given font. Use the least c

Re: zProblem

2009-04-13 Thread norseman
Gabriel Genellina wrote: En Fri, 10 Apr 2009 21:14:01 -0300, norseman escribió: norseman wrote: Gabriel Genellina wrote: En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: ...(snip) I didn't understand what your problem is actually. UUHHDid you read the pdf? Yes (and

Re: numpy permutations with replacement

2009-04-13 Thread skorpi...@gmail.com
On Apr 13, 1:17 pm, Mensanator wrote: > On Apr 13, 6:36 am, "skorpi...@gmail.com" wrote: > > > > > On Apr 13, 7:13 am, Chris Rebert wrote: > > > > On Mon, Apr 13, 2009 at 4:05 AM, skorpi...@gmail.com > > > > wrote: > > > > I am trying to generate all possible permutations of length three from >

cx_Oracle - DLL load failed

2009-04-13 Thread cwurld
Hi, I am having some trouble getting cx_Oracle to work. When I try to import cx_Oracle, I get the following error message: ImportError: DLL load failed: %1 is not a valid Win32 application. I am using Python 2.6 on WIndows. Oracle Client 10g. Any ideas? Thanks -- http://mail.python.org/mailman

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Aahz
In article <74ha3lf10bj9...@mid.uni-berlin.de>, Diez B. Roggisch wrote: >hubritic schrieb: >> >> Can the Parser object know who its Daddy is? > >Yes, by Daddy telling him so. That's how nature does it, and how you >should do it. Or do you think that because DNA-tests are available to us >we sho

Re: Data Model:

2009-04-13 Thread Anthony
On Apr 13, 1:26 am, Peter Otten <__pete...@web.de> wrote: > Anthony wrote: > > On Apr 12, 7:46 pm, Aaron Watters wrote: > >> On Apr 12, 10:14 pm, Anthony wrote: > > >> > I'm struggling on whether or not to implement GroupItem (below) with > >> > two separate models, or with one model that has a d

Re: sending and receiving ipv6 multicasts

2009-04-13 Thread Martin v. Löwis
Kai Timmer wrote: > I am trying to send and receive packages via an ipv6 multicast. But I > can't get it working. What I thought was, that on the listener site, I > just need to bind my socket to the interfaces ipv6 local link address > and on the sender site, to the multicast address (in my case f

Re: numpy permutations with replacement

2009-04-13 Thread Mensanator
On Apr 13, 6:36 am, "skorpi...@gmail.com" wrote: > On Apr 13, 7:13 am, Chris Rebert wrote: > > > > > > > On Mon, Apr 13, 2009 at 4:05 AM, skorpi...@gmail.com > > > wrote: > > > I am trying to generate all possible permutations of length three from > > > elements of [0,1]. i.e in this scenario th

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Diez B. Roggisch
hubritic schrieb: I want to build a parser object that handles two different log file formats. I have an object that handles Connection logs and an object for Filter logs. Each will instantiate a Parser object, passing in the path to individual log files. There are a number of ways I could fig

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Jean-Paul Calderone
On Mon, 13 Apr 2009 09:53:04 -0700 (PDT), hubritic wrote: I want to build a parser object that handles two different log file formats. I have an object that handles Connection logs and an object for Filter logs. Each will instantiate a Parser object, passing in the path to individual log file

Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread hubritic
I want to build a parser object that handles two different log file formats. I have an object that handles Connection logs and an object for Filter logs. Each will instantiate a Parser object, passing in the path to individual log files. There are a number of ways I could figure out whether I am

sending and receiving ipv6 multicasts

2009-04-13 Thread Kai Timmer
I am trying to send and receive packages via an ipv6 multicast. But I can't get it working. What I thought was, that on the listener site, I just need to bind my socket to the interfaces ipv6 local link address and on the sender site, to the multicast address (in my case ff02::). That doesn't work

tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Alan G Isaac
Why do I get the ImportError below? What is the right way to do this? Thanks, Alan Isaac Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import Tkinter as tk >>> root=tk.Tk() >>> im

RE: Imports in python are static, any solution?

2009-04-13 Thread AJ Mayorga
For something like this I generally create a superclass to hold configuration variables that will change overtime, doing that will save you from insanity. Class configVar: #set initial values Def __init__(self): Self.A = 5 Self.B = 10

Re: Imports in python are static, any solution?

2009-04-13 Thread David Stanek
On Mon, Apr 13, 2009 at 11:59 AM, Ravi wrote: > foo.py : > >    i = 10 > >   def fi(): >      global i >      i = 99 > > bar.py : > >    import foo >    from foo import i > >    print i, foo.i >    foo.fi() >    print i, foo.i > > This is problematic. Well I want i to change with foo.fi() . Why n

Re: Imports in python are static, any solution?

2009-04-13 Thread Luis Alberto Zarrabeitia Gomez
Quoting Ravi : > > This is problematic. Well I want i to change with foo.fi() . You can't. i and foo.i are _different_ variables that just happen to share the same value initially. What you are observing is no different than i = 10 j = i i = 99 print i # prints 99 print j # print 10 May I

Re: possible pairings in a set

2009-04-13 Thread Przemyslaw Kaminski
Ross wrote: > I'm new to python and I'm trying to come up with a function that takes > a given number of players in a game and returns all possible unique > pairings. Here's the code I've come up with so far, but I'm not > getting the output I'd like to: > > def all_pairings(players): > cleanlist

Re: sharing/swapping items between lists

2009-04-13 Thread Aahz
In article , Ross wrote: > >I'm sorry...my example was probably a bad one. A better example of >output I would like would be something like [[1,2],[3,4],[5,6]] and >then for the leftovers list [7,8,9,10 etc]. What I'm trying to do is >produce some sort of round robin algorithm for tennis that is

RE:wxpython question

2009-04-13 Thread isam uraiqat
I HATE VISTA!! it just needed to be installed on the site packages library, because it was installed by default on program files, hope this might help another poor vista user cheers -- http://mail.python.org/mailman/listinfo/python-list

Imports in python are static, any solution?

2009-04-13 Thread Ravi
foo.py : i = 10 def fi(): global i i = 99 bar.py : import foo from foo import i print i, foo.i foo.fi() print i, foo.i This is problematic. Well I want i to change with foo.fi() . -- http://mail.python.org/mailman/listinfo/python-list

wxpython question

2009-04-13 Thread isam uraiqat
hello fellow geeks i am trying to run the demo for wxpython, and once i click on it i get the sand clock coming up for a second and then that's it, it is not running no matter what i do. i tried it on another computer and im getting the same thing! it used to work earlier i dont know what happened

Re: Can I replace this for loop with a join?

2009-04-13 Thread Nicolas Dandrimont
* WP [2009-04-13 17:03:17 +0200]: > Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} > > I now want to print: > "Press 1 for astring" > "Press 2 for anotherstring" etc > > I could do it like this: > dict = {1:'astring', 2:'anotherstring'} > for key in dict.keys(): > print 'Press

Re: Can I replace this for loop with a join?

2009-04-13 Thread Tim Chase
WP wrote: Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} I now want to print: "Press 1 for astring" "Press 2 for anotherstring" etc I could do it like this: dict = {1:'astring', 2:'anotherstring'} for key in dict.keys(): print 'Press %i for %s' % (key, dict[key]) Press 1 f

Re: Can I replace this for loop with a join?

2009-04-13 Thread Kushal Kumaran
On Mon, Apr 13, 2009 at 8:33 PM, WP wrote: > Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} > > I now want to print: > "Press 1 for astring" > "Press 2 for anotherstring" etc > > I could do it like this: > dict = {1:'astring', 2:'anotherstring'} > for key in dict.keys(): >    print

Re: sharing/swapping items between lists

2009-04-13 Thread Ross
On Apr 11, 1:10 pm, a...@pythoncraft.com (Aahz) wrote: > In article > <4fd78ac3-ba83-456b-b768-3a0043548...@f19g2000vbf.googlegroups.com>, > > Ross   wrote: > > >I'm trying to design an iterator that produces two lists. The first > >list will be a list of unique pairings and the second will be a l

Can I replace this for loop with a join?

2009-04-13 Thread WP
Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} I now want to print: "Press 1 for astring" "Press 2 for anotherstring" etc I could do it like this: dict = {1:'astring', 2:'anotherstring'} for key in dict.keys(): print 'Press %i for %s' % (key, dict[key]) Press 1 for astring P

Re: Python inside C++

2009-04-13 Thread Aaron Brady
On Apr 13, 8:41 am, Kushal Kumaran wrote: > On Wed, Apr 15, 2009 at 8:56 AM, AJ Mayorga wrote: > > Hello all, > > > I am looking for a way  to statically compile pythonxx.dll into my C++ > > application, so that I can use It as an internal scripting language and > > either run the native python c

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Aaron Brady
On Apr 13, 8:25 am, azeem wrote: > On Apr 13, 3:45 pm, Aaron Brady wrote: snip > > @take_ab > > def f( c= 42, d= 'some' ): > >     print( 'in f, c= %r, d= %r'% ( c, d ) ) > > > f( a= 'paramA', b= 'paramB', c= 'other number' ) > > > /Output: > > > aval 'paramA' and bval 'paramB' popped > > in f, c

Re: ANN: PyGUI 2.0.1

2009-04-13 Thread user
Greg Ewing wrote: PyGUI 2.0.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes some problems in setup.py affecting installation on Linux and Windows. What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly

Re: Python inside C++

2009-04-13 Thread Kushal Kumaran
On Wed, Apr 15, 2009 at 8:56 AM, AJ Mayorga wrote: > Hello all, > > > > I am looking for a way  to statically compile pythonxx.dll into my C++ > application, so that I can use It as an internal scripting language and > either run the native python code or take an ELF from py2exe/pyinstaller and >

Python inside C++

2009-04-13 Thread AJ Mayorga
Hello all, I am looking for a way to statically compile pythonxx.dll into my C++ application, so that I can use It as an internal scripting language and either run the native python code or take an ELF from py2exe/pyinstaller and run that. The machines that will have my C++ app running on the

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread azeem
On Apr 13, 3:45 pm, Aaron Brady wrote: > On Apr 13, 5:11 am, Michel Albert wrote: > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it's a more basic python problem, with cherrypy on

Re: how to fit a gamma distribution

2009-04-13 Thread Kushal Kumaran
On Mon, Apr 13, 2009 at 1:40 PM, ning luwen wrote: > hi, >  i need to fit a gamma distribution, is there any module can do the job? > Did you try google? Searching for python curve fitting returns some promising results. -- kushal -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Conversion in python

2009-04-13 Thread Aaron Watters
On Apr 13, 1:47 am, "venutaurus...@gmail.com" wrote: > Hello All, > Is there any library defined in Python which can convert a > given text file into a html page. Basically, I require functions for > creating tables or filling background colours for the html pages etc > instead of writ

Re: video capture in Python ?

2009-04-13 Thread Tino Wildenhain
Hi Stef, Stef Mientki wrote: ... videocapture webcamwatcher opencv libvidcap hdpvrassistent they didn't run at all or they crashed within 10 seconds :-( The most promissing looks videocapture, but that also crashes within 10 seconds. Video capture is not a trivial task. to be more exactly, I

Re: download robot

2009-04-13 Thread Kushal Kumaran
On Mon, Apr 13, 2009 at 11:13 AM, larryzhang wrote: > Hi, > Being a newbie for Python, I am trying to write a code that can act as > a downloading robot. > This might be useful: http://wwwsearch.sourceforge.net/mechanize/. I've only casually gone through the page, not actually used it. If you fe

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:45 pm, Aaron Brady wrote: > On Apr 13, 5:11 am, Michel Albert wrote: > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it's a more basic python problem, with cherrypy o

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:52 pm, Jon Clements wrote: > On 13 Apr, 11:11, Michel Albert wrote: > > > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it's a more basic python problem, with cherryp

Re: [ANN] Falcon - powering innovation

2009-04-13 Thread Andrii V. Mishkovskyi
On Sat, Apr 11, 2009 at 4:11 PM, Kless wrote: [skipped buzzwords] > > > [1] http://www.falconpl.org/ > [2] > http://www.computerworld.com.au/article/298655/-z_programming_languages_falcon?fp=2&fpid= And this table should make you even more interested in Falcon (also called THE BEST PROGRAMMING L

Re: Generators/iterators, Pythonicity, and primes

2009-04-13 Thread Aaron Brady
On Apr 13, 1:39 am, Arnaud Delobelle wrote: > Duncan Booth writes: > > Duncan Booth wrote: > > >> John Posner wrote: > > >>> Do know what in the itertools implementation causes adding a 'if p <= > >>> sqrt(n)' clause to *decrease* performance, while adding a > >>> 'takewhile()' clause *increase

Re: numpy permutations with replacement

2009-04-13 Thread skorpi...@gmail.com
On Apr 13, 7:13 am, Chris Rebert wrote: > On Mon, Apr 13, 2009 at 4:05 AM, skorpi...@gmail.com > > wrote: > > I am trying to generate all possible permutations of length three from > > elements of [0,1]. i.e in this scenario there are a total of 8 > > distinct permutations: > > > [0,0,0] > > [0,0

Re: regex for multiple whitespace-only lines

2009-04-13 Thread MRAB
Phil Mayes wrote: I am trying to search for 1 or more empty or white-space-only lines. Empty lines work: >>> re.compile('(?m)(^$){1,2}') <_sre.SRE_Pattern object at 0x010F9218> One line with possible whitespace works: >>> re.compile('(?m)(^\s*$)') <_sre.SRE_Pattern object at 0x010F7860> Multi

  1   2   >