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
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
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.
--
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
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.
--
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
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
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/
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
_
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,
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
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.
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
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
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
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
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
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
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
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
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
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
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,
--
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
: 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
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
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
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
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
#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.
-
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
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
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
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
'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
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
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
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
__
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
___
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 /
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
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
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
. 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
_
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
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:
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)}
>
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
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
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
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
51 matches
Mail list logo