Re: [Tutor] problem reading script

2011-07-01 Thread Martin A. Brown
explain what you were reading. -Martin [0] http://docs.python.org/dev/library/stdtypes.html#string-methods -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] broken script

2011-07-05 Thread Martin A. Brown
in for us to put right!!!) : : Pointers in the right direction very gratefully received! Try again, keep with it, and recognize that these beasties are awfully particular in what they accept. And, for good reason. Best of luck, Lisi, -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] What's the difference between %s and %r?

2011-07-23 Thread Martin A. Brown
* iif = if and only if -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Adding index numbers to tuple

2011-08-16 Thread Martin A. Brown
the desired : output. Anyone with a solution or push in the right direction? Perhaps you did not know about enumerate? t = ('a', 'b', 'c', 'd') l = list() for x in enumerate(t): l.extend(x) -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] Tables

2011-10-03 Thread Martin A. Brown
for homework, but, as tutors, we are very happy to help you understand Python and how to make it do what you want. -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] read in text file containing non-English characters

2012-01-12 Thread Martin A. Brown
of %s is %s' % (row[0], row[1],) The above is trivial, but if you would like some more substantive assistance, you should describe your problem in a bit more detail. -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Read in text file containing non-English characters

2012-01-13 Thread Martin A. Brown
is a good place to be for such initial explorations. There are a number of libraries that can help with the mathematical operations and you will probably get many good suggestions. Welcome to the list, -Martin [0] http://wiki.python.org/moin/Python2orPython3 -- Martin A. Brown http://linux

Re: [Tutor] Request for advice on Python code

2012-02-13 Thread Martin A. Brown
Greetings Elaina, I will echo Alan's remarks--it sounds like you are using a quite specialized (specialised?) module. It is certainly not a module with which I am familiar, not in the standard library, and not a commonly encountered problem. I would classify this module as domain-specific.

Re: [Tutor] How to convert seconds to hh:mm:ss format

2012-02-16 Thread Martin A. Brown
the date and time handling tools available in libraries, rather than try to build your own. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] creating dict of dict : similar to perl hash of hash

2012-03-06 Thread Martin A. Brown
= collections.defaultdict(collections.defaultdict) a,b,c = range(3) d[a][b] = c d defaultdict(type 'collections.defaultdict', {0: defaultdict(None, {1: 2})}) Have a look at the collections module. See if that scratches your itch. Good luck, -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] error when using using subprocess.popen in Python wrapper script

2012-05-06 Thread Martin A. Brown
process python /path/to/your/python/script.py Enjoy, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread Martin A. Brown
: csv.reader(f,delimiter='\t') -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-20 Thread Martin A. Brown
/ Good luck and enjoy Python, -Martin [0] http://shop.oreilly.com/product/9780596007973.do -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] Coding Challenges

2012-05-21 Thread Martin A. Brown
a concrete task to approach is a good way to learn. Enjoy, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dictionaries

2012-06-17 Thread Martin A. Brown
looking at the other sorts of things that you can do with dictionaries. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] (no subject)

2012-06-19 Thread Martin A. Brown
techniques here (and the one Joel just posted): http://mail.python.org/pipermail/tutor/2012-June/090025.html -Martin (You asked your question much more clearly this time and with a code sample--so, keep it up and enjoy the Python.) -- Martin A. Brown http://linux-ip.net

Re: [Tutor] Counting Items in a List

2012-06-20 Thread Martin A. Brown
= collections.defaultdict(int) for line in lines: words = line.strip().split() for word in words: summary[word] += 1 Lots of interesting features in the collections module... -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor

Re: [Tutor] Generating random alphanumeric codes

2012-06-26 Thread Martin A. Brown
if there were not more efficient ways of accomplishing this. -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] intercepting and recored I/O function calls

2010-09-16 Thread Martin A. Brown
like this. Alan's admonition bears repeating. Trapping all application I/O is probably just fine for development, instrumenting and diagnosing, but you may wish to support that in an easily removable manner, especially if performance is paramount. Good luck, -Martin -- Martin A. Brown http

Re: [Tutor] intercepting and recored I/O function calls

2010-09-17 Thread Martin A. Brown
of the others on this list can help. -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List comprehension question

2010-11-09 Thread Martin A. Brown
in range(2, int(n**.5)+1): factor, mod = divmod(n,x) if mod == 0: pd.update((x,factor)) return list(pd) Have a great day, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor

Re: [Tutor] Simple counter to determine frequencies of words in a document

2010-11-20 Thread Martin A. Brown
collections, as suggested by Peter Otten. Enjoy and good luck! -Martin * Somebody will be certain to point out a language or languages that provide some sort of facility to abstract the use of multiple processors without the explicit use of threads. -- Martin A. Brown http://linux

Re: [Tutor] Tab delimited question

2010-12-13 Thread Martin A. Brown
' is probably not quite what you had wanted, but you should be able to adapt it pretty readily. Good luck, -Martin [0] http://mail.python.org/pipermail/tutor/2010-December/080592.html -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor

Re: [Tutor] merging 2 files.

2011-02-24 Thread Martin A. Brown
csv.reader you may have at your disposal, but also what data structures are suited to your questions of your data. : I am in need of the solution as client breathing down my neck. They always do. Wear a scarf. -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] Bitwise operation

2011-02-28 Thread Martin A. Brown
/reference/expressions.html#boolean-operations http://docs.python.org/reference/expressions.html#summary This may also be useful: http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-complex Good luck, -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] Dynamically assign variable names to tuple objects

2011-03-01 Thread Martin A. Brown
approach I suggested above), I'd suggest using your list variable directly! varlist = [] for i in myfiles: varlist.append( makeTuple( i ) ) Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Deleting strings from a line

2011-04-26 Thread Martin A. Brown
there are and what they do. The strip() method is one of the first to learn. The split() should be your second. Keep on going, and you'll find all sorts of goodies in there. And, enjoy Python! -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist

Re: [Tutor] Python Interview Questions..

2011-05-24 Thread Martin A. Brown
that you as a developer have faced. That would also be interesting to me as a technical interviewer. -Martin [0] http://www.quotationspage.com/quote/12220.html -- Martin A. Brown http://linux-ip.net/___ Tutor maillist - Tutor@python.org

Re: [Tutor] Clunky Password maker

2011-05-25 Thread Martin A. Brown
. (You are looking at 'hashlib', correct?) Good luck, -Martin -- Martin A. Brown http://linux-ip.net/___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] unicode help

2011-05-28 Thread Martin A. Brown
anything other than ASCII without this (slightly hackish) hint. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] searching for an ip and subnets in a dir of csv's

2009-07-29 Thread Martin A. Brown
print # -- end of file - -- Martin A. Brown http://linux-ip.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) Comment: pgf-0.72 (http://linux-ip.net/sw/pine-gpg-filter/) iD8DBQFKcFbwHEoZD1iZ+YcRApGhAJ9fJxjEigCeCZ7cpDSa9uCoAadl+QCfYkhI 7fR7P0mZRsBl4lbleqkDoqw= =ns0F

Re: [Tutor] mapping/filtering a sequence

2009-09-05 Thread Martin A. Brown
, 40, 17, 19 ] l = map( filt_seq, l ) Good luck, - -Martin - -- Martin A. Brown http://linux-ip.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) Comment: pgf-0.72 (http://linux-ip.net/sw/pine-gpg-filter/) iD8DBQFKonmNHEoZD1iZ+YcRAme7AKDqThvHP6+3xbzBg1p48rxmY21ztgCdFYnA

Re: [Tutor] Logfile Manipulation

2009-11-09 Thread Martin A. Brown
, - -- Martin A. Brown http://linux-ip.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (GNU/Linux) Comment: pgf-0.72 (http://linux-ip.net/sw/pine-gpg-filter/) iD8DBQFK9+MGHEoZD1iZ+YcRAhITAKCLGF6GnEMYr50bgk4vAw3YMRZjuACg2VUg I7/Vrw6KKjwqfxG0qfr10lo= =oi6X -END PGP SIGNATURE

Re: [Tutor] ask-why I cannot run it, and I am so confused about the traceback

2010-04-07 Thread Martin A. Brown
. Each call to Cone only supplies a single argument. ... Cone(1.1),Cone(1.2) ... - -Martin - -- Martin A. Brown http://linux-ip.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (GNU/Linux) Comment: pgf-0.72 (http://linux-ip.net/sw/pine-gpg-filter/) iD8DBQFLvGZJHEoZD1iZ

Re: [Tutor] Move all files to top-level directory

2010-04-13 Thread Martin A. Brown
available in GNU mv (and cp), I believe. I'll second the recommendation for 'shutil', although you can have some fun playing with recursion by building your tree flattener using os.walk(), os.path.split() and os.path.join(). - -Martin - -- Martin A. Brown http://linux-ip.net/ -BEGIN PGP

Re: [Tutor] Making pretty web pages from python code examples?

2010-04-13 Thread Martin A. Brown
python modules. Much easier than building your own. Good luck, - -Martin [0] http://sphinx.pocoo.org/ http://sphinx.pocoo.org/contents.html http://pypi.python.org/pypi/Sphinx - -- Martin A. Brown http://linux-ip.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (GNU/Linux

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Martin A. Brown
-- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Please Help

2013-03-22 Thread Martin A. Brown
-list-tuple-bytearray-buffer-xrange # print 'slice out from your original data: ', data[1::2] -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] making a string

2013-05-25 Thread Martin A. Brown
Lutz has been writing books on Python for almost as long as Python has been around. So, good luck and ask questions here. There's quite a group here willing to help. -Martin -- Martin A. Brown http://linux-ip.net/___ Tutor maillist - Tutor@python.org

Re: [Tutor] Processing CSV files

2013-10-08 Thread Martin A. Brown
of the oldest scientific computational libraries available for Python. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo

Re: [Tutor] How to get file permissions (Python 2.4)?

2014-03-19 Thread Martin A. Brown
? Let os.access() [1] do the bitmath for you: os.access('/usr/bin/python', os.X_OK) Good luck, -Martin [0] http://docs.python.org/2/library/stat.html [1] http://docs.python.org/2/library/os.html#os.access -- Martin A. Brown http://linux-ip.net

Re: [Tutor] improving speed using and recalling C functions

2014-04-10 Thread Martin A. Brown
/ -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] improving speed using and recalling C functions

2014-04-10 Thread Martin A. Brown
not a performance bottleneck. If you can find the parts of your skymaps5.py code that are the bottleneck, then you could post it here. I hadn't thought of using interpolate, myself, as I didn't even know it existed. Thanks and good luck, -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] improving speed using and recalling C functions

2014-04-10 Thread Martin A. Brown
://docs.python.org/3/library/logging.html -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] preferred httprequest library

2014-05-08 Thread Martin A. Brown
tools (urllib, and urllib2) unless you need that finer control. This has a nice abstraction and, from your description, I think this would be a good fit: http://docs.python-requests.org/en/latest/ -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] Real world experience

2014-05-12 Thread Martin A. Brown
for them. Keep reading. Hire them. Keep writing. Keep reading. [3] Oops. I learned on BASIC. I hope I do not get banned from the list. -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Modules to work with curl.

2014-07-17 Thread Martin A. Brown
/multiprocessing.html -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Development of administration utility

2014-08-21 Thread Martin A. Brown
Greetings Alessandro, : We are currently investigating different languages and technologies to : develop an command line administration utility. : Python is one of the options we are looking at for the job but currently we : have no relevant skill set so I thought I'd post some question to

Re: [Tutor] printing all text that begins with 25

2014-10-02 Thread Martin A. Brown
. Happy trails and good luck, -Martin [0] https://apps.db.ripe.net/search/query.html?searchtext=25.0.0.0/8source=RIPE#resultsAnchor -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Suggestions Please

2014-10-06 Thread Martin A. Brown
documentation: https://docs.python.org/2/ # -- Python-2.7.x https://docs.python.org/3/ # -- Python-3.4.x -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] search/match file position q

2014-10-07 Thread Martin A. Brown
= pattern.search(s,0) while matched: endpos = matched.end() print(matched.group(0), matched.start(), matched.end()) matched = pattern.search(s, endpos) -- Martin A. Brown http://linux-ip.net/ ___ Tutor

Re: [Tutor] How best to structure a plain text data file for use in program(s) and later updating with new data?

2014-10-08 Thread Martin A. Brown
-are-the-differences-between-json-and-simplejson-python-modules -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How best to structure a plain text data file for use in program(s) and later updating with new data?

2014-10-08 Thread Martin A. Brown
, then maybe that's a better option for you. If you can not do so, then take this older version of simplejson. You are at that place of last resort to which the simplejson authors allude. How do you like it at that resort? Would I want to go on vacation there? -Martin -- Martin A. Brown http

Re: [Tutor] (no subject)

2014-10-09 Thread Martin A. Brown
clear question and letting us know your OS and Python version, as well. -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Would somebody kindly...

2014-10-30 Thread Martin A. Brown
)) for x in values if key == x[0]] [('a', 1, 2656), ('a', 5, 4510)] Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman

Re: [Tutor] Would somebody kindly...

2014-10-30 Thread Martin A. Brown
that this was fixed. Apologies! -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Parsing JSON with Python

2014-12-11 Thread Martin A. Brown
on to json.dump() and json.load() to put your data into files. -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] SQLAlchemy

2015-01-26 Thread Martin A. Brown
://groups.google.com/forum/#!forum/sqlalchemy [2] 'The IRC channel is on the Freenode network as #sqlalchemy.' -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman

Re: [Tutor] UPDATE: Is there a 'hook' to capture all exits from a python program?

2015-03-20 Thread Martin A. Brown
a certain routine activity'. So, it may surprise some folk if a process died after receiving a HUP. This may be desirable--it depends entirely on what your software does. Stopping and starting are hard! -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] Feedback on Script for Pandas DataFrame Written into XML

2015-03-29 Thread Martin A. Brown
... https://mailman-mail5.webfaction.com/listinfo/lxml ... or maybe the Pandas mailing list: https://groups.google.com/forum/#!forum/pydata Best of luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Feedback on Script for Pandas DataFrame Written into XML

2015-03-30 Thread Martin A. Brown
? For understanding and using a DataFrame, you'd probably be better off asking on the pandas mailing list. ... or maybe the Pandas mailing list: https://groups.google.com/forum/#!forum/pydata May the Python never release you from its grip! -Martin -- Martin A. Brown http://linux-ip.net

Re: [Tutor] Advice on Strategy for Attacking IO Program

2015-03-29 Thread Martin A. Brown
': import sys validate_files(sys.argv[1:]) # -- end of file [0] http://en.wikipedia.org/wiki/Functional_programming [1] https://docs.python.org/2/library/tempfile.html#module-tempfile -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist

Re: [Tutor] Pun panic, was Re: calling a method directly

2015-04-21 Thread Martin A. Brown
, and threatening (which is cognate to the contemporary German word 'lauern') And, I dairy not chase this pun any further -Martin [0] http://www.merriam-webster.com/dictionary/lower -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor

Re: [Tutor] Integrating TDD into my current project work-flows

2015-05-04 Thread Martin A. Brown
! Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Hi

2015-04-11 Thread Martin A. Brown
slapdash answers, that this one comes as a huge surprise.) -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] lists, name semantics

2015-04-17 Thread Martin A. Brown
[0] https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo

Re: [Tutor] How to return a list in an exception object?

2015-06-17 Thread Martin A. Brown
] https://docs.python.org/2/library/difflib.html [1] https://docs.python.org/3/library/exceptions.html#Exception -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https

Re: [Tutor] Problem using lxml

2015-08-22 Thread Martin A. Brown
. You will be able to figure out exactly which xpath gets you the data you would like, and then you can drop it into your script. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] line error on no. 7

2015-07-28 Thread Martin A. Brown
fair sun and kill the envious moon Who is already sick and pale with grief -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] for loop for long numbers

2015-08-03 Thread Martin A. Brown
12.8 seconds to count through the loop. So, before accounting for any work that you plan to undertake inside the loop, you have a runtime of ~115 seconds. -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] String Attribute

2015-07-31 Thread Martin A. Brown
the variable and throwing away anything that was there before.. -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help Command Question

2015-07-28 Thread Martin A. Brown
Hi there, In [1]: help list File ipython-input-1-823a3ff84bc4, line 1 help list ^ SyntaxError: invalid syntax.' Question: What is the correct help command? Try: help(list) Snipped from my ipython session: In [1]: help(list) Good luck, -Martin -- Martin A. Brown

Re: [Tutor] Socket Module

2015-07-26 Thread Martin A. Brown
-- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Plotting with python

2015-10-30 Thread Martin A. Brown
ange you want to display, you don't need to mess with the axes. See their tutorial: http://matplotlib.org/users/pyplot_tutorial.html Good luck and enjoy! -Martin [0] http://ipython.org/ [1] http://ipython.org/notebook.html -- Martin A. Brown http://linux-ip.net/ __

Re: [Tutor] For Loop

2015-10-30 Thread Martin A. Brown
https://docs.python.org/3/tutorial/controlflow.html If you have more specific details on what you are trying to accomplish and/or learn, then send along those questions! Good luck as you get started, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor ma

Re: [Tutor] File operation query

2015-10-16 Thread Martin A. Brown
;) I would, therefore write your program like this: input1 = raw_input("Input1:") f = open("check.txt", "w") f.write(input1 + "\n") f.close() f = open("check.txt", "r") for line in f:

Re: [Tutor] accessing modules found throughout a package?

2015-10-18 Thread Martin A. Brown
rovement would be to only prepend the PYTHONPATH and required colon if there's a value to PYTHONPATH already. So, this little beautifully obnoxious bash parameter expansion gem will accomplish that for you: PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}/home/alex/Py&

Re: [Tutor] 0 > "0" --> is there a "from __future__ import to make this raise a TypeError?

2015-10-13 Thread Martin A. Brown
he benefit, then, of your code being agnostic (or extensible) to the serialization tool. By the way, did you know that pandas.to_csv() [0] also exists? -Martin [0] http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_csv.html -- Martin A. Brown http://li

Re: [Tutor] How to read all integers from a binary file?

2015-10-09 Thread Martin A. Brown
. You'll see that I didn't have a mess of unsigned integers hanging around in a file, so you can see how I generated and stored them in write_data and gen_data). -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] How should my code handle db connections? Should my db manager module use OOP?

2015-08-26 Thread Martin A. Brown
-- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Creating lists with definite (n) items without repetitions

2015-09-03 Thread Martin A. Brown
out at the intercative prompt. Perhaps this is what you are looking for? >>> import random >>> import string >>> l = list(string.lowercase) >>> random.sample(l, 7) ['z', 'h', 'e', 'n', 'c', 'f', 'r'] Best of luck, -Martin -- Martin A. Brown http://l

Re: [Tutor] ftp socket.error

2015-09-12 Thread Martin A. Brown
/sftp. Good luck, -Martin [0] http://www.networksorcery.com/enp/protocol/icmp/msg3.htm -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listi

Re: [Tutor] ftp socket.error

2015-09-11 Thread Martin A. Brown
d access, use ssh/scp/sftp. Good luck, -Martin [0] http://www.networksorcery.com/enp/protocol/icmp/msg3.htm -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-26 Thread Martin A. Brown
bout my code. Note that it solves Problem B, providing one possible example. This appears not to be what you want. It will not enumerate all possible examples. Good luck and enjoy the remainder of your weekend, Marcus, -Martin -Ursprüngliche Nachricht- Von: Martin A. Brown [mailto:mar...@lin

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-27 Thread Martin A. Brown
experience in combinatorics to guide you in thinking properly (and clearly) about this problem and that is where you are stuck at the moment. Sorry I can't help you much further. Good luck, Marcus, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor

Re: [Tutor] mathematical and statistical functions in Python

2015-09-27 Thread Martin A. Brown
-statistics Thggere are other, richer tools in third-party libraries if you are looking for more advanced tools. But, perhaps you only need to start with the above. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-21 Thread Martin A. Brown
IJ') pcount = 2 # players per game gcount = 3 # games per match rcount = 7 # rounds (of matches) matches = generate_rounds(players, pcount, gcount, rcount) lo

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-21 Thread Martin A. Brown
ast Antivirus-Software auf Viren geprüft. https://www.avast.com/antivirus ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor -- Martin A. Brown http://linux-ip.net/ ___

Re: [Tutor] How to get Key from multiple value dictionary search

2016-01-06 Thread Martin A. Brown
contain anywhere from zero keys (the value is not present in any list in the dictionary values) OR all keys (the value is present in every list in the dictionary values). {Whew.} Good luck and have fun, -Martin -- Martin A. Brown http://linux-ip.net/ _

Re: [Tutor] MemoryError

2015-12-29 Thread Martin A. Brown
orkan faktor_1, faktor_2 = faktorisasi(n) print faktor_1 print faktor_2 -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Hi Tutor

2016-01-09 Thread Martin A. Brown
I would like to have some Onion soup, the Crab cake, Rum and a Caesar, please. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] looping generator

2016-01-07 Thread Martin A. Brown
ing a text apart by paragraph. Think about how this applies to your problem: http://code.activestate.com/recipes/66063-read-a-text-file-by-paragraph/#c1 N.B. The code example may not be utterly perfect, but it is precisely the same problem that you are having. Good luck and enjoy, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: How best to use Git for multi-directory projects?

2015-12-29 Thread Martin A. Brown
gies depending on what you are doing with the software and the environment in which you are working. Good luck and have fun with Python in 2016, since you have arrived there before the rest of us, -Martin P.S. Two questions: should I buy some some YHOO stock and should I sell my Euros? -

Re: [Tutor] Simultaneous read and write on file

2016-01-18 Thread Martin A. Brown
it an experienced Windows/POSIX user trying to understand open() in Python if it were available in the standard documentation. Thanks for mapping this to common operating systems. I had inferred this already, but this is a great summary. -Martin -- Martin A. Brown http://linux-ip.net/

Re: [Tutor] Simultaneous read and write on file

2016-01-18 Thread Martin A. Brown
kernel). So, take control of the data back into your own hands by taking adavantage of the beauty of the filesystem. Filesystem atomicity! Good luck, -Martin [0] Or just about as close as conceivably possible to atomic as you can be guaranteed in userspace applications. -- Mart

Re: [Tutor] Help with date range

2016-02-09 Thread Martin A. Brown
sorting, computation, calculation or range-finding. Also, if you have a smaller block of code and data, we may find it easier to make specific suggestions. And, one last general comment Unless you have a specific reason why not to do so, it's best to convert and decode inputs into a canon

Re: [Tutor] declare a variable inside a class

2016-02-11 Thread Martin A. Brown
errors. Good luck, -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] declare a variable inside a class

2016-02-11 Thread Martin A. Brown
fine_in_instance() c.oh_there_it_is() # -- newly defined instances will get the default class attribute d = MyClass() d.oh_there_it_is() -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread Martin A. Brown
ractions and really just want an individual thingy that that behaves like a file, but can be constructed in memory, use StringIO (or cStringIO). Good luck! -Martin -- Martin A. Brown http://linux-ip.net/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread Martin A. Brown
nt an individual thingy that that behaves like a file, but >> can be constructed in memory, use StringIO (or cStringIO). > >Isn't option D what Danny was using to make option B? Or are you >saying keep things even simpler? Oh dear--yes. Apologies, Danny and boB. To the

  1   2   >