Re: [Tutor] factorial of anumber

2012-02-04 Thread Blockheads Oi Oi
On 04/02/2012 10:11, Debashish Saha wrote: _PROGRAM TO FIND FACTORIAL OF A NUMBER(I HAVE WRITTEN IT ON GEDIT)_ x=1 n=input('enter a positive integer no:') for i in range(1,1+n): x=x*i print x _ERROR:_ enter a positive integer no:

Re: [Tutor] Importing libraries

2012-02-04 Thread Blockheads Oi Oi
On 04/02/2012 05:37, Michael Lewis wrote: Why don't I have to import str or list to access their attributes like I do with the math or random or any other library? -- Michael J. Lewis mjole...@gmail.com 415.815.7257 ___ T

Re: [Tutor] (no subject)

2012-02-03 Thread Blockheads Oi Oi
On 03/02/2012 20:32, Debashish Saha wrote: what is the basic difference between numpy and pylab? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor http://catb.org/es

Re: [Tutor] ASCII Conversion

2012-01-30 Thread Blockheads Oi Oi
On 31/01/2012 05:33, Christian Witts wrote: On 2012/01/31 06:50 AM, Michael Lewis wrote: I am trying to do a simple test but am not sure how to get around ASCII conversion of characters. I want to pass in y have the function test to see if y is an integer and print out a value if that integer sa

Re: [Tutor] compile time calculator

2012-01-27 Thread Blockheads Oi Oi
On 27/01/2012 15:46, Surya K wrote: Hi, I want to calculate compile time for my puzzles. Although I read about timeit(), I didn't really understand how it should be applied it. So, can anyone write a function for me please!! I am looking for a function which should solve my puzzle and also show

Re: [Tutor] Pythonic way of concatenation of elements in an array

2012-01-27 Thread Blockheads Oi Oi
On 27/01/2012 06:44, Andre' Walker-Loud wrote: Hi Steven, (5) When assembling strings from substrings, never use repeated concatenation using + as that can be EXTREMELY slow. Use str.join to build the string in one assignment, instead of multiple assignments. Your code shown above is *very*

Re: [Tutor] OverflowError in lucky numbers script

2012-01-22 Thread Blockheads Oi Oi
On 23/01/2012 06:15, Shreesh bhat wrote: Calculating the table is fast. I think either my luckiness test (where i find the sum of all digits and sum of squares of all digits of a large number) or generating numbers is slow. Don't think, know :) Tools like the profile or timeit modules are ther

Re: [Tutor] PyVISA

2011-04-01 Thread Blockheads Oi Oi
On 01/04/2011 20:10, Alan Gauld wrote: "Mark R Rivet" wrote Well I tried the setup file and here is what I get: C:\Users\Rivetmr\PyVisa_1.3\PyVISA-1.3>Python setup.py install Traceback (most recent call last): File "setup.py", line 60, in home_dir = os.environ['HOME'] Windows doesn't by de

Re: [Tutor] Run application from MS-DOS with sys.argv

2011-04-01 Thread Blockheads Oi Oi
On 01/04/2011 18:15, Susana Iraiis Delgado Rodriguez wrote: Hello! I'm going to answer to the question I posted in this list. After a search trouhg web and analize the code, I just had to add a try/except statement. Now I get what I need. Here is the information: directorio = sys.argv[1] extens

Re: [Tutor] PyVISA GPIB

2011-04-01 Thread Blockheads Oi Oi
On 01/04/2011 18:00, Donald Bedsole wrote: Hi Mark, On Fri, Apr 1, 2011 at 11:42 AM, wrote: I would like to control electronic instruments with PyVISA. I have downloaded PyVISA and unpacked the files into the Python27/lib/site-packages dir and in the IDLE GUI I run "import visa' for a quic

Re: [Tutor] Data frame packages

2011-03-31 Thread Blockheads Oi Oi
On 31/03/2011 09:38, Ben Hunter wrote: Is anybody out there familiar with data frame modules for python that will allow me to read a CSV in a similar way that R does? pydataframe and DataFrame have both befuddled me. One requires a special stripe of R that I don't think is available on windows an

Re: [Tutor] String formatting question.

2011-03-29 Thread Blockheads Oi Oi
On 29/03/2011 20:41, Prasad, Ramit wrote: Is there a difference (or preference) between using the following? "%s %d" % (var,num) VERSUS "{0} {1}".format(var,num) Ramit ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opti

Re: [Tutor] Read arguments from command line

2011-03-28 Thread Blockheads Oi Oi
On 28/03/2011 18:24, Susana Iraiis Delgado Rodriguez wrote: Hello everyone! I want to run a python script which reads arguments from command line. I searched in web and the module sys.argv came up. But I don't understand how it works. I need to know how to pass arguments from command line and ma

Re: [Tutor] how to join two text files ?

2011-03-27 Thread Blockheads Oi Oi
On 26/03/2011 21:08, Mateusz K wrote: Hello, I have many text files, where data is delimited by space. Each file contain three colums: coordinate x, coordinate y and value for this location. I would like to join this data to get one big file which will contain columns: coordinate x, coordinate

Re: [Tutor] if value not in dictionary, do a?

2011-03-25 Thread Blockheads Oi Oi
On 25/03/2011 16:11, Robert Sjoblom wrote: I received your email just as I left my computer, and didn't want to type out an answer on my phone (because smartphones aren't smart enough for that yet), and my first reaction was "why?" followed by "I need my program to continue even if I get the err