[Tutor] About Using timeout Mark in Pytest

2016-08-20 Thread Michelle Meiduo Wu
Hi there,


I'd like to use @pytest. mark.timeout  in pytest test in Windows. But if one of 
test cases is timeout, then the following test cases will stop.


Is there anybody know how to continue to run the following test cases  if a 
test case is timeout?


Thank you in advance.


Michelle
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] About using list in a function

2015-08-19 Thread Michelle Meiduo Wu
Hi there,
I'm trying to use List in a function. But it doesn't work. Here are sample code 
not work: ---def getResult():ls = []
ls= ls.append(100)ls= ls.append(200)  return ls
reList = []reList = getResult()lsLength = len(reList)print '\n The length of 
the list is:' + str(lsLength)-I ran the 
above code, there is an error message: AttributeError: 'NoneType' object has no 
attribute 'append'
But the code below not using list in a function 
works.--### This works:ls = 
[]ls.append(100)ls.append(200)lsLength = len(ls)print '\n list length is: ' + 
str(lsLength)- Do you know  
the reason?
Thank you,Michelle

  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] About Python Module to Process Bytes

2015-08-05 Thread Michelle Meiduo Wu
I think this works for me!
Thanks a lot,Michelle

> From: d...@hashcollision.org
> Date: Tue, 4 Aug 2015 12:12:20 -0700
> Subject: Re: [Tutor] About Python Module to Process Bytes
> To: wum...@hotmail.com
> CC: tutor@python.org
> 
> On Tue, Aug 4, 2015 at 9:26 AM, Michelle Meiduo Wu  wrote:
> > Hi there,
> > I'd like to find some python module to easily process bytes array data, 
> > like encoding different types of data (char, long, short, float, etc) into 
> > a same bytes array. I checked Python built-in library and there are bytes 
> > and bytearray types which don't provide enough functions for processing 
> > bytes easily.
> > Does anybody know if there is other convenient module available for 
> > processing bytes?
> 
> 
> The 'struct' module is probably what you're looking for.  See:
> 
> https://docs.python.org/3.5/library/struct.html
> 
> Let us know if you have any questions with it.  Good luck.
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] About Python Module to Process Bytes

2015-08-04 Thread Michelle Meiduo Wu
Hi there,
I'd like to find some python module to easily process bytes array data, like 
encoding different types of data (char, long, short, float, etc) into a same 
bytes array. I checked Python built-in library and there are bytes and 
bytearray types which don't provide enough functions for processing bytes 
easily. 
Does anybody know if there is other convenient module available for processing 
bytes?
Thank you,Michelle
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Access HBase

2015-07-13 Thread Michelle Meiduo Wu
Thanks a lot!Your information is very helpful. I believe it's easier to try 
HappyBase at beginning.
Thanks,Michelle
> To: wum...@hotmail.com
> CC: l...@openend.se; tutor@python.org; l...@openend.se
> From: l...@openend.se
> Subject: Re: [Tutor] Access HBase
> Date: Sun, 12 Jul 2015 12:46:15 +0200
> 
> In a message of Sat, 11 Jul 2015 23:46:56 -0400, Michelle Meiduo Wu writes:
> >Thanks a lot! 
> >
> >Do you know anything about HappyBase compared with Jython?
> >
> >Best,
> >Michelle
> 
> I don't know anything at all about HappyBase, and next to nothing about
> Hadoop.  But I know quite a bit about Jython.
> 
> The Python you get from python.org (and from ActiveState) is written
> in the C programming language.  That is why some of us often call it
> CPython.  However, there are other implementations of Python that
> are not written in C, and one of them is called Jython.  Jython is
> the Python Programming lanaguage written in Java.
> 
> Now, in the Greater Python Programming World, most libraries you
> would like to import and include in your own programs are written
> in Python itself.  They will be perfectly happy running under CPython
> or under Jython.  There are also a whole lot of libraries that are
> written in C.  Getting other things written in C to talk to CPython
> is work, but it is a pretty straight forward business to wrap your
> C libraries and getting them to work with CPython.
> 
> Getting something written in some other language than C to work with
> CPython is much harder.  C++ libraries get wrapped often enough that
> we have standard ways of doing that, too, but it is a lot more work.
> And C++ is, by design, a whole lot like C.
> 
> It is very rare that CPython developers bother to wrap something
> written in any other language at all.  So the world is full of
> perfectly great libraries written in Java and the CPython world
> basically never uses them because going from the Java world to the C
> world is even harder.
> 
> On the Java side things are similar.  If you like your Java world,
> but want Python syntax, not Java syntax -- you would like to program
> in Python -- you use Jython.  If you want to use a library and it is
> written in Python, you import that, and it just works.  If you want
> to use a library and it is written in Java, usually -- not all of the
> time, but most of the time -- you can wrap it very easily, import it,
> and it works.  And if you want to use a C or a C++ library, things
> get harder.
> 
> But your goal here is to talk to apache HBase, and that is a java
> library.  Somebody wanted that enough that they made CPython bindings
> for that, and that is called Thrift, and all I know about that is that
> it was so hard to use and error prone that the HappyBase developers
> wrote HappyBase to wrap Thrift in something easier to use.  If you
> want to develop in CPython this is probably where you will end up.
> (But somebody tomorrow could come by with information on a library
> I have never heard of, of course.)
> 
> The other way to go after this is to develop your code with Jython
> not CPython.  Then you follow the instructions here:
> http://wiki.apache.org/hadoop/Hbase/Jython
> 
> and you are good to go.
> 
> You just write to Hbase directly using Python syntax.
> 
> The next thing you need to do is see what other libraries you need to
> use for your work, and see if they exist for Jython.  For instance,
> if you need NumPy, you cannot use Jython at this time.  People are
> working on this problem over here: http://jyni.org/  where they are
> trying to build a better way to interface Jython with C and C++
> programs, but they aren't close to being done yet.
> 
> Laura
> 
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Access HBase

2015-07-12 Thread Michelle Meiduo Wu
Thanks a lot! 

Do you know anything about HappyBase compared with Jython?

Best,
Michelle

> To: wum...@hotmail.com
> CC: tutor@python.org; l...@openend.se
> From: l...@openend.se
> Subject: Re: [Tutor] Access HBase
> Date: Sat, 11 Jul 2015 19:53:19 +0200
> 
> In a message of Sat, 11 Jul 2015 09:01:15 -0400, Michelle Meiduo Wu writes:
> >Hi there,
> >I'm just starting to use Python. I'd like to ask which Library is good for 
> >Python to access HBASE? 
> >
> >Besides Happybase and Python HBase, is there any other one? Which is more 
> >robotic and better functional?
> >
> >Any advice would be greatly appreciated.
> >
> >Thank you,
> >Michelle
> 
> One thing that people I know of are doing is connecting using Jython,
> instead of CPython.  see: http://wiki.apache.org/hadoop/Hbase/Jython
> 
> They say it is a _lot_ faster.
> 
> Laura
> 
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Access HBase

2015-07-11 Thread Michelle Meiduo Wu
Hi there,
I'm just starting to use Python. I'd like to ask which Library is good for 
Python to access HBASE? 

Besides Happybase and Python HBase, is there any other one? Which is more 
robotic and better functional?

Any advice would be greatly appreciated.

Thank you,
Michelle
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


tutor@python.org

2015-06-12 Thread Michelle Meiduo Wu
Yes, I also found Py.test  is a good testing framework for automation testing. 
Another one is Robot testing framework. It's also a testing framework based on 
Python Unittest framework.
Hard to pick one to use:)
Thank you,Michelle 

> To: alan.ga...@btinternet.com
> From: l...@openend.se
> Date: Fri, 12 Jun 2015 22:08:55 +0200
> Subject: Re: [Tutor] Python&Pytest
> CC: l...@openend.se; tutor@python.org
> 
> In a message of Fri, 12 Jun 2015 17:26:42 +0100, Alan Gauld writes:
> >I stand corrected but it still seems to me like its easier to
> >test in the language in which you develop. And most languages
> >have testing frameworks these days.
> 
> Many languages have extremely poor testing frameworks.  And when it
> came time to do testing of the javascript code of the web client
> of our python app, we found that there wasn't anything available
> for doing exactly that.
> 
> >And when there are large paradigm differences in the languages
> >that's even more true. Testing JS (or even Haskell) in Python
> >seems like a weird choice!
> 
> I don't see this at all.  By this logic, we would have been better
> off writing a test framework in javascript to handle our javascript
> code.  But our experience is that, whenever possible, you are always
> better off not using javascript and programming in another language.
> Plus the real challenge here was testing our code in the collection
> of browsers expected to run it.  We found lots and lots and lots
> of javascript bugs.
> 
> Py.test (as pytest was called at the time) was already happy to do
> practically all of the heavy lifting for us.  Pick this up, throw it
> at something, get a result compare the result to what you are looking
> for -- all of that was handled.  So all we had to do was write the
> stuff that actually went out and ran the things in the browser.
> 
> It's not a lot of code.
> https://bitbucket.org/pedronis/js-infrastructure/src
> 
> Laura
> 
> >-- 
> >Alan G
> >Author of the Learn to Program web site
> >http://www.alan-g.me.uk/
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


tutor@python.org

2015-06-11 Thread Michelle Meiduo Wu
Hi there,
I'm looking for a language to write test scripts for our application. I read 
some document and found Pytest can be used to write simpler code compared with 
using unittest in Python. Does anybody know what's other pros and cons of using 
these two for writing test scripts?
Thank you,Michelle
   

  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor