[Tutor] Toronto PyCamp 2010
The University of Toronto Department of Physics brings PyCamp to Toronto on Monday, August 30 through Friday, September 3, 2010. Register today at http://trizpug.org/boot-camp/torpy10/ For beginners, this ultra-low-cost Python Boot Camp makes you productive so you can get your work done quickly. PyCamp emphasizes the features which make Python a simpler and more efficient language. Following along with example Python PushUps™ speeds your learning process in a modern high-tech classroom. Become a self-sufficient Python developer in just five days at PyCamp! Conducted on the campus of the University of Toronto, PyCamp comes with your own single OS/single developer copy of Wing Professional Python IDE. -- Sincerely, Chris Calloway office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] Toronto PyCamp 2009
For beginners, this ultra-low-cost Python Boot Camp developed by the Triangle Zope and Python Users Group makes you productive so you can get your work done quickly. PyCamp emphasizes the features which make Python a simpler and more efficient language. Following along by example speeds your learning process in a modern high-tech classroom. Become a self-sufficient Python developer in just five days at PyCamp! The University or Toronto Department of Physics brings PyCamp to Toronto, July 13-17, 2009. Register today at http://trizpug.org/boot-camp/pycamp-toronto-2009/ -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] What exactly is [::-1]?
Kent Johnson wrote: > AFAIK extended slicing is not supported by any standard Python data > types, it was added specifically for Numeric. Numeric *is* responsible for getting *one* of the two forms of extended slicing added (the one with multiple slices or ellipses separated by commas) and yes, that *one form* isn't supported by any builtin or "standard" global module Python data types. The *other* form of extended slicing, the one with two colons (and no commas) is supported by typeseq objects, though. The phrase "extended slicing" probably ought to be clarified in the documentation as having two distinct forms (stepped and multiple). This is a root of considerable confusion for people reading about extended slicing in the standard documentation. Extended slicing is really talking about two ways of creating a *slice object* (and there are other ways of creating slice objects). And not all slice objects are created equally as far as typeseq and array module objects are concerned. A sensible solution would be to refer to the stepped form as a simple slice and realize that both "stepped simple" slices and comma-extended slices create slice objects in Python 2.3 and later. I don't know how wise it would be to further confuse the issue by changing the documentation at this point. It's a judgment call. Using stepped slicing with numpy/Numeric/numarray style arrays is also very different from using it with the standard array module and typeseq objects. With typeseq objects, the two colon extended slicing provides a reversed *copy* of the typeseq object as opposed to the .reverse method which reverses a typeseq object *in place* (and has no return value): >>> a = [0,1,2,3,4] >>> b = a[::-1] >>> a[2] = 6 >>> a.reverse() >>> a [4, 3, 6, 1, 0] >>> b [4, 3, 2, 1, 0] >>> Same with the array module (a copy is made): >>> import array >>> e = array.array('i',[0,1,2,3,4]) >>> f = e[::-1] >>> e[2] = 23 >>> e.reverse() >>> e array('i', [4, 3, 23, 1, 0]) >>> f array('i', [4, 3, 2, 1, 0]) >>> However, with numpy/Numeric/numarray style arrays, extended slicing gives you a "view" of the original array, somewhat similar to using .reverse() on typeseq objects (but still different because the original array is unchanged). Changes to the original array will be *reflected* in the view objects of that original array (unlike in the example copied objects above): >>> import numpy >>> c = numpy.array([0, 1, 2, 3, 4]) >>> d = c[::-1] >>> c[2] = 9 >>> c array([0, 1, 9, 3, 4]) >>> d array([4, 3, 9, 1, 0]) >>> To get a reversed *copy* of numpy/Numeric/numarray style arrays, you'll need to use their .copy() method on the extended slice. numpy/Numeric/numarray style arrays have no .reverse() method as typeseq and array module objects do: >>> g = c[::-1].copy() >>> c[2] = 42 >>> c array([ 0, 1, 42, 3, 4]) >>> g array([4, 3, 9, 1, 0]) >>> c.reverse() Traceback (most recent call last): File "", line 1, in ? AttributeError: 'numpy.ndarray' object has no attribute 'reverse' >>> So that extended slicing of the form [::-1] is kind of necessary with numpy/Numeric/numarray style arrays in order to "reverse" the object. Just remember, double colon extended slicing has a different effect on typeseq and array module objects (by making a copy). -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Thanks re: [::-1]
Charles Cuell wrote: > The one odd thing about Python's slice notation is that the -1 means to > start from the end and work backwards. My first inclination would have > been to assume that -1 means to start at i and go to j by steps of -1 > (only nonempy if j < i). A negative step attribute does not change the semantics of the start and stop (read only) attributes of slice objects: >>> m = range(10) >>> m[2:7:-1] [] >>> m[7:2:-1] [7, 6, 5, 4, 3] >>> m[-3:-8:-1] [7, 6, 5, 4, 3] >>> So your first inclination was correct! :) i does go to j by steps of k. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]
bhaaluu wrote: > Perhaps these concerns should be directed to either the > maintainers of Python.Org ( http://python.org/ ), or to > the author of the Software Carpentry Course? I sent a pointer both to the lead maintainer (Dr. Greg Wilson at Univ. Toronto) and to Titus Brown who, along with Chris Lasher, is having a Software Carpentry sprint at SciPy'07 at Caltech tomorrow. So this is a timely observation. :) Titus wrote back that it "sure does sound wrong," so I would bet on it getting fixed tomorrow. SWC has been around since 1998. It started as an 800KUSD Dept. of Energy project at Los Alamos for a design competition with cash prizes. It resulted in several tools including Roundup and SCons. It received 27KUSD in funding from the PSF in 2006. It is taught to scientists at Univ of Toronto, Indiana Univ, and Caltech. Dr. Wilson wrote about it in the magazine of Sigma Xi: http://www.americanscientist.org/template/AssetDetail/assetid/48548 It has moved around a lot. It's current official home is on scipy.org: http://www.swc.scipy.org/ There are several links to older SWC URLs on python.org. None of them are in the wiki where they could be easily fixed, however. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]
Tim Michelsen wrote: > How nice that the SWC gets updated and improved! I heard from Chris Lasher at the SWC Sprint on Saturday. Turns out there is a bug collector for SWC and this bug has been documented for some time: http://projects.scipy.org/swc/ticket/88 Chris reported, "Will have this fixed by the end of the sprint today, provided we get commit access figured out." Follow progress here: http://projects.scipy.org/swc/roadmap It looks like most of the changesets have been about getting SWC svn access ironed out at its new home at scipy.org. Chris Lasher is also making podcasts out of SWC: http://showmedo.com/videos/series?name=bfNi2X3Xg -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Floating Confusion
wormwood_3 wrote: > The second case is, of course, what is throwing me. By having a decimal > point, "1.1" is a float type, and apparently it cannot be represented by > binary floating point numbers accurately. I must admit that I do not > understand why this is the case. Would anyone be able to enlighten me? This is fairly standard computer science, not just Python. If you take freshman Fortran for scientists, you will eat, sleep, and breath this stuff. Is one tenth any power of 2? Like how 2**-1 is 0.5? Or how 2**-2 is 0.25? Or 2**-3 is 0.125? Or 2**-4 is 0.0625. Oops, we went right by 0.1. Any binary representation of one tenth will have a round-off error in the mantissa. See http://docs.python.org/tut/node16.html for a Pythonic explanation. See http://en.wikipedia.org/wiki/IEEE_floating-point_standard for how it is implemented on most platforms. This problem was solved in Python 2.4 with the introduction of the Decimal module into the standard library: http://docs.python.org/lib/module-decimal.html http://www.python.org/dev/peps/pep-0327/ -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] using in over several entities
Tino Dai wrote: > I am wondering about a short cut to doing this. Let's say that we > have an array: > > dbs= ['oracle','mysql','postgres','infomix','access'] > > and we wanted to do this: > > if 'oracle' in dbs or 'mysql' in dbs or 'bdb' in dbs: ><... do something ...> > > Is there a short way or writing this? Something like > ('oracle','mysql','bdb') in dbs Sets to the rescue. Set intersection specifically: >>> dbs = set(['oracle','mysql','postgres','infomix','access']) >>> mine = set(['oracle','mysql','bdb']) >>> dbs & mine set(['oracle', 'mysql']) >>> if dbs & mine: ... print 'doing something' ... doing something >>> This also has the advantage of returning to you an object of exactly what elements in mine were in dbs. And difference: >>> dbs - mine set(['access', 'infomix', 'postgres']) >>> will show you which elements of mine were not in dbs. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] using in over several entities
Alan Gauld wrote: > "Chris Calloway" <[EMAIL PROTECTED]> wrote > >>>>> dbs = set(['oracle','mysql','postgres','infomix','access']) >>>>> mine = set(['oracle','mysql','bdb']) >>>>> dbs & mine >> set(['oracle', 'mysql']) >>>>> dbs - mine >> set(['access', 'infomix', 'postgres']) > > Interesting. I didn't know about the & and - set operations. > Thanks for the pointer. They just invoke special methods, of course: s.issubset(t) s <= t __le__ s.issuperset(t) s >= t __ge__ s.union(t)s | t__or__ s.intersection(t) s & t__and__ s.difference(t) s - t__sub__ s.symmetric_difference(t) s ^ t__xor__ s.update(t) s |= t __ior__ s.intersection_update(t) s &= t __iand__ s.difference_update(t)s -= t __isub__ s.symmetric_difference_update(t) s ^= t __ixor__ Good times! The advantage of the s.method(t) versions are, in Python 2.3.1 and after, they will accept any, cough, iterable as argument t, whereas the operator versions require set objects on both side of the operator: >>> set(xrange(10)).issubset(xrange(20)) True >>> -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Help Request: Nested While commands
Paul W Peterson wrote: > Could you provide a way to achieve this > using nested while statements, or suggest a better use of the ifs? You could use one while statement. while guess != the_number and tries < 5: I can't think of a *good* way to use nested whiles for your problem. > Ellicott, Colorado > The Technological Capital of Mid Central Eastern El Paso County, Colorado. Nice. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] New Introductory Book
Michael H. Goldwasser wrote: >We are pleased to announce the release of a new Python book. Why is this book $102? -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] New Introductory Book
Danyelle Gragsone wrote: > I wonder what schools offer python as a course. It has been rather widely publicized of late that MIT this year switched all their incoming computer science and electrical engineering students to Python (from Lisp) as their introductory programming language. They use this well regarded $26.40 textbook: http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996/ There is a computer science department at my university. They don't teach languages. Teaching languages is frowned upon in some computer science departments under the logic that if you belong in a computer science class, you'd better show up for class already knowing something as easy to grasp as an implementation language. Some computer science courses at my university have an implementation language used in the class. I've noticed both Python and Lisp used. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] comparing dates
On Nov 24, 2007, at 12:27 AM, Lawrence Shafer wrote: How would I compare these two dates and extract the difference in H:M:S?? http://docs.python.org/lib/module-datetime.html http://docs.python.org/lib/datetime-timedelta.html 22 Nov 2007 18:54:07 23 Nov 2007 23:24:23 >>> import datetime >>> a = datetime.datetime(2007,11,22,18,54,7) >>> b = datetime.datetime(2007,11,23,23,24,23) >>> c = b - a >>> hours = (c.seconds / (60*60)) >>> minutes = (c.seconds - (hours * 60*60)) / 60 >>> seconds = c.seconds - (hours * 60*60) - (minutes * 60) >>> print str((c.days*24) + hours) + ":" + str(minutes) + ":" + str (seconds) 28:30:16 >>> -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall cell: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Import error in UNO
On Feb 6, 2008, at 5:23 AM, muhamed niyas wrote: I can import when i moved to the uno location. pls see the messages in the terminal. C:\>cd "Program Files\OpenOffice.org 2.0\program"\ C:\Program Files\OpenOffice.org 2.0\program>python Python 2.3.4 (#53, Feb 2 2006, 01:06:22) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import uno >>> Given this and the behavior before where the import uno did not return to the prompt, it sounds like the dependencies the uno module has on the OpenOffice libraries. When OpenOffice is in the current path, uno seems to be able to find them. If you look at the windows documentation for uno: http://udk.openoffice.org/python/python-bridge.html even the hello world examples have you switch to the Open Office program directory. Later on in the documentation, it explains this (pay close attention the third paragraph below): "Unlike the Java or C++ UNO binding, the python UNO binding is not self contained. It requires the C++ UNO binding and additional scripting components. These additional components currently live in the shared libraries typeconverter.uno, invocation.uno, corereflection.uno, introspection.uno, invocadapt.uno, proxyfac.uno, pythonloader.uno (on windows typeconverter.uno.dll,...; unix typeconverter.uno.so,...). Often, the components for setting up an interprocess connection are also required. These are uuresolver.uno, connector.uno, remotebridge.uno, bridgefac.uno shared libraries. The path environment variables ( LD_LIBRARY_PATH on Unix, PATH on Windows) must point to a directory, where the core UNO libraries, the above listed components and the pyuno shared library is located. (On Unix, there exists two files: libpyuno.so containing the code and a pyuno.so which is needed for importing a native python module). Additionally, the python module uno.py, unohelper.py and pythonloader.py must be located in a directory, which is listed in the PYTHONPATH environment variable. " -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall cell: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Houston PyCamp
Need to learn Python quickly? http://trizpug.org/boot-camp/hpyc1/ -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Applications
Archana Maheshwari wrote: > tell me about the applications of python programming in mapping field. Python is now the primary scripting language for ESRI products: http://www.esri.com/news/arcuser/0405/files/python.pdf Python wraps GDAL: http://www.gdal.org/gdal_tutorial.html and OGR: http://ogr.maptools.org/ Generic Mapping Tools is wrapped by Python: http://www.cdc.noaa.gov/people/jeffrey.s.whitaker/python/gmt/gmt-src/doc/html/public/gmt.gmt-module.html Python is a scripting language for MapServer: http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PythonMapScript The Python Cartographic Library: http://trac.gispython.org/projects/PCL/wiki forms the basis of PrimaGIS: http://primagis.fi/ which are both collected by the GIS Python community: http://www.gispython.org/ GRASS, the main open source GIS analysis product, is scripted in Python: http://grass.gdf-hannover.de/wiki/GRASS_and_Python Basically, Python is the GIS scripting language of choice. If you google on "python +gis", there are over a million hits. Any mapping tool worth paying attention to has a Python API. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Noobie projects
[EMAIL PROTECTED] wrote: > Is there a set of more basic projects for flexing one's novice Python skills? Three python projects for noobs: http://www.handysoftware.com/cpif/ -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] OT: Python 2.5 (Was Re: Length of longest item in a list, using a list comp)
Chris Hengge wrote: > I hope this is related enough for this thread, but I'm curious why > people didn't seem to unanimously jump into 2.5 upon release. If I'm driving a 2006 model car, I don't rush right out and trade for a 2007 model just because they are available. There's cost and effort involved with changing versions. Not the least is having to retest all your existing applications. Generators now have a different syntax, so some applications would need some updating in order to take advantage of 2.5. The new "with" statement is very cool, though. > I've personally held back just because most of the > documentation I've come across is for 2.4, 100% of this is Python 2.5 documentation: http://docs.python.org/ Very little of it had to change from the last version. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Query about getattr used as a dispatcher
raghu raghu wrote: > Actually i installed python 2.5 i ran this script and its showing error > it could not import statsout. why is it so? statsout is a *hypothetical* module used for an example only. The statsout module does not actually exist. When Dive Into Python wants you to type in an example, it will shown either as lines at the Python interpreter prompt (>>>), or it will be an example in a Python source file included with the Dive Into Python examples bundle. If you look at the example using the imaginary statsout module in section 4.12, which is not included in any Python source file in the Dive Into Python examples bundle, you will see the example is not referenced in a file, nor is it shown as being typed at the Python interpreter prompt. If, however, you had an actual statsout module in your sys.path, you could import it. And it that module had top level functions functions that took one argument and had function names like "output_text" and "output_pdf" and "output_html," then the example would work if you typed it in. The example is just showing a hypothetical case of a very simple dispatcher. The example is asking you to imagine *if* you had a statsout module, and *if* that module had functions by those names in it. Dive Into Python uses the getattr function in the apihelper.py example you are currently reading about. In the next chapter, a more complicated example is shown where getattr is used in a dispatcher which finds, not just a function by name, but a class by name and dispatches that class object to create a new object of that class. So the statsout *imaginary* example is just preparing you for a more complicated *real life* dispatcher example in the next chapter. Hypothetical examples are often shown in programming books to prepare you for more complicated real life examples. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Difference between filter and map
vanam wrote: > i want to know the difference between filter(function,sequence) and > map(function,sequence). >>> print filter.__doc__ filter(function or None, sequence) -> list, tuple, or string Return those items of sequence for which function(item) is true. If function is None, return the items that are true. If sequence is a tuple or string, return the same type, else return a list. >>> print map.__doc__ map(function, sequence[, sequence, ...]) -> list Return a list of the results of applying the function to the items of the argument sequence(s). If more than one sequence is given, the function is called with an argument list consisting of the corresponding item of each sequence, substituting None for missing values when not all sequences have the same length. If the function is None, return a list of the items of the sequence (or a list of tuples if more than one sequence). >>> filter returns a subsequence of a sequence based on passing each item in the sequence to a function which returns a *boolean context*. If the returns value's boolean context is true, the item is placed in the new subsequence. map returns a sequence of the same length based on the return value of passing each item in the sequence to a function. One literally filters a sequence. The other literally maps a sequence. filter can return a tuple, string, or list. map only returns a list. I tried for a simple script with an function > which finds the square of the number,after including separately filter > and map in the script i am getting the same results for instance > def squ(x): > return x*x > filter(squ,range(1,3))->1,4(output) > map(squ,range(1,3)->1,4(output) The boolean context of the return value of squ is true for all items of the sequence which you passed it in filter. Also, the filter you showed above does *not* return [1,4]. It returns [1,2], which is every item in range(1,3), because every item in that list passes the filter function's boolean context (is x*x true?). -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Difference between filter and map
vanam wrote: > ya i am sure about that i am using python editor which has python > intrepreter attached to it i got the same output for both filter and map > def squ(n): >y = n*n > print y > filter(y,range(3))->0 1 4 > map(y,range(3))->0 1 4 You are not printing the result of either the filter or map function here. You have the print statement embedded in squ. In fact you wouldn't print anything but a NameError exception here because you haven't passed filter or map a function, just an identifier which isn't in their scope: >>> def squ(n): ...y = n*n ...print y ... >>> filter(y, range(3)) Traceback (most recent call last): File "", line 1, in ? NameError: name 'y' is not defined >>> Also not, the function squ as defined here always returns None, so it is useless as either a filtering or mapping function. Printing a value is not the same as returning a value. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] CRC calculation with python
First, you need to find the preprocessor define for CCITT_POLY. The code is incomplete without it. Second, where did this code come from? It defines an unused local named cval, which will usually cause at least a compilation warning. This looks like a snippet, not a complete CCITT CRC calculation. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 Johan Geldenhuys wrote: > Hi all, > > I'm not a C++ expert at all and I would like to find out if somebody can > explain to me how the statement below can be done in Python? > > """ > _uint16 ComCRC16(_uint8 val, _uint16 crc) > { > _uint8 i; > _uint16 cval; > > for (i=0;i<8;i++) > { > if (((crc & 0x0001)^(val & 0x0001))!= 0) crc = (crc >> 1)^ > CCITT_POLY; > else crc >>= 1; > val >>= 1; > } > return crc > } > > """ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Three days left for Zope3 boot camp registration
Registration ends Friday: http://trizpug.org/boot-camp/camp5 -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] HELP!!!!!
On 4/17/2008 3:40 AM, Michael Kim wrote: > Hi I am having a really hard time making my tictactoe program work. I > was wondering if you could could check it out and help me with the > error. Thanks Heh. First, there are two obvious indentation errors you can find yourself. This may be a byproduct of having pasted your program into an email. Email programs will often incorrectly reformat Python code so that the indentation no longer works. To send long code listings to an email list, use a pastebin like: http://python.pastebin.com/ and send us the link of your pasted code. So after you fix the indentation errors, we get this: >>> main() Do you want to go first? (y/n): y Traceback (most recent call last): File "", line 1, in ? File "", line 2, in main File "", line 4, in pieces UnboundLocalError: local variable 'X' referenced before assignment >>> And if you look just where the traceback is telling you (line 4 of function pieces): >>> def pieces(): ... whosefirst=askquestion("Do you want to go first? (y/n): ") ... if whosefirst == "y": ... human = X You see that you did indeed do exactly what the traceback told you. You referenced a local variable named X before anything was assigned to X. Good luck with your homework! -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] web programming tutorials?
On 4/18/2008 8:20 AM, bob gailer wrote: > Norman Khine wrote: >> Here are the docs, http://download.ikaaro.org/doc/itools/index.html >> >> > Having never heard of itools I decided to take a look at the itools.web > examples. I was OK with 13.1 Hello world. Then I hit 13.2 Traversal. The > text on the page leaves me hopelessly lost. Is there any other explanation? Bob, Traversal (and acquisition) is (and are) standard Zope 2 terminology. They are described, among other places, on page 226 of the Zope Book: http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ZopeBook-2_6.pdf Here's an illustrated version of the same explanation: http://plope.com/Books/2_7Edition/BasicScripting.stx#2-6 Zope picked this up from some storied academic paper somewhere I've since misplaced. Several other Python frameworks subsequently picked it up. Here's a paper from the 1996 Python Workshop 5 described how traveral was implemented in what was then called the Python Object Publisher, commissioned by what was then called the Python Software Activity (PSA) which later became the PSF, code-named "Bobo," and later known as the Zope Object Publisher: http://www.python.org/workshops/1996-11/papers/PythonObjectPublisher.html And thus is how all your bobobase came to belong to us. -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] web programming tutorials?
On 4/18/2008 11:01 AM, Hansen, Mike wrote: > I'm curious about > other tutor list member's thoughts on this. Am I out to lunch on this > viewpoint? +1 (In favor of your viewpoint, that is. Not in favor of you being out to lunch on this. :) In the Zope community I see evidence all the time from noobs that tells me, oh, you don't know how HTTP requests and responses work, do you? Honestly, I don't know how anyone could work well with a web framework without knowing these things. But many people try. :) Python makes it so easy to try. Even with CGI programming, there are some things you need to know about this first. Actually, more so. It's almost like web noobs should start with socket programming. :) There is a Firefox extension called LiveHTTPHeaders that can be illustrative to HTTP noobs. You can see all the requests and response headers without any programming: http://livehttpheaders.mozdev.org/ The httplib module allows you to experiment with this in Python programming once you understand a little about what to put in a request by watching a few with LiveHTTPHeaders: http://docs.python.org/lib/httplib-examples.html This little $10 book is also indispensable for those on such a learning curve: http://www.amazon.com/HTTP-Pocket-Reference-Hypertext-Transfer/dp/1565928628/ -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] web programming tutorials?
On 4/18/2008 4:00 PM, Monika Jisswel wrote: > Ok but I still need more votes for zope to be convinced, Well, arguing about what is the best python web framework is kind of fruitless. Everybody has an opinion. But no one is qualified to pronounce a comparison on all of them. The "votes" you would get would be reflective of the number of devotees of particular frameworks. And not all frameworks are comparable. They have all sorts of niches from simple to advanced covering different use cases. Heck, Zope 2 isn't even a framework. It's an application server. And Zope 3 isn't even a framework. It's a component architecture. And Plone isn't even a framework. It's a CMS product. Experience is your guide. Experience from others: you look at who is using what to solve your *use case*. And then experience from yourself: you evaluate the options for your use case by using them for yourself. There is some old Python saw I think attributed to GVR that goes something like, "Why would anyone learn anyone else's Python web framework when it is so easy to write your own Python web framework?" And of course the answer is, to get to the other side. Your question twofold. First, "What's best?" And I would have to ask, "Best what?" Then, "Which is most used, Zope or ikaaro?" And the answer would be Zope by a mile. But possibly only because a lot of people haven't tried ikaaro and Zope has been around about ten years longer with a huge accumulated mind-share. > Just in case Zope won the majority of the voices ... How much time would it > take one to learn & become productive in zope ? If you have to ask... (you can't afford). It depends on what you want to do. The base use case for Zope 2 has one of the lowest barriers to entry of any web application server ever. The trouble is learning enough to extend that base use case to your use case. Then the learning curve can be very steep. Whole frameworks on top of Zope have been built for that reason. Which is why people head for simpler web frameworks for other use cases. I find that the complexity and learning curve of a technology *may* have some relation to its power and flexibility. Or not. In the case of Zope, it is definitely related to *stuff I don't have to build that I want in order to be productive.* That is, to get to the other side. When I look at a lot of other web technologies, they spend most of their learning curve showing you how to build things that already come pre-built in Zope. That alone is very much in keeping with the Zen of Python in a "batteries included" kind of way. And these things are usually built the right way in Zope by people much wiser than me and in ways other technologies only borrow from when they get wise enough themselves to borrow from Zope. It's like Python in that I spend less time programming and more time just getting things done. But like the Python Standard Library, you don't learn it in a week. You learn it bit by bit. And then there's the stuff in Zope the other technologies never even get around showing you how to build, like awesome super-fine-grained easily-extensible security done right and awesome super-flexible easily-extensible workflow done right. Stuff that come "out of the box" with Zope would often be considered some very advanced cutting edge application in some other mere web framework. You may not need these things. Lesser web frameworky kinda thingies have their sweet spot use cases which only require a certain amount of functionality that you might be able to get your head around in a shorter amount of time. But if you have to ask why Zope, you probably should not get into it. Seriously. -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python and Plone Boot Camps in Chapel Hill, NC
Triangle (NC) Zope and Python Users Group (TriZPUG) is proud to open registration for our fourth annual ultra-low cost Plone and Python training camps, BootCampArama 2008: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp: Customizing Plone, July 28 - August 1 Advanced Plone Boot Camp: Plone 3 Techniques, August 4 - 8 All of these take place on the campus of the University of North Carolina at Chapel Hill in state of the art high tech classrooms, with free mass transit, low-cost accommodations with free wireless, and convenient dining options. Plone Boot Camp is taught by Joel Burton, twice chair of the Plone Foundation. Joel has logged more the 200 days at the head of Plone classrooms on four continents. See plonebootcamps.com for dozens of testimonials from Joel's students. PyCamp is taught by Chris Calloway, facilitator for TriZPUG and application analyst for the Southeast Coastal Ocean Observing System. Chris has developed PyCamp for over 1500 hours on behalf of Python user groups. Early bird registration runs through June 30. So register today! PyCamp is TriZPUG's Python Boot Camp, which takes a programmer familiar with basic programming concepts to the status of Python developer with one week of training. If you have previous scripting or programming experience and want to step into Python programming as quickly and painlessly as possible, this boot camp is for you. PyCamp is also the perfect follow-on to Plone Boot Camp: Customizing Plone the previous week. At Plone Boot Camp: Customizing Plone you will learn the essentials you need to build your Plone site and deploy it. This course is the most popular in the Plone world--for a good reason: it teaches you practical skills in a friendly, hands-on format. This bootcamp is aimed at: * people with HTML or web design experience * people with some or no Python experience * people with some or no Zope/Plone experience It covers using Plone, customizing, and deploying Plone sites. At Advanced Plone Boot Camp: Plone 3 Techniques you will learn to build a site using the best practices of Plone 3 as well as advance your skills in scripting and developing for Plone. The course covers the new technologies in Plone 3.0 and 3.1 intended for site integrators and developers: our new portlet infrastructure, viewlets, versioning, and a friendly introduction to Zope 3 component architecture. Now, updated for Plone 3.1! The course is intended for people who have experience with the basics of Plone site development and HTML/CSS. It will cover what you need to know to take advantage of these new technologies in Plone 3. For more information contact: [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] BootCampArama Early Bird Registration Reminder
Just a reminder, we're at the two week warning on early bird registration for PyCamp: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp: Customizing Plone, July 28 - August 1 Advanced Plone Boot Camp: Plone 3 Techniques, August 4 - 7 All of these take place on the campus of the University of North Carolina at Chapel Hill in state of the art high tech classrooms, with free mass transit, low-cost accommodations with free wireless, and convenient dining options. Plone Boot Camp is taught by Joel Burton, twice chair of the Plone Foundation. Joel has logged more the 200 days at the head of Plone classrooms on four continents. See plonebootcamps.com for dozens of testimonials from Joel's students. PyCamp is taught by Chris Calloway, facilitator for TriZPUG and application analyst for the Southeast Coastal Ocean Observing System. Chris has developed PyCamp for over 1500 hours on behalf of Python user groups. Early bird registration runs through June 30. So register today! PyCamp is TriZPUG's Python Boot Camp, which takes a programmer familiar with basic programming concepts to the status of Python developer with one week of training. If you have previous scripting or programming experience and want to step into Python programming as quickly and painlessly as possible, this boot camp is for you. PyCamp is also the perfect follow-on to Plone Boot Camp: Customizing Plone the previous week. At Plone Boot Camp: Customizing Plone you will learn the essentials you need to build your Plone site and deploy it. This course is the most popular in the Plone world--for a good reason: it teaches you practical skills in a friendly, hands-on format. This bootcamp is aimed at: * people with HTML or web design experience * people with some or no Python experience * people with some or no Zope/Plone experience It covers using Plone, customizing, and deploying Plone sites. At Advanced Plone Boot Camp: Plone 3 Techniques you will learn to build a site using the best practices of Plone 3 as well as advance your skills in scripting and developing for Plone. The course covers the new technologies in Plone 3.0 and 3.1 intended for site integrators and developers: our new portlet infrastructure, viewlets, versioning, and a friendly introduction to Zope 3 component architecture. Now, updated for Plone 3.1! The course is intended for people who have experience with the basics of Plone site development and HTML/CSS. It will cover what you need to know to take advantage of these new technologies in Plone 3. For more information contact: [EMAIL PROTECTED] -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] BootCampArama Final Reminder
Final reminder, we're in the last two weeks of open registration for PyCamp, Plone Boot Camp, and Advanced Plone Boot Camp: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp: Customizing Plone, July 28 - August 1 Advanced Plone Boot Camp: Plone 3 Techniques, August 4 - 7 All of these take place on the campus of the University of North Carolina at Chapel Hill in state of the art high tech classrooms, with free mass transit, low-cost accommodations with free wireless, and convenient dining options. Plone Boot Camp is taught by Joel Burton, twice chair of the Plone Foundation. Joel has logged more the 200 days at the head of Plone classrooms on four continents. See plonebootcamps.com for dozens of testimonials from Joel's students. PyCamp is taught by Chris Calloway, facilitator for TriZPUG and application analyst for the Southeast Coastal Ocean Observing System. Chris has developed PyCamp for over 1500 hours on behalf of Python user groups. Early bird registration runs through June 30. So register today! PyCamp is TriZPUG's Python Boot Camp, which takes a programmer familiar with basic programming concepts to the status of Python developer with one week of training. If you have previous scripting or programming experience and want to step into Python programming as quickly and painlessly as possible, this boot camp is for you. PyCamp is also the perfect follow-on to Plone Boot Camp: Customizing Plone the previous week. At Plone Boot Camp: Customizing Plone you will learn the essentials you need to build your Plone site and deploy it. This course is the most popular in the Plone world--for a good reason: it teaches you practical skills in a friendly, hands-on format. This bootcamp is aimed at: * people with HTML or web design experience * people with some or no Python experience * people with some or no Zope/Plone experience It covers using Plone, customizing, and deploying Plone sites. At Advanced Plone Boot Camp: Plone 3 Techniques you will learn to build a site using the best practices of Plone 3 as well as advance your skills in scripting and developing for Plone. The course covers the new technologies in Plone 3.0 and 3.1intended for site integrators and developers: our new portlet infrastructure, viewlets, versioning, and a friendly introduction to Zope 3 component architecture. Now, updated for Plone 3.1! The course is intended for people who have experience with the basics of Plone site development and HTML/CSS. It will cover what you need to know to take advantage of these new technologies in Plone 3. For more information contact: [EMAIL PROTECTED] -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Web programming advice
On Sep 20, 2008, at 7:51 AM, Jan Ulrich Hasecke wrote: Am 20.09.2008 um 00:01 schrieb Alan Gauld: "Patrick" <[EMAIL PROTECTED]> wrote is of paramount importance. It appears to me that Django is an all- in-one monolithic application. Years ago Zope was the number 1 and now it's basically gone. Zope is still around but it has retreated into something of a niche where it offers its own unique advantages, namely very large, high volume sites. Zope is, I believe, also the engine underneath Plone which is in itself something of a niche market content management system. Zope has not retreated into a niche, but has heavily evolved from the technical point of view in the last years. [snip] Plone is not a niche CMS, but the leading Python CMS if not the leading Open Source CMS around. [snip] So the answer to the OP is: Try out Grok to start with Zope. It is great! I'm so glad Jan wrote that so I didn't have to. -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Reading module to import from a string
On 12/15/2008 5:38 PM, Shrutarshi Basu wrote: Suppose I have a module that I want to import called ImMod1 that's saved in a variable like so: var = "ImMod1" Is there some way to import ImMod1 by using var? http://stackoverflow.com/questions/67631/how-to-import-module-from-file-name -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Reading module to import from a string
On 12/15/2008 5:38 PM, Shrutarshi Basu wrote: Suppose I have a module that I want to import called ImMod1 that's saved in a variable like so: var = "ImMod1" Is there some way to import ImMod1 by using var? http://docs.python.org/library/imp.html -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] what does the "@" operator mean?
On 12/15/2008 3:42 PM, Marc Tompkins wrote: > If you're just starting out in Python, decorators can be hard to get > your head around... This would be a huge help: http://www.ddj.com/web-development/184406073 -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] PyLucene on Python 2.6
On 12/18/2008 11:03 AM, Jose Neto wrote: Does anyone know if there is a win32 binary of PyLucene? http://code.google.com/p/pylucene-win32-binary/downloads/list -- Sincerely, Chris Calloway http://www.secoora.org office: 332 Chapman Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Toronto PyCamp 2011
The University of Toronto Department of Physics brings PyCamp to Toronto on Monday, June 27 through Thursday, June 30, 2011. Register today at http://trizpug.org/boot-camp/torpy11/ For beginners, this ultra-low-cost Python Boot Camp makes you productive so you can get your work done quickly. PyCamp emphasizes the features which make Python a simpler and more efficient language. Following along with example Python PushUps™ speeds your learning process. Become a self-sufficient Python developer in just four days at PyCamp! PyCamp is conducted on the campus of the University of Toronto in a state of the art high technology classroom. -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] Seattle PyCamp 2011
University of Washington Marketing and the Seattle Plone Gathering host the inaugural Seattle PyCamp 2011 at The Paul G. Allen Center for Computer Science & Engineering on Monday, August 29 through Friday, September 2, 2011. Register today at http://trizpug.org/boot-camp/seapy11/ For beginners, this ultra-low-cost Python Boot Camp makes you productive so you can get your work done quickly. PyCamp emphasizes the features which make Python a simpler and more efficient language. Following along with example Python PushUps™ speeds your learning process. Become a self-sufficient Python developer in just five days at PyCamp! PyCamp is conducted on the campus of the University of Washington in a state of the art high technology classroom. -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Seattle PyCamp 2011
On 6/17/2011 11:03 PM, Noah Hall wrote: On Sat, Jun 18, 2011 at 2:15 AM, Steven D'Aprano wrote: Noah Hall wrote: Just a note, but are these questions jokes? Know how to use a text editor (not a word processor, but a text editor)? Know how to use a browser to download a file? Know how to run a program installer? If not, then I'd consider removing them. This isn't 1984. I think the questions are fine. It indicates the level of technical knowledge required -- not much, but more than just the ability to sign in to AOL. In 1984 the newbies didn't know anything about computers *and knew they didn't know*, but now you have people who think that because they can write a letter in Microsoft Office and save as HTML, they're expert at programming. I wish I were joking but I've had to work for some of them. That's true, I suppose, but in that case the rest of the questions are out of place. I believe that someone who knows what environmental variables are and how to change them is a huge step up from someone who knows how to *download things*. Mr. Hall, I've taught Python to over a thousand students. And these questions, which are on the PyCamp site and not in the previous email to this list, are not only not the slightest bit out of place or jokes, but rather necessary. We didn't start out asking these questions of prospective students. They were developed from experience. As far as 1984, plenty of people in 1984 knew what environment variables were and how to change them without knowing how to use a browser to download anything. :) What is a "step up" is a matter of perspective. We get not a lot but plenty enough people coming to PyCamp whose last experience with using a computer was 1984. It's simple courtesy to warn those people of what to expect. Thank you for your concern. -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Seattle PyCamp 2011
On 6/19/2011 3:53 PM, Noah Hall wrote: 1984 was not to be taken literally, of course. ;) Well, if you decide that in this day and age that asking whether someone knows how to use a browser to download files, or if someone knows how to install a program, then that's entirely up to you. I am merely in disbelief that you could find someone these days interested enough in computers to learn Python, and yet not know how to download a file. Had they been in jest, I would have understood, you know, something along the lines of "Want to learn Python? Well, there's only one thing you need to know - how to read!". But when taking it in seriousness, I must congratulate you on somehow finding these people; I had no idea they still existed. ;) Regards, Noah. I also realised how aggressive my first reply was, for which I'm sorry, I was merely trying to point out that perhaps they were out of date questions. Mr. Hall, It's not really entirely up to me, no. There are many people in several user groups behind these questions. And the questions have evolved over time to be perfectly up to date, yes. The first few PyCamps attempted to qualify participants by simply stating the syllabus. The casual observer might think that would be enough. But no, that is not the case in reality when you get experience from teaching many classes of any kind. From those first few camps there were outlier participants who either thought PyCamp was too easy or too hard and who demanded more information be placed on the PyCamp page about what qualifications are required. With each successive PyCamp, those qualifications were adjusted according to participant feedback until the suggested prerequisites are what they are now. I'm sure they will continue to evolve even more in the future. No, it isn't enough to only need to know how to read to come to PyCamp. There are many ways to learn Python which might entail only knowing how to read or learning to use a computer at the same time. But PyCamp is one week and we don't teach people how to use a computer during that week. Whatever your disbelief, I can assure you in this day and age if it is not explicitly stated up front that you need to know how to download a file and run a program installer before coming to PyCamp, then there will be people who will be upset when lack of those skills hinders them in class and when class doesn't pause to teach them those skills. And I can assure you those people are common enough to find, no congratulations necessary, especially when offering a week long training at the low PyCamp price point. You may not mean 1984. But PyCamp and any computer-based open training for that matter has to account for people from 1984. Python doesn't appeal only to computer nerds. Python has many domain-specific uses from geography to biology. When you have large numbers of people coming from such disparate backgrounds, you find that computer illiteracy is quite high in the general population, even among the educated, even among people who Facebook, or even among people from 2011. :) I accept your apology and yes, I was taken aback by the hostility of your replies in a public forum. However, in the interest of providing information about PyCamp and in the interest of what it takes to tutor Python, I hope this explains some things. -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] PyCamp Registration Open for Columbus, Toronto, and Oshkosh
Registration is open for three upcoming PyCamps produced by the Triangle Python Users Group: - A five-day PyOhio PyCamp hosted by the Ohio State University Open Source Club, July 22-26, 2013 the week prior to the PyOhio regional Python conference weekend. PyCamp is a training program and sponsor of PyOhio: http://trizpug.org/boot-camp/pyohio13/ - A five-day Toronto PyCamp hosted by the University of Toronto Department of Physics, August 12-16, 2013 the week after the PyCon Canada national Python conference weekend. PyCamp is a Diversity Sponsor of PyCon CA: http://trizpug.org/boot-camp/torpy13/ - A three-day Wisconsin Mini-PyCamp hosted at the University of Wisconsin Oshkosh, June 2-4, 2013 as part of the Plone Symposium Midwest training days: http://trizpug.org/boot-camp/wiscpy13/ PyCamp is the original, ultra-low-cost Python Boot Camp created by a user group for user groups. For beginners, PyCamp makes you productive so you can get your work done quickly. PyCamp emphasizes the features which make Python a simpler and more efficient language. Following along with example Python PushUps speeds your learning process. Become a self-sufficient Python developer at PyCamp. PyCamps are conducted in state of the art high technology classrooms on university campuses. Registration will open soon also for two additional Triangle Python User Group boot camp events. An additional announcement will follow when registration opens for these events, but mark your calendars now: - A five-day Seattle PyCamp hosted by the University of Washington Department of Computer Science and Engineering and UW Marketing, September 9-13, 2013. PyCamp is a sponsor of the Seattle Plone Users Group. - A five-day special Python Web Programming boot camp hosted by the University of North Carolina Department of Marine Sciences, August 5-9, 2013. -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] First program after PyCamp
On 6/12/2013 11:18 AM, bja...@jamesgang.dyndns.org wrote: I've updated this code and to make it more easily readible put it in a github repo https://github.com/CyberCowboy/FindDuplicates Everything is working, however the code is hard to read and I'll be working on cleaning that up, as well as splitting the program into 3 different functions (one that gets hashes, one that finds and identifies the duplicates, and one that outputs the results) However I'm having a problem in that if during the hashing faze a filename with non-ascii characters is encountered the file errors out. Since this is going to be used at work and we have a large number of Chinese and Arabic filenames I need to have the search allow a unicode character set. How would I go about doing this? Python 2.7 btw. Feed os.walk a unicode path and you'll get unicode filenames back. -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] 2014 PyCamps
Need some in-person and structured Python tutoring? PyCamp is an ultra-low-cost, five-day, intensive Python boot camp program by a user group for user groups. PyCamp has taught Python fundamentals to thousands of beginners for nine years while sponsoring Python regional conferences, symposia, sprints, scholarships, and user groups. You can get up to speed on the most modern programming language at PyCamp. This year choose from two PyCamps: Wisconsin PyCamp 2014, June 13-17, University of Wisconsin-Oshkosh http://tripython.org/wiscpy14 Wisconsin PyCamp 2014 is a training program of Plone Symposium Midwest. http://midwest.plonesymp.org Wisconsin PyCamp 2014 is all-day catered (breakfast, lunch, snacks). or PyOhio PyCamp 2014, July 21-25, The Ohio State University http://tripython.org/pyohio14 PyOhio PyCamp 2014 is a pre-conference training program of PyOhio http://pyohio.org Scholarships for women and minorities are available for PyOhio PyCamp. -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Python Help
On 4/9/2014 3:59 PM, Adam Grierson wrote: I'm using 3D climate data (ending in “.nc”). The cube contains time, longitude and latitude. I would like to look at the average output over the last 20 years. The time field spans back hundreds of years and I only know how to collapse the entire field into a mean value. How can I tell python to collapse just the last 20 years into a mean value? An ".nc" file extension is NetCDF. NetCDF can be served by a DAP server. A DAP server can be sent a DAP request by a Python DAP client to drill for results confined to particular variables, a geographic bounding box, and a stop and start timestamp. See: http://pydap.org Or you can simply subset the desired subarray of NetCDF data using SciPy: http://docs.scipy.org/doc/scipy/reference/generated/scipy.io.netcdf.netcdf_file.html Here's a tutorial: snowball.millersville.edu/~adecaria/ESCI386P/esci386-lesson14-Reading-NetCDF-files.pdf -- Sincerely, Chris Calloway http://nccoos.org/Members/cbc office: 3313 Venable Hall phone: (919) 599-3530 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Python and Django Web Engineering Class
Not for everybody, but this just popped up in my neck of the woods, organized by members of my Python user group, and I though there might be a few people here looking for something like this: http://astrocodeschool.com/ It's one of those intensive multi-week code school formats that aren't inexpensive. But it's taught by the primary Python instructor at UNC. The school is also licensed by the State of North Carolina and sponsored by Caktus Group, the largest Django development firm. -- Sincerely, Chris Calloway, Applications Analyst UNC Renaissance Computing Institute 100 Europa Drive, Suite 540, Chapel Hill, NC 27517 (919) 599-3530 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor