[Tutor] How to write tests for main() function that does not return anything

2016-02-02 Thread Pedro Miguel
Hi guys, I'm trying to test the code in the main() but I'm a bit unsure how to go about it since I'm not passing any arguments or even returning anything other then logging. For the purposes of the example I've shortened the tree statements in the function.. Can anyone point me in the right dire

Re: [Tutor] how to see a terminal window showing progress of os.system

2009-12-20 Thread pedro
On 2009-12-17 20:02:03 -0500, "Alan Gauld" said: "pedro" wrote Hi I am sending commands to the command line using python's os.system. Is there a way to see a terminal window showing the progress of os.system as if you had just run the command from a normal termina

Re: [Tutor] How to run two os.system commands simultaneously

2009-12-17 Thread pedro
On 2009-12-17 09:52:34 -0500, Kent Johnson said: call os.system() in a thread Hi Kent, pardon my ignorance but what do you mean by call os.system() in a thread? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription optio

[Tutor] how to see a terminal window showing progress of os.system

2009-12-17 Thread pedro
Hi I am sending commands to the command line using python's os.system. Is there a way to see a terminal window showing the progress of os.system as if you had just run the command from a normal terminal window? As it is now it runs completely in the background ___

[Tutor] How to run two os.system commands simultaneously

2009-12-17 Thread pedro
Hi, I have two computationally intensive commands that I would like to render simultaneously on two fifferent computers. When I run these two commands, os.system(theTerminalCommandMacPro4) os.system(theTerminalCommandMacPro1) the second command doesn't begin until the first command has finish

Re: [Tutor] update html pages using python

2009-08-29 Thread pedro
On 2009-08-29 19:34:15 -0400, "Alan Gauld" said: "pedro" wrote Hi, I was wondering if anyone could point me in the right direction as far as the best way to use python to update html. There are a number of modules in the standard library that can help but the best k

[Tutor] update html pages using python

2009-08-29 Thread pedro
Hi, I was wondering if anyone could point me in the right direction as far as the best way to use python to update html. Specifically, I have a python script which coordinates the rendering of image sequences to disk (rendered from Nuke, the compositing program) and also automates the creation

Re: [Tutor] run python script on another computer's terminal (LAN)

2009-08-11 Thread pedro
On 2009-08-11 05:27:19 -0400, "Alan Gauld" said: "pedro" wrote Hi, does anyone know how to send a command that is within a python script to another computer's terminal. This is what it looks like in Applescript. tell application "Terminal" of machine

[Tutor] run python script on another computer's terminal (LAN)

2009-08-10 Thread pedro
Hi, does anyone know how to send a command that is within a python script to another computer's terminal. This is what it looks like in Applescript. tell application "Terminal" of machine "eppc://USERNAME:passw...@computer2.local" do script "ls"

Re: [Tutor] droplet like behaviour in Python

2009-08-10 Thread pedro
On 2009-08-10 22:40:14 -0400, Dave Angel said: bob gailer wrote: Alan Gauld wrote: "pedro" wrote Well I made a script called droplet.py which looks like this: #!/usr/bin/env python # encoding: utf-8 import sys theFilePath = sys.argv[1] print theFilePath But when I try to drop

Re: [Tutor] droplet like behaviour in Python

2009-08-09 Thread pedro
On 2009-08-08 19:34:44 -0400, "Alan Gauld" said: "pedro" wrote is one thing I am not really sure how to do. I want to be able to drop a file onto a python script (or app I guess) and have the python script use the path to the file that was dropped on it as sys.argv[1]

[Tutor] droplet like behaviour in Python

2009-08-08 Thread pedro
Hi I am porting some of my code over from Applescript to Python. There is one thing I am not really sure how to do. I want to be able to drop a file onto a python script (or app I guess) and have the python script use the path to the file that was dropped on it as sys.argv[1] In applescript it

Re: [Tutor] monitor number of files in a folder

2009-08-07 Thread pedro
On 2009-08-06 17:25:50 -0400, Νικόλαος Ράπτης said: Well, os.listdir doesn't include "." or ".." anyway as you can see here On my machine (a Mac), os.listdir does include files that begin with "." Having the while loop timeout after 10 or 20 times through as was suggested a couple posts bac

Re: [Tutor] monitor number of files in a folder

2009-08-06 Thread pedro
On 2009-08-06 15:49:35 -0400, Wayne said: On Thu, Aug 6, 2009 at 2:33 PM, pedro wrote: Hi I am rendering image sequences on a basic render farm that I am building. Once all the files in the sequence have been rendered I would like to make a quicktime of the sequence automatically. The

Re: [Tutor] monitor number of files in a folder

2009-08-06 Thread pedro
On 2009-08-06 15:49:35 -0400, Wayne said: On Thu, Aug 6, 2009 at 2:33 PM, pedro wrote: Hi I am rendering image sequences on a basic render farm that I am building. Once all the files in the sequence have been rendered I would like to make a quicktime of the sequence automatically. The

[Tutor] monitor number of files in a folder

2009-08-06 Thread pedro
Hi I am rendering image sequences on a basic render farm that I am building. Once all the files in the sequence have been rendered I would like to make a quicktime of the sequence automatically. The problem I am having is that if one of the computers on the farm is rendering slow the quicktime

[Tutor] "File exists, overwrite?" dialog help

2009-07-28 Thread pedro
Hi I am learning python for use in Nuke (image compositing software). I would like to test if a file exists and receive a warning if it does. To do a Nuke command line render, it looks something like this: /Applications/Nuke5.1v5/Nuke5.1v5.app/Contents/MacOS/Nuke5.1v5 -iX WriteComp '/Volumes/s

Re: [Tutor] != -1: versus == 1

2009-07-17 Thread pedro
Thanks for the replies. I think my mistake was assuming that "1" meant "true" when if fact it means "index 1". Whe I tested for "== 1", since "Source Height" was coincidentally at index 1 it returned something which looked like it worked. Thanks for the clarification. And thanks for the suggest

[Tutor] != -1: versus == 1

2009-07-17 Thread pedro
Hi I have been trying to understand a python script and I keep coming across this kind of structure that says "If it is not equal to negative one" for line in theLines: if line.find("Source Height") != -1: #etc... ### Is there

Re: [Tutor] pyparsing complex search

2009-07-16 Thread pedro
Hi Paul. Thanks. I would like to get better at pyparsing. Can you recommend a good resource for learning. I am finding that what info I have found on the subject (on the web) isn't really explaining it from the ground up as much as I would like. Cheers Pete ___

[Tutor] pyparsing complex search

2009-07-16 Thread pedro
Hi, well mabe it's not so complex (just for me). I have this code which works fine: #start### from pyparsing import * data = """23 different size pry bars hammer the pitchfork pound felt paper staple the felt paper every to inches staple ham

Re: [Tutor] find and replace relative to an nearby search string

2009-07-13 Thread pedro
Hi and thanks everyone for the enlightenment. I guess pyparsing is the way to go then. I just installed it and am trying it out. It looks good for all the stuff I need to do in Nuke frequently. I am going to do a bit of testing with Paul's solution. Cheers Pete __

Re: [Tutor] mac os x executable

2009-07-12 Thread pedro
Hi, the way I do this on mac os x is to use applescript like so. --start of applescript tell application "Terminal" do script "python /Volumes/Seagate750/drive_01/myPythonScript.py" end tell --end of applescript Where you simply point the terminal to the python script using applescri