[Tutor] downloading modules for both python 2 and 3

2017-04-09 Thread Benjamin Fishbein
I’ve been writing an app using Kivy, and now I want to test it out on an iPhone. However, this can currently only be done in Python 2. https://kivy.org/docs/guide/packaging-ios.html But when I import kivy in Python2, I get an ImportError. ImportErr

[Tutor] how to move an executable into path

2016-11-22 Thread Benjamin Fishbein
Everything was going fine with my selenium webdriver programs, but then today I updated to Firefox 50. Everything stopped working. So I updated to selenium 3, hoping this would work. But apparently I need something called geckodriver. I managed to download this, but it’s in the wrong place: in my

[Tutor] looking for image library based on PIL Image

2016-10-30 Thread Benjamin Fishbein
I’m trying to automate a lot of images using PIL’s Image library, but I don’t want to write all the filters and manipulation algorithms myself. Do you know of any good code that people have written that does this? I’m not getting much luck simply googling it, since all the results lead me to bas

[Tutor] simulating key presses

2016-03-08 Thread Benjamin Fishbein
Despite scouring stack overflow and other places, I can’t figure out how to simulate key presses. I’m using Mac 10.10.5. Most answers to this involve sending keys to an element, but my problem is that I have no element to send to; I’m trying to automate key presses for choosing (browsing) a file

[Tutor] saving webpage as webarchive

2016-02-29 Thread Benjamin Fishbein
This seems like it should be simple, but I can’t find any answer with the docs or google. I’m on a Mac. OSX Yosemite 10.10.5 I want to save a webpage as a webarchive, and not just get the text. I hope there’s a way to do it without saving all of the images separately. And even if I do have to down

[Tutor] pygame doesn't work

2013-12-11 Thread Benjamin Fishbein
Hello. I'm using Python 2.7.6 on Mac OSX. I try importing pygame and get this: >>> import pygame Traceback (most recent call last): File "", line 1, in import pygame File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py", line 95, in

Re: [Tutor] saving Tkinter canvas as jpg

2013-12-08 Thread Benjamin Fishbein
> Have you imported PIL ? Show a small coding example here with the traceback. > Cut and paste the traceback, don't paraphrase it. Here's what printed out: Traceback (most recent call last): File "", line 1, in from PIL import ImageGrab File "/Library/Python/2.7/site-packages/PIL/Image

[Tutor] saving Tkinter canvas as jpg

2013-12-08 Thread Benjamin Fishbein
Hello. I'm writing a program to draw pictures. I'm using Python 2.7.3 on Mac OSx. I'm trying to find a good way to save the canvas as a jpg (or other pic formats). The advice I've found on stackoverflow is ImageGrab from PIL, but apparently that doesn't work for macs. I get the "no module named

Re: [Tutor] selenium programs stopped working

2013-06-04 Thread Benjamin Fishbein
Is it saying that 2.29 isn't letting itself be upgraded? Will I have to completely delete Selenium from my computer and then reinstall it with the updated one? Ben On Jun 4, 2013, at 3:27 AM, Walter Prins wrote: > Hi, > > On 4 June 2013 02:27, Benjamin Fishbein wrote: > WebDri

Re: [Tutor] selenium programs stopped working

2013-06-03 Thread Benjamin Fishbein
LOG addons.xpi: checkForChanges\n*** LOG addons.xpi: No changes found\n" I can't make any sense of this. Ben On Jun 3, 2013, at 8:08 PM, Benjamin Fishbein wrote: > I'm using selenium webdriver with python 2.7. I have some programs I wrote > with it and they've

[Tutor] selenium programs stopped working

2013-06-03 Thread Benjamin Fishbein
I'm using selenium webdriver with python 2.7. I have some programs I wrote with it and they've been working properly for some months. But today I tried to write a new program with the selenium module. from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriv

Re: [Tutor] building a website with python

2013-04-09 Thread Benjamin Fishbein
> > You've gotten some good feedback, but I suspect you will get better > information if you provide more information about your goals for the site. > Thanks for your help, everyone. There are some specific things I want the site to do, and I'm not sure which would be the best developing tool

[Tutor] building a website with python

2013-04-09 Thread Benjamin Fishbein
Hello. I learned Python this past year (with help from many of you) and wrote many programs for my small business. Now I want to build a website. I acquired the domain name through godaddy.com (bookchicken.com) but have not found hosting yet. I learned html, css, and javascript via codeacademy.o

[Tutor] python on ipad

2013-03-10 Thread Benjamin Fishbein
Hello. I wrote some python programs for my small business that I run on my computer...macbook air. I'm planning to backpack around Mexico and perhaps south america. I'll still be working though. Basically my computer does all the work, I just need to have internet connections and run the program

Re: [Tutor] changing unicode to ascii

2013-01-30 Thread Benjamin Fishbein
> Using text.encode("ascii", "ignore") should absolutely work. You could also > just write the file in UTF-8 if you don't absolutely need ascii by using > text.encode("utf-8"). > > Hugo You're right. It does work. I forgot to assign the result to a variable: text = text.encode("ascii", "ignore"

[Tutor] changing unicode to ascii

2013-01-30 Thread Benjamin Fishbein
I was trying to write text to a file and got the following error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 5495: ordinal not in range(128) I tried several things I found online, such as: text.encode("ascii", "ignore") which gave me the same error and text.rep

Re: [Tutor] automate add-to-cart with python

2013-01-30 Thread Benjamin Fishbein
On Jan 29, 2013, at 11:49 PM, Marc Tompkins wrote: > > I'm pretty sure that's a typo. It should say: > python virtualenv.py > Woohoo!!! It works. You're right. It worked this way and I was able to install pip. And I got selenium to work. Apparently the problem is that selenium isn't compatible

Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Benjamin Fishbein
> > >http://www.pip-installer.org/en/latest/installing.html > I went to this pip site. It told me to install virtualenv. http://www.virtualenv.org/en/latest/#installation The virtualenv site told me: You can install virtualenv with pip install virtualenv, or the latest development version w

Re: [Tutor] automate add-to-cart with python

2013-01-29 Thread Benjamin Fishbein
>> > > A direct approach would probably use the webdriver API to automate the > browser. Selenium has one: > I decided to use Selenium. It may be overkill for this particular problem, but I'll want to use it for other things. This is my first time trying to install a new module to Python. I've

[Tutor] automate add-to-cart with python

2013-01-28 Thread Benjamin Fishbein
Hello, I'm trying to automate putting a series of items into my cart. Here's the html for the add-to-cart button on the website: http://cart.half.ebay.com/ws/eBayISAPI.dll?HalfAddItemToCart&ap=additem&itemid=343343950913&pr=57017296&fromshop=1";>Add to cart Using the cookielib and urllib2 module,

[Tutor] What can I do if I'm banned from a website??

2012-10-10 Thread Benjamin Fishbein
I've been scraping info from a website with a url program I wrote. But now I can't open their webpage, no matter which web browser I use. I think they've somehow blocked me. How can I get back in? Is it a temporary block? And can I get in with the same computer from a different wifi? __

[Tutor] finding digit in string

2012-10-08 Thread Benjamin Fishbein
I figured out a solution for the question I asked on here. To find the next digit (0-9) in a string, I use: text.find("0" or "1" or "2", etc...) But is there a more elegant way to do this? The way I found uses a lot of typing. ___ Tutor maillist -

[Tutor] finding a number with str.find

2012-10-08 Thread Benjamin Fishbein
Is there a way to find the next character that is a digit (0-9) in a string? It seems that the str.find method can only find one particular character, rather than any character from among many. ___ Tutor maillist - Tutor@python.org To unsubscribe or c

[Tutor] website is returning error when I post data

2012-10-06 Thread Benjamin Fishbein
Hello. This problem has got me stumped, and I've been trying to figure it out for more than a month. This program checks to see if a college buyback site is buying back particular books. I'm using mac OSX Here's the code. import urllib,urllib2 base_url="http://textbooks.com"; action="/BuyBack-Se

[Tutor] posting with urllib2

2012-10-02 Thread Benjamin Fishbein
Hi. I'm really confused about which data I need to put in for posting something with urllib2. I added the action on to the website. I know that I use that for the URL parameter. But what do I need to put in dicts to pass along data? And what is the purpose of the third parameter...the delay?? Th

Re: [Tutor] running program in terminal

2012-09-24 Thread Benjamin Fishbein
> > Can you start up a terminal window then try to run your program and finally > paste the whole session into a mail and post it here? > > That should help. > If your program is complex try a simple one like: > > print ('Hello world') > input('Hit enter to quit...') Last login: Mon Sep 24 18:

[Tutor] running program in terminal

2012-09-24 Thread Benjamin Fishbein
Hello. I can run programs in IDLE but when I try to do it in a terminal or with textwrangler, it usually just logs out and says it's completed, but the program hasn't been run. This is particularly so when the program uses urllib. I'm using OS X. logout [Process completed] That's what it pri

Re: [Tutor] running more than one python program at the same time

2012-09-03 Thread Benjamin Fishbein
Hi. I started running the program in the terminal rather than IDLE. It works, and I can run several programs at the same time. The problem is that when the program is finished running, it prints: exit status: 0 logout [Process completed] And I can't access the data that the program returned. Do

[Tutor] running more than one python program at the same time

2012-08-28 Thread Benjamin Fishbein
Hello, I wrote a program that I want to have running 24/7. But the problem is that I also want to write and run other programs. I'm using Idle and it won't let me run more than one script at a time. Do you know if there's a way to do this? Or do I need to buy a second computer? Thanks, Ben

[Tutor] getting results from encoded data i sent to website

2012-07-27 Thread Benjamin Fishbein
I'm trying to learn encoding, and I've had a bit of success. I managed to input something to the text box on Python's home page and I got the result I expected. But I can't figure out why this program I wrote isn't working; I think I did everything right. I'm inputting the isbn of Cat in the Hat

[Tutor] going rate for python tutoring?

2012-07-26 Thread Benjamin Fishbein
Hello, I'm trying to learn "posting" and am having a very hard time at it. I'm going to hire someone to give me a private lesson, so I put up a notice on Northwestern's CS bulletin board--probably a student there'll be able to help. How much money should I offer? I haven't the foggiest notion wha

Re: [Tutor] entering text on web site

2012-06-13 Thread Benjamin Fishbein
, > > On 13 June 2012 13:35, Benjamin Fishbein wrote: >> Hello. I have been teaching myself Python and have been stuck on this >> problem for a week--I scoured the web for an answer and even asked a couple >> computer programmer friends. >> I managed to write a simple p

[Tutor] entering text on web site

2012-06-13 Thread Benjamin Fishbein
Hello. I have been teaching myself Python and have been stuck on this problem for a week--I scoured the web for an answer and even asked a couple computer programmer friends. I managed to write a simple program with urllib that downloads the content from web pages; but I want to put text in a te