Re: Getting a stable virtual env

2014-02-17 Thread JM
This one should be in plain text, sorry guys I'm trying to get used to
this new mail address and client.

Hi ppl,

I'm trying to figure out the whole virtualenv story.
Right now I'm using it to creating an environment for our upcoming
debian upgrade to squeeze.

I'm doing some tests in our current distrib (python 2.5).
I have come to realize that a lot of packages in the version I'm
interested in are not available anymore on pypi. The pip installer
fails a lot.

Squeeze features python 2.7 so I'm pretty sure that everything will
work fine. I've actually tested it. The question is, how do I protect
myself from future package removal ?
Do I absolutely need to run a local pypi server (I've seen some python
package doing this), and mirror all the packages I'm interested in ?

cheers,

JM

2014-02-17 14:21 GMT+01:00 P J :
> Hi ppl,
>
> I'm trying to figure out the whole virtualenv story.
> Right now I'm using it to creating an environment for our upcoming debian
> upgrade to squeeze.
>
> I'm doing some tests in our current distrib (python 2.5).
> I have come to realize that a lot of packages in the version I'm interested
> in are not available anymore on pypi. The pip installer fails a lot.
>
> Squeeze features python 2.7 so I'm pretty sure that everything will work
> fine. I've actually tested it. The question is, how do I protect myself from
> future package removal ?
> Do I absolutely need to run a local pypi server (I've seen some python
> package doing this), and mirror all the packages I'm interested in ?
>
> cheers,
>
> JM
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Access lotus notes using Python

2005-05-24 Thread jm
try this

import win32com.client
session = win32com.client.Dispatch('Lotus.NotesSession')
session.Initialize(r'')
db = session.GetDatabase('',r'.nsf')
view = db.GetView(r'')
doc = view.GetFirstDocument()
print doc.GetFirstItem('ii').Values

domino return string as unicode

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Access lotus notes using Python

2005-05-24 Thread jm
Lotus Domino Designer 6.5.1 Help (instaled by notesdesigner)

see section LotusScript/COM/OLE Classes  & LotusScript Classes A-Z

-- 
http://mail.python.org/mailman/listinfo/python-list


PNYIKOS DOWN AND UNDER!

2014-03-19 Thread THRINAXODON JM

===
>BREAKING NEWS
===
>
RICHARD LEAKEY JUST DIED DUE TO HEART FAILURE!
>
THE REASONS DESCRIBED BY THE MEDICAL TEAM IS THAT HIS WORK WAS
DISPROVEN, BY NONE OTHER THAN YOUR OWN BASTARD, THRINAXODON.
>
THIS CAUSED LEAKEY'S HEART TO EXPLODE!
>
THRINAXODON DANCED WITH JOY AS HE WAS GRANTED $600,000,000,000.000!
>
TO WASTE YOUR TIME EVEN FURTHER, CHECK OUT THESE LINKS BELOW.
===
EVIDENCE THAT HUMANS LIVED IN THE DEVONIAN:

https://groups.google.com/group/sci.bio.paleontology/browse_thread/threa
d/6f501c469c7af24f# 
 




https://groups.google.com/group/sci.bio.paleontology/browse_thread/threa
d/3aad75c16afb0b82# 
 




==
==

http://thrinaxodon.wordpress.com/ 

===

THRINAXODON ONLY HAD THIS TO SAY:

"I..I...I...Can't believe it. This completely disproved Darwinian
orthodoxy."

===

THE BASTARDS AT THE SMITHSONIAN, AND THE LEAKEY FOUNDATION ARE ERODING
WITH FEAR.

===
THESE ASSHOLES ARE GOING TO DIE:
THOMAS AQUINAS;
ALDOUS HUXLEY;
BOB CASANVOVA;
SkyEyes;
DAVID IAIN GRIEG;
MARK ISAAK;
JOHN HARSHAM;
RICHARD NORMAN;
DR. DOOLITTLE;
CHARLES DARWIN;
MARK HORTON;
ERIK SIMPSON;
HYPATIAB7;
PAUL J. GANS;
JILLERY;
WIKI TRIK;
THRINAXODON;
PETER NYIKOS;
RON OKIMOTO;
JOHN S. WILKINS
===

THRINAXODON WAS SCOURING ANOTHER DEVONIAN FOSSIL BED, AND FOUND A
HUMAN SKULL, AND A HUMAN FEMUR. HE ANALYSED THE FINDS, AND SAW THAT
THEY WERE NOT NORMAL ROCKS. THESE WERE FOSSILIZED BONES. THEY EVEN HAD
TOOTH MARKS ON THEM. SO, THRINAXODON BROUGHT THEM TO THE LEAKEY
FOUNDATION, THEY UTTERLY DISMISSED IT, AND SAID, "We want to keep
people thinking that humans evolved 2 Ma." THRINAXODON BROUGHT HIS
SWORD, AND SAID, "SCIENCE CORRECTS ITSELF." RICHARD LEAKEY SAID, "That
is a myth, for people to believe in science." THRINAXODON PLANS TO
BRING DOOM TO SCIENCE, ITSELF.



THRINAXODON IS NOW ON REDDIT

--
---Thrinaxodon

--
https://mail.python.org/mailman/listinfo/python-list


For using python ability, what should I do???

2014-08-17 Thread Jm Cho
Hello~ I'm Korean, and I register this groups just now.
Thesedays, I'm studying Python 3.x version. I like Python.
i read a book, python for kids a playful introduction to programming, 
it is very easy but very effective to me.

so, I hope my python ability is higher...
What should I do??

ps. In fect, I did try to Django, but it was very difficult..
Do you think I will make any program??

I want to listen your solution~

Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Why this script can work?

2007-01-18 Thread Jm lists
Please help with this script:

class ShortInputException(Exception):
'''A user-defined exception class.'''
def __init__(self,length,atleast):
Exception.__init__(self)
self.length=length
self.atleast=atleast

try:
s=raw_input('Enter something --> ')
if len(s)<3:
raise ShortInputException(len(s),3)
# Other work can continue as usual here
except EOFError:
print '\nWhy did you do an EOF on me?'
except ShortInputException,x:
print 'ShortInputException: The input was of length %d, was
expecting at least %d' %(x.length,x.atleast)
else:
print 'No exception was raised.'


My questions are:

1) ShortInputException,x:   what's the 'x'? where is it coming?

2) The 'if' and 'else' are not in the same indent scope,why this can work?

Thanks in advance.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why this script can work?

2007-01-19 Thread Jm lists
Thanks for all the helps.
I'm not habitual for this usage of 'else',other languages seem don't
support this syntax.
i.g,writting the codes below by Perl would get an error:

# perl -le 'for $i  (1..10){print $i}  else{print "finished"}'
syntax error at -e line 1, near "}else"
Execution of -e aborted due to compilation errors.

2007/1/19, Diez B. Roggisch <[EMAIL PROTECTED]>:
> Jm lists wrote:
>
> > Please help with this script:
> >
> > class ShortInputException(Exception):
> > '''A user-defined exception class.'''
> > def __init__(self,length,atleast):
> > Exception.__init__(self)
> > self.length=length
> > self.atleast=atleast
> >
> > try:
> > s=raw_input('Enter something --> ')
> > if len(s)<3:
> > raise ShortInputException(len(s),3)
> > # Other work can continue as usual here
> > except EOFError:
> > print '\nWhy did you do an EOF on me?'
> > except ShortInputException,x:
> > print 'ShortInputException: The input was of length %d, was
> > expecting at least %d' %(x.length,x.atleast)
> > else:
> > print 'No exception was raised.'
> >
> >
> > My questions are:
> >
> > 1) ShortInputException,x:   what's the 'x'? where is it coming?
>
> except , :
>
> will catch an exception of the kind specified in  (it might
> actually be more than one), and store the exception object in the variable
> named 
>
> > 2) The 'if' and 'else' are not in the same indent scope,why this can work?
>
>
> Because additionally to if, also for and try have else-clauses. The latter
> two are only being called if the body of the control structure hasn't been
> left due to "unnatural" circumstances. See this:
>
>
>
>
> for i in xrange(10):
> pass
> else:
> print "test 1"
>
> for i in xrange(10):
> break
> else:
> print "test 2"
>
> try:
> pass
> except:
> pass
> else:
> print "test 3"
>
> try:
> raise "I know I shouldn't rais strings..."
> except:
> pass
> else:
> print "test 4"
>
>
>
> It will only print
>
> test 1
> test 3
>
>
> Diez
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


**argv can't work

2007-01-19 Thread Jm lists
hello members,

See my script piece below:

def testB(shift,**argv):
print "first argument is %s" %shift
print "all other arguments are:",argv

testB('mails','Jen','[EMAIL PROTECTED]','Joe','[EMAIL PROTECTED]')

It can't work at all.please help tell me the reasons.thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: **argv can't work

2007-01-19 Thread Jm lists
Thanks for all the kind helps!

2007/1/20, Parthan SR <[EMAIL PROTECTED]>:
>
>
> On 1/20/07, Jm lists <[EMAIL PROTECTED]> wrote:
> > hello members,
> >
> > See my script piece below:
> >
> > def testB(shift,**argv):
> > print "first argument is %s" %shift
> > print "all other arguments are:",argv
> >
> > testB('mails','Jen',' [EMAIL PROTECTED]','Joe','[EMAIL PROTECTED]')
> >
> > It can't work at all.please help tell me the reasons.thanks.
> >
> >
>
> It works for me, check this one :
>
> >>> def argtst(x, **y):
> ... print "first arument is %s" % x
> ... print "other arguments are", y
> ...
> >>> argtst(x=10,a=1,b=2,c=3)
> first arument is 10
> other arguments are {'a': 1, 'c': 3, 'b': 2}
>
>
> (!) : Do not use the name 'argv' for the second argument.
>
> --
> With Regards,
>
> TechnoFreak
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Does eval has the same features as Perl's?

2007-01-20 Thread Jm lists
Hello members,

I want to know does the "eval" in python have the same features as in
Perl (capture errors)?

For example,in perl I can wrote:

$re = eval { 1 / 0 };

Though 1/0 is a fatal error but since it's in "eval" block so the perl
interpreter doesn't get exit.

Thanks again.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Does eval has the same features as Perl's?

2007-01-20 Thread Jm lists
Thank you.I'm just learning Python and want to make something clear to me.:)

2007/1/20, Steven D'Aprano <[EMAIL PROTECTED]>:
> On Sat, 20 Jan 2007 17:30:24 +0800, Jm lists wrote:
>
> > Hello members,
> >
> > I want to know does the "eval" in python have the same features as in
> > Perl (capture errors)?
> >
> > For example,in perl I can wrote:
> >
> > $re = eval { 1 / 0 };
> >
> > Though 1/0 is a fatal error but since it's in "eval" block so the perl
> > interpreter doesn't get exit.
>
> How hard would it be to actually try it?
>
> >>> eval("1/0")
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "", line 1, in 
> ZeroDivisionError: integer division or modulo by zero
>
> It took about three seconds to actually test it.
>
> eval has many security risks -- as a rule, you should never pass strings
> you've got from the user to eval, unless you want the user to p0wn your
> computer. It is harder than you might think to make eval safe -- you
> should seriously consider it an advanced tool, not a basic tool. As a
> newbie, you should work under the following rule:
>
> "If I think I need to use eval, I'm probably wrong."
>
> I've been using Python for seven or eight years, and I don't think I've
> ever used eval in serious code.
>
> Now, suppose you find yourself wanting to use eval. You've considered the
> above rule carefully, and decided that it doesn't apply in this case.
> You've been careful to use it only on safe strings, not arbitrary strings
> from users. How do you use eval so it captures errors?
>
> try:
> eval("1/0")
> except ZeroDivisionError: # capture only one error
> pass
>
>
> or something like this:
>
> try:
> eval("something or other goes here")
> except Exception: # capture any error
> pass
>
>
>
> --
> Steven.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


About getattr()

2007-02-11 Thread Jm lists
Hello,

Since I can write the statement like:

>>> print os.path.isdir.__doc__
Test whether a path is a directory

Why do I still need the getattr() func as below?

>>> print getattr(os.path,"isdir").__doc__
Test whether a path is a directory

Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


tcp socket problem

2008-07-25 Thread jm . carp
I'm writing a tcp client that grabs data from a server at 32hz. But
the connection drops exactly one minute after it's opened. I can get
data from the server fine for the first 60s, and then the connection
goes dead. What's going on?
--
http://mail.python.org/mailman/listinfo/python-list