Re: [Tutor] 2.6 vs 2.7: package compatibility?

2010-10-25 Thread Tim Golden
On 25/10/2010 02:20, Alex Hall wrote: Hi all, I want to run a certain program from source. One dependency, Durus, keeps giving me an error that no one can figure out. Someone said that it will work if I use 2.7 instead of 2.6, but a lot of packages I have installed work only on 2.6. I know I can

Re: [Tutor] 2.6 vs 2.7: package compatibility?

2010-10-25 Thread Alex Hall
On 10/25/10, Tim Golden m...@timgolden.me.uk wrote: On 25/10/2010 02:20, Alex Hall wrote: Hi all, I want to run a certain program from source. One dependency, Durus, keeps giving me an error that no one can figure out. Someone said that it will work if I use 2.7 instead of 2.6, but a lot of

Re: [Tutor] 2.6 vs 2.7: package compatibility?

2010-10-25 Thread Tim Golden
It tells me that persistent_dict does not exist, when it clearly does. Another user had the exact same problem when running the source on 2.6, but he had no problem when running 2.7. If you had an msi to install Durus for 2.6 specifically, it would be interesting to see if the persistent_dict

Re: [Tutor] 2.6 vs 2.7: package compatibility?

2010-10-25 Thread Alex Hall
On 10/25/10, Tim Golden m...@timgolden.me.uk wrote: It tells me that persistent_dict does not exist, when it clearly does. Another user had the exact same problem when running the source on 2.6, but he had no problem when running 2.7. If you had an msi to install Durus for 2.6 specifically, it

[Tutor] Need help with converting script using 2.6's urllib2 to Python 3.1

2010-10-25 Thread Richard D. Moores
The lines below are the essence of a 2.6 script that gets the current USD/yen quote. I'd like to convert the script to 3.1, but I can't understand the docs for the 3.1 urllib module. Please someone tell me what to do. (Converting 'print rate' to 'print(rate)' I understand.) import

[Tutor] Python and excel writer: 'ascii' codec can't decode byte 0xf3 in position 49

2010-10-25 Thread Susana Iraiis Delgado Rodriguez
Hello members: I'm starting an script for geospatial information using python and gdal binaries, but I have problems saving the data I get into an excel shee. At the beginning I thought it was because the characters the files have for some records, but I run the code in a way it saves the path

Re: [Tutor] Need help with converting script using 2.6's urllib2 to Python 3.1

2010-10-25 Thread Sander Sweers
On 25 October 2010 14:46, Richard D. Moores rdmoo...@gmail.com wrote: I'd like to convert the script to 3.1, but I can't understand the docs for the 3.1 urllib module. Please someone tell me what to do. (Converting   'print rate'   to   'print(rate)'   I understand.) Have you actually tried

[Tutor] connect through the ip sharers

2010-10-25 Thread 김태윤
hello there are two computer. one is in here, and another is in other country. both of two computer connected to internet by IP sharer. I want to make program that connect both computer and send and receive data. but my trying fails again and agian it works when I try to connect each program in

Re: [Tutor] connect through the ip sharers

2010-10-25 Thread Robert Berman
Hi, Since your post appears to be discussing a networking problem rather than a problem with the Python language you might have far better results posting to a group more attuned to network problems. Good luck, Robert From: tutor-bounces+bermanrl=cfl.rr@python.org

Re: [Tutor] Need help with converting script using 2.6's urllib2 to Python 3.1

2010-10-25 Thread Richard D. Moores
On Mon, Oct 25, 2010 at 08:38, Sander Sweers sander.swe...@gmail.com wrote: Have you actually tried reading the documentation? Of course. Though I can see why you wondered. The _very_ first section of the urllib documentation we have urllib.request.urlopen [1]. Which looks to me what you are

Re: [Tutor] Need help with converting script using 2.6's urllib2 to Python 3.1

2010-10-25 Thread Richard D. Moores
And trying 2to3.py, which I've used successfully before, gets C:\P26Working\Finished\For2to32to3 -w -f urllib dollar2yen_rate_simple.py Traceback (most recent call last): File C:\P26Working\Finished\For2to3\2to3.py, line 2, in module from lib2to3.main import main File

Re: [Tutor] Need help with converting script using 2.6's urllib2 to Python 3.1

2010-10-25 Thread Sander Sweers
On 25 October 2010 18:19, Richard D. Moores rdmoo...@gmail.com wrote: Doing it your way, from urllib import request a = request.urlopen('http://www.marketwatch.com/investing/currency/CUR_USDYEN').read(20500) print(a[123:140]) succeeds. Why? Not sure how this exactly works but this is

Re: [Tutor] Need help with converting script using 2.6's urllib2 to Python 3.1

2010-10-25 Thread Richard D. Moores
So I finally find a relevant example in the docs: http://docs.python.org/py3k/library/urllib.request.html?highlight=urllib#examples The first example gave me some understanding and led me to revising my code to import urllib.request f =

[Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Sean Carolan
I'm rewriting a bunch of my bash scripts to get some python practice. There are some instances where python doesn't have the built-in text processing that I need, so I'm using subprocess.call. How can I pass a python variable to these subprocesses? For example: mydir = /usr/local/bin

Re: [Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Abhijeet Rastogi
On Tue, Oct 26, 2010 at 3:31 AM, Sean Carolan scaro...@gmail.com wrote: I'm rewriting a bunch of my bash scripts to get some python practice. There are some instances where python doesn't have the built-in text processing that I need, so I'm using subprocess.call. How can I pass a python

Re: [Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Bill Campbell
On Mon, Oct 25, 2010, Sean Carolan wrote: I'm rewriting a bunch of my bash scripts to get some python practice. There are some instances where python doesn't have the built-in text processing that I need, so I'm using subprocess.call. How can I pass a python variable to these subprocesses? For

Re: [Tutor] How to pass a python variable to subprocess.call?

2010-10-25 Thread Steve Willoughby
On 25-Oct-10 15:19, Abhijeet Rastogi wrote: subprocess.call(ls -l +mydir,shell=True) will do the job. In python, we can simply concatenate the strings like that. How do I replace /usr/local/bin in the subprocess call with the mydir variable? It's often preferable (for reasons ranging

Re: [Tutor] connect through the ip sharers

2010-10-25 Thread Robert Berman
Hi, As you well know networking opens a Pandora’s box of information so I tried using Google looking for ‘computer connectivity’ which has a wide range of topics. This may be a very good starting point you might wish to follow. The alternative is again using Google to look for ‘networking

[Tutor] decorators (the at sign)?

2010-10-25 Thread Alex Hall
Hi all, Now that I am able to run the source code of an open source application I hope to one day help develop, I am trying to understand how it works. One thing I keep seeing is an at sign followed by a word, usually (maybe always) immediately preceeding a function definition. For example, and I

Re: [Tutor] decorators (the at sign)?

2010-10-25 Thread James Mills
On Tue, Oct 26, 2010 at 12:46 PM, Alex Hall mehg...@gmail.com wrote: �...@set_index  def get_url(self, index=None):  return self.storage[index]['Url'] Decorators in python are used (almost as convenience) to wrap functions/methods for various purposes. It might be to do some logging before and