Re: numpy column_stack - why does this work?

2015-11-16 Thread PythonDude
On Friday, 13 November 2015 18:17:59 UTC+1, Ian wrote: > On Fri, Nov 13, 2015 at 8:37 AM, PythonDude wrote: > > 3) I DON'T understand why the code doesn't look like this: > > > > means, stds = np.column_stack([ > > for _ in xrange(n_portfolios): > > getMuSigma_from_PF(return_vec) ]) >

Re: A Program that prints the numbers from 1 to 100

2015-11-16 Thread Ammammata
Il giorno Sat 14 Nov 2015 07:18:18p, *BartC* inviava su comp.lang.python il messaggio news:n27tp6$ec5$1...@dont-email.me. Vediamo cosa scrisse: > Here's one way +1 :) -- /-\ /\/\ /\/\ /-\ /\/\ /\/\ /-\ T /-\ -=- -=- -=- -=- -=- -=- -=- -=- - -=- > http://www.bb2002.it :) < ..

Re: help in pexpect multiprocessing

2015-11-16 Thread harirammanohar159
On Monday, 9 November 2015 18:07:36 UTC+5:30, hariramm...@gmail.com wrote: > Hi, > > I am using multiprocessing with pexpect, issue is whenever i call a function > which is having expect(), its throwing error which is genuine as multiple > threads are processing it same time (i/o prompt same ti

Re: What is the right way to import a package?

2015-11-16 Thread Grobu
On 14/11/15 21:00, fl wrote: Hi, I want to use a code snippet found on-line. It has such content: from numpy import * dt = 0.1 # Initialization of state matrices X = array([[0.0], [0.0], [0.1], [0.1]]) # Measurement matrices Y = array([[X[0,0] + abs(randn(1)[0])], [X[1,0] + abs(randn(1)[0])]])

Re: A Program that prints the numbers from 1 to 100

2015-11-16 Thread harirammanohar159
On Saturday, 14 November 2015 23:04:40 UTC+5:30, Cai Gengyang wrote: > I want to write a program in Python that does this > > "Write a program that prints the numbers from 1 to 100. But for multiples of > three print "Fizz" instead of the number and for the multiples of five print > "Buzz"

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-16 Thread Steven D'Aprano
On Mon, 16 Nov 2015 05:15 pm, Gregory Ewing wrote: > Ian Kelly wrote: >> Unary integer division seems pretty silly since the only possible results >> would be 0, 1 or -1. > > Ints are not the only thing that // can be applied to: > > >>> 1.0//0.01 > 99.0 Good catch! -- Steven -- https:/

Re: What meaning is 'a[0:10:2]'?

2015-11-16 Thread Steven D'Aprano
On Mon, 16 Nov 2015 11:27 am, fl wrote: > hi, > > When I learn slice, I have a new question on the help file. If I set: > > pp=a[0:10:2] > > pp is array([1, 3]) Really? How do you get that answer? What is `a`? > I don't know how a[0:10:2] gives array([1, 3]). Neither do I, because you have

Re: A Program that prints the numbers from 1 to 100

2015-11-16 Thread Chris Angelico
On Mon, Nov 16, 2015 at 10:57 PM, wrote: > This would help, but try to write on your own to improve, else you cant make > this going long > Here's another version, but with a deliberate bug in it. You may use this code if and only if your comprehension is sufficient to detect and correct th

Names [was Re: What meaning is 'a[0:10:2]'?]

2015-11-16 Thread Steven D'Aprano
On Mon, 16 Nov 2015 11:46 am, Ben Finney wrote: > (Please set a “From” address that has a name for you as an individual; > “fl” is rather anonymous and doesn't help us to identify you in these > conversations.) As far as I know, there's only one "fl" who posts here. And "fl" as a cognomen is no w

uninstall 3.5

2015-11-16 Thread Adrien Viala
Hello, Thank you for your work. Just discovering python. My issue steps were : - 3.5 installed - friend codes in 2.7 - server scripts can t run on my laptop (cant find module 0o) - whatever, must be 3.5 / 2.7 issues - let's try virtualenv - can t download virtualenvwrapper-powershell : error X t

Re: Matplotlib error: Value Error: x and y must have same first dimension

2015-11-16 Thread Abhishek Mallela
Thank you Laura and Oscar. Abhishek -- https://mail.python.org/mailman/listinfo/python-list

Re: uninstall 3.5

2015-11-16 Thread Adrien Viala
Hi again, Correct guess, virtualenvwrapper-powershell correctly installed under 2.7 :) On Sun, 15 Nov 2015 at 12:31 Adrien Viala < adrien.georges.louis.vi...@gmail.com> wrote: > Hello, > > Thank you for your work. Just discovering python. > > My issue steps were : > - 3.5 installed > - friend co

Re: Why won't this run?

2015-11-16 Thread Gary Herron
On 11/15/2015 12:38 PM, jbak36 wrote: Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. #this program says hello and asks for my name print:('Hello world!') Hello world! You are lyi

WinXP invalid python 3.5 installation

2015-11-16 Thread lokotraktor
Dear all, Would you be so kind and help me to find a fix of my trouble? I have had installed python 2.7 already. I have downloaded the https://www.python.org/ftp/python/3.5.0/python-3.5.0.exe and have installed it on Windows XP Home Edition Version 2002 SP3 (I am the administrator, which is on c

Re: Question about yield

2015-11-16 Thread Steven D'Aprano
On Sun, 15 Nov 2015 01:37 pm, fl wrote: > Hi, > I have read a couple of tutorial on yield. The following code snippet > still gives me a shock. I am told yield is a little like return. I only > see one yield in the tutorial examples. Here it has two yields. And there > are three variables followin

Re: WinXP invalid python 3.5 installation

2015-11-16 Thread Chris Angelico
On Sun, Nov 15, 2015 at 8:19 PM, wrote: > I have downloaded the > https://www.python.org/ftp/python/3.5.0/python-3.5.0.exe > and have installed it on Windows XP Home Edition Version 2002 SP3 (I am the > administrator, which is on czech laguage the word "Spravce".) You're not going to be able to

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-16 Thread Steven D'Aprano
On Sun, 15 Nov 2015 01:23 pm, Chris Angelico wrote: > On Sun, Nov 15, 2015 at 1:08 PM, Steven D'Aprano > wrote: >> number = +raw_input("enter a number: ") >> >> versus: >> >> text = raw_input("enter a number: ") >> try: >> number = float(text) >> except ValueError: >> number = int(text) >

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-16 Thread Chris Angelico
On Tue, Nov 17, 2015 at 12:17 AM, Steven D'Aprano wrote: > On Sun, 15 Nov 2015 01:23 pm, Chris Angelico wrote: > >> On Sun, Nov 15, 2015 at 1:08 PM, Steven D'Aprano >> wrote: >>> number = +raw_input("enter a number: ") >>> >>> versus: >>> >>> text = raw_input("enter a number: ") >>> try: >>>

Re: A Program that prints the numbers from 1 to 100

2015-11-16 Thread Jussi Piitulainen
Chris Angelico writes: > > Here's another version, but with a deliberate bug in it. [- -] This one recycles fish in a way that looks a bit worrying but it seems to work. If there's a bug, it's not deliberate. Except stopping at 15 is deliberate. from contextlib import contextmanager as fish from

Re: A Program that prints the numbers from 1 to 100

2015-11-16 Thread Chris Angelico
On Tue, Nov 17, 2015 at 12:39 AM, Jussi Piitulainen wrote: > This one recycles fish in a way that looks a bit worrying but it seems > to work. Recycles fish? http://www.saigan.com/kidscorner/comics/unhfulb.jpg ChrisA -- https://mail.python.org/mailman/listinfo/python-list

pexpect matching?

2015-11-16 Thread Didymus
Greetings, I have the following code: import pexpect child = pexpect.spawn('/bin/bash') i = child.expect_exact('bash-3.2$ ') child.sendline("rpm -q --queryformat '%{VERSION}\\n' glibc") i = child.expect (['2', '2.5', '2.52.5', pexpect.TIMEOUT]) print child.before print '---' print child.af

Re: uninstall 3.5

2015-11-16 Thread Ian Kelly
On Nov 16, 2015 6:10 AM, "Adrien Viala" < adrien.georges.louis.vi...@gmail.com> wrote: > > Hello, > > Thank you for your work. Just discovering python. > > My issue steps were : > - 3.5 installed > - friend codes in 2.7 > - server scripts can t run on my laptop (cant find module 0o) > - whatever,

Re: Running latest 32-bit Python on 64-bit system

2015-11-16 Thread Zachary Ware
On Fri, Nov 13, 2015 at 4:52 AM, Christian Ullrich wrote: > Hello, > > I have a problem with using the (otherwise nice) Python launcher. How can I > get it to run the highest 32-bit Python on my 64-bit system? This is on > Windows, but I think it applies to other OSes as well. > > My application r

import module pyttsx in windows IDLE failed

2015-11-16 Thread input/ldompeling
When I try to run this module in Windows IDLE I get this message: How can I solve this problem. Thanks Traceback (most recent call last): File "C:\raspberrypi\recipe-578839-1.py", line 1, in import pyttsx ImportError: No module named 'pyttsx' This is what I found on the internet:

write data in Excel using python

2015-11-16 Thread syedmwaliullah
hi, I am trying to write Excel file suing output from another software where the output comes as myturnlist.Show() The first part is for the output from the software which is saved in the clipboard. The big middle part works to open Excel and save the data into excel file called "TurnData.xl

Immediate Requirement for IIB/APM Administrator at Orlando, FL.

2015-11-16 Thread recruiter . venkat36
Hi , Hope you are doing Good, We have Immediate Requirement for IIB/APM Administrator, Kindly go through the Job Description Below and If interested Please Respond to this Mail. Job Description: Title: IIB/APM Administrator Location: - Orlando, FL Duration: - 3 Months IBM Technical expert is

Re: import module pyttsx in windows IDLE failed

2015-11-16 Thread MRAB
On 2015-11-16 17:12, input/ldompel...@casema.nl wrote: When I try to run this module in Windows IDLE I get this message: How can I solve this problem. Thanks Traceback (most recent call last): File "C:\raspberrypi\recipe-578839-1.py", line 1, in import pyttsx ImportError: No module nam

Re: import module pyttsx in windows IDLE failed

2015-11-16 Thread input/ldompeling
In reply to "MRAB" who wrote the following: Have you installed pyttsx? No, I did not. Where can I find pyttsx to install ? Thanks - > On 2015-11-16 17:12, input/ldompel...@casema.nl wrote: > > When I try to run this module in Win

Getting started Image processing python

2015-11-16 Thread Vindhyachal Takniki
1. I want to learn basic image processing in python. (working on raspberry pi 2 board) 2. I have a image with different color dots like red,white, etc.After taking image, need to identify how many are red,white etc. I am looking for free image processing libs for that. Which one is better for

Re: import module pyttsx in windows IDLE failed

2015-11-16 Thread MRAB
On 2015-11-16 17:45, input/ldompel...@casema.nl wrote: In reply to "MRAB" who wrote the following: Have you installed pyttsx? No, I did not. Where can I find pyttsx to install ? The first place to look is PyPI. It's here: https://pypi.python.org/pypi/pyttsx You might want to look at the link

Re: import module pyttsx in windows IDLE failed

2015-11-16 Thread Terry Reedy
On 11/16/2015 12:45 PM, input/ldompel...@casema.nl wrote: In reply to "MRAB" who wrote the following: Have you installed pyttsx? No, I did not. Where can I find pyttsx to install ? Let pip find it (its on pypi). On a command line, enter 'pip install pyttsx' -- Terry Jan Reedy -- https://mail

Re: write data in Excel using python

2015-11-16 Thread Michiel Overtoom
Hi, > On 16 Nov 2015, at 18:14, syedmwaliul...@gmail.com wrote: > For some reason it doesn't save the file. Did you get an error message? > excel.activeWorkbook.SaveAs ("c:\TurnData.xlsx") When you use backslashes in strings, don't forget to escape them: > excel.activeWorkbook.SaveAs("c:\\Tur

Re: Running latest 32-bit Python on 64-bit system

2015-11-16 Thread Christian Ullrich
* Zachary Ware wrote: On Fri, Nov 13, 2015 at 4:52 AM, Christian Ullrich wrote: However, with the shebang syntax supported by the launcher, I can only demand a 32-bit version if I also specify the Python minor version I want, and I don't necessarily know that in advance. I can code around t

Re: import module pyttsx in windows IDLE failed

2015-11-16 Thread input/ldompeling
Now I get this error: Traceback (most recent call last): File "C:\raspberrypi\recipe-578839-1.py", line 1, in import pyttsx File "C:\Users\loek\AppData\Local\Programs\Python\Python35\lib\site-packages\pyttsx\__init__.py", line 18, in from engine import Engine ImportError: No module

Re: write data in Excel using python

2015-11-16 Thread Ian Kelly
On Mon, Nov 16, 2015 at 11:20 AM, Michiel Overtoom wrote: > > Hi, > >> On 16 Nov 2015, at 18:14, syedmwaliul...@gmail.com wrote: >> For some reason it doesn't save the file. > > Did you get an error message? > >> excel.activeWorkbook.SaveAs ("c:\TurnData.xlsx") > > When you use backslashes in stri

Re: write data in Excel using python

2015-11-16 Thread tdsperth
On Tuesday, November 17, 2015 at 1:14:56 AM UTC+8, SW wrote: > hi, > I am trying to write Excel file suing output from another software where the > output comes as myturnlist.Show() > > The first part is for the output from the software which is saved in the > clipboard. > > The big middle pa

palindrome

2015-11-16 Thread Seymore4Head
http://www.practicepython.org/exercise/2014/03/12/06-string-lists.html Here is my answers. What would make it better? import random str1="" letcount=4 count=0 abc='abcdefghijklmnopqrstuvwxyz' while True: for i in range(letcount): a=random.choice(abc) str1+=a print str1

Re: palindrome

2015-11-16 Thread Abhiram R
On Tue, Nov 17, 2015 at 9:59 AM, Seymore4Head wrote: > http://www.practicepython.org/exercise/2014/03/12/06-string-lists.html > > Here is my answers. What would make it better? > > import random > str1="" > letcount=4 > count=0 > abc='abcdefghijklmnopqrstuvwxyz' > while True: > for i in rang

Re: palindrome

2015-11-16 Thread Seymore4Head
On Tue, 17 Nov 2015 10:09:27 +0530, Abhiram R wrote: >On Tue, Nov 17, 2015 at 9:59 AM, Seymore4Head >wrote: > >> http://www.practicepython.org/exercise/2014/03/12/06-string-lists.html >> >> Here is my answers. What would make it better? >> >> import random >> str1="" >> letcount=4 >> count=0 >>

Re: palindrome

2015-11-16 Thread Abhiram R
On Tue, Nov 17, 2015 at 10:18 AM, Seymore4Head wrote: > On Tue, 17 Nov 2015 10:09:27 +0530, Abhiram R > wrote: > > >On Tue, Nov 17, 2015 at 9:59 AM, Seymore4Head > > >wrote: > > > >> http://www.practicepython.org/exercise/2014/03/12/06-string-lists.html > >> > >> Here is my answers. What would