I get below error
NameError: name 'functools' is not defined
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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", &
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,
>
> >
>
> > >
>
&
I added the print command.
It prints [] when there is no data.
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
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
That worked, Ian.
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
>
> >
>
>
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
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
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
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
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,
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
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
"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
"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
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
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
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
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
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
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
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
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:
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:
dude, you are the sap that wrote "it's not clear". get a life.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
ugly. i guess this thread shows that you are clueless regarding your
thread crapping.
--
http://mail.python.org/mailman/listinfo/python-list
os.path.exists()
--
http://mail.pyth
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
"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
"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
"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
<[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
>> >
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
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
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
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
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
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
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
"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,
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
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
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
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
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
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
Perfect. This is what I"ll use. Thanks! Mike
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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)+'
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
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
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
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
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
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
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
Thanks Everyone for your input.
Mike
--
http://mail.python.org/mailman/listinfo/python-list
,
Mike
--
http://mail.python.org/mailman/listinfo/python-list
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
(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
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
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
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
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
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
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
an't care
less either. We'll wait for some rain :)
Mike
--
http://mail.python.org/mailman/listinfo/python-list
cture in clear text.
Thanks,
Mike
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
"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\\)
>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
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
Great! It works.
Thanks a lot.
--
http://mail.python.org/mailman/listinfo/python-list
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
--
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
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
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,
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
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
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
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
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
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
Are there key listeners for Python? Either built in or third party?
--
http://mail.python.org/mailman/listinfo/python-list
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
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 - 100 of 2126 matches
Mail list logo