Why do these statements evaluate the way they do?

2016-05-06 Thread Anthony Papillion
I'm trying to figure out why the following statements evaluate the way they do and I'm not grasping it for some reason. I'm hoping someone can help me. 40+2 is 42 #evaluates to True But 2**32 is 2**32 #evaluates to False This is an example taken from a Microsoft blog on the topic. They say the

Re: Sending an email with a binary attachment

2016-03-01 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 03/01/2016 02:03 AM, Chris Angelico wrote: > On Tue, Mar 1, 2016 at 6:58 PM, Anthony Papillion > wrote: >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 >> >> On 02/29/2016 11:13 AM, Chris Angelico wrote: >>&g

Re: Sending an email with a binary attachment

2016-02-29 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 02/29/2016 11:13 AM, Chris Angelico wrote: > On Tue, Mar 1, 2016 at 4:08 AM, Peter Pearson > wrote: >> try: smtp.sendmail(message['From'], message['To'], >> message.as_string()) except: print "Message sending has failed" >> sys.exit(1) print "M

Sending an email with a binary attachment

2016-02-29 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello Everyone, I've been trying to write a /very/ simple script that will email a binary file to an email address when run. Pretty simple. I've done quite a bit of research and have finally settled on the following code: http://pastebin.com/sryj98

Re: Everything good about Python except GUI IDE?

2016-02-27 Thread Anthony Papillion
I would absolutely recommend you take a look at the Qt stuff. Very modern, easy to use, and free for non-commercial products. Anthony On February 27, 2016 5:18:57 AM CST, wrong.addres...@gmail.com wrote: >I have some VB forms with more than a hundred objects. If I cannot drag >and drop text

Re: [SOLVED] There has to be a better way to split this string!

2016-02-09 Thread Anthony Papillion
On 02/09/2016 07:47 PM, Ben Finney wrote: > Anthony Papillion writes: > >> On 02/09/2016 07:26 PM, Anthony Papillion wrote: >>> I am using datetime.now() to create a unique version of a filename. >>> […] >> >> Found the solution in strftime(). Exactly wh

Re: [SOLVED] There has to be a better way to split this string!

2016-02-09 Thread Anthony Papillion
On 02/09/2016 07:26 PM, Anthony Papillion wrote: > Hello Everyone, > > I am using datetime.now() to create a unique version of a filename. > When the final file is named, it will look something like: > > myfile-2015-02-09-19-08-45-4223 > > Notice I'm replacing all o

There has to be a better way to split this string!

2016-02-09 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello Everyone, I am using datetime.now() to create a unique version of a filename. When the final file is named, it will look something like: myfile-2015-02-09-19-08-45-4223 Notice I'm replacing all of the "."'s, " "'s, and ":"'s returned by date

Getting data out of Mozilla Thunderbird with Python?

2015-12-08 Thread Anthony Papillion
vely. I'm looking for a way to get at the mail stored in Thunderbird using Python and, so far, I can't find anything. I did find the mozmail package but it seems to be geared more towards testing and not really the kind of use I need. Can anyone suggest anything? Many Thanks, Anthony Pa

How to create a folder using IMAPLib?

2015-11-18 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 I'm writing a program to help migrate mail from one host to another with a few special circumstances. I'm able to get a list off of the source IMAP server using the .list() command but I'm not quite sure how to create a folder on the target machine.

Creating PST files using Python

2015-11-03 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Does anyone know of a module that allows the wiring of Outlook PST files using Python? I'm working on a project that will require me to migrate 60gb of maildir mail (multiple accounts) to Outlook. Thanks Anthony - -- Sent from my Android device wi

Re: How to handle attachments passed via Postfix

2015-10-13 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On October 13, 2015 2:04:09 AM CDT, Burak Arslan wrote: > > >On 10/13/15 00:52, Anthony Papillion wrote: >>> Check out the email.parser module, or the convenience function >>> > email.message_from_string - yo

Re: How to handle attachments passed via Postfix

2015-10-12 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 10/12/2015 3:58 AM, Chris Angelico wrote: > On Mon, Oct 12, 2015 at 6:17 PM, Anthony Papillion > wrote: >> I'm writing a script that will have email with attachments passed >> to it via Postfix. Postfix is properly p

How to handle attachments passed via Postfix

2015-10-12 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 I'm writing a script that will have email with attachments passed to it via Postfix. Postfix is properly passing the email to the script but I'm not quite sure how to get at the attachment. What I need to do is save the attachment out to the fil

Is there a Windows Python SIG?

2015-10-07 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Over the next few months, I'll be working on a project using Python on Microsoft Windows. While I'm doing this project, I'd also like to contribute in any way I can to making Python in Windows better. Does anyone know if there is a Windows SIG?

How do I real a SSL certs serial number using Python?

2015-09-03 Thread Anthony Papillion
in the general direction of how to do it? Thanks, Anthony Papillion - -- Phone:1-(845) 666-1114 VoIP: 17772471...@in.callcentric.com Skype:CajunTechie -BEGIN PGP SIGNATURE- Version: APG v1.1.1 iQJJBAEBCgAzBQJV6FtfLBxBbnRob255IFBhcGlsbGlvbiA8Y

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Anthony Papillion
On 01/21/2015 04:35 PM, Chris Angelico wrote: > On Thu, Jan 22, 2015 at 6:18 AM, Grant Edwards > wrote: >> On 2015-01-21, Steven D'Aprano wrote: >>> In 2009, Robert Martin gave a talk at RailsConf titled "What Killed >>> Smalltalk Could Kill Ruby". >> >> But does he answer the more important que

How do I remove/unlink wildcarded files

2015-01-02 Thread Anthony Papillion
ldcards? Thanks, Anthony -- Anthony Papillion Phone: 1.918.631.7331 XMPP Chat: cyp...@chat.cpunk.us Fingerprint: 65EF73EC 8B57F6B1 8C475BD4 426088AC FE21B251 iNum:+883510001190960 PGP Key: http://www.cajuntechie.org/p/my-pgp-key.html -- https://mail.python.org/mailman/listinfo/python-list

Read TLS cert serial number?

2014-04-21 Thread Anthony Papillion
Is there a way to read the serial number of a TLS cert my app receives? Anthony Sent from my mobile device -- https://mail.python.org/mailman/listinfo/python-list

Why Python 3?

2014-04-18 Thread Anthony Papillion
Hello Everyone, So I've been working with Python for a while and I'm starting to take on more and more serious projects with it. I've been reading a lot about Python 2 vs Python 3 and the community kind of seems split on which should be used. Some say 'Python 3 is the future, use it for everythin

Re: How can I parse this correctly?

2014-04-05 Thread Anthony Papillion
On Apr 5, 2014, at 23:21, Ben Finney wrote: Anthony Papillion writes: for row in r: print row['YEAR'] This works fine. But, I am needing to do date addition/subtraction using datetime and so I need these dates as integers. I assume you mean you will be creating ‘datetime.dat

Re: How can I parse this correctly?

2014-04-05 Thread Anthony Papillion
On Apr 5, 2014, at 23:03, Chris Angelico wrote: On Sun, Apr 6, 2014 at 1:52 PM, Anthony Papillion wrote: When I try to cast them like this: print int(row['YEAR']) I am told by the interpreter: Traceback (most recent call last): File "analyze.py", line 14, in

How can I parse this correctly?

2014-04-05 Thread Anthony Papillion
Hello Everyone, I'm working with historical earthquake data and I have a tab delimited file. I'm using the csv module with the \t delimiter to denote it's tab separated and it's working fine. I've set things up loike this: import csv f = open('earthquakes.tsv') r = csv.DictReader(f, delimiter='\

How to parse JSON passed on the command line?

2013-11-06 Thread Anthony Papillion
Hello Everyone, I'm writing a little helper script in Python that will access a JSON formatted argument from the shell when it's called. The parameter will look like this: {"url":"http://www.google.com"} So, if my program is called "getargfromcli.py" the call will look like this: getargfromcli.

Re: Another question about JSON

2013-09-13 Thread Anthony Papillion
On 09/13/2013 08:24 AM, Peter Otten wrote: > Anthony Papillion wrote: > >> And I get a traceback that says: No JSON object could be decoded. The >> specific traceback is: >> >> Traceback (most recent call last): >> File "coinbase_bot.py", line 31,

Another question about JSON

2013-09-13 Thread Anthony Papillion
usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object

Re: Can I trust downloading Python?

2013-09-09 Thread Anthony Papillion
On 09/09/2013 04:41 AM, Steven D'Aprano wrote: > On Mon, 09 Sep 2013 02:39:09 +1000, Chris Angelico wrote: > >> On Mon, Sep 9, 2013 at 2:08 AM, Charles Hottel >> wrote: >>> I think this article is relevant althought the code examples are not >>> Python but C: >>> >>> http://cm.bell-labs.com/who/k

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-02 Thread Anthony Papillion
On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: > On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion wrote: >> Hello Everyone, >> >> I have a multi-line string and I need to remove the very first line from >> it. How can I do that? I looked at StringIO but I can&

How can I remove the first line of a multi-line string?

2013-09-02 Thread Anthony Papillion
Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove the first line. Basically, I want to toss the first line but keep everything else. Can anyone put me

Re: How do I process this using Python? (SOLVED)

2013-08-31 Thread Anthony Papillion
On 08/31/2013 07:32 PM, Chris Angelico wrote: > On Sun, Sep 1, 2013 at 10:19 AM, Anthony Papillion > wrote: >> On 08/31/2013 06:48 PM, Chris Angelico wrote: >>> On Sun, Sep 1, 2013 at 9:44 AM, Anthony Papillion >>> wrote: >>>> I'm writing a proces

Re: How do I process this using Python?

2013-08-31 Thread Anthony Papillion
On 08/31/2013 07:32 PM, Cameron Simpson wrote: > On 31Aug2013 19:19, Anthony Papillion wrote: > | On 08/31/2013 06:48 PM, Chris Angelico wrote: > | > On Sun, Sep 1, 2013 at 9:44 AM, Anthony Papillion > wrote: > | >> I'm writing a processor for Bitmessage

Re: How do I process this using Python?

2013-08-31 Thread Anthony Papillion
On 08/31/2013 06:48 PM, Chris Angelico wrote: > On Sun, Sep 1, 2013 at 9:44 AM, Anthony Papillion wrote: >> I'm writing a processor for Bitmessage messages and I am needing to >> parse the following returned JSON string: >> >> {u'inboxMessages': >

How do I process this using Python?

2013-08-31 Thread Anthony Papillion
Hello Everyone, I'm writing a processor for Bitmessage messages and I am needing to parse the following returned JSON string: {u'inboxMessages': [{u'fromAddress': u'BM-2DBYkhiBZCyrBa8J7gFRGrFRSGqtHgPtMvwQ', u'toAddress': u'BM-2DC7SCTj2gzgrGgMvUCARdrfrsgLyz3iMyN3', u'read': 0, u'msgid': u'36659a44

Re: Question about crypto

2013-08-19 Thread Anthony Papillion
On 08/18/2013 05:52 PM, Roy Smith wrote: > In article , > Anthony Papillion wrote: > >> I've just started working with the Crypto library and I've already run >> into a wall even though I'm following a tutorial. Basically, I'm trying >> to encr

Re: Question about crypto

2013-08-19 Thread Anthony Papillion
On 08/18/2013 05:29 PM, Skip Montanaro wrote: >> When I run the code above, I am told that the IV must be 16 bytes long. >> I'm assuming that the IV (I know that means "Initialization Vector") is >> either the key OR something else I can set. But I don't know how or what >> to do. > > Does this St

Question about crypto

2013-08-18 Thread Anthony Papillion
I've just started working with the Crypto library and I've already run into a wall even though I'm following a tutorial. Basically, I'm trying to encrypt a string using AES in CBC mode. Here is the code: from Crypto import AES import hashlib text_to_encrypt = 'This is a super secret encrypted mes

Question about function failing with large number

2013-08-13 Thread Anthony Papillion
(bits) print "\nGenerated Number: ", a, "\n" print "Number of digits: ", len(str(a)) isNumberPrime = isprime(a) if isNumberPrime == True: print "\nThis number is a prime.\n" else: print "\nThis number is not a prime.\n" Thanks!

OK, I lied, I do have another question...

2011-07-10 Thread Anthony Papillion
Hi Everyone, So I've used Glade to build a simple UI and I'm loading it with gtkBuilder. The UI loads fine but, for some reason, none of my signals are being connected. For example, in Glade, I said when the button called btnExit was clicked, execute the btnExit_clicked method. Then, in my App() c

Re: How to get or set the text of a textfield? - SOLVED

2011-07-10 Thread Anthony Papillion
> I don't know anything about Glade, so I can't answer your question > definitively. However, as a general rule, you can use the dir() builtin > function to see what methods are defined by an object. Hi John, Thanks for the input and it looks like it's pretty simple. Basically, I can access the

How to get or set the text of a textfield?

2011-07-10 Thread Anthony Papillion
Hi Everyone, So I've built a UI with Glade and have loaded it using the standard Python code. In my UI, I have a textfield called txtUsername. How do I get and set the text in this field from my Python code? Thanks! Anthony -- Anthony Papillion Advanced Data Concepts Get real about

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-10 Thread Anthony Papillion
ly do not see any reasons why there isn't anything. > Please help me understand it. Any insights? > -- > http://mail.python.org/mailman/listinfo/python-list > -- Anthony Papillion Advanced Data Concepts Get real about your software/web development and IT Services Phone: (918) 919-4624

Why are my signals being ignored?

2011-06-22 Thread Anthony Papillion
Hello Everyone, So I figured out the last problem about why I couldn't load my UI files but now I've got something that has be totally stumped. I've worked on it most of the day yesterday, Google'd it, and fought with it today and I'm admitting defeat and coming to the group with hat in hand askin

Simple question about loading a .glade UI file

2011-06-21 Thread Anthony Papillion
Hi Everyone, So I'm tackling designing a non-CLI program using Glade. I went through some tutorials and it seems like I'm doing things right but I'm my UI won't load. Python keeps griping about "could not create glade XML object". I have a .glade file called MainWindow.glade and my main window is

Re: New member intro and question

2011-06-19 Thread Anthony Papillion
Just wanted to thank you guys for taking the time to respond. Looks like my 'limited resources' aren't so limited after all! Cheers, Anthony -- http://mail.python.org/mailman/listinfo/python-list

New member intro and question

2011-06-17 Thread Anthony Papillion
m-pc-in-a-power-outlet-2011022/) which isn't too shabby but I wonder if it will work. Thanks! Anthony Papillion -- http://mail.python.org/mailman/listinfo/python-list

TkInter bind() event is not firing event trigger

2010-06-22 Thread Anthony Papillion
So I want to execute some code when the user double clicks an item in a ListBox. The documentation says I should use the listbox.bind() method, specifying the Double-l event to detect the double left mouse button click. My code is this: gsItems = Listbox(root, width=76, height=30, selectmode="brow

Redirecting STDOUT to a Python Variable

2010-06-22 Thread Anthony Papillion
I'm writing an application that uses the Google Storage Python library. When an error occurs, the error is printed on the terminal. What I need to do is intercept that text into a variable so I can run a re.search() against it and find out what's going on. I thought doing a output_text = method_n

Re: tkInter Listbox question

2010-06-21 Thread Anthony Papillion
Thank you, RantingRick and EB303. Much appreciated and it looks like it works fine now. Still learning but I am amazed every single day how simple Python is! Thanks Again, Anthony Papillion -- http://mail.python.org/mailman/listinfo/python-list

tkInter Listbox question

2010-06-20 Thread Anthony Papillion
So I'm trying to add a Listbox to my window. I want it to be the width of my window and the height of my window. I'm using the following code ('root' is my toplevel window): gsItems = Listbox(root, width=root.winfo_width(), height=root.winfo_height()) gsItems.pack() While you would think this co

Re: Python on Android Mobile?

2010-06-13 Thread Anthony Papillion
Thank you gentleman for your input. I'm starting to look at Python/GTK for desktop development and was hoping there might also be something for Android. Oh well, like Simon said (pardon the pun), it is open source so... :-) Anthony -- http://mail.python.org/mailman/listinfo/python-list

Re: Community (A Modest Proposal)

2010-06-13 Thread Anthony Papillion
you say you were. IMHO, your posts serves no purpose but to hurt the community and scare away newbies. Anthony Papillion -- http://mail.python.org/mailman/listinfo/python-list

Python on Android Mobile?

2010-06-13 Thread Anthony Papillion
I know Python is growing in popularity and some of Palms devices already let you run Python apps in a VM environment. I'm wondering if anyone knows (or can make an educated guess) if there are any plans for Python to come to the Android environment? I'm not talking backend stuff here but full fro

What's the difference?

2010-06-10 Thread Anthony Papillion
Someone helped me with some code yesterday and I'm trying to understand it. The way they wrote it was subjects = (info[2] for info in items) Perhaps I'm not truly understanding what this does. Does this do anything different than if I wrote for info[2] in items subject = info[2] Thanks! Anth

Re: What's the difference?

2010-06-10 Thread Anthony Papillion
Thank you Emile and Thomas! I appreciate the help. MUCH clearer now. -- http://mail.python.org/mailman/listinfo/python-list

Re: Another nntplib Question

2010-06-09 Thread Anthony Papillion
Thomas, You have been my savior on this journey twice now and I appreciate it. What you did totally makes sense (and I had forgotten the list was zero based) and I'm going to try it out right now. Thank you SO much for your patience. I'm coming from a near pure .NET and PHP background so I'm stil

Another nntplib Question

2010-06-09 Thread Anthony Papillion
Hello Everyone, Thanks to help from this group, my statistical project is going very well and I'm learning a LOT about Python as I go. I'm absolutely falling in love with this language and I'm now thinking about using it for nearly all my projects. I've run into another snag with nntplib I'm hopi

Re: Question about NNTPLib

2010-06-09 Thread Anthony Papillion
> I just had a quick look at the documentation. It looks like you should > re-read it.http://docs.python.org/py3k/library/nntplib.html#nntplib.NNTP.xhdr Thank you for the help Thomas. I did reread the doc and I see what you mean. I think this will work now. Much thanks for the help! Anthony --

Re: Question about NNTPLib

2010-06-08 Thread Anthony Papillion
Hi Tim, Tried both and neither works. While I really believe it's simply the wrong code, I'm wondering if my news server might be throwing something invalid into the header or not conforming to RFC standards. Thanks for taking a shot at this anyway though. Anyone have any other thoughts on why th

Question about NNTPLib

2010-06-08 Thread Anthony Papillion
I'm new to NNTPLib (and Python) and I'm experiencing some behavior I can't understand. I'm writing a program to analyze newsgroup subject which will then produce statistics on topics discussed. For my example, I'm using this group (comp.lang.python) and trying to simply print out all of the subject

Re: Importing modules

2010-06-07 Thread Anthony Papillion
On Jun 6, 10:16 pm, Ben Finney wrote: > Anthony Papillion writes: > > import os > > > os.path.append('$HOME/gsutils/boto') > > > thinking I could then successfully do the import boto statement. > > Nope. > > You'll need to give the liter

Re: Importing modules

2010-06-06 Thread Anthony Papillion
On Jun 6, 10:33 pm, Chris Rebert wrote: > On Sun, Jun 6, 2010 at 8:16 PM, Ben Finney wrote: > > Anthony Papillion writes: > > >> import os > > >> os.path.append('$HOME/gsutils/boto') > > >> thinking I could then successfully do the import b

Importing modules

2010-06-06 Thread Anthony Papillion
Hello Everyone, I'm brand new to Python and have been finding it really easy to get into. But I've run into my very first problem that I'm hoping someone here might be able to help me with. I'm working with the Google Storage API and all of their Python library is under a directory called $HOME/g