[Tutor] Wedscraping Yahoo API

2017-02-20 Thread Joe via Tutor
.format(i))        else:            print('Already have {}'.format(i)) However, I keep getting this error. Please help in identifying the problem. Thank you. Traceback (most recent call last):  File "", line 1, in     get_data_from_yahoo()  File "C:\Users\Joe\Deskto

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-04 Thread Joe Farro
Joe Farro gmail.com> writes: > indentation doesn't (always) reflect the hierarchy of the data being > generated, which seems more clear. Meant to say: However, the indentation doesn't (always) reflect the hierarchy of the data being generated, which seems more clear *

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-04 Thread Joe Farro
Joe Farro gmail.com> writes: > > Thanks, Peter. > > Peter Otten <__peter__ web.de> writes: > > > Can you give a real-world example where your DSL is significantly cleaner > > than the corresponding code using bs4, or lxml.xpath, or lxml.objectify? Peter,

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Joe Farro
Alan Gauld btinternet.com> writes: > DSL? Good to know the term/acronym is not ubiquitous. I was going for succinct, possibly too succinct... > Have you looked at the existing web scraping tools in Python? > There are several to pick from. They all avoid the kind of mess > you describe. I'm fam

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Joe Farro
Thanks, Peter. Peter Otten <__peter__ web.de> writes: > Can you give a real-world example where your DSL is significantly cleaner > than the corresponding code using bs4, or lxml.xpath, or lxml.objectify? Yes, definitely. Will work something up. > Your code on github looks good to me (too fe

[Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Joe Farro
rocessing. This is my first go at something along these lines, so any feedback is welcomed. Thanks! Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How inefficient is this code?

2014-05-08 Thread Joe Cortes
n chime in. On Wed, May 7, 2014 at 8:39 PM, C Smith wrote: > On Wed, May 7, 2014 at 7:55 PM, Joe Cortes wrote: >> Welcome to the wonderful world of generators! >> >> Looking at your code, you'll notice two things. First, you're >> iterating over all the numb

Re: [Tutor] How inefficient is this code?

2014-05-08 Thread Joe Cortes
Welcome to the wonderful world of generators! Looking at your code, you'll notice two things. First, you're iterating over all the numbers twice: once to calculate them, and then another time to actually do the sum. What's worse, at any given point in time, you're only really using fibs[-1] and fi

[Tutor] win32api & win32gui help

2014-02-28 Thread Joe Bennett
wnd message = win32api.RegisterWindowMessage("Logger32 3") win32api.PostMessage(hwnd,message,1,9) test = win32gui.GetMessage(hwnd,0,0) print "GetMessage: ", test Thanks -Joe KA3NAM ___ Tutor maillist - Tutor@python

[Tutor] how to generate random numbers in Python

2013-10-03 Thread Joe Jacques
Problems in the link http://home.manhattan.edu/~ankur.agrawal/cmpt101/assgn5.txt Sent from my iPhone ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Joe Batt
the stack was only big enough for 2 letters and I tried to push ABC it would give a stack overflow because I was trying to push 3. How would I deal with this? Can I make the stack bigger or a way to just push A B pop AB then push C and pop it. Thank you guy

[Tutor] Further pickle problem :0(

2011-11-19 Thread Joe Batt
Hi all again Thank you to those that have helped me previously with this problem it is appreciated. Thanks to Walter I have actually found the pickle file that I am trying to restore to a variable however I am getting the following error Traceback (most recent call last): File "/Users/joebatt/

[Tutor] Pickling files in Python

2011-11-19 Thread Joe Batt
) they look the same. I am viewing them in notepad on the Mac. Many thanksJoe Pickle an object- Puzzle 5 # Joe Batt 18 Nov 2011 - http://www.pythonchallenge.com/pc/def/peak.html

[Tutor] In a pickle over pickles….Python 3

2011-11-18 Thread Joe Batt
oint me in the right direction please? (I know my coding is very untidy and verbose, sorry I am very new and at the moment I have to think in baby steps with little knowledge!) Joe #

[Tutor] Printing with no newline :(

2011-11-05 Thread Joe Batt
I am learning Python 3 and programming and am very new so please bear with me… I am writing a program to pull out specific characters in a sequence and then print then out. So far so good however when the characters are printed out they pint on separate lines as opposed to what I want, all on th

[Tutor] Help with re in Python 3

2011-11-04 Thread Joe Batt
explain why I am getting "EOL while scanning string literal" when I try running my program in Python 3. Thanks for your help Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] A total newbie…sorry

2011-10-27 Thread Joe Batt
Inc. build 5658) (LLVM build 2335.15.00)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> print "Hello"Hello>>> I can see its a different version but what is the problem? Many thanks and sorry for th

Re: [Tutor] Data conversion

2011-05-19 Thread Joe Aquilina
On 19/05/11 17:26, Andre Engels wrote: On Thu, May 19, 2011 at 8:15 AM, Joe Aquilina wrote: I realised after I read your response that I probably hadn't included enough information, partly due to my inexperience in Python and partly due to haste on my part. AFter my original post, I

Re: [Tutor] Data conversion - Problem solved

2011-05-19 Thread Joe Aquilina
On 19/05/11 14:15, Joe Aquilina wrote: On 19/05/11 13:53, Andre Engels wrote: On Thu, May 19, 2011 at 6:36 AM, Joe Aquilina wrote: I am new to this list and very much a beginner to Python. Please excuse me if this is a silly question, but in all my searches this morning I have not been

Re: [Tutor] Data conversion

2011-05-18 Thread Joe Aquilina
On 19/05/11 13:53, Andre Engels wrote: On Thu, May 19, 2011 at 6:36 AM, Joe Aquilina wrote: I am new to this list and very much a beginner to Python. Please excuse me if this is a silly question, but in all my searches this morning I have not been able to find an answer. I have a (single

[Tutor] Data conversion

2011-05-18 Thread Joe Aquilina
er to make this work. Is this possible? Or can I achieve my objective in some other way? Any advice/assistance would be appreciated. Thanks in advance. Joe Aquilina ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] Assistance with Psuedocode

2010-11-17 Thread Joe Ohmer
dds a rainbow effect to the picture def mysteryEffect( pic2 ): for px in getPixels( pic2 ): r= getRed ( px ) g= getGreen( px ) b= getBlue( px ) setRed( px, 64*(r/64)) setGreen( px, 64*(g/64)) setBlue( px, 64*(b/64)) repaint( pic2 ) Thanks

[Tutor] Opening C++ binary files

2010-09-21 Thread Joe Bennett
I have some binary files created by a program written in C++... Anyone have any experience with this and willing to share? ACSII test is easy, but not sure how the rest is encoded -Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Controlling a device with ioctl's?

2010-08-24 Thread Joe Veldhuis
re trouble. -Joe On Wed, 25 Aug 2010 00:21:12 +0200 Sander Sweers wrote: > Maybe you can use the python v4l2 bindings from [1] as example how to > use it for dvb. Not used it or have any experience with anything like > this but it might help.. > > Greets > Sander > > [1

[Tutor] Controlling a device with ioctl's?

2010-08-24 Thread Joe Veldhuis
ow absolutely /nothing/ about device drivers or kernel code, I'm certain I'm missing something simple and obvious. Anyone want to set me straight? Thanks, -Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Converting audio samples from 16-bit signed int to float?

2010-06-20 Thread Joe Veldhuis
floating-point values (-1.0 - +1.0). So, what is the most efficient way to do the necessary conversion? I'm using the pyalsaaudio module to access the soundcard, if it matters. -Joe Veldhuis ___ Tutor maillist - Tutor@python.org To unsubs

[Tutor] Fast fourier transform libraries?

2009-12-09 Thread Joe Veldhuis
ng to FFTW, or something else entirely. A search on PYPI returned nothing of interest. Any advice greatly appreciated! -Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Class understanding

2009-11-24 Thread Joe Bennett
would be helpful... I've done a lot of searching via Google on classes, and it's all confusing to me... -Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Processing rows from CSV

2009-11-21 Thread Joe Bennett
Doing this a lot in my daily activities... your example > For row in reader: >If row['foo'] == 'something' : >do this etc. 'row' will return a row within 'reader'... You can then pick through the headers like "foo" and see what is there... I have some compare scripts that do exactly

Re: [Tutor] Handling Generator exceptions in Python 2.5

2009-06-20 Thread Joe
Dave, Thanks for enlightening me and providing a solution. I am a recent Python convert (from Perl). Hence the confusion about generators.(Coroutines are not a standard part of Perl anyway) - Joe Dave Angel wrote: Joe Python wrote: I have a generator as follows to do list calculations

Re: [Tutor] Handling Generator exceptions in Python 2.5

2009-06-19 Thread Joe Python
Thanks everyone for the responses. - Joe On Fri, Jun 19, 2009 at 11:09 AM, vince spicer wrote: > Well* > > *result = [(ListA[i] - ListB[i-1])/ListA[i] for i in range(len(ListA))*if > not ListA[i] == 0*] > > will exclude any results where listA[i] is 0, if you still want the

[Tutor] Handling Generator exceptions in Python 2.5

2009-06-19 Thread Joe Python
ithin that statement)'. Sorry if this question sounds too stupid. TIA Joe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Sorting Dictionary of Dictionary by certain Value

2008-09-25 Thread Joe
Thanks to Kent Johnson, Robert Berman, Bill Campbell and John Fouhy for the replies. They have been useful. Kent Johnson wrote: On Tue, Sep 23, 2008 at 8:41 PM, Joe Python <[EMAIL PROTECTED]> wrote: Hi Pythonistas, I have a large dictionary of dictionary (50,000+ keys) whi

[Tutor] Sorting Dictionary of Dictionary by certain Value

2008-09-23 Thread Joe Python
Hi Pythonistas, I have a large dictionary of dictionary (50,000+ keys) which has a structure as follows: DoD = { 'flintstones' : { 'husband' : "fred", 'pal' : "barney", 'income': 500, }, 'jetsons' : { 'husband' : "george", 'wif

Re: [Tutor] Online class/education for Python?

2008-07-20 Thread Joe Bennett
What time where the classes? Web site seems to be missing that info... -Joe On Sun, Jul 20, 2008 at 1:08 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > At 02:45 PM 7/19/2008, David wrote: >> >> Steve Poe wrote: >>> >>> Anyone taken or know of any onl

[Tutor] Generating audio tones?

2008-07-19 Thread Joe Veldhuis
running on an x86-64 Linux machine, using the ossaudiodev module to access the soundcard. Anyone think they can help? -Joe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tkinter problem

2008-06-15 Thread Joe
The following worked for me. from Tkinter import * root = Tk() myContainer = Frame(root) myContainer.pack() button1 = Button(myContainer) button1['text'] = "Hello, World!" button1['background'] = "green" button1.pack() root.mainloop() Arden Hall wrote: I'm trying to learn to use Tkinter fr

Re: [Tutor] Project Euler Problem 6

2008-04-24 Thread joe gallo
It says: Find the difference between the sum of the squares of the first * one hundred* natural numbers and the square of the sum. You did range(1,111). On Thu, Apr 24, 2008 at 1:13 PM, kinuthia muchane <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to solve problem 6 on the Project Euler, bu

Re: [Tutor] Little problem with math module

2008-04-21 Thread joe gallo
On Mon, Apr 21, 2008 at 12:07 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > >>> pow(20, 0.333) > 2.7144173455393048 > >>> pow(-20, 0.333) > Traceback (most recent call last): > File "", line 1, in > ValueError: negative number cannot be raised to a fractional power > >>> -20**0.333 >

Re: [Tutor] Array indexing

2007-01-16 Thread Joe Abbey
On 1/16/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote: On Tue, Jan 16, 2007 at 11:28:49AM -0500, Joe Abbey wrote: > Hello, > > I'm using Active Python v2.4.3.11 on a Windows XP machine. > > Probably more relevant is that I'm just learning Python, as in I've be

[Tutor] Array indexing

2007-01-16 Thread Joe Abbey
ch busted? Is there a better way to reference elements? The "fix" I'm currently using is to write the index I want: (directoryTable[0], directoryTable[1]) I was hoping someone on this list could point me in the right direction. Thanks in advance! Cheers, Joe __

Re: [Tutor] basic python question/getting values

2007-01-02 Thread Joe M
Thanks. I appreciate the quick response. I am going to kick myself for this one ;) On Tue, 2 Jan 2007, Asrarahmed Kadri wrote: > Date: Tue, 2 Jan 2007 19:38:04 + > From: Asrarahmed Kadri <[EMAIL PROTECTED]> > To: Joe M <[EMAIL PROTECTED]> > Subject: Re: [Tutor] basic

[Tutor] basic python question/getting values

2007-01-02 Thread Joe M
I apologize in advanced as I know this is basic information, but I cannot seem to figure it. I have a few scripts that will return a value ie here I am testing to see if a database is alive (script is called dbping.py): def db_alive(): dbRunning = '0' try: con =

[Tutor] Simple calculator

2006-10-31 Thread Joe Cox
y", line 12, in ? entry.bind("", evaluate) File "D:\Python24\lib\lib-tk\Tkinter.py", line 933, in bind return self._bind(('bind', self._w), sequence, func, add) File "D:\Python24\lib\lib-tk\Tkinter.py", line 888, in _bind self.tk.call(what

Re: [Tutor] Decimal truncation, rounding etc.

2006-10-25 Thread Joe Cox
PMTo: [EMAIL PROTECTED]Cc: tutorSubject: Re: [Tutor] Decimal truncation, rounding etc.More specifically, Joe, where and what types of errors are you getting?When I type in your example exactly as above I get the following:>>>from decimal import *>>> Decimal(&#x

[Tutor] Decimal truncation, rounding etc.

2006-10-25 Thread Joe Cox
")   But when I go in to IDLE, I just don't seem to be able to make this work.   A typical line of code for me to read and edit will look like: G01 G91 X7.12345 Y7. Z-0.0086  The underlines is what I need to edit, as above.   I must not understand something fu

[Tutor] GUI new project

2006-10-22 Thread Joe Cox
.py", line 22, in __init__ , relief=SUNKEN) File "D:\Python24\lib\lib-tk\Tkinter.py", line 2409, in __init__ Widget.__init__(self, master, 'listbox', cnf, kw) File "D:\Python24\lib\lib-tk\Tkinter.py", line 1862, in __init__ self.tk.call( TclError:

[Tutor] Share variables between py scripts

2006-10-06 Thread Bennett, Joe
Can anyone direct me to some documentation on how to take variables from one py script, execute and pass them to another script? Then I need to get data back from the executed script? I've been searching Google and I see information, but I am in need of some examples...     Thanks! -Joehttp://www.d

[Tutor] Idle socket connection refused on w2k

2006-09-06 Thread Joe Cox
Alan, I got Active State program, man what a difference. Thanks for the help. I having fun again. -- Joe Cox 513-293-4830 Mobile ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Idle socket connection refused on w2k

2006-09-02 Thread Joe Cox
on't want to give up on python. If I need to do a dual boot and add Linux so be it. Joe Cox 513-293-4830 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] thanks

2006-08-29 Thread Joe Gamman
just a quick note to say thanks to all the replies i got from the community.  once again, my idea has already been done, and far better than i could have imagined.  i'm off to wander aimlessly around the useless python site ;-) ___ Tutor maillist - Tuto

[Tutor] Query to the tutor mailing list

2006-08-24 Thread Joe Gamman
challenge and perhaps more of these would be a suitable way to do this.  I've tried the cookbook but most of the problems are beyond me at this stage so i can't self study the code for hints.  Anyway, would appreciate any comments on the idea.cheers,joe __

[Tutor] Listbox selection

2006-08-03 Thread Joe Cox
uot;, variable=var, value='c', command=radio_command).pack() radio_d = Radiobutton(root,text="Nickel", variable=var, value='d', command=radio_command).pack() radio_e = Radiobutton(root,text="Titaniuim", variable=var, value='e', command=radio_command).p

[Tutor] images in pygame

2006-07-23 Thread Joe F
Hello, I have a code here. and I want to make the "rockwholescreen.gif" blocked, but still displayed.  I want it so "001.png" can't walk through that gif.  any ideas?import pygame, os, sysfrom pygame.locals import *  pygame.init( ) def _loadImages_ ( path, name ):        image_obj   = os.path.join(

[Tutor] Binding ListBox

2006-07-21 Thread Joe Cox
I am learning Python 2.4 with Tkinter. I have a series of radio buttons that I want to bind to their own individual listbox in order to narrow down a selection process. I just don't seem to grasp how to call up the approiate box to it's proper radiobutton. Please help. Joe Cox 51

[Tutor] List Box binding

2006-07-19 Thread Joe Cox
I am using Tk and have a series of Radio buttons that I want to bind to it's own listbox for further selection. I just don't get the point how to click the button and select the proper listbox I want it tied too. Joe Cox513-293-4830 mobile[EMAIL

[Tutor] help...newbie

2006-05-22 Thread Joe F
Hello, I am pretty sure I am sending this to the right email address.  But anyway I need help.  I started learning python, and I wanna know how to make a simple program, that displays text and when the user presses enter more text is displayed.  And so and so until the end.  Thank you, joe. Love

Re: [Tutor] question about serial coms

2005-11-14 Thread Bennett, Joe
Serial Port\n" ser.close() The 'command_1.txt' file is literally a text file with lines of text like such: command1 on command2 off command3 %4 command5 on etc -Joe --- Hans Dushanthakumar <[EMAIL PROTECTED]> wrote: > Just to make sure that I understood

Re: [Tutor] question about serial coms

2005-11-14 Thread Bennett, Joe
r.write("\r\n") print "Sending: " + line time.sleep(1) data_in = ser.read(100) print "Response: " + data_in time.sleep(.2) print "Closing Serial Port\n" ser.close() -Joe --- nephish <[EMAIL PROTECTED]> wrote: &

[Tutor] Boolean math question

2005-10-22 Thread Joe Bennett
Anyone know of a good explanation of either how to perform boolean math in Python? What I am trying to do is AND two numbers together: e = 51 AND 15 00110011 0011 In this case the result should be e = 3... Ideas? -Joe

Re: [Tutor] CGIXMLRPCRequestHandler doesn't actually work, does it?

2005-06-24 Thread joe
directory then using the following worked: >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy("http://127.0.0.1/~joe/xmlrpctest.cgi";) >>> s.plus(4,5) 9 Hope this helps Joe > Thanks for your response, Shuying Wang -- I was afraid no one even r

Re: [Tutor] Database connections don't stay alive

2005-06-06 Thread Joe Healy
etchall() Hope this helps, Joe Olli Rajala wrote: >Well, I asked about tutorials, but maybe this was not so good day, >because it has been quite "silent". :) > >So, good tutorials are still welcome, though I know now how to connect >to the Postgresql database. I just

Re: [Tutor] map() and lambda to change class instance attribute (fwd)

2005-05-13 Thread Joe Healy
r this! > >Alan G >Author of the Learn to Program web tutor >http://www.freenetpages.co.uk/hp/alan.gauld > >___ >Tutor maillist - Tutor@python.org >http://mail.python.org/mailman/listinfo/tutor > > -- ___