Re: [Tutor] creating distribution lists in outlook

2010-05-13 Thread Alan Gauld


"Luke Paireepinart"  


1000+ contacts in one contacts folder. When you create the distribution
lists a number get cut off if you try to put too many into the list. But
there is no indication of how many went into the list. 


I think Luke made a good point. This is usually done by businesses 
at the Exchange server as a central list. Do you use Exchange?
Outlook is intended as an individual mail client so doesn't expect 
any one person to be putting togetrher really big lists. (A stupid 
assumption because I've been hit with this limit too.)


If you are using Exchange you should look at the admin interface of that 
and see how to create big lists - I've never done it personally but I 
know that's how I need to get a big list created - via the Exchange 
admin team.


Just a thought.

Alan G.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Character creator program

2010-05-13 Thread Ben Millane
>
> Ok, thank you everyone for the helpful replies. I am currently very new to
> both Python and programming (started looking into the whole business about 2
> weeks ago) and I know how awful my coding skills are at the moment. But,
> thanks to lists like these, I hope I can improve my skills. I will look at
> the branching tutorial for sure and add my else statement in too. Thanks
> again.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] creating distribution lists in outlook

2010-05-13 Thread Pirritano, Matthew
I appreciate the effort to help! 

I work for the county. If we were a business, or maybe just in better economic 
times maybe we could afford a program that does email distribution lists. I 
believe that is the way the companies probably deal with this.

Here's what Microsoft says about the size of outlook distribution lists:

http://support.microsoft.com/kb/238569

Between 50 & 70 emails per list. That's just a limitation of outlook. At least 
outlook 2003.

On the other hand I have heard that Outlook 2007 might have dealt with this 
limitation. I will probably check that out. It does seem like the python 
solution is going to be too labor intensive. As with many such issues I thought 
it would be a fun challenge to see if I could get it to work. : )

Thanks for the help.
matt

Matthew Pirritano, Ph.D.
Research Analyst IV
Medical Services Initiative (MSI)
Orange County Health Care Agency
(714) 568-5648
-Original Message-
From: Luke Paireepinart [mailto:rabidpoob...@gmail.com] 
Sent: Wednesday, May 12, 2010 5:00 PM
To: Pirritano, Matthew
Cc: tutor@python.org
Subject: Re: [Tutor] creating distribution lists in outlook

On Wed, May 12, 2010 at 6:32 PM, Pirritano, Matthew
 wrote:
> Here's the thing. You can import them all at once. But then you have
> 1000+ contacts in one contacts folder. When you create the distribution
> lists a number get cut off if you try to put too many into the list. But
> there is no indication of how many went into the list. And there are not
> row numbers or anything like it in the contacts folders. So you'd have
> to keep in mind how far you got and then choose the next set, and it
> would be way to labor intensive if you were to count to 50 and then do
> that again. It's easier to create 20 separate files and make
> corresponding lists.  But still takes a while.

Pardon me for continuing not to address your specific question, but
this seems like something that businesses would commonly run into and
I'd be very surprised if there's not a way around this already.
Is there really no way to have a group of more than 50?  Have you
tried creating distribution lists based on contact groups?  If this is
possible you could automatically add all contacts to one specific
group.

I really think there's a simple solution if you look into it, but I
don't have outlook, I use Thunderbird.

Are you able to use a plugin to perform the work or is that against
your company's policies?

I just don't see automating with COM being the cleanest / most robust
approach, but if you really want to try it hopefully we can help if
you run into any python-specific issues!
-Luke
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] creating distribution lists in outlook

2010-05-13 Thread Pirritano, Matthew
Thanks for all of the feedback. 

The work continues. Unfortunately I think the admin interface is only
for internal lists, not emails outside the server.

Thanks
matt

Matthew Pirritano, Ph.D.
Research Analyst IV
Medical Services Initiative (MSI)
Orange County Health Care Agency
(714) 568-5648

-Original Message-
From: tutor-bounces+mpirritano=ochca@python.org
[mailto:tutor-bounces+mpirritano=ochca@python.org] On Behalf Of Alan
Gauld
Sent: Thursday, May 13, 2010 12:19 AM
To: tutor@python.org
Subject: Re: [Tutor] creating distribution lists in outlook


"Luke Paireepinart"  

> 1000+ contacts in one contacts folder. When you create the
distribution
> lists a number get cut off if you try to put too many into the list.
But
> there is no indication of how many went into the list. 

I think Luke made a good point. This is usually done by businesses 
at the Exchange server as a central list. Do you use Exchange?
Outlook is intended as an individual mail client so doesn't expect 
any one person to be putting togetrher really big lists. (A stupid 
assumption because I've been hit with this limit too.)

If you are using Exchange you should look at the admin interface of that

and see how to create big lists - I've never done it personally but I 
know that's how I need to get a big list created - via the Exchange 
admin team.

Just a thought.

Alan G.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] raw_input a directory path

2010-05-13 Thread Spencer Parker
I figured out the issue...for some reason it works with the trailing slash,
but not without it.  Once I do that...everything is all good...

On Wed, May 12, 2010 at 8:00 PM, Dave Angel  wrote:

>
>
> Spencer Parker wrote:
>
>> Here is the code:
>> http://dpaste.com/hold/193862/
>>
>> It still isn't working for me.  I don't
>> see
>> it hitting the first for loop or even the second one.  It runs without an
>> error at all.
>>
>> I am inputing the directory as: \\Documents\ and\
>> Settings\\user\\Desktop\\test
>>
>>
> When using raw_input(), no characters are substituted and none need
> escaping.  It's not a literal to need double-backslashing, and it's not a
> Unix shell, to need escaping of the space character.  What you type is what
> you get, other than things like backspace and enter.
>
> Prove it to yourself with print, and then type it straight.  You might also
> add an extra (untested) :
>
> if  not (os.path.exists(directory) and os.path.isdir(directory)):
>  print "Not a valid directory"
>
>
> DaveA
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] raw_input a directory path

2010-05-13 Thread Spencer Parker
In these files I also have some special characters I need to remove, but I
cannot figure out how to specify this.

I need to remove a vertical tab and a formfeed character.  How would I
specify to remove these characters?  I have tried \v and \f

On Thu, May 13, 2010 at 8:48 AM, Spencer Parker wrote:

> I figured out the issue...for some reason it works with the trailing slash,
> but not without it.  Once I do that...everything is all good...
>
>
> On Wed, May 12, 2010 at 8:00 PM, Dave Angel  wrote:
>
>>
>>
>> Spencer Parker wrote:
>>
>>> Here is the code:
>>> http://dpaste.com/hold/193862/
>>>
>>> It still isn't working for me.  I don't
>>> see
>>> it hitting the first for loop or even the second one.  It runs without an
>>> error at all.
>>>
>>> I am inputing the directory as: \\Documents\ and\
>>> Settings\\user\\Desktop\\test
>>>
>>>
>> When using raw_input(), no characters are substituted and none need
>> escaping.  It's not a literal to need double-backslashing, and it's not a
>> Unix shell, to need escaping of the space character.  What you type is what
>> you get, other than things like backspace and enter.
>>
>> Prove it to yourself with print, and then type it straight.  You might
>> also add an extra (untested) :
>>
>> if  not (os.path.exists(directory) and os.path.isdir(directory)):
>>  print "Not a valid directory"
>>
>>
>> DaveA
>>
>>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] raw_input a directory path

2010-05-13 Thread Hugo Arts
On Fri, May 14, 2010 at 12:17 AM, Spencer Parker  wrote:
> In these files I also have some special characters I need to remove, but I
> cannot figure out how to specify this.
> I need to remove a vertical tab and a formfeed character.  How would I
> specify to remove these characters?  I have tried \v and \f
>

As was noted, raw_input doesn't want escaping done on its input, it
just takes it as is. Escaping is something done only for
representation purposes. If you want your script to replace a vertical
tab, you'll need to enter a vertical tab character into your console.
To be fair, it's not immediately obvious how to do that. I must
confess I have no idea how you would do that on windows[1]

Alternatively, you could change your script so that you can, for
example, enter the corresponding ASCII code as input (the chr function
can convert ascii codes to their corresponding character).

Hugo

[1] had you been using linux I would have suggested:
$ echo -e '\v' | xclip -i -selection c
Then just paste as input. It's not exactly convenient, but does solve
the problem.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] raw_input a directory path

2010-05-13 Thread Hugo Arts
On Fri, May 14, 2010 at 2:37 AM, Dave Angel  wrote:
> The other approach is to have the user type in the text according to some
> escaping language (like the one used for literals), and explicitly decode
> that after the raw_input().  I thought there was a way in the stdlib, but I
> can't seem to find it right now.
>

the str.decode method has a 'string_escape' encoding:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print raw_input('prompt: ').decode('string_escape')
prompt: hello\nhello
hello
hello
>>>

Hugo
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Design Question: File Object used everywhere

2010-05-13 Thread Jan Jansen

Hi there,

I'm working on a code to read and write large amounts of binary data 
according to a given specification. In the specification there are a lot 
of "segments" defined. The segments in turn have defintions of datatypes 
and what they represent, how many of some of the data values are present 
in the file and sometimes the offset from the beginning of the file.


Now I wonder, what would be a good way to model the code.

Currently I have one class, that is the "FileReader". This class holds 
the file object, information about the endianess and also a method to 
read data (using the struct module). Then, I have more classes 
representing the segements. In those classes I define data-formats, call 
the read-method of the FileReader object and hold the data. Currently 
I'm passing the FileReader object as arguement.


Here some examples, first the "FileReader" class:

class JTFile():

def __init__(self, file_obj):
self.file_stream = file_obj
self.version_string = ""
self.endian_format_prefix = ""

def read_data(self, fmt, pos = None):
format_size = struct.calcsize(fmt)
if pos is not None:
self.file_stream.seek(pos)
return struct.unpack_from(self.endian_format_prefix + fmt, 
self.file_stream.read(format_size))


and here an example for a segment class that uses a FileReader instance 
(file_stream):


class LSGSegement():

def __init__(self, file_stream):
self.file_stream = file_stream
self.lsg_root_element = None
self._read_lsg_root()

def _read_lsg_root(self):
fmt = "80Bi"
raw_data = self.file_stream.read_data(fmt)
self.lsg_root_element = LSGRootElement(raw_data[:79], raw_data[79])

So, now I wonder, what would be a good pythonic way to model the 
FileReader class. Maybe use a global functions to avoid passing the 
FileReader object around? Or something like "Singleton" I've heard about 
but never used it? Or keept it like that?


Cheers,

Jan

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Design Question: File Object used everywhere

2010-05-13 Thread Luke Paireepinart
On Thu, May 13, 2010 at 11:49 PM, Jan Jansen  wrote:
> Hi there,
>
> I'm working on a code to read and write large amounts of binary data
> according to a given specification. In the specification there are a lot of
> "segments" defined. The segments in turn have defintions of datatypes and
> what they represent, how many of some of the data values are present in the
> file and sometimes the offset from the beginning of the file.
>
> Now I wonder, what would be a good way to model the code.

Personally I would just create a class that inherits from object (btw
I don't think you should have empty parenthesis after your classname,
I believe you should explicitly say object so it's clear what you're
inheriting from) and just implement the generic file object methods
(in this case read() and close() is probably all you'd need.)
that way you can pass it to other classes if you need to.
Basically the pythonic way is to make it as generic as possible and to
exploit duck typing so that other classes don't need to know how
you're actually implementing your reading/writing behind the scenes.

I'm not sure if that's acceptable (or even desirable) in this
particular situation though.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor