[Tutor] Modules and variable usage in functions from other files

2015-12-24 Thread Richard Bekenstein
Dear All, I have a main .py script which contains code that occasionally calls some functions. This script calls in these defined functions from other .py files in the same directory as the main .py. However, even after importing the functions from the different .py files, I get err

Re: [Tutor] Modules and variable usage in functions from other files

2015-12-24 Thread Alan Gauld
On 24/12/15 01:45, Richard Bekenstein wrote: >from scipy.constants import m_p,G,k >import numpy as np >from math import cos, pi, floor ... >from bol_runge_kutta_evl_nonadaptive import runge_kutta_evl >When I run this main.py, I get an error message from the im

[Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread boB Stepp
My Google-fu is weak on this question. I keep getting lots of hits on web scraping, but my interest is actually as follows: I find myself doing the same boring, repetitive tasks by hand, which amounts to copying certain information from one program and putting it into other programs. None of the

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread Jim Byrnes
On 12/24/2015 08:54 AM, boB Stepp wrote: My Google-fu is weak on this question. I keep getting lots of hits on web scraping, but my interest is actually as follows: I find myself doing the same boring, repetitive tasks by hand, which amounts to copying certain information from one program and p

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread Oscar Benjamin
On 24 Dec 2015 14:55, "boB Stepp" wrote: > > My Google-fu is weak on this question. I keep getting lots of hits on > web scraping, but my interest is actually as follows: > > I find myself doing the same boring, repetitive tasks by hand, which > amounts to copying certain information from one pro

[Tutor] trouble with beautiful soup

2015-12-24 Thread marcus lütolf
dear pythonistas, for hours I'am traying to use Beautiful Soup for scraping some websites as an exercise. But each time I run the code below: >>> import urllib >>> from BeautifulSpoup import * >>> url = raw_input( 'Enter -') >>> html = urllib.urlopen(url).read() >>> soup = B

Re: [Tutor] trouble with beautiful soup

2015-12-24 Thread Jos Kerc
Hi, see below. On Thu, Dec 24, 2015 at 6:21 PM, marcus lütolf wrote: > dear pythonistas, > for hours I'am traying to use Beautiful Soup for scraping some websites as an > exercise. > But each time I run the code below: > import urllib from BeautifulSpoup import * > url = raw_inpu

[Tutor] reading an input stream

2015-12-24 Thread richard kappler
I have to create a script that reads xml data over a tcp socket, parses it and outputs it to console. Not so bad, most of which I already know how to do. I know how to set up the socket, though I am using a file for development and testing, am using lxml and have created an xslt that does what I w

Re: [Tutor] trouble with beautiful soup

2015-12-24 Thread Danny Yoo
The error message suggests that something is misspelled. Let's look at the message again: >> Traceback (most recent call last): >> File "C:/Python27/Beautiful Soup_ex1.py", line 2, in >> from beautifulspoup import * >> ImportError: No module named beautifulspoup A "spoup" is, according t

Re: [Tutor] Using python 3 on Ubuntu 14.04

2015-12-24 Thread Jim Byrnes
On 12/23/2015 07:52 PM, Alan Gauld wrote: On 23/12/15 23:15, Nnamdi Anyanwu wrote: If you're installing modules with pip, install pip3 and install the appropriate modules using pip3 instead of using regular pip. Most v3 modules are also available via the Ubuntu package system so you can instal

Re: [Tutor] trouble with beautiful soup

2015-12-24 Thread marcus lütolf
dear pythonistas, Jos, Alex, Danny, Francois and Rodney I am absolutely thrilled about your prompt responses to my problem on this Christmas' eve and I am somewhat ashamed by my typing error. However, neither the correct typing of beautifulsoup nor the replacment of the 2nd line of my code by

Re: [Tutor] reading an input stream

2015-12-24 Thread Danny Yoo
> I think what I need to do would be analogous to (pardon if I'm using the > wrong terminology, at this poing in the discussion I am officially out of > my depth) sending the input stream to a buffer(s) until the ETX for that > message comes in, shoot the buffer contents to the parser while accept

Re: [Tutor] trouble with beautiful soup

2015-12-24 Thread Danny Yoo
> I have installed and unzipped etc. the latest file from www.crummy.com many > times. > If I click setup.py the command window appears only a fraction of a second. > ?? Ah, you're on Windows. I missed this detail earlier. Double-clicking setup.py isn't enough to install that module. You n

Re: [Tutor] Using python 3 on Ubuntu 14.04

2015-12-24 Thread Ben Finney
Jim Byrnes writes: > Thanks for all the info guys. I got myself confused because I thought > that python 3 was the default for Ubuntu 14.04, but it is just > installed by default. Even if that were true, the ‘python’ command will likely still invoke a Python 2 interpreter. Most systems that inst

Re: [Tutor] trouble with beautiful soup

2015-12-24 Thread Walter Prins
Hi, On 24 December 2015 at 17:21, marcus lütolf wrote: > I am getting the following trace back without beeing prompted for an input: > > Traceback (most recent call last): > File "C:/Python27/Beautiful Soup_ex1.py", line 2, in > from beautifulspoup import * > ImportError: No module named

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread boB Stepp
On Thu, Dec 24, 2015 at 11:34 AM, Oscar Benjamin wrote: > > On 24 Dec 2015 14:55, "boB Stepp" wrote: [...] >> I find myself doing the same boring, repetitive tasks by hand, which >> amounts to copying certain information from one program and putting it >> into other programs. None of these pro

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread Alan Gauld
On 24/12/15 14:54, boB Stepp wrote: > publicly accessible API. Are there ways to programmatically > accurately click the right buttons (or check boxes, radio buttons, > etc.), copy desired fields and then switch to another program and > paste the desired information into the desired fields, accur

Re: [Tutor] reading an input stream

2015-12-24 Thread Alan Gauld
On 24/12/15 18:54, richard kappler wrote: > I think what I need to do would be analogous to (pardon if I'm using the > wrong terminology, at this poing in the discussion I am officially out of > my depth) sending the input stream to a buffer(s) until the ETX for that > message comes in, shoot the

Re: [Tutor] reading an input stream

2015-12-24 Thread boB Stepp
On Thu, Dec 24, 2015 at 3:54 PM, Danny Yoo wrote: I tried to follow your example: > > For example, here's a generator that knows how to produce an infinite > stream of numbers: > > ## > def nums(): > n = 0 > while True: > yield n > n += 1 > ## > > W

Re: [Tutor] Using python 3 on Ubuntu 14.04

2015-12-24 Thread Jim Byrnes
On 12/24/2015 04:03 PM, Ben Finney wrote: Jim Byrnes writes: Thanks for all the info guys. I got myself confused because I thought that python 3 was the default for Ubuntu 14.04, but it is just installed by default. Even if that were true, the ‘python’ command will likely still invoke a Pyth

Re: [Tutor] reading an input stream

2015-12-24 Thread Cameron Simpson
On 24Dec2015 13:54, richard kappler wrote: I have to create a script that reads xml data over a tcp socket, parses it and outputs it to console. Not so bad, most of which I already know how to do. I know how to set up the socket, though I am using a file for development and testing, am using lx

Re: [Tutor] reading an input stream

2015-12-24 Thread Danny Yoo
numStream.next() > Traceback (most recent call last): > File "", line 1, in > numStream.next() > AttributeError: 'generator' object has no attribute 'next' > > > If I instead do this: > next(numStream) > 0 next(numStream) > 1 next(numStream) > 2 > > Things work as you des

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread boB Stepp
On Thu, Dec 24, 2015 at 5:38 PM, Alan Gauld wrote: > To quote my recent book: [...] > This is a frustrating technique that is very error prone and also very > vulnerable to changes in the application being controlled—for example, > if an upgrade changes the screen layout, your code will likely

Re: [Tutor] reading an input stream

2015-12-24 Thread eryk sun
On Thu, Dec 24, 2015 at 9:13 PM, boB Stepp wrote: > AttributeError: 'generator' object has no attribute 'next' The iterator protocol was added in Python 2.2 (circa 2001) as a generalization for use in "for" loops, but the language didn't have built-in next() at the time. Instead the method to get