[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

Re: [Tutor] lst file

2008-01-24 Thread Remco Gerlich
t len(line)" and see if the lines are empty, or filled with unprintable things. Also, what sort of file is it? Remco On Jan 24, 2008 11:42 AM, SwartMumba snake <[EMAIL PROTECTED]> wrote: > Hi > > I am trying to read from a specific .lst file. When I read from it, it >

Re: [Tutor] creating a nested dictionary

2008-01-24 Thread Remco Gerlich
nary on its own. Remco On Jan 24, 2008 8:20 AM, Garry Willgoose <[EMAIL PROTECTED]> wrote: > Is there any easy way to create a nested dictionary. I want to be > able to allocate like > > pdb[dataset][modulename][parametername]['value']=value > > where dataset,

Re: [Tutor] creating a nested dictionary

2008-01-24 Thread Remco Gerlich
ict while level > 1: result = lambda: defaultdict(result) level -= 1 return result d = deep_default_dict(4)() Should give a dictionary for level=1 and the appropriate defaultdict for the number of levels you need. But I can't test right now... Remco On Jan 24, 2008 8:20

Re: [Tutor] random.choice function

2008-01-19 Thread Remco Gerlich
string into a list, splitting at every space. Also, I'd recommend adding ( and ) around the tuple for readability, so you'd get this: ch = ("So good to see you!", "How are you?", "Everything good today?", "Glad you're here!",

Re: [Tutor] interview questions

2008-01-19 Thread Remco Gerlich
h what they ask, since you have the level of Python knowledge that you claimed. Remco Gerlich On Jan 19, 2008 3:09 AM, Varsha Purohit <[EMAIL PROTECTED]> wrote: > Hello All, >I have an interview in python program development. Can i know some > interview questions in python

Re: [Tutor] run in "deamon" mode?

2008-01-10 Thread Remco Gerlich
Hi, A few days ago, someone posted a "daemon.py" to Reddit, that's supposed to do everything needed. Haven't used it myself, but here it is: http://hathawaymix.org/Software/Sketches/daemon.py Remco On Jan 10, 2008 6:41 AM, Allen Fowler <[EMAIL PROTECTED]> wrote: >

Re: [Tutor] how to compare elements of 2 lists

2008-01-04 Thread Remco Gerlich
Hi, a = [4,3,2,6,7,9] b = [8,6,3,3,2,7] You can turn this into a list of two element tuples with zip(): >>> zip(a,b) [ (4,8),(3,6,),(2,3),(6,3),(7,2),(9,7) ] Now you can loop through that and compare both elements, for instance I believe this list comprehension is what you're looking for: [ t[0

Re: [Tutor] Something I don't understand

2007-12-18 Thread Remco Gerlich
On Dec 18, 2007 2:44 AM, Jim Morcombe <[EMAIL PROTECTED]> wrote: > Below, "student_seats" is a list of the class "student". How do you create the list? And yes, the naming is confusing, but I believe that only masks the class, it shouldn't

Re: [Tutor] How to iterate and update subseqent items in list

2007-12-06 Thread Remco Gerlich
Hi, In this case, I'd go for the simple old fashioned for loop with a boolean: found = False for thing in Things: if thing.value > 0: found = True if found: thing.value = 2 Remco Gerlich On Dec 6, 2007 9:48 AM, ted b <[EMAIL PROTECTED]> wrote: > Can y

Re: [Tutor] Best way of learning

2007-12-06 Thread Remco Gerlich
x27;s fun, and it's a tour of what Python can do - but you'll have to find the way yourself :-) Remco Gerlich ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Problems with List Server?

2007-12-06 Thread Remco Gerlich
It arrived. Since you appear to be the only one reporting the problem, perhaps it's something on your end? Remco Gerlich On Dec 3, 2007 11:51 PM, Tim Johnson <[EMAIL PROTECTED]> wrote: > On Monday 03 December 2007, Tim Johnson wrote: > > I appear to be having a weird p

Re: [Tutor] opening a javascript window and reading its source

2007-11-27 Thread Remco Gerlich
ctly normal windows, that contain normal HTML. It's hard to give more help without knowing more about your problem. Hope this helps a little, Remco Gerlich On Nov 27, 2007 1:10 AM, Chiar Nimeni <[EMAIL PROTECTED]> wrote: > i basicly need python to open a certain javascr

Re: [Tutor] How to import modules using the input() command

2007-11-15 Thread Remco Gerlich
rt is a statement, not an expression. However, you can use the built-in function __import__(), that imports the module and returns it. That loads it into memory, but it doesn't add the module to the current namespace. What do you need this for? Remco Gerlich On Nov 15, 2007 4:25 PM, Mihai I

Re: [Tutor] Obtaining image date of creation

2007-11-14 Thread Remco Gerlich
e to the PyExif library ( http//pyexif.sourceforge.net/ ) and this post by someone who did the exact thing you want to do: http://www.leancrew.com/all-this/2007/08/photo_file_renaming_again.html Hope this helps :-) Remco On Nov 14, 2007 1:04 PM, Roy Chen <[EMAIL PROTECTED]> wrote: > Hello, &g