Re: How can i create a random array of floats from 0 to 5 in python

2013-03-12 Thread Boris FELD
You can use [random.random() * 5 for x in range(100)] but works only on range [0, 5). If you want to include 5, you will need more code. Cheers, FELD Boris 2013/3/12 Norah Jones : > I want to create a random float array of size 100, with the values in the > array ranging from 0 to 5. I have tried

Re: For Loop in List

2013-01-13 Thread Boris FELD
2013/1/13 Tim Chase : > On 01/13/13 06:45, subhabangal...@gmail.com wrote: > SIZE = 3 for i in range(len(list1)//SICE): > ... print list1[i*SIZE:i*SIZE+SIZE] > ... > [1, 2, 3] > [4, 5, 6] > [7, 8, 9] > [10, 11, 12] > A little shorter and simpler version: >>> x = x[1:] >>> for i in ra

Re: Help with unittest2

2012-12-13 Thread Boris FELD
How are you importing unittest2, do you have something like this ? try: import unittest2 as unittest except ImportError: import unittest If it's the case, you are maybe using default unittest while you think you are using unittest2. 2012/12/13 Daniel Laird : > On Thursday, December 13, 2012

Re: open URL in the current tab

2012-12-10 Thread Boris FELD
Don't think that it's possible with webbrowser, you should try with Selenium. For example with sst (Simple Selenium Test), it open url in current tab or create a new one if no one exists: from sst.actions import * go_to('http://www.ubuntu.com/') 2012/12/10 Jabba Laci : > Hi, > > With the webbrow

Re: Testing against multiple versions of Python

2012-10-19 Thread Boris FELD
Did you take a look at https://www.shiningpanda-ci.com/? 2012/10/19 andrea crotti : > 2012/10/19 Michele Simionato : >> Yesterday I released a new version of the decorator module. It should run >> under Python 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3. I did not have the will >> to install on my ma

Re: Writing Android application using GPS data with Python

2012-04-15 Thread Boris FELD
You can try appaccelerator, it seems to support python and you should be able to access geolocalisation (according to wikipedia: https://en.wikipedia.org/wiki/Appcelerator_Titanium) Le 15 avril 2012 16:44, Noam Peled a écrit : > I want to write an Android application using Python. I've found 2 o

Re: Python benefits over Cobra

2011-04-05 Thread Boris FELD
Cobra seems interessant, open-source, but the dependance on Mono and .Net annoy me a bit. Otherwise, cobra have good ideas, a syntax similar to python. One thing i really love is the "How-To" and the "Samples" pages on it's website, i think it's a very good thing for beginners. FELD Boris 2011/

Re: Validating Command Line Options

2011-03-23 Thread Boris FELD
If you're using argparse, you have a method for that named "add_mutually_exclusive_group". Tutorial : http://www.doughellmann.com/PyMOTW/argparse/#mutually-exclusive-options Cheers, Feld Boris 2011/3/23 T : > For a Python script with multiple command line options, what is the > best way to go abo

Re: Threading with Socket Server

2011-03-23 Thread Boris FELD
I'm not sure to understand what you want. Is it your server process that will read the shelve file ? You may give more informations about your problem, but i can give you some hints. In order to create a TCP server, you can use SocketServer which is in the builtin library (http://docs.python.org/l