Dealing with dictionary like strings

2007-06-08 Thread Mr SZ
Hello all, I'm using the urllib module to fetch pages from the web.The returned response is in the structure of a dictionary .For eg: {"":"","label": [ ] ,"torrents": [ ["F0666BDCCBFD01A52535759C044485E2E1CCE3C3",136,"AAA",1250164864,651,646185088,606208,0,0,0,-1,"",0,0,0,0,33564,7,342884352], [

running python scripts via crontab

2007-06-09 Thread Mr SZ
Hello all, I wrote a simple python script to send mail via smtp to my gmail acc.I can run it as python /home/phil/Desktop/smtp.py but when I add the same to my crontab as * * * * * /usr/bin/python2.5 /home/phil/Desktop/smtp.py ,it doesn't run.I checked the process by using top comman

Working with dictionary like strings

2007-06-11 Thread Mr SZ
hello all, I'm using the urllib module to fetch pages from the web.The returned response is in the structure of a dictionary .For eg: {"":"","label": [ ] ,"torrents": [ ["F0666BDCCBFD01A52535759C044485E2E1CCE3C3",136,"AAA",1250164864,651,646185088,606208,0,0,0,-1,"",0,0,0,0,33564,7,342884352], [

ODBC links?

2007-11-12 Thread Mr. Connolly
Lo' there. I'm a new user of Python, what I'm looking for is an easy way to create ODBC links to Access databases (obviously, Access isn't the best database out there I can use, but its easiest to just piece together for this quick project). What modules would I want to be looking for to create

using wxPython events inside a loop

2006-05-17 Thread Mr BigSmoke
I'm writting an applicatio that that does something like this: class batchSpy(wx.Frame): def __init__(self, parent): wx.Frame.__init__( self, None, -1, "Batch Spy", pos = (0,0), size = mySize) do layo

Re: Python in IIS + WSGI

2008-01-11 Thread mr . zeitgeist
On Jan 12, 1:42 am, Phillip Sitbon <[EMAIL PROTECTED]> wrote: > Pardon my typo! > > http://pyisapie.sourceforge.net > > On Jan 11, 4:37 pm, Phillip Sitbon <[EMAIL PROTECTED]> wrote: > > > Recently (finally) updated the PyISAPIe project. Version 1.0.4 > > includes WSGI support (tested with current D

is it a bug?

2008-01-27 Thread Mr Shore
import threading import time class timer(threading.Thread): def __init__(self,no,interval): threading.Thread.__init__(self) self.no=no self.interval=interval def run(self): while True: print 'Thread Object (%d), Time:%s'%(self.no,time.ctime())

mapping problem

2008-02-16 Thread Mr Shore
I've now crawled the meta infor,but with multi name all means the same thing, such as MS,microsoft,microsoft corporation all means the same thing, how can I mapping words like this to the same thing? -- http://mail.python.org/mailman/listinfo/python-list

Re: mapping problem

2008-02-24 Thread Mr Shore
yes you guessed perfectly I'm not a native English speaker sorry for my poor english.. On Feb 16, 6:35 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 16 Feb 2008 01:35:32 -0800,MrShorewrote: > > I've now crawled the meta infor,but with multi name all means the same > >

Re: mapping problem

2008-02-24 Thread Mr Shore
On Feb 16, 6:35 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 16 Feb 2008 01:35:32 -0800,MrShorewrote: > > I've now crawled the meta infor,but with multi name all means the same > > thing, > > such as MS,microsoft,microsoft corporation all means the same thing, how > >

Re: some questions about ejabberd,spark and psi

2008-02-24 Thread Mr Shore
the url missed http://allforces.com/2005/05/06/ichat-to-msn-through-jabber/ On 2月25日, 上午12时01分, Mr Shore <[EMAIL PROTECTED]> wrote: > hi,every buddy > I've now installed a jabber server,right it's ejabberd mentioned above > and 2 jabber client,right again it's spark

some questions about ejabberd,spark and psi

2008-02-24 Thread Mr Shore
hi,every buddy I've now installed a jabber server,right it's ejabberd mentioned above and 2 jabber client,right again it's spark and psi and I can connect to jabber server by spark but failed by psi,saying 'certificate failed the authenticity test;Reason:certificate is self signed' and i follow thi

imaplib thread method anomaly

2009-02-03 Thread Mr SZ
Hi, I was looking at the thread functionality of IMAP4rev1 servers with the threading extension. Here is my output with debug=8 : 02:23.02 > GDJB3 UID THREAD references UTF-8 (SEEN) 02:23.02 < * THREAD (3)(2)(4)(1) 02:23.02 matched r'\* (?P[A-Z-]+)( (?P.*))?' => ('THREAD', ' (3)(2)

Re: Free place to host python files?

2008-12-16 Thread Mr . SpOOn
2008/12/16 feba : > Stuff like code.google, sf.net, are more oriented towards serious > development, not just holding random apps, aren't they? > > Anyway, I found MediaFire, which looks like it will suffice for now. Take a look to Dropbox (http://www.getdropbox.com/). You can use it to directly

OT: Binary tree logarithms properties

2008-12-17 Thread Mr . SpOOn
Hi, I'm searching for a clear explanation of binary tree properties, expecially the ones related to logarithms. For example, I know that in a tree with 2n-1 nodes, we have log(n) levels, from 0 to log(n). So, if k is the level, the nodes on a level have indexes between 2^k and 2^(k+1)-1. For k=0

Re: OT: Binary tree logarithms properties

2008-12-18 Thread Mr . SpOOn
2008/12/17 Terry Reedy : > Nodes only have single number indexes if you arrange them linearly. Then the > index depends on how you arrange them, whether you start the array indexes > with 0 or 1, and whether you start the level numbers with 0 or 1. Call the > breadth-first sequence bf. Then the 1

Overloading operators

2008-10-15 Thread Mr . SpOOn
Hi, in a project I'm overloading a lot of comparison and arithmetic operators to make them working with more complex classes that I defined. Sometimes I need a different behavior of the operator depending on the argument. For example, if I compare a object with an int, I get a result, but if I com

Re: Overloading operators

2008-10-16 Thread Mr . SpOOn
Thanks for the suggestion. I think I'm gonna try the multimethods way, that I didn't know about it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Overloading operators

2008-10-16 Thread Mr . SpOOn
On Thu, Oct 16, 2008 at 10:54 PM, Lie Ryan <[EMAIL PROTECTED]> wrote: > On Wed, 15 Oct 2008 14:34:14 +0200, Mr.SpOOn wrote: > Something that is more pythonic is something that doesn't use > multimethods. It's just an elaborated way to do type checking. In python, > you usually avoid type checking a

Ordering python sets

2008-10-22 Thread Mr . SpOOn
Hi, I need a structure to represent a set of integers. I also need to perform on this set some basic set operations, such as adding or removing elements, joining with other sets and checking for the presence of specific elements. I think that using Python sets would be the best choice, but I also

Re: Ordering python sets

2008-10-22 Thread Mr . SpOOn
On Wed, Oct 22, 2008 at 3:37 PM, Peter Otten <[EMAIL PROTECTED]> wrote: > Tim Chase wrote: > >> Though for each test, in 2.3, 2.4, and 2.5 that I've got >> installed on my local machine, they each printed "s" in-order, >> and the iteration occurred in-order as well, even without the >> added "sorte

Re: Ordering python sets

2008-10-22 Thread Mr . SpOOn
On Wed, Oct 22, 2008 at 4:30 PM, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Mr.SpOOn <[EMAIL PROTECTED]> wrote: > >> It seems to me that it orders elements when you add using the add() >> method, but if you create a set starting from a list, it may result >> unordered

Global dictionary or class variables

2008-10-24 Thread Mr . SpOOn
Hi, in an application I have to use some variables with fixed valuse. For example, I'm working with musical notes, so I have a global dictionary like this: natural_notes = {'C': 0, 'D': 2, 'E': 4 } This actually works fine. I was just thinking if it wasn't better to use class variables. Sin

Exact match with regular expression

2008-10-26 Thread Mr . SpOOn
Hi, I'd like to use regular expressions to parse a string and accept only valid strings. What I mean is the possibility to check if the whole string matches the regex. So if I have: >>> p = re.compile('a*b*') I can match this: 'aabbb' >>> m = p.match('aabbb') >>> m.group() 'aabbb'

Re: Web crawler on python

2008-10-26 Thread Mr . SpOOn
On Sun, Oct 26, 2008 at 9:54 PM, sonich <[EMAIL PROTECTED]> wrote: > I need simple web crawler, > I found Ruya, but it's seems not currently maintained. > Does anybody know good web crawler on python or with python interface? What about BeautifulSoup? http://www.crummy.com/software/BeautifulSoup/

Re: Exact match with regular expression

2008-11-03 Thread Mr . SpOOn
On Sat, Nov 1, 2008 at 1:57 AM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Rob > Williscroft wrote: > >> Read (and bookmark) this: >> >> http://www.python.org/doc/2.5.2/lib/re-syntax.html > > Funny how you never get a thank-you when you tell people to RTFM. My

Re: locating the chorus in a MIDI song?

2008-11-04 Thread Mr . SpOOn
On Tue, Nov 4, 2008 at 5:20 AM, Joe Strout <[EMAIL PROTECTED]> wrote: > We've got a need to generate short "samples" of songs that are in MIDI > format, to provide a preview function in a web app. We'd like to do > something more clever than just taking the middle 20 seconds (or whatever) > of the

Inheritance problem

2008-11-05 Thread Mr . SpOOn
Hi, I have a problem with this piece of code: class NoteSet(OrderedSet): def has_pitch(self): pass def has_note(self): pass class Scale(NoteSet): def __init__(self, root, type): self.append(root) self.type = type ScaleType(scale=self) OrderedS

Re: Inheritance problem

2008-11-05 Thread Mr . SpOOn
On Wed, Nov 5, 2008 at 6:59 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > You need to call the __init__ of NoteSet inside Scale, as otherwise the > instance isn't properly initialized. Thanks, solved. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ordering python sets

2008-11-05 Thread Mr . SpOOn
The discussion's gone a bit off topic so I don't know if it is a good idea to continue here. I'll try. My first question was about a way to order a python set. Someone suggested to try this module: http://code.activestate.com/recipes/528878/ It seemed pretty good, but I've tried it just today an

Re: Ordering python sets

2008-11-06 Thread Mr . SpOOn
On Wed, Nov 5, 2008 at 10:03 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Only hashable objects can go in a set. By default a class you define is > not hashable (unless it descends from a hashable class). To remedy this > you can define a __hash__ method in your class. IIRC the only > requi

More __init__ methods

2008-11-06 Thread Mr . SpOOn
Hi, I know there can be only one __init__ method (at least, I think). Often I need an object to be created in different ways, for example passing a string as argument, or an integer, or another object. To achieve this I put the default value of the arguments to None and then I some if...elif insid

Re: More __init__ methods

2008-11-06 Thread Mr . SpOOn
On Thu, Nov 6, 2008 at 4:59 PM, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > class A(object): >def __init__(self, a, b, c): >self.a = a ># ... > >@classmethod >def from_string(cls, s): ># ... >return cls(a, b, c) Thanks. I think it's time to st

Re: More __init__ methods

2008-11-06 Thread Mr . SpOOn
On Thu, Nov 6, 2008 at 7:44 PM, Tim Golden <[EMAIL PROTECTED]> wrote: > While that's no bad thing, you don't really need to do > that simply to understand these examples: they're just > saying "do whatever you need to to make these method > class methods, not instance methods". Yes. I think this

Re: More __init__ methods

2008-11-07 Thread Mr . SpOOn
On Thu, Nov 6, 2008 at 11:00 PM, Ben Finney <[EMAIL PROTECTED]> wrote: > Yes, the main reason is that it kills duck typing. The initialiser > should *use* the parameters passed, and allow exceptions to propagate > back to the caller if the parameters don't behave as expected. > > Another good reaso

Re: More __init__ methods

2008-11-07 Thread Mr . SpOOn
On Fri, Nov 7, 2008 at 4:16 PM, Duncan Booth <[EMAIL PROTECTED]> wrote: > There is a really big advantage to being explicit in this situation: you no > longer have to make sure that all your constructors use a unique set of > types. Consider: > > class Location(object): >def __init__(self, lat,

Re: More __init__ methods

2008-11-07 Thread Mr . SpOOn
On Thu, Nov 6, 2008 at 11:00 PM, Ben Finney <[EMAIL PROTECTED]> wrote: > Yes, the main reason is that it kills duck typing. The initialiser > should *use* the parameters passed, and allow exceptions to propagate > back to the caller if the parameters don't behave as expected. > > Another good reaso

Re: More __init__ methods

2008-11-07 Thread Mr . SpOOn
On Fri, Nov 7, 2008 at 7:02 PM, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> What if I need the parse method to be called in other parts of the >> program? > > I don't understand!? Then you call it from those other parts. Yes, you're right. Don't know why, but I was thinking to use @cl

Re: is there really no good gui builder

2008-11-09 Thread Mr . SpOOn
On Sun, Nov 9, 2008 at 12:29 AM, Stef Mientki <[EMAIL PROTECTED]> wrote: > Qt seems to be good, but I don't like their licence. What's the problem with qt licence? -- http://mail.python.org/mailman/listinfo/python-list

wildcard match with list.index()

2008-11-10 Thread Mr . SpOOn
Hi, is there any way to search elements in a list using wildcards? I have a list of various elements and I need to search for elements starting with 'no', extract them and put in a new list. I was thinking about something like: mylist.index('no*') Of course this doesn't work. -- http://mail.pyth

Re: wildcard match with list.index()

2008-11-11 Thread Mr . SpOOn
Thanks, I just have to choose which one to use :) -- http://mail.python.org/mailman/listinfo/python-list

Free Downloadable Presentations--http://www.yfrindia.com/resources/Presentations

2008-11-14 Thread Mr. Lonely
Dear Friend, Preparing to GET A JOB? Applying for a competitive exam? Heading for GATE, CAT, XAT, MAT, TOEFL, GRE? Want to clear a certification, like MCP, SCJP? We have solution to all your answers. YFRIndia.com presents you a new approach in online education for all your preparation needs to get

Building musical chords starting from (a lot of) rules

2008-11-14 Thread Mr . SpOOn
Hi, I'm writing a method to create musical chords. This method must follow a specific set of syntax rules. At least, this is my idea, but maybe there's a better way. Anyway, in the code I have class Chord which is a set. The costrunction of a chord is based on a root note and a structure, so by d

Regular expression and exception

2008-11-15 Thread Mr . SpOOn
Hi, I've never used exception before, but I think now it's time to start. I've seen that there is a list of the built-in exceptions in the Python docs, but this explains the meaning of every exception. Does exist an inverted list? I mean, how may I know what kind of exception is going to raise my

Re: Building musical chords starting from (a lot of) rules

2008-11-16 Thread Mr . SpOOn
On Sun, Nov 16, 2008 at 7:21 AM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Mr.SpOOn > wrote: > >> C 9 is a base chord plus a the ninth note, but this implies the >> presence of the seventh too, so it results in: C E G B D > > I don't recall such meanings in th

Customizing sequence types

2008-11-16 Thread Mr . SpOOn
Hi, I'm trying to create a class which inherit a list to change some behavior. This list should contain other instance objects and has to manage these instances in a particular way. 1) I need to sort this elements in this list, but they must be sorted using an instance variable. What does Python u

Re: Customizing sequence types

2008-11-16 Thread Mr . SpOOn
On Sun, Nov 16, 2008 at 7:15 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Mr.SpOOn <[EMAIL PROTECTED]> writes: > >> Hi, >> I'm trying to create a class which inherit a list to change some behavior. >> This list should contain other instance objects and has to manage >> these instances in a par

Re: Customizing sequence types

2008-11-17 Thread Mr . SpOOn
It seems that I solved my main problem, but I still have some doubt. I'll make an example: >>> class foo: ...def __init__(self, a): ...self.a = a ... >>> f = foo(1) >>> f2 = foo(2) >>> f3 = foo(3) >>> f1 = foo(1) >>> s = set() >>> s.add(f) >>> s set([<__main__.foo instance at 0x8311fa

Re: Customizing sequence types

2008-11-17 Thread Mr . SpOOn
On Mon, Nov 17, 2008 at 8:30 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Sets and dicts use __hash__ and __eq__ together, as documented. > > "If a class does not define an __eq__() method it should not define a > __hash__() operation either;" (3.0 manual, but same earlier). Well, maybe, but in th

Re: Customizing sequence types

2008-11-18 Thread Mr . SpOOn
On Tue, Nov 18, 2008 at 1:59 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > Yes, __cmp__ is gone in 3.0 > You said you wrote __cmp__ the same as __eq__ and that's wrong, they return > different results. Try something like this (untested): > > class X: > def __init__(self, a): self.a = a > def

Re: Programming exercises/challenges

2008-11-19 Thread Mr . SpOOn
On Wed, Nov 19, 2008 at 1:50 PM, Jeremiah Dodds <[EMAIL PROTECTED]> wrote: > If you need to do it on the extremely cheap, you can host on your own > machine on a port other than 80, make sure your router / firewall is > forwarding the port to your machine, and use dyndns (http://dyndns.com) to > gi

Re: Programming exercises/challenges

2008-11-19 Thread Mr . SpOOn
On Wed, Nov 19, 2008 at 1:35 PM, Jeremiah Dodds <[EMAIL PROTECTED]> wrote: > > Personally, I prefer a host that gives me root on a box (or virtual > machine). I've had a great time with slicehost (http://slicehost.com). Yes, I knew about slicehost, but it is expensive for what I need to do, that i

Re: Programming exercises/challenges

2008-11-19 Thread Mr . SpOOn
On Wed, Nov 19, 2008 at 2:39 AM, Mensanator <[EMAIL PROTECTED]> wrote: > Another hobby I have is tracking movie box-office receipts > (where you can make interesting graphs comparing Titanic > to Harry Potter or how well the various sequels do, if Pierce > Brosnan saved the James Bond franchise, wh

Re: Programming exercises/challenges

2008-11-19 Thread Mr . SpOOn
On Wed, Nov 19, 2008 at 3:41 PM, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > I'm not sure why you'd need to host the Python code anywhere other than your > home computer. If you wanted to pull thousands of pages from a site like > that, you'd need to respect their robots.txt file. Don't forget to

Re: Building musical chords starting from (a lot of) rules

2008-11-19 Thread Mr . SpOOn
I think I've found a nice way to represent and build chords. At least, at the moment it satisfy me, maybe later I'll understand how it sucks. I'm using two separate classes: one represent a chord and is implemented as a set of Notes; the other represents the structure (type) of the chord and is a

strange permission issue with nosetests

2008-11-20 Thread Mr . SpOOn
Hi, I'm trying the nose testing package. I've just started reading the tutorial and I had a problem with the first simple example. This is the test: def test_b(): assert 'b' == 'b' In the same directory I gave the command nosetests and it runs the test. Then I try with nosetests -v, but it

Re: strange permission issue with nosetests

2008-11-20 Thread Mr . SpOOn
On Thu, Nov 20, 2008 at 13:34, Ben Finney <[EMAIL PROTECTED]> wrote: > Mr.SpOOn <[EMAIL PROTECTED]> writes: > >> Searching on google I found this: http://www.siafoo.net/article/61 >> He had the same issue and said to change permission of the file to 664. > > Unit test modules, which are primarily m

Re: matching exactly a 4 digit number in python

2008-11-21 Thread Mr . SpOOn
2008/11/21 harijay <[EMAIL PROTECTED]>: > Hi > I am a few months new into python. I have used regexps before in perl > and java but am a little confused with this problem. > > I want to parse a number of strings and extract only those that > contain a 4 digit number anywhere inside a string > > How

Emulate a printf() C-statement in Python???

2009-03-19 Thread Mr. Z
I'm trying emulate a printf() c statement that does, for example char* name="Chris"; int age=30; printf("My name is %s", name); printf("My name is %s and I am %d years old.", %s, %d); In other words, printf() has a variable arguement list the we all know. I'm trying to do this in Python... clas

Re: Emulate a printf() C-statement in Python???

2009-03-19 Thread Mr. Z
"Andrii V. Mishkovskyi" wrote in message news:mailman.2185.1237467269.11746.python-l...@python.org... On Thu, Mar 19, 2009 at 2:43 PM, Mr. Z wrote: > I'm trying emulate a printf() c statement that does, for example > > char* name="Chris"; > int age=30; >

getattr on a function

2009-04-27 Thread Mr SZ
Hi all, Is it possible to call functions using getattr. I have written a simple script with functions that call either SSL, TLS or plain functionality. something like: def func(): ... def funcSSL(): ... def funcTLS(): ... Now, based on my args I would like to call either one of them. I

vmware job vacancy!

2008-06-16 Thread Mr Shore
A veteran engineer from VMWare Inc., Jeffrey, is being featured on jobirn.com on Monday Jun 16, from 9am to 5pm (PST.) He will chat with applicants who are interested in job openings in VMWare. He will identify qualified candidates and directly submit qualified candidates' resumes to hiring manager

Re: Learning Python in a group

2008-06-26 Thread Mr. Juju
Taygun Kekec wrote: hi guys. I would be glad to join your group because i want to learn deeper python but i am frustrated of isolation too. It would provide stimulation and encourage to study and will boost our desire to learn. So count me in! hello all, I just started studying python myself a

UnboundLocalError problems

2008-06-29 Thread Mr SZ
Hi, I am writing a small script that changes my pidgin status to away when I lock my screen.I'm using the DBUS API for pidgin and gnome-screensaver.Here's the code: #!/usr/bin/env python import dbus, gobject from dbus.mainloop.glib import DBusGMainLoop dbus.mainloop.glib.DBusGMainLoop(set_as_

Filechooser issues

2008-07-11 Thread Mr SZ
Hi, I am using a gtk.filechooser dialog to open and save files.How do I add a filter so that only images are filtered ?I did something like this:     def get_save_filename(self):         filename = None     chooser = gtk.FileChooserDialog("Save File...", self.window,

Adding a Cairo object into a vbox using pygtk

2008-07-11 Thread Mr SZ
Hi , I am trying to attach a cairo object into a vbox.I can pack a textbox with the following code:     entry = gtk.Entry()     entry.set_max_length(50)     entry.connect("activate", self.enter_callback, entry)     entry.set_text("hello")     entry.insert_text(" world", len(entry.get_text()))   

Simple Image Cropper

2008-07-14 Thread Mr SZ
Hi, I am designing a simple image cropper which simply takes an image and use PIL to do the cropping.Now in order to do the cropping I simply draw a rectangle on the image by dragging the mouse over the image.I then use button press and button release events to find the mouse postition and send

Handling events using pycairo

2008-07-17 Thread Mr SZ
Hi, I'm trying to create a rectangle when the user presses or releases the mouse over a cairo object.I'm using the eventBox to capture the mouse events. Now the problem is the shapes is beng drawn when I call it from the expose_event event handler and nothing happens when I call the same from t

Help with decorators

2008-07-18 Thread Mr SZ
Hi, I'm using decos for the first time.I want to check the input and then call a function in a class. I'm pasting the code:     def check_input_sanity(self,rover_input):         '''Check the input from client'''         def _check(fn):             def _inner(rover_input):                 if ro

regex doubts

2008-07-19 Thread Mr SZ
Hi, I am taking a string as an input from the user and it should only contain the chars:L , M or R I tried the folllowing in kodos but they are still not perfect: [^A-K,^N-Q,^S-Z,^0-9] [L][M][R] [LRM]?L?[LRM]? etc but they do not exactly meet what I need. For eg: LRLRLRLRLM is ok but LRLRLRNL

ldap

2008-04-07 Thread mr . enx
sorry, i'm new with Python. I must do interaction beetween Python and Ldap, and I don't know how do this. Searching on the web I know that exists PythonLdap, but I dont'know if this is best choise or not. Thank's -- http://mail.python.org/mailman/listinfo/python-list

Weirdness comparing strings

2008-09-30 Thread Mr . SpOOn
Hi, I have this piece of code: class Note(): ... ... def has_the_same_name(self, note): return self == note def __str__(self): return self.note_name + accidentals[self.accidentals] __repr__ = __str__ if __name__ == '__main__': n = Note('B')

Re: Weirdness comparing strings

2008-09-30 Thread Mr . SpOOn
On Tue, Sep 30, 2008 at 12:55 PM, Ken Seehart <[EMAIL PROTECTED]> wrote: > Instance comparison is not necessarily the same as string comparison. > Neither __str__ nor __repr__ are implicitly used at all for comparison. Ok, I see. > In fact, by default a pair of instances are not equal unless the

Python, VB math simple problem

2006-03-31 Thread Mr X
Hi looking for help with what should be a fairly simple Python problem, relating to VB inter-operability. Got a great response from a fellow named Matt at [EMAIL PROTECTED], pointed me in some good directions - some areas, concerns still foggy on, the below thread is included any feedbac

Python, VB math simple problem

2006-03-31 Thread Mr X
Hi looking for help with what should be a fairly simple Python problem, relating to VB inter-operability. Got a great response from a fellow named Matt at [EMAIL PROTECTED], pointed me in some good directions - some areas, concerns still foggy on, the below thread is included any feedbac

Re: Numpy and cPickle

2006-04-15 Thread Mr. M
Martin Manns wrote: > Robert Kern wrote: >> Martin Manns wrote: > >>> If I cPickle a numpy array under Linux and un-cPickle it under Solaris >>> 10, my arrays seem to be transposed. >> Transposed? That's odd. There was a byteorder issue with pickles going across >> differently-endianed platforms

Find the name of a setup tools plugin when its class is known.

2009-06-29 Thread Mr SZ
Hi, Using pkg_resources, I can iterate through the plugins in an entrypoint and note down the plugin classes and all using "pkg_resources.iter_entry_points(ENTRYPOINT)" Now, when the plugin is loaded, I want to know it's entrypoint name as I have to load a bunch of settings identified by the

Learning to use decorators with classes

2009-06-30 Thread Mr SZ
Hi, I'm writing an LDAP plugin for my TG2 application. In this I wrote a small class based decorator with args to set up a connection and call the necessary functionality but I'm having problems with it. Here's my code: class getConnection(object): def __init__(self, settings, credentials)

A newbie doubt on methods/functions calling

2016-10-06 Thread mr . puneet . goyal
Hi I just started learning python. Is there any way to call functions in different way ? Rather calling obj.function(arg1, arg2) I would like to call like below "obj function arg1 arg2" this function is part of a class. class myClass: def function(arg1, arg2): # do something

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread mr . puneet . goyal
Well I jump from TCL to Python. And found that it was very convenient to use Procs there. So I was looking for that luxury in Python. I am not trying to reinvent the wheel. I was just curious to know if there is any possibility to create a caller function in my way (TCL) where I can call pyth

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread mr . puneet . goyal
Let me rephrase my question in other way. class myClass: def __init__(self, var): self.var = var myObj = myClass(abc) # I am calling instance with function name and arguments myObj func1 arg1 arg2 Can i associate any function like __init__ with instance ? Means if I just use in

How to process syntax errors

2016-10-10 Thread mr . puneet . goyal
Hi Is there any way to capture syntax errors and process them ? I want to write a function which calls every time whenever there is syntax error in the program. For example, inside example.py I just mention below line Obj = myClass() Obj xyz Obj is instance of a class. But there is synt

Re: How to process syntax errors

2016-10-12 Thread mr . puneet . goyal
Hi All Its really good to see that some discussion happening around this topic. Sorry I was out from my work for sometime so couldn't follow up but I really find it useful. It gives me good opportunity to know python better as I recently started learning python. Ok so I tell you why I need to

Re: How to process syntax errors

2016-10-12 Thread mr . puneet . goyal
On Monday, October 10, 2016 at 7:45:40 PM UTC+5:30, mr.pune...@gmail.com wrote: > Hi > > Is there any way to capture syntax errors and process them ? I want to write > a function which calls every time whenever there is syntax error in the > program. > > For example, > > inside example.py >

Help building python application from source

2020-02-28 Thread Mr. Lee Chiffre
sorry re posting because I forgot subject line in last email. I am a python noob. This is why I ask the python masters. There is a python software I want to install on the server it is called Electrumx. https://github.com/kyuupichan/electrumx is the link. I am having troubles with installing t

Re: Help building python application from source

2020-02-29 Thread Mr. Lee Chiffre
Thanks for the comments. > (To make OP's requirements plainly visible, note that this appears to > be a cryptocurrency application.) Correct. It is a software that does not store private keys but acts as a server to serve lightweight wallets that would connect to it remotely. Electrumx does not

Python question

2020-03-06 Thread Mr. Lee Chiffre
Thank you Marco for at least taking the time to read my message even if you do not agree with me on things. And no disrespect to you. But I came here for python related questions and help. Not to be called suspicious and untrustworthy only because I am concerned about security of users and for bein

Python question

2020-03-06 Thread Mr . Lee Chiffre
Thank you Marco for at least taking the time to read my message even if you do not agree with me on things. And no disrespect to you. But I came here for python related questions and help. Not to be called suspicious and untrustworthy only because I am concerned about security of users and for b

Python question

2020-03-07 Thread Mr . Lee Chiffre
Thank you Marco for at least taking the time to read my message even if you do not agree with me on things. And no disrespect to you. But I came here for python related questions and help. Not to be called suspicious and untrustworthy only because I am concerned about security of users and for b

no-installation version of python

2006-09-22 Thread mr . porteiro . head
Is there a stand-alone version of python out there that I can package with my scripts so that I don't have to bother with something like py2exe? -- http://mail.python.org/mailman/listinfo/python-list

OT: New Python T-shirt available

2006-02-01 Thread Mr t dolton
I created a new Python T-shirt: http://www.cafepress.com/import_re I have been looking for this shirt ever since I fell in love with the slogan a few years ago. I gave up looking and decided to fumble through Photoshop for many hours to make my own. >From today through February 14th, $1.00 from

Daylight saving time question

2007-03-20 Thread Mr Pekka Niiranen
Hi, is it possible to get the two annual daylight saving times (day, month and time) from Python by giving location in some country/location string ("Europe/Finland" for example). I need to ask country in program and calculate daylight saving times for the next few years onwards somehow like this

Python 3000 vs. Python 2.x

2008-06-13 Thread mr . opus . penguin
As a new comer to Python I was wondering which is the best to start learning. I've read that a number of significant features have changed between the two versions. Yet, the majority of Python programs out in the world are 2.x and it would be nice to understand those as well. Thanks for all the

Re: Python 3000 vs. Python 2.x

2008-06-13 Thread mr . opus . penguin
On Jun 13, 4:13 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Jun 13, 4:04 pm, [EMAIL PROTECTED] wrote: > > > As a new comer to Python I was wondering which is the best to start > > learning. I've read that a number of significant features have > > changed between the two versions. Yet, the majo

How do I use PyGTK to put text besides clickable buttons?

2012-04-02 Thread Jason Hsu, Mr. Swift Linux
I've decided to use PyGTK instead of gtkdialog for providing configuration menus/dialog boxes in Swift Linux, the Linux distro I started. The problem with gtkdialog is that the i386 version is no longer available in the Debian repository. Since a picture is worth a thousand words, I'll give you a

Can I fully replace GNU Bash with Python?

2011-11-04 Thread Jason Hsu, Mr. Swift Linux
This question concerns my process of creating Swift Linux from the base distro (antiX Linux in the past, Linux Mint Debian Edition now). (NOTE: The process I'm describing here is an oversimplification.) All of my development work takes place in the ~/develop directory. This is the directory where

Re: Help building python application from source

2020-03-02 Thread Mr. Lee Chiffre via Python-list
> I think I have the solution, but can I ask you why are you creating a > bitcoin server? > Yes. I am a crypto anarchist. I have a bitcoin node to do my part to running the bitcoin network and help remain it decentralized and resilient. The more people that run a node the better it is. When it co

<    1   2