Re: [Tutor] PHP

2010-12-04 Thread Brett Ritter
aintenance/testing/reuse that much harder, even moreso when working on a team with different skill specialties. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: h

Re: [Tutor] Which non SQL Database ?

2010-12-04 Thread Brett Ritter
s a package for older pythons. Berkeley DB is pretty much interchangeable with SQLite in terms of functionality. I much prefer SQLite. If your web application intends to have multiple users interacting with the same data, neither is probably a go

Re: [Tutor] Trying to parse a HUGE(1gb) xml file in python

2010-12-20 Thread Brett Ritter
On Mon, Dec 20, 2010 at 4:19 PM, Steven D'Aprano wrote: >> Goal : I am trying to parse a ginormous ( ~ 1gb) xml file. > > I sympathize with you. I wonder who thought that building a 1GB XML file was > a good thing. XML is like violence: if it isn't working, try more. --

Re: [Tutor] Trying to parse a HUGE(1gb) xml file in python

2010-12-20 Thread Brett Ritter
majority of XML usage I've encountered. As to the original post: Yes, as others have suggested you're going to want an event-based parser along the lines of SAX. Sadly (for you) this means a mental shift in how you address your code, but it's not terrible - just different. -- Bre

Re: [Tutor] vim as a python editor

2010-12-22 Thread Brett Ritter
environment perfectly tailored (yay for virtualenv) I'll have a screen session manage the entire thing until the project is done, just reconnecting to it when I'm working on it. I highly recommend both screen and virtualenv to anyone that is unfamiliar with them. --

Re: [Tutor] Choice of Python

2010-12-28 Thread Brett Ritter
several years, Python may or may not be the best choice depending on your field. If you want a useful tool that will improve your understanding of other tools in addition to being useful in its own right, Python is absolutely a good choice. All that said, I doubt you'll find many Python Nay

Re: [Tutor] Choice of Python

2010-12-28 Thread Brett Ritter
e without hoop-jumping? -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Brett Ritter
of the languages I'm using, and Python appears to use camelCase more than not. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/

Re: [Tutor] regex question

2011-01-04 Thread Brett Ritter
off not using a regex and just using a string operation. Regexes are great for trying to do powerful and complicated things - and as such may be too complicated if you're trying to do a simple thing. -- Brett Ritter / SwiftOne swift...@swiftone.org _

Re: [Tutor] regex question

2011-01-04 Thread Brett Ritter
htly different Regex pattern. .*dex.* would match both lines. You'll need to be more specific when you say "the word dex" to determine your regex. \sdex\s will match dex surrounded by whitespace, which might be what you want. \bdex\b will match dex surrounded by word boundaries,

Re: [Tutor] Beginning Python and other resources (was Re: SlicingTuples)

2011-01-13 Thread Brett Ritter
to know of some other way to obtain it for less than $45? Half.com is always my stop of choice for programming books. I see a copy there for $16. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] ideas for a simple program

2011-01-25 Thread Brett Ritter
end the attempt, but for #2 I recommend small games. A blackjack game or a computer that can play tic-tac-toe with you are great ways to work on a well-defined problem that won't take forever. Once you feel sufficiently confident, helping on an open source project as others suggest is a great way.

Re: [Tutor] ideas for a simple program

2011-01-25 Thread Brett Ritter
do it in seconds and a bad program would take hours (if it didn't run out of memory first). -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pytho

Re: [Tutor] python packaging systems

2011-02-10 Thread Brett Ritter
motivation need not be obfuscation. I myself like to package standalone programs for non-techie friends and family to use. For them, "Run this" is a good first instruction versus "Install Python..." (regardless of how much their lives might be improved by the latter :) ) -- Bre

Re: [Tutor] Python3 Tutorial question about a[:] = []

2011-02-16 Thread Brett Ritter
t;> a = [1,2,3] >>> b = a >>> a = [] >>> print a [] >>> print b [1, 2, 3] Versus: >>> a = [1,2,3] >>> b = a >>> a[:] = [] >>> print a [] >>> print b [] -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Replying

2011-03-28 Thread Brett Ritter
itism for existing. (*steps off soapbox*). You can google "Eternal September" for more on that general topic. TL;DR Version: Yes, that's perfectly acceptable. *bites tongue to resist going off on a rant about TL;DR* Hope that was helpful! -- Brett Ritter / SwiftOne swift...@swiftone.o

Re: [Tutor] learnpython.org - Free Interactive Python Tutorial

2011-04-21 Thread Brett Ritter
d you pls provide the link. tq To all: The link is in the subject line: http://learnpython.org -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.or

Re: [Tutor] Python assignment

2011-05-09 Thread Brett Ritter
sults) * Give a clear question to answer. If you haven't gotten this from someone else, then consider this that response :) -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Printing output from Python program to HTML

2011-05-10 Thread Brett Ritter
te strings to/from other places (for example, template files, raw HTML files, etc). Hope that helps! -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] folder and file list

2011-05-10 Thread Brett Ritter
nize that your backslash is an actual real backslash you can escape it: scandir('c:\\tmp') After that your code should work fine (it runs on my system, but I'm not on windows). This filepath issue has many details you can look up or ask about, b

Re: [Tutor] Graphic interface

2011-05-10 Thread Brett Ritter
b-based application, I'd start by googling TkInter and going from there. There are alternatives, but that's well-supported and widely used. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe o

Re: [Tutor] Python program with multiple answers

2011-05-11 Thread Brett Ritter
r any problem it's limited in scope rather than trying to take it all in at once. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python file upload

2011-05-14 Thread Brett Ritter
On Friday, May 13, 2011, Rayon wrote: > Hi all, I need a python script to upload a xml file to a web page using > python. I have tried using pycurl but I am still getting Fyi, the XML spec allows for no characters or whitespace before the XML declaration, that could be your error, --

Re: [Tutor] upload xml file via pycurl

2011-05-16 Thread Brett Ritter
On Mon, May 16, 2011 at 2:00 PM, Rayon wrote: > I am trying to upload a xml file via pycurl, I really need some help here. What is the error your are receiving? Did you fix the fact that you had starting whitespace as I mentioned to your last email? -- Brett Ritter / SwiftOne sw

Re: [Tutor] Python Interview Questions..

2011-05-27 Thread Brett Ritter
: Stacked patterns without understanding the purpose, premature and excessive abstraction, elimination of verbs, and horrendous naming habits. I'm curious to see if any of these habits change if/when Java adds functions as first-class objects. -- Brett Ritter / SwiftOne swift...@swiftone.org

Re: [Tutor] Strategy to read a redirecting html page

2011-06-02 Thread Brett Ritter
the first warning/error message page and not the redirection one.") -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Q

2011-06-08 Thread Brett Ritter
our chances are up!") You want this to occur when your chances are up, right? So why is it _inside_ the while loop? Your basic approach is fine, you just have some extra stuff going on unnecessarily and I'm guessing it's confused you as to your logic. Give it another shot and let us know how it goes. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Floating Point Craziness

2011-06-12 Thread Brett Ritter
u'll just want to use a format to output the number and you'll see exactly what you expect. It only becomes a problem in high-precision areas, which 0.1 increments don't tend to be. Hope that helps! -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] using python to write web page

2011-06-15 Thread Brett Ritter
for such templates. This is assuming that you generate the HTML in the first place instead of trying to edit someone elses existing HTML. In that case you'd proceed as you described. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor

Re: [Tutor] nitinchandra rubbish on list

2011-06-19 Thread Brett Ritter
#x27;t recall of such behavior. All works > fine with me. I've had this as well, and as Steven says, it only occurs with a partiuclar recipient. If you send to the list only (or in fact anyone other than that person), you'll not receive this. -

Re: [Tutor] Using a dict value in the same dict

2011-07-05 Thread Brett Ritter
Which is correct. To set one value based on another they must be set separately. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List methods inside a dictionary of list

2011-07-11 Thread Brett Ritter
t that's the source of your issue. To achieve what you are trying, try this instead: d = dict([(x,[0]) for x in ['a', 'q', 'c', 'b', 'e', 'd', 'g', 'j']]) Can you understand how this behaves differently than 8

Re: [Tutor] Mailing list documentation

2011-07-31 Thread Brett Ritter
is nothing of concern here. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] When to use def __init__ when making a class?

2011-08-02 Thread Brett Ritter
will use a different print syntax class Name: pass instance = Name() instance.man = "Fred" print instance.man -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Standard way to create debian packages for python programs?

2011-08-18 Thread Brett Ritter
't competent enough on the subject to give proper feedback. :) Are you looking for distutils advice, or .deb advice? They are pretty different. How are you expecting your users to install your package? Via easy_install? Apt-get? Something else? -- Brett Ritter / Swi

Re: [Tutor] Intro

2011-08-29 Thread Brett Ritter
On Mon, Aug 29, 2011 at 11:26 AM, Cranky Frankie wrote: > Hi Python tutor listers, as an intro I'll repost what I sent to my > Linux groups, since one of their members turned me on to you: Glad you're so happy with this book...did you have a question for this list? -- Brett R

[Tutor] Strange zip syntax

2011-09-15 Thread Brett Ritter
to get multiple arguments: >>> b = iter(a) #our original iterator is spent, so we're assigning a new one >>> c = [b,b] >>> zip(c) #Not flattened, is just a single list, like a. [(,), (,)] >>> zip(b,b) # here it is two iterators sent to zip() (though they happen to >>> be the SAME iterator) [('a', '1'), ('b', '2'), ('c', '3')] I hope some of you enjoy playing with this, and hopefully someone learned something useful! While I'm not likely to use the listed form, I can very well see myself saying: >>> a = ['a','1','b','2','c','3'] #well, I can see myself using this with >>> meaningful variable names >>> b = iter(a) >>> zip(b,b) # Group in sets of 2 elements -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Logging to different directories

2011-09-24 Thread Brett Ritter
ndler will let me write to filenames based on date, but it won't alter the path (in fact, the entire logging module seems to be built on the assumption of no subdirectories). Have I missed something? -- Brett Ritter / SwiftOne swift...@swiftone.org __

Re: [Tutor] Return T/F vs print T/F

2012-02-04 Thread Brett Ritter
int it. When using the interactive mode, the program that creates that mode prints the return. When you are using it your program, the caller decides what to do. The flip side is that printing a value does NOT return it. -- Brett Ritter / SwiftOne swift...@swiftone.org ___

Re: [Tutor] What the difference between the two RE?

2012-02-09 Thread Brett Ritter
quot;hello" but does not match RE "^hello". In addition to the other answers, it's important to note that nothing in these REs require it to be a "word". So both of the above will match the "hello" in "hellonwheels" for example. -- Brett Ritter /

Re: [Tutor] specific recommendation for a Python book, to move from baby-level to intermediate-level

2012-02-15 Thread Brett Ritter
ok list comprehensions * I understand generators * I understand decorators (where understand is more than "can use") -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] breeds of Python .....

2012-03-31 Thread Brett Ritter
Python2 - most major projects haven't made the switch and I'd expect another year or two before they do so. Many tutorials and examples are Python 2-based and there are not that many differences to unlearn in terms of habits. -- Brett Ritter / SwiftO

Re: [Tutor] finally without try or except

2012-07-30 Thread Brett Ritter
le of wrapping everything everywhere (be that good or bad). -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] simon says

2012-09-10 Thread Brett Ritter
. The game would then replay the sequence and add an additional step. Player would have to enter the longer sequence in. Continue until player loses (and game made an angry buzz). It was quite addictive. -- Brett Ritter / SwiftOne swift...@swiftone.org _

Re: [Tutor] quick question

2012-09-27 Thread Brett Ritter
hat most digits are painful to use as divisors in base 2 (binary) except for 1,2,4, 8, or other powers of 2.) -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-29 Thread Brett Ritter
ral discussions of variables in research rather than studies about programming variable names (my google-fu is weak) -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
s in FileObject: > linelist=lines.split('\t') > Key=linelist[0] > ValCity=(linelist[12]).strip() > ValState=linelist[13] > ValOne=linelist[2] > ValTwo=linelist[6] > ValThree=boolean(linelist[7]) > D={Key:(ValOne, ValTwo, ValThree, ValCity,ValState)} >

Re: [Tutor] help on dic creation

2012-11-05 Thread Brett Ritter
FYI - Gmail's new "compose" feature makes it WAY too easy to miss trimming the quotes. :( On Mon, Nov 5, 2012 at 3:37 PM, Brett Ritter wrote: (way too much) -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tuto

Re: [Tutor] Beginner's question

2012-11-23 Thread Brett Ritter
or wrong) for, and the constraints placed on it (just to keep you from getting lost in unfamiliar syntax) make it a mental challenge for us because our first approach is disallowed. Don't be disheartened at the difficulty, and don't fear it being this hard all along. -- Brett

Re: [Tutor] Regular expressions question

2012-12-05 Thread Brett Ritter
On Wed, Dec 5, 2012 at 4:13 PM, Ed Owens wrote: > >>> str(string) > '[\nUpdated: Dec 5, 2012, 5:08pm EST\n]' > >>> m = re.search('":\b(\w+\s+\d+,\s+\**d+,\s+\d+:\d+.m\s+\w+)<', > str(string)) > >>> print m > None &g

Re: [Tutor] Regular expressions question

2012-12-05 Thread Brett Ritter
t was the double-quote), I believe the issue now is that you have a space in the string (after the colon), but \b is a zero-width match. -- Brett Ritter / SwiftOne swift...@swiftone.org ___ Tutor maillist - Tutor@python.org To unsubscribe or change s