Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
On 19 May 2015 at 17:25, Jim Mooney Py3.4.3winXP wrote: > > If I can get dir to accept x I can parse the output to get rid of the > __xxx stuff and print it out. > By that I mean dir will give me a list of strings I can then use __doc__ on to get all useful help items. -- Jim After not doing

Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
On 19 May 2015 at 17:18, Ben Finney wrote: > You will be pleased to know of the standard library ‘importlib’ > library:: > > >>> import importlib > Yes, I already got importlib to accept a string. But I can't figure how to get dir to accept it: >>> x = 'shutil' >>> import importlib >>> impo

Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Ben Finney
"Jim Mooney Py3.4.3winXP" writes: > I can only use the hardcoded imported module name, shutil in this > case. If I try x = anothermodule, then import x, it doesn't work. Can you show an example of Python code that you would like to work? I am *guessing* you mean you want this to work:: >>>

[Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
I use python help() a good deal but get tired of paging through the __object__ stuff to get to what I use at my level, so I wrote the following to omit it. The problem is, I want to import it then use it as shorthelp.py for different modules so I could just type shorthelp(modulename). Only the impo

Re: [Tutor] create a copying tool

2015-05-19 Thread Jos Kerc
Hi, see comments below: On Tue, May 19, 2015 at 2:20 PM, Remco wrote: > Hello, > import os > import shutil > > target_dir = r'D:\target\' > source_dir = r'D:\source\' > source_file = r'D:\source\list.txt' you are not using this... > missing_files = open("missings.txt","w") > > for line in o

Re: [Tutor] create a copying tool

2015-05-19 Thread Alan Gauld
On 19/05/15 13:20, Remco wrote: The source folder looks like this: (with in some cases even sub-folders or sub-sub-folders) D:\source\folder1 D:\source\folder2 D:\source\folder3 D:\source\folder4 D:\source\folder5 And the list.txt looks like this: (over 250 entries in the original list file)

Re: [Tutor] Myplotlab issue

2015-05-19 Thread Mark Lawrence
On 19/05/2015 16:58, bgen...@masonlive.gmu.edu wrote: Hello, I am currently working with a simple program in Python (just starting out) and am getting an error message: Traceback (most recent call last): File "/Users/nomargfan661/Desktop/PythonProjects/chapter3/graphics.py", line 3 fr

[Tutor] create a copying tool

2015-05-19 Thread Remco
Hello, I am new here, and new with Python. I use Python 2.7 on a windows computer in Pyscripter. I've got the next problem witch I need some help with: I need to copy several files, from several folders to a new location in the same folder structure as they are now. And all the files I need to

[Tutor] Myplotlab issue

2015-05-19 Thread bgen...@masonlive.gmu.edu
Hello, I am currently working with a simple program in Python (just starting out) and am getting an error message: Traceback (most recent call last): File "/Users/nomargfan661/Desktop/PythonProjects/chapter3/graphics.py", line 3 from pylab import plot,show File "/Library/Frameworks/Pyth

Re: [Tutor] Connecting Py 2.7 with visa

2015-05-19 Thread Wilson, Pete
Pip-for-windows worked great! Bob's your uncle! Case closed. Pete > -Original Message- > From: Tutor [mailto:tutor-bounces+pete.wilson=atmel@python.org] On > Behalf Of Mark Lawrence > Sent: Friday, May 15, 2015 7:15 PM > To: tutor@python.org > Subject: Re: [Tutor] Connecting Py 2.7 wi