Re: Retrieving an object from a set

2013-01-25 Thread Vito De Tullio
MRAB wrote: > It turns out that both S & {x} and {x} & S return {x}, not {y}. curious. $ python Python 2.7.3 (default, Jul 3 2012, 19:58:39) [GCC 4.7.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> x = (1,2,3) >>> y = (1,2,3) >>> s = set([y]) >>> (s & se

Re: Need Pattern For Logging Into A Website

2013-01-25 Thread Michael Torrie
On 01/25/2013 05:15 PM, Tim Daneliuk wrote: > Does it handle self-signed SSL certs? No idea. you'd have to try it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieving an object from a set

2013-01-25 Thread Steven D'Aprano
Arnaud Delobelle wrote: > Dear Pythoneers, > > I've got a seemingly simple problem, but for which I cannot find a > simple solution. > > I have a set of objects (say S) containing an object which is equal to > a given object (say x). So > > x in S > > is true. So there is an object y in S

Re: Fonts & Tinker

2013-01-25 Thread Paul
class FontSpec: """Wrapper for something like 'Arial 10 bold #red' """ tkf = None # Tk Font spec = "" # specification tkspec = "" # specification for Tk family = None size = 0 color = "black" weight = "normal" slant = "roman" underline = 0 overstrike

Re: Fonts & Tinker

2013-01-25 Thread Angel
Dammm it should be Tkinter for subject..:D -- http://mail.python.org/mailman/listinfo/python-list

Fonts & Tinker

2013-01-25 Thread Angel
I am changing the default font for a Tkinter application: class FuelControl(Tkinter.Frame): def __init__(self,master): self.version='0.02' self.font=tkFont.Font(family="Helvetica",size=18) print self.font.actual() . . . and everything looks ok: {'family': 'Nimbus San

doctests/unittest problem with exception

2013-01-25 Thread Paul
Hello. I converted doctests into DocTestSuite() to use with unittest. And try it under Python 3. And, sure, I get errors with unmatched exceptions details (mismatched name of exception class: a.b.c.MyError instead of MyError). So, I have 2 questions: 1) how to turn on option IGNORE_EXCEPTION_DE

Toontown

2013-01-25 Thread devonfelix79
Hi i am working on tryin to import texture into Toontown. It involves PyDatagrams, Billboard 3d textures and the tt server if anyone could help please post below or aim me at: gamerboy1...@yahoo.com :) Thanks. ps: For those of you that do not know toontown runs on python coding. -- http://mai

Re: Retrieving an object from a set

2013-01-25 Thread MRAB
On 2013-01-26 00:26, Ian Kelly wrote: On Fri, Jan 25, 2013 at 4:45 PM, MRAB wrote: You could first limit the search to only those which it could be: S & set([y]) A search would be: f = [m for m in S & set([y]) if m is y][0] f is y True But in practice he won't have y, only x. So tha

Re: finding abc's

2013-01-25 Thread lars van gemerden
for future reference, i decided to go with 2 functions: def common_bases(classes): if not len(classes): return None common = set(classes.pop().mro()) for cls in classes: common.intersection_update(cls.mro()) #all subclasses in common return [cls for cls in co

Re: Retrieving an object from a set

2013-01-25 Thread Ian Kelly
On Fri, Jan 25, 2013 at 4:45 PM, MRAB wrote: > You could first limit the search to only those which it could be: > > S & set([y]) > > A search would be: > f = [m for m in S & set([y]) if m is y][0] f is y > True But in practice he won't have y, only x. So that would have to be: >>

Re: Need Pattern For Logging Into A Website

2013-01-25 Thread Tim Daneliuk
On 01/25/2013 01:18 PM, Michael Torrie wrote: On 01/25/2013 09:18 AM, Tim Daneliuk wrote: On 01/25/2013 10:01 AM, Steve Petrie wrote: On Thursday, January 24, 2013 8:29:51 PM UTC-5, Tim Daneliuk wrote: The mechanize module (http://wwwsearch.sourceforge.net/mechanize/) might be a place to start.

Re: Retrieving an object from a set

2013-01-25 Thread Dave Angel
On 01/25/2013 06:14 PM, Arnaud Delobelle wrote: Dear Pythoneers, I've got a seemingly simple problem, but for which I cannot find a simple solution. I have a set of objects (say S) containing an object which is equal to a given object (say x). So x in S is true. So there is an object y

Re: Retrieving an object from a set

2013-01-25 Thread Ethan Furman
On 01/25/2013 03:14 PM, Arnaud Delobelle wrote: I've got a seemingly simple problem, but for which I cannot find a simple solution. I have a set of objects (say S) containing an object which is equal to a given object (say x). So x in S is true. So there is an object y in S which is equa

Re: Retrieving an object from a set

2013-01-25 Thread MRAB
On 2013-01-25 23:14, Arnaud Delobelle wrote: Dear Pythoneers, I've got a seemingly simple problem, but for which I cannot find a simple solution. I have a set of objects (say S) containing an object which is equal to a given object (say x). So x in S is true. So there is an object y in

Re: Retrieving an object from a set

2013-01-25 Thread Ian Kelly
On Fri, Jan 25, 2013 at 4:30 PM, Ian Kelly wrote: > On Fri, Jan 25, 2013 at 4:14 PM, Arnaud Delobelle wrote: >> Dear Pythoneers, >> >> I've got a seemingly simple problem, but for which I cannot find a >> simple solution. >> >> I have a set of objects (say S) containing an object which is equal t

Re: Retrieving an object from a set

2013-01-25 Thread Ian Kelly
On Fri, Jan 25, 2013 at 4:14 PM, Arnaud Delobelle wrote: > Dear Pythoneers, > > I've got a seemingly simple problem, but for which I cannot find a > simple solution. > > I have a set of objects (say S) containing an object which is equal to > a given object (say x). So > > x in S > > is true.

Retrieving an object from a set

2013-01-25 Thread Arnaud Delobelle
Dear Pythoneers, I've got a seemingly simple problem, but for which I cannot find a simple solution. I have a set of objects (say S) containing an object which is equal to a given object (say x). So x in S is true. So there is an object y in S which is equal to x. My problem is how to ret

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Tetsuya
On 01/25/2013 06:47 PM, Michael Torrie wrote: On 01/24/2013 02:14 PM, Tetsuya wrote: Vim has everything, you just need a bunch of plugins. [...] jedi (*awesome* python smart autocompletion) [...] supertab (autocomplete everything with TAB, smartly depending on language and context). Awesom

Re: Changing the font size of anOptionMenu widget

2013-01-25 Thread Angel
Den fredagen den 25:e januari 2013 kl. 06:57:00 UTC+1 skrev Rick Johnson: > > menu = optMenu.nametowidget(optMenu.menuname) > That was what I was missing, the '.nametowidget'. It worked like a charm: o1=Tkinter.OptionMenu(t,v3, "€", "$") o1.config(font=self.font) o1.nametowidget(o1.menuname).con

Re: finding abc's

2013-01-25 Thread lars van gemerden
On Friday, January 25, 2013 8:08:18 PM UTC+1, Peter Otten wrote: > lars van gemerden wrote: > > > > > Hi all, > > > > > > i was writing a function to determine the common base class of a number > > > classes: > > > > > > def common_base(classes): > > > if not len(classes): > > >

Re: finding abc's

2013-01-25 Thread lars van gemerden
On Friday, January 25, 2013 8:04:32 PM UTC+1, Ian wrote: > On Fri, Jan 25, 2013 at 10:40 AM, lars van gemerden > > wrote: > > > Hi all, > > > > > > i was writing a function to determine the common base class of a number > > classes: > > > > > [...] > > > > > > and ran common_base(int, flo

Re: Need Pattern For Logging Into A Website

2013-01-25 Thread Michael Torrie
On 01/25/2013 09:18 AM, Tim Daneliuk wrote: > On 01/25/2013 10:01 AM, Steve Petrie wrote: >> On Thursday, January 24, 2013 8:29:51 PM UTC-5, Tim Daneliuk >> wrote: The mechanize module >> (http://wwwsearch.sourceforge.net/mechanize/) might be a place to >> start. I've done something similar with c

Re: finding abc's

2013-01-25 Thread Peter Otten
lars van gemerden wrote: > Hi all, > > i was writing a function to determine the common base class of a number > classes: > > def common_base(classes): > if not len(classes): > return None > common = set(classes.pop().mro()) > for cls in classes: > common.intersection

Re: finding abc's

2013-01-25 Thread Ian Kelly
On Fri, Jan 25, 2013 at 10:40 AM, lars van gemerden wrote: > Hi all, > > i was writing a function to determine the common base class of a number > classes: > [...] > > and ran common_base(int, float), hoping to get numbers.Number. > > this did not work because abstract base classes are not always

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Dave Angel
On 01/25/2013 12:54 PM, Neil Cerutti wrote: On 2013-01-25, Leonard, Arah wrote: Though, that said, I have used Notepad and Wordpad any number of times in the past to edit Python files, all without bringing the universe to an untimely end. Even used DOS Edit once. You use what you have at the

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Neil Cerutti
On 2013-01-25, Leonard, Arah wrote: > Though, that said, I have used Notepad and Wordpad any number > of times in the past to edit Python files, all without bringing > the universe to an untimely end. Even used DOS Edit once. You > use what you have at the time. A good craftsman never blames >

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Michael Torrie
On 01/24/2013 02:14 PM, Tetsuya wrote: > Vim has everything, you just need a bunch of plugins. > I code mainly in python and django, and I use these plugins (among others): > > powerline (status bar indicating git branch, etc..) > syntastic (support for pep8, flake8, pyflakes, etc..) > ctrlp (fuzz

finding abc's

2013-01-25 Thread lars van gemerden
Hi all, i was writing a function to determine the common base class of a number classes: def common_base(classes): if not len(classes): return None common = set(classes.pop().mro()) for cls in classes: common.intersection_update(cls.mro()) while len(common) > 1:

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Chris Angelico
On Sat, Jan 26, 2013 at 4:35 AM, Leonard, Arah wrote: >>> >>> It's just a text file after all. >>> >> >> True indeed, let's not worry about trivial issues like indentation, mixing >> tabs and spaces or whatever. Notepad anybody? :) >> > > Hey, I didn't say Notepad was the *best* tool for the job

RE: The best, friendly and easy use Python Editor.

2013-01-25 Thread Leonard, Arah
>> >> It's just a text file after all. >> > > True indeed, let's not worry about trivial issues like indentation, mixing > tabs and spaces or whatever. Notepad anybody? :) > Hey, I didn't say Notepad was the *best* tool for the job, just that Python scripts are merely text files. Though, tha

Python GUI able to display a spatial image

2013-01-25 Thread Alex
Hello, does python have capabilities to display a spatial image and read the coordinates from it? If so, what modules or extension do I need to achieve that? I'll appreciate any help. Thanks, Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Wolfgang Keller
> for all senior can you suggest me the best, friendly and easy use > with nice GUI editor for me, and have many a good features such as > auto complete/auto correct. Depends on what you are used to. If you're used to bare-bones editors such as emacs, vim etc, they can be used for Python. If you

Re: Need Pattern For Logging Into A Website

2013-01-25 Thread Tim Daneliuk
On 01/25/2013 10:01 AM, Steve Petrie wrote: On Thursday, January 24, 2013 8:29:51 PM UTC-5, Tim Daneliuk wrote: I need to write a Python script to do the following: - Connect to a URL and accept any certificate - self-signed or authoritative - Provide login name/password credentials

Re: Need Pattern For Logging Into A Website

2013-01-25 Thread Steve Petrie
On Thursday, January 24, 2013 8:29:51 PM UTC-5, Tim Daneliuk wrote: > I need to write a Python script to do the following: > > > >- Connect to a URL and accept any certificate - self-signed or > authoritative > >- Provide login name/password credentials > >- Fill in some presented

Re: mysql solution

2013-01-25 Thread Ferrous Cranus
Τη Πέμπτη, 24 Ιανουαρίου 2013 10:43:59 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: > On Thu, 24 Jan 2013 03:04:46 -0800 (PST), Ferrous Cranus > > declaimed the following in > > gmane.comp.python.general: > > > > > # insert new page record in table counters or update it if already exists

Re: create object base on text file

2013-01-25 Thread cxleung
On Friday, January 25, 2013 9:04:31 PM UTC+8, Dave Angel wrote: > On 01/25/2013 07:06 AM, moonhkt wrote: > > > Hi All > > > > > > Python 2.6.x on AIX > > > > > > Data file > > > > > > PrinterA > > >print Production batch1 > > > xx > > >

Re: using split for a string : error

2013-01-25 Thread Neil Cerutti
On 2013-01-25, Hans Mulder wrote: >> Right. atoi is no good even in C. You get much better control >> using the sprintf family. > > I think you meant sscanf. Yes, thanks for knocking that huge chunk of rust off of me. ;) -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: using split for a string : error

2013-01-25 Thread Joel Goldstick
Don't forget to look at csv reader. http://docs.python.org/2/library/csv.html On Fri, Jan 25, 2013 at 9:31 AM, Hans Mulder wrote: > On 25/01/13 15:04:02, Neil Cerutti wrote: > > On 2013-01-25, Oscar Benjamin wrote: > >> On 24 January 2013 11:35, Chris Angelico wrote: > >>> It's usually fine

Re: using split for a string : error

2013-01-25 Thread Hans Mulder
On 25/01/13 15:04:02, Neil Cerutti wrote: > On 2013-01-25, Oscar Benjamin wrote: >> On 24 January 2013 11:35, Chris Angelico wrote: >>> It's usually fine to have int() complain about any >>> non-numerics in the string, but I must confess, I do sometimes >>> yearn for atoi() semantics: atoi("123as

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Miki Tebeka
On Thursday, January 24, 2013 2:34:45 AM UTC-8, mik...@gmail.com wrote: > On Thursday, January 24, 2013 9:43:31 AM UTC, Hazard Seventyfour wrote: > > for all senior can you suggest me the best, friendly and easy use with nice > > GUI editor for me, and have many a good features such as auto comple

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Ritchie Flick
You could try ninja-ide or Sublime Text 2. This message was send from my phone Flick Ritchie On 25 Jan 2013 10:45, "Kirill Pekarov" wrote: > > I think PyCharm is ideal for you. > > http://www.jetbrains.com/pycharm/ > > +1 for PyCharm. > I used many ed

Re: monolithic apps

2013-01-25 Thread tamnt54
Glue not just python but whatever is needed to communicate back and forth. lots of data, but whatever could be glue in python of course. The C++ glue and functions would be controlled as python data and communicated between different modules. todd. -- http://mail.python.org/mailman/listinfo/py

Re: using split for a string : error

2013-01-25 Thread Neil Cerutti
On 2013-01-25, Oscar Benjamin wrote: > On 24 January 2013 11:35, Chris Angelico wrote: >> It's usually fine to have int() complain about any >> non-numerics in the string, but I must confess, I do sometimes >> yearn for atoi() semantics: atoi("123asd") == 123, and >> atoi("qqq") == 0. I've not se

Re: monolithic apps

2013-01-25 Thread tamnt54
..snipped... > > 2) Manipulate multiple gui apps while having the same UI as though there > was just one main window, and other windows all belong to it. Multiple > GUI processes, but some central control to change the user experience > into resembling a single GUI app. ...snipped > > You say

Re: create object base on text file

2013-01-25 Thread Dave Angel
On 01/25/2013 07:06 AM, moonhkt wrote: Hi All Python 2.6.x on AIX Data file PrinterA print Production batch1 xx print Production batch2 xx print Production batch3 xx

create object base on text file

2013-01-25 Thread moonhkt
Hi All Python 2.6.x on AIX Data file PrinterA print Production batch1 xx print Production batch2 xx print Production batch3 xxx PrinterB print Prod

Re: How to debug pyd File in Vs???

2013-01-25 Thread Neil Hodgson
Junze Liu: Third, use the embed interpreter to execute a .py File.The .py File include the module that in .pyd File I created. Here, the problem comes out! When I start my main project. I can only debug the problems in my main project, when my main project use the python interpreter

How to debug pyd File in Vs???

2013-01-25 Thread Junze Liu
Recently, I build a hybrid system with C++ and python. First,I encapsulate a class(I can't guarantee the robustness of this class ) with boost.python which can implement some functions that can not be implemented by C++, I get a .pyd File in result. Second,I embed a python interprete

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Kirill Pekarov
> I think PyCharm is ideal for you. > http://www.jetbrains.com/pycharm/ +1 for PyCharm. I used many editors, and PyCharm (IDEA) is just perfect. -- http://mail.python.org/mailman/listinfo/python-list

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Mark Lawrence
On 24/01/2013 19:34, Leonard, Arah wrote: It's just a text file after all. True indeed, let's not worry about trivial issues like indentation, mixing tabs and spaces or whatever. Notepad anybody? :) -- Cheers. Mark Lawrence -- http://mail.python.org/mailman/listinfo/python-list

Re: XML validation / exception.

2013-01-25 Thread dieter
Andrew Robinson writes: > On xml.etree, > When I scan in a handwritten XML file, and there are mismatched tags -- > it will throw an exception. > and the exception will contain a line number of the closing tag which > does not have a mate of the same kind. > > Is there a way to get the line numbe

Re: Else statement executing when it shouldnt

2013-01-25 Thread Frank Millman
On 23/01/2013 15:35, Jussi Piitulainen wrote: Thomas Boell writes: Using a keyword that has a well-understood meaning in just about every other programming language on the planet *and even in English*, redefining it to mean something completely different, and then making the syntax look like th