Re: [Tutor] importing my module imports only one function

2014-01-30 Thread Dave Angel
Ian D Wrote in message: > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > 1) you forgot to escape the backslashes in your module path. Either use forward sl

Re: [Tutor] getUncPath(mappedDrive)

2014-01-30 Thread eryksun
On Thu, Jan 30, 2014 at 8:13 AM, danz wrote: > I apologize to all, but my above code won't work with paths that have > embedded spaces. It also turns out that the "net use" command inserts a > carriage-return/line-feed between the Path and Network fields when the last > character position of the

Re: [Tutor] importing my module imports only one function

2014-01-30 Thread Alan Gauld
On 30/01/14 15:43, Ian D wrote: if I create a module called "modtest.py" like this: import turtle def square(): def tri(): if __name__ == "__main__": tri() And then call it like this: import modtest modtest.square() modtest.tri() why would I just get ability to call the 'square()

[Tutor] importing my module imports only one function

2014-01-30 Thread Ian D
if I create a module called "modtest.py" like this: import turtle def square(): for i in range(4): turtle.fd(100) turtle.lt(90) def tri(): for i in range(3): turtle.fd(100) turtle.lt(120) if __name__ == "__main__": tri() And then call it

Re: [Tutor] getUncPath(mappedDrive)

2014-01-30 Thread danz
I apologize to all, but my above code won't work with paths that have embedded spaces. It also turns out that the "net use" command inserts a carriage-return/line-feed between the Path and Network fields when the last character position of the Path exceeds 80 characters. My above approach seemed

Re: [Tutor] imaplib and mutt flags

2014-01-30 Thread Bill Campbell
On Thu, Jan 30, 2014, Alan Gauld wrote: > On 30/01/14 02:45, Bill Campbell wrote: >> I'm writing a python script which uses imaplib > > We don't get many messages about imaplib so I'm > not sure how many folks here know about it. I've used it off and on for years, but still don't know much about i

Re: [Tutor] Python Mastermind Help

2014-01-30 Thread Alan Gauld
On 29/01/14 22:19, Amy Davidson wrote: I’ve been given an assignment in which I need to recreate > the game Mastermind. OK I assume you know how mastermind works? ie the rules of the game. I’ve been attempting it for approx a week with little to no progress. > I was hoping someone would be a

Re: [Tutor] getUncPath(mappedDrive)

2014-01-30 Thread Tim Golden
On 30/01/2014 11:39, Tim Golden wrote: > On 29/01/2014 21:58, danz wrote: >> Tim. >> >> I came across your code while searching for a similar need. Your post was >> the best I could find on the subject. Perhaps more importantly, you showed >> me that going down the ctypes rabbit hole can be less

Re: [Tutor] getUncPath(mappedDrive)

2014-01-30 Thread Tim Golden
On 29/01/2014 21:58, danz wrote: > Tim. > > I came across your code while searching for a similar need. Your post was > the best I could find on the subject. Perhaps more importantly, you showed > me that going down the ctypes rabbit hole can be less intimidating than I > assumed. Thanks! [The

Re: [Tutor] Project directory structure

2014-01-30 Thread Steven D'Aprano
On Wed, Jan 29, 2014 at 10:45:53PM +0530, Reuben wrote: > Hi, > > Do we need to follow any particular directory structure for creating any > New projects or could we just randomly create a folder containing the > script of interest? Yes and no. If all you're doing is writing a single file script

Re: [Tutor] Split Method

2014-01-30 Thread Peter Otten
Rafael Knuth wrote: > Hey there, > > I am having some issues with splitting strings. > I already know how to split strings that are separated through empty > spaces: > > def SplitMyStrings(): > Colors = "red blue green white black".split() > return (Colors) > > print(SplitMyStrings()) >

Re: [Tutor] Split Method

2014-01-30 Thread Steven D'Aprano
On Thu, Jan 30, 2014 at 12:11:56PM +0100, Rafael Knuth wrote: > Hey there, > > I am having some issues with splitting strings. > I already know how to split strings that are separated through empty spaces: > > def SplitMyStrings(): > Colors = "red blue green white black".split() > return

[Tutor] Split Method

2014-01-30 Thread Rafael Knuth
Hey there, I am having some issues with splitting strings. I already know how to split strings that are separated through empty spaces: def SplitMyStrings(): Colors = "red blue green white black".split() return (Colors) print(SplitMyStrings()) >>> ['red', 'blue', 'green', 'white', 'blac

[Tutor] Python Mastermind Help

2014-01-30 Thread Amy Davidson
Hello, I’ve been given an assignment in which I need to recreate the game Mastermind. I’ve been attempting it for approx a week with little to no progress. I was hoping someone would be able to point me in the right direction. here is what I’ve got: import random def masterMind(): userGue

Re: [Tutor] getUncPath(mappedDrive)

2014-01-30 Thread danz
Tim. I came across your code while searching for a similar need. Your post was the best I could find on the subject. Perhaps more importantly, you showed me that going down the ctypes rabbit hole can be less intimidating than I assumed. Thanks! My use case was a little different than the origi

[Tutor] Python shell wont open IDLE or an exisiting .py files

2014-01-30 Thread shangonichols
I am on Windows 8, Python 3.3.4 and 3.3.3 and all previous versions exhibit the same problem on my Windows 8 PC. This problem occurred out of nowhere overnight. It was working fine for months until today. > I tried to open a file and nothing happened. If I tried to open a .py file > (any .py fi

Re: [Tutor] imaplib and mutt flags

2014-01-30 Thread Alan Gauld
On 30/01/14 02:45, Bill Campbell wrote: I'm writing a python script which uses imaplib We don't get many messages about imaplib so I'm not sure how many folks here know about it. After some trial and error, I've figured out how to remove the \Seen flag from messages I want to look at manually