Re: sum function

2012-10-04 Thread Mike
I get below error NameError: name 'functools' is not defined Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: sum function

2012-10-04 Thread Mike
Thanks Ian for the quick reply. I get the below error. NameError: name 'itertools' is not defined Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: sum function

2012-10-04 Thread Mike
On Thursday, October 4, 2012 5:40:26 PM UTC-4, Dave Angel wrote: > On 10/04/2012 05:29 PM, Mike wrote: > > > I get below error > > > > > > NameError: name 'functools' is not defined > > > > > > > functools is a module in t

Re: sum function

2012-10-04 Thread Mike
I agree with you, Ian. Thanks for all the help. Now I get the below error. File "test.py", line 17, in total = sum(float(col.value) for r in iter(next_r, None) for col in r[0].columns.itervalues()) File "test.py", line 17, in total = sum(float(col.value) for r in iter(next_r, None

Re: sum function

2012-10-05 Thread Mike
On Thursday, October 4, 2012 4:52:50 PM UTC-4, Mike wrote: > Hi All, > > > > I am new to python and am getting the data from hbase. > > I am trying to do sum on the column as below > > > > > > scanner = client.scannerOpenWithStop("tab", &

Re: sum function

2012-10-05 Thread Mike
On Friday, October 5, 2012 9:41:44 AM UTC-4, Ramchandra Apte wrote: > On Friday, 5 October 2012 19:09:15 UTC+5:30, Mike wrote: > > > On Thursday, October 4, 2012 4:52:50 PM UTC-4, Mike wrote: > > > > > > > Hi All, > > > > > > > > &

Re: sum function

2012-10-05 Thread Mike
I added the print command. It prints [] when there is no data. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: sum function

2012-10-05 Thread Mike
Terry, I am not using the mail client. I am just posting on the site. Something wrong with this site. When you do individual reply, it does the double posting which it shouldn't. See "Ramachandra Apte's" reply. It is posted twice too. Thanks -- http://mail.python.org/mailman/listinfo/pytho

Re: sum function

2012-10-05 Thread Mike
That worked, Ian. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Print value from array

2012-11-22 Thread Mike
Hello, I am noob en python programing, i wrote a perl script for read from csv but now i wish print value but the value must be within double quote and I can not do this. For example now the output is: ma user@domain displayName Name SecondName givenName Name sn SecondName cn Name and i wish

Re: Print value from array

2012-11-22 Thread Mike
El jueves, 22 de noviembre de 2012 16:02:30 UTC-3, Alister escribió: > On Thu, 22 Nov 2012 10:44:02 -0800, Mike wrote: > > > > > Hello, > > > I am noob en python programing, i wrote a perl script for read from csv > > > but now i wish print value but t

Problem with print and output to screen

2012-12-11 Thread Mike
Hello, I am learning python and i have the next problem and i not understand how fix. The script is very simple, shows in the terminal the command but, the row is divided in two: Example: /opt/zimbra/bin/zmprov ga u...@example.com |egrep "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForward

Re: Problem with print and output to screen

2012-12-11 Thread Mike
El martes, 11 de diciembre de 2012 20:07:09 UTC-3, Joel Goldstick escribió: > On Tue, Dec 11, 2012 at 6:00 PM, Dave Angel wrote: > > > On 12/11/2012 05:53 PM, Joel Goldstick wrote: > > > When you read the file line by line the end of line character is included > > > in the result > > > > >

ElementTree XML parsing problem

2011-04-27 Thread Mike
continue root = tree.getroot() records = root.find('records') for record in records: print record.attrib['id'], record.attrib['education'] if __name__ == "__main__": main() Thanks, -- Mike -- -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
and then: - gives same error as you described. Try to change XML encoding. a. Thanks, Hegedüs and everyone else who responded. That is exactly it - I'm afraid I probably missed it in the docs because I was searching for terms like "unicode" and "coerce." In any

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
On 4/27/2011 12:24 PM, Neil Cerutti wrote: On 2011-04-27, Mike wrote: I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ?. Here's the XML: The complaint offered up by the parser is

nosend missing in suds 0.4?

2011-05-31 Thread Mike
Looks like the nosend attribute is not available in 0.4. Any reason for this? Any plans to add it back and what is the most recent release that does have the nosend option? -- http://mail.python.org/mailman/listinfo/python-list

Re: good way to avoid recomputations?

2016-04-15 Thread Mike
On Tuesday, April 5, 2016 at 4:54:50 PM UTC-4, Maurice wrote: > Hi. I working on a project where I have 5 scripts loading the same file at > the very beginning so I would like to know the best way I can get this file > without having to compute it 5 times. > > I also perform, in all the scripts,

Re: Any better way for this removal?

2020-11-07 Thread Mike
Use .split() to split the string on the character and then use .join() to rejoin the first 2 tokens tokens = text.split(“,”) new_string = “,”.join(tokens[:2]) On Sat, Nov 7, 2020, at 1:46 PM, Bischoop wrote: > > > So I was training with slicing. > Came to idea to remove text after second occu

Re: Telephony project

2005-09-27 Thread Mike
I was able to do something like this in Python a while back. You'll need one of: (a) A telephone line dialer/monitor & DTMF I/O board that works through the serial port, and a phone audio tap that mixes the soundcard I/O to the phone (b) A TAPI-compliant modem that does everything you need (c) A

Re: Perl's documentation come of age

2005-09-27 Thread Mike
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike wrote: >> "Steve Holden" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>>Jim Hugunin's keynote speech at this year's

Re: Perl's documentation come of age

2005-09-27 Thread Mike
"Mike" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Looks like I'm having a bad week w/these URLs, because now I'm not able to > access http://lists.ironpython.com/listinfo.cgi/users-ironpython.com . > I was hoping to get at the archives to

Replacing utf-8 characters

2005-10-05 Thread Mike
Hi, I am using Python to scrape web pages and I do not have problem unless I run into a site that is utf-8. It seems & is changed to & when the site is utf-8. If I try to replace it with .replace('&','&') it for some reason does not replace it. For example: http://today.reuters.co.uk/news/def

Re: Replacing utf-8 characters

2005-10-05 Thread Mike
27;&') But if I now view the the contents link it shows it the same as when it was assigned. Richard Brodie wrote: > "Mike" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > >>However when I pull it into python the URL ends up looki

Re: Replacing utf-8 characters

2005-10-05 Thread Mike
Steve Holden wrote: >>> > You must be doing *something* wrong: > > >>> link = > "/news/newsArticle.aspx?type=businessNews&storyID=2005-10-05T151245Z_01_HO548006_RTRUKOC_0_UK-AIRLINES-BA.xml" > > > >>> link = link.replace('&','&') > >>> link > '/news/newsArticle.aspx?type=businessNe

Re: Replacing utf-8 characters

2005-10-05 Thread Mike
In playing with this I found link.replace does work but when I use link.replace('&','&') it replaces it with & instead of just &. link.replace is working for me since if I changed the second option from & to something else I see the change. So it seems link.replace() function reads whether th

os.access with wildcards

2005-10-06 Thread mike
i'd like to use os.access(path,mode) where path may contain linux style wildcards. i've failed so far. my workaround is the bash command. os.system('[ -e %s ]' % fn ) any suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: os.access with wildcards

2005-10-07 Thread mike
thanks Leif. poor question on my part. I had been using glob.glob(path)==[] and was looking for something more readable, hence os.system('[ -e %s ]' % path ) but that doesn't seem like a good idiom for crossplatform. I thought there may either be a way to escape the wildcards, or an

Re: os.access with wildcards

2005-10-07 Thread mike
thanks Leif. poor question on my part. I had been using glob.glob(path)==[] and was looking for something more readable, hence os.system('[ -e %s ]' % path ) but that doesn't seem like a good idiom for crossplatform. I thought there may either be a way to escape the wildcards, or an

Re: os.access with wildcards

2005-10-07 Thread mike
Test for the existence of one or more matches of the wildcard expression. For example: Are there any files that begin with 2005? This doesn't work (wish it did): os.access('2005*',os.F_OK) However, these work arounds do the job: glob.glob('2005*')==[] as does this bash command:

Re: os.access with wildcards

2005-10-07 Thread mike
Test for the existence of one or more matches of the wildcard expression. For example: Are there any files that begin with 2005? This doesn't work (wish it did): os.access('2005*',os.F_OK) However, these work arounds do the job: glob.glob('2005*')==[] as does this bash command:

Re: os.access with wildcards

2005-10-07 Thread mike
dude, you are the sap that wrote "it's not clear". get a life. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.access with wildcards

2005-10-07 Thread mike
No need to apologize for continuing to waste your time, self.plonk. Get a life, though, and you'll be happier. As to your question, well, not before you apologize for thread crapping. As for your possible solutions, if you consider any of yours to be "readable", then i have no interest in coding

Re: os.access with wildcards

2005-10-07 Thread mike
Thanks Mike. Would there be an idiom using "is"? somethng like glob.glob('2005*) is not Empty I have not figured out what to put on the right hand side of "is" I guess, for readability, nothing has come up that seems _great_. One last effort would be to hide the

Re: os.access with wildcards

2005-10-07 Thread mike
Hi Dan, It works, it's elegant, and it uses python strengths. I guess I have to settle the question of who my audience is. That is who do I want to make it readable for. All the solutions so far require some python specific knowledge, and there are some which are horendous even at that. Perhaps

Re: os.access with wildcards

2005-10-08 Thread mike
ugly. i guess this thread shows that you are clueless regarding your thread crapping. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.access with wildcards

2005-10-16 Thread mike
os.path.exists() -- http://mail.pyth

several interpreters and suspend script

2005-10-24 Thread Mike
Hello All, I'm working ( and a beginner ) with mixing Python scripting and C++. And I need some little help. :) I've searched on the net, but found no answer. So I ask you directly. Globally, I'd like to do 2 things. The first, when I'm in the program, I call a script, which call a function t

Re: Making immutable instances

2005-11-23 Thread Mike
"Ben Finney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Howdy all, > > How can a (user-defined) class ensure that its instances are > immutable, like an int or a tuple, without inheriting from those > types? > > What caveats should be observed in making immutable instances? IM

Re: Making immutable instances

2005-11-24 Thread Mike
"Giovanni Bajo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike wrote: > >>> How can a (user-defined) class ensure that its instances are >>> immutable, like an int or a tuple, without inheriting from those >>> types? >>&g

Re: Making immutable instances

2005-11-24 Thread Mike
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Op 2005-11-24, Mike schreef <[EMAIL PROTECTED]>: [...snip...] >> ...but I think Python's voluntary >> DoThis, _DoThisIfYouReallyHaveTo, and __You'dBetterKnowWhatYou&#

Re: Making immutable instances

2005-11-24 Thread Mike
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Mike Meyer wrote: >> "Giovanni Bajo" <[EMAIL PROTECTED]> writes: >> > Mike Meyer wrote: >> >> Note that this property of __slots__ is an implementation detail. You >> >

Re: Software keyboard

2005-11-24 Thread Mike
You need to call keybd_event which is (or was in win3.x - win95 at least) in USER32.DLL. Simulate return keypress: keybd_event(VK_RETURN,0,0,0); keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0); Google turned this up: http://www.howtodothings.com/viewarticle.aspx?article=395 Note: This is ol

This Program Realy Works

2005-01-06 Thread MIke
6 envelopes to the following addresses: #1 John Christensen 5446 Santa Barbara Sparks, NV 89436 #2 Randall Hines 22 Stature Dr. Newark DE 19713 #3 Mike Sharrer 921 West State St. Coopersburg PA 18036 #4 Travis Montgomery 2211 Elmers Lane Norfolk NE 68701 #5 James Adair the third 22 Over Rd. Feasterv

is extending an object considered acceptable usage?

2005-01-24 Thread mike
i have an Item which belongs to a Category, so Item has: - item.categoryId, the database primary key of its Category - item.category, a reference to its Category. this null unless i need a reference from item to its Category object, in which case i call setCategory(category) sometimes i want a

py.dll for version 2.2.1 (Windows)

2005-01-28 Thread mike
for Windows (XP) ? I looked at www.python.org and do not see a py.dll file in the self-installation or .tgz versions of 2.2.1 that are posted. Thanks ! Mike -- http://mail.python.org/mailman/listinfo/python-list

Microsoft Visual C++ and pyton

2005-01-30 Thread mike
Hi, I am new with python. Is it possible to have an MFC application and develop some module using python? what are the steps in doing this? can anybody give me a url or some documentation for this.. thanks.. mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Visual C++ and pyton

2005-01-31 Thread mike
Thanks Chris.. I was also advised to build the python core (pythoncore.vcproj) with my C++ program. By that way I would not have to load the python core anymore during runtime. Is this a good approach? I am currently using VC++ 7 and python 2.4. - mike Christopher De Vries wrote: > On Sun, Jan

Re: python object model diagram

2005-09-09 Thread Mike
I think he's looking for diagrams of the batteries-included modules and classes. My guess is that he thinks there's a set of "framework" classes that is a lot deeper and class-ier than it is, similar to what you'd find in C++, C#, Java, etc. So, OP - who won the guessing game :) m "gene tani

Re: Perl's documentation come of age

2005-09-22 Thread Mike
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jim Hugunin's keynote speech at this year's PyCon was accompanied by a > projection if his interactive interpreter session, and I know I wasn't > alone in finding this a convincing example of Microsoft's (well, Jim's,

NEED MONEY FOR FAMILY MATTERS

2005-02-28 Thread mike
HI I WAS A MARINE MECHANIC working boat engines for 20 years and now I have started making money for the rest of my life after i got into my own business but I wish I had started many years ago, check it out for yourself you'll be HAPPY you did. This site changed my life and my families and it will

help running python in a limited interpreted environment

2004-12-02 Thread Mike
We have a large c++ program that runs under Windows NT Embedded to control an instrument. That program has been written to run external python scripts. The computer where this code runs does not and cannot have a full python installation. It ONLY has the pythonNN.dll file that comes with a full

Re: Python installation breaks Outlook Express

2004-12-06 Thread Mike
I have the same problem. It isn't a problem with Outlook. It is with Python. I loose my wired AND wireless connections. Removing Python bringst them back to operational. Mike M. Laymon wrote: > I just installed Python 2.3.3 under Windows XP professional. After I > did, my wi

Re: Writing to stdout and a log file

2005-04-19 Thread Mike
Thanks. I should've mentioned I want StdoutLog to subclass the 'file' type because I need all the file attributes available. I could add all the standard file methods and attributes to StdoutLog without subclassing 'file' but I'd rather avoid this if I can. -- http://mail.python.org/mailman/li

Writing to stdout and a log file

2005-04-19 Thread Mike
on my screen. Where's the screen output? It looks like the superclass's write() method is getting called instead of the StdoutLog instance's write() method. The python documentation says 'print' should write to sys.stdout.write() but that doesn't seem to be happening

Re: Writing to stdout and a log file

2005-04-20 Thread Mike
flushing stdout has no effect. I've got an implementation that does not subclass file. It's not as nice but it works. -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to stdout and a log file

2005-04-20 Thread Mike
Perfect. This is what I"ll use. Thanks! Mike -- http://mail.python.org/mailman/listinfo/python-list

Printer list value problem

2014-01-14 Thread Mike
Hello, I confudsed,need printer the value of list (this is reaer from csv) . The reader is ok, but my problem is in the print moment because printer only the last value. For example my csv is: [] us...@example.com;user1;lastName;Name us...@example.com;user2;lastName;Name [] But

Re: Printer list value problem

2014-01-14 Thread Mike
El martes, 14 de enero de 2014 16:32:49 UTC-3, MRAB escribió: > On 2014-01-14 19:24, Mike wrote: > > > Hello, > > > I confudsed,need printer the value of list (this is reaer from csv) . The > > reader is ok, but my problem is in the print moment because printer on

Re: Everything good about Python except GUI IDE?

2016-03-01 Thread Mike
On Saturday, February 27, 2016 at 6:19:21 AM UTC-5, wrong.a...@gmail.com wrote: > I have some VB forms with more than a hundred objects. If I cannot drag and > drop text boxes, list boxes, labels, etc., it will be too much work to create > that with several lines of code for each object. > > Is

Error compressing tar file

2014-03-02 Thread Mike
Hello, I have the script that make a backup file (this process is ok), but now i wish compress the file on tar file format. But i have problem syntax in the line of the tar function. The error is [root@master ~]# python bkp_db.py File "bkp_db.py", line 19 tar = tarfile.open(dumpfile)+'

Re: Error compressing tar file

2014-03-02 Thread Mike
El domingo, 2 de marzo de 2014 21:38:49 UTC-3, Mike escribió: > Hello, > > I have the script that make a backup file (this process is ok), but now i > wish compress the file on tar file format. But i have problem syntax in the > line of the tar function. > &g

ERROR:root:code for hash md5 was not found

2012-01-11 Thread mike
Hi, We are running are running Python program on Redhat 5.5. When executing our program we get the following error ( see below). Any ideas what this is due to? br, //mike /pysibelius/lib/common/ DataTypes.py Overwriten ... ERROR:root:code for hash md5 was not found. Traceback (most recent

Re: ERROR:root:code for hash md5 was not found

2012-01-11 Thread mike
On Jan 12, 12:28 am, Steven D'Aprano wrote: > On Wed, 11 Jan 2012 05:54:29 -0800, mike wrote: > > I did some more digging and found that our class imports a "yacc.py" > > that uses > > > import re, types, sys, cStringIO, hashlib, os.path > > > so

Re: ERROR:root:code for hash md5 was not found

2012-01-11 Thread mike
On Jan 12, 7:13 am, mike wrote: > On Jan 12, 12:28 am, Steven D'Aprano > > > > > > > > > +comp.lang.pyt...@pearwood.info> wrote: > > On Wed, 11 Jan 2012 05:54:29 -0800, mike wrote: > > > I did some more digging and found that our class imports

Re: ERROR:root:code for hash md5 was not found

2012-01-13 Thread mike
program works on SuSE but not on RH server. And AFAIK the only difference ( well that I can see) is the OpenSSL version. According to code it uses openssl: So I need to find a way to convince the linux sys admin to install same version of openssl on both servers. Thanks a lot for your val

Re: Remote Function Call

2006-01-12 Thread Mike
Sounds like what I need. Thanks Irmen. I heard google uses python with multiple machines... how do they do it? Mike -- http://mail.python.org/mailman/listinfo/python-list

Remote Function Call

2006-01-13 Thread Mike
Hi, I have two machines. A python program on machine 1 needs to make a python call to a method in machine 2. What is the most efficient / fast / programmer friendly way to do it? - XML-RPC? - Http Call? Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Remote Function Call

2006-01-13 Thread Mike
Thanks Everyone for your input. Mike -- http://mail.python.org/mailman/listinfo/python-list

XML vs. cPickle

2006-01-13 Thread Mike
, Mike -- http://mail.python.org/mailman/listinfo/python-list

Marshal Obj is String or Binary?

2006-01-13 Thread Mike
0t\x03\x00\x00\x00twoi\x03\x00\x00\x00t\x05\x00\x00\x00three0' Now, I need to store this data safely in my database as CLEAR TEXT, not BLOB. It seems to me that it should work just fine since it is string anyways. So, why does O'reilly's Python Cookbook is insisting in saving it

Re: XML vs. cPickle

2006-01-13 Thread Mike
(right?) > > Ideas are appreciated, > I'd write a few simple prototypes and take some empirical measurements. I am doing it now. Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Mike
Wait a sec. \x00 may represent a byte when unmarshaled, but as long as marshal likes it as \x00, I think my db is capable of storing \ x 0 0 characters. What is the problem? Is it that \? I could escape that... actually I think my django framework already does that for me. Thanks, Mike -- http

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Mike
Wait a sec. \x00 may represent a byte when unmarshaled, but as long as marshal likes it as \x00, I think my db is capable of storing \ x 0 0 characters. What is the problem? Is it that \? I could escape that... actually I think my django framework already does that for me. Thanks, Mike -- http

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Mike
Thanks everyone. It seems broken storing complex structures as escaped strings, but I think I'll take my changes. Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Mike
wing: - Save my structure as binary data, and reference the file from my db - Find a clean method of saving bytes into my db Thanks again, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
heel? marshal is not recommended, but if you can > live with the limitations of marshal then it might do the job. But trying > to optimise code that hasn't even been written yet is a sure way to > trouble. Thanks. Will do. Regards, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
heel? marshal is not recommended, but if you can > live with the limitations of marshal then it might do the job. But trying > to optimise code that hasn't even been written yet is a sure way to > trouble. Thanks. Will do. Regards, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
an't care less either. We'll wait for some rain :) Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Marshal Obj is String or Binary?

2006-01-15 Thread Mike
cture in clear text. Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: self question

2006-07-26 Thread Mike
Schüle Daniel wrote: > Hi all, > > given python description below > > import random > > class Node: > def __init__(self): > self.nachbarn = [] > > class Graph(object): > # more code here > def randomizeEdges(self, low=1, high=self.n): > pas

"no module named win32api" using PyWin32-208

2006-06-27 Thread Mike
ot;import win32api"); with no luck. Can the win32 extensions handle compiled python modules? If not how can I get it to work? Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

raw strings in regexps

2006-12-07 Thread Mike
ct at 0x6bf0e0> >>> C:\Dev\python>python ActivePython 2.4.2 Build 10 (ActiveState Corp.) based on Python 2.4.2 (#67, Jan 17 2006, 15:36:03) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> print re.match(r'\\this', r'\\this') None >>> print re.match(r'this', r'\\this') <_sre.SRE_Match object at 0x009DA058> >>> -- Mike -- -- http://mail.python.org/mailman/listinfo/python-list

Re: raw strings in regexps

2006-12-08 Thread Mike
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ... > You have to quote metacharacters if you want to match them. The escape > method is useful for this: > > >>> re.escape('(a)') > '\\(a\\)&#x

Re: What is different with Python ?

2005-06-13 Thread Mike
>there should be no room for "magic" in a computer >for a professional programmer. > well put. sounds like the makings of a good signature... -- http://mail.python.org/mailman/listinfo/python-list

how to print out each single char from a string in HEX format?

2007-06-04 Thread mike
guys, I've researched python pretty much but still have no idea how to print out each single character from a string in HEX format? Hope someone can give me some hints. Thanks a lot. e.g.###here is a string a='01234' ###how to print out it out in this way 0x31

Re: how to print out each single char from a string in HEX format?

2007-06-04 Thread mike
Great! It works. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Could someone show me a sample how to flush the socket sending buffer? Thanks a lot.

2007-06-08 Thread mike
uot;) s.send("[EMAIL PROTECTED]") .. but still, the server can only receive the first line, and keep waiting for the second line. So, in my mind the second line is still in the sending buffer, and not reach the server side. Any hints would be appreciated. Mike --

Re: MI5 Persecution: Goldfish and Piranha 29/9/95 (5104)

2007-06-09 Thread Mike
nce | people, but my interpretation is that they simultaneously try to | discredit them, and stem the flow of Corley articles. | | = | | In article <[EMAIL PROTECTED]>, | Mike Corley <[EMAIL PROTECTED]> wrote: | > | >John J Smith ([EMAIL PROTECTED]) wrot

How can I capture all exceptions especially when os.system() fail? Thanks

2007-06-13 Thread mike
script printed: Some exceptions occurred. Done So far so good, then I changed the code to run a non-exist command "wrong_command_test"(commented the open and sleep lines), then the script printed: sh: wrong_command_test: command not found well Done Any opinions would be appreciated. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I capture all exceptions especially when os.system() fail? Thanks

2007-06-14 Thread mike
On Jun 14, 2:55 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Wed, 13 Jun 2007 21:47:16 -0300, mike <[EMAIL PROTECTED]> escribió: > > >> Following piece of code can capture IOError when the file doesn't > >> exist,

adding methods at runtime and lambda

2007-05-03 Thread Mike
I was messing around with adding methods to a class instance at runtime and saw the usual code one finds online for this. All the examples I saw say, of course, to make sure that for your method that you have 'self' as the first parameter. I got to thinking and thought "I have a lot of arbitrary me

Re: adding methods at runtime and lambda

2007-05-03 Thread Mike
In the above example 'addm' should be 'AddMethod' superdict = AddMethod(dict(), lambda self, d: myUtils.HasDrive(d),"hasdrive") -- http://mail.python.org/mailman/listinfo/python-list

Re: adding methods at runtime and lambda

2007-05-04 Thread Mike
On May 3, 11:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 03 May 2007 16:52:55 -0300, Mike <[EMAIL PROTECTED]> escribió: > > > I was messing around with adding methods to a class instance at > > runtime and saw the usual code one finds onl

Re: adding methods at runtime and lambda

2007-05-04 Thread Mike
On May 4, 2:05 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Mike wrote: > > staticmethod makes the function available to the whole class according > > to the docs. What if I only want it to be available on a particular > > instance? Say I'm adding abilities to

Re: adding methods at runtime and lambda

2007-05-07 Thread Mike
On May 4, 5:46 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Mike wrote: > > I just realized in working with this more that the issues I was having > > with instancemethod and other things seems to be tied solely to > > What you describe below is a function that happe

Re: Basic Class/Instance Question

2007-05-23 Thread Mike
Thanks Alan, I am still perplexed why the default value of this object is shared. hemm...d Back to programming, :) Sia On May 23, 7:19 am, Alan Franzoni <[EMAIL PROTECTED]> wrote: > Il 23 May 2007 04:07:19 -0700, Siah ha scritto: > > > Ready to go insane here. Class A, taking on a default value

Key Listeners

2007-05-29 Thread Mike
Are there key listeners for Python? Either built in or third party? -- http://mail.python.org/mailman/listinfo/python-list

Re: first, second, etc line of text file

2007-07-26 Thread Mike
On Jul 26, 8:46 am, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote: > > > A very simple question: I currently use a cumbersome-looking way of > > > getting the first, second, etc. line of a text file: > > > > for i, line in enumerate( open( textfile ) ): > > > if i == 0: > > > print 'First

Re: help on object programing

2007-08-17 Thread mike
On Aug 17, 11:07 am, yadin <[EMAIL PROTECTED]> wrote: > class big(self): > > x = 32 > list = [] > def inside (self): > > class small(self): # a new class defined inside the first > > y = 348 > list.append(y) # send the value to first list > li

  1   2   3   4   5   6   7   8   9   10   >