Re: [Tutor] Trouble running Python on Windows Vista

2012-06-14 Thread Kwpolska
ubscription options: > http://mail.python.org/mailman/listinfo/tutor > That's not how you run files. python path-to-your-file If it isn't in your %PATH% (it might not be, as you need to set it in Computer->Properties->Advanced system settings->Environment Variables), prepend

Re: [Tutor] Pymongo Error

2012-06-19 Thread Kwpolska
>     'USER': '', >     'PASSWORD': '12424214', >     'HOST': 'mongodb://staff.mongohq.com/', >     'PORT': 'X', >     }, > } > > my requirement packages, > Django==1.3 > dictshield==0

Re: [Tutor] Working with lists - why does my script not work?

2012-06-25 Thread Kwpolska
ommended that you use the > Python 2.7 runtime. This tutorial is for the older version of the Python > runtime that lacks many of the newer App Engine features. From your link. -- Kwpolska <http://kwpolska.tk> stop html mail      | always bottom-post www.asciiribbon.org | www.netmeis

Re: [Tutor] using dynamic import statements

2012-07-09 Thread Kwpolska
> > [snip] Why not the more standard: import sys import os and so on? http://www.python.org/dev/peps/pep-0008/#imports -- Kwpolska <http://kwpolska.tk> stop html mail | always bottom-post www.asciiribbon.org | www.netmeister.org/news/learn2quote.htm

Re: [Tutor] adding a windows registry value

2012-08-03 Thread Kwpolska
html Also, using registry keys is not a great idea if you would want someone to use your code on a different platform. (originally sent to the OP @ 2012-08-03T15:14:00Z) -- Kwpolska <http://kwpolska.tk> stop html mail | always bottom-post www

Re: [Tutor] I-Phone App in Python?

2012-08-04 Thread Kwpolska
lar nowadays), but it costs $199.99. But you also need to pay the iPhone Developer fee of $99. And, of course, you need a Mac, no matter what. Thus, it’s cheaper to learn and write in Objective-C. Or for Android. -- Kwpolska <http://kwpolska.tk> stop html mail | always bottom-pos

Re: [Tutor] I-Phone App in Python?

2012-08-04 Thread Kwpolska
e subscription options: >> http://mail.python.org/mailman/listinfo/tutor > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor Sure, the website can be written using

Re: [Tutor] I-Phone App in Python?

2012-08-04 Thread Kwpolska
ld pass at least five grand by now. And sorry for a bit of OT, but I had to. * Android and Nokia/Ovi are per lifetime AFAIK, others are per year, including iOS. -- Kwpolska <http://kwpolska.tk> stop html mail | always bottom-post www.asciiribbon.org | www.

Re: [Tutor] Question

2012-08-23 Thread Kwpolska
d that for you: http://paste.pound-python.org/show/25126/ As a bonus, I made it so "yes", "YES", or "YeS " will yield the same effect. Hope you are using py3k -- otherwise, replace input with raw_input, as py2k

Re: [Tutor] Question

2012-08-23 Thread Kwpolska
he > list in a column." > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > >

Re: [Tutor] Help with class in class

2012-09-09 Thread Kwpolska
> Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > Please do not top post. --- And the problem is: add_text_widget() defines a local (function-wide) `text` object rather than a

Re: [Tutor] How can I modify this simple script for argparse?

2012-10-13 Thread Kwpolska
= parser.parse_args() foo = "This line was written by a Python script." with open(args.filename, 'a') as file: file.write(foo) Note that this is the most basic version. Also, I had problems with running it as a standalone file, but it worked fine in the int

Re: [Tutor] please give me feedback - linux & virtual machine python script

2012-11-04 Thread Kwpolska
at() syntax instead of %. Like: > log.debug('Received URI is {}'.format(unicode(sys.argv[1], 'utf-8'))) > log.debug("Receaved URI is type %s" > % type(unicode(sys.argv[1], 'utf-8'))) What for? It’s unicode or unicode. Or som

Re: [Tutor] Help please!

2012-12-14 Thread Kwpolska
before* simpstart. Also, about not “free source”: (a) did you mean: open source? (b) why did you publish it here? -- Kwpolska <http://kwpolska.tk> stop html mail | always bottom-post www.asciiribbon.org | www.netmeister.org/news/learn2quote.html GPG KEY: 5EAAEA16 __

Re: [Tutor] Clearing Python text

2012-12-15 Thread Kwpolska
o prefer to > print to a cleared screen, don't know why, just do. > > Mike :) > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor Or cls & python file.py. (clear; ./file.py for th

Re: [Tutor] help

2012-12-29 Thread Kwpolska
whatever else you used) is set to make sound with the bell. -- Kwpolska <http://kwpolska.tk> stop html mail | always bottom-post www.asciiribbon.org | www.netmeister.org/news/learn2quote.html GPG KEY: 5EAAEA16 ___ Tutor maillist - Tut

Re: [Tutor] Facebook login using python

2013-01-28 Thread Kwpolska
I will kill the one who invented this bullshit with the Reply button. (sent 1 h 13 min ago) -- Forwarded message -- From: Kwpolska Date: Mon, Jan 28, 2013 at 4:48 PM Subject: Re: [Tutor] Facebook login using python To: Aaron Misquith On Mon, Jan 28, 2013 at 4:40 PM, Aaron

Re: [Tutor] Help!

2013-01-29 Thread Kwpolska
it shouldn’t filter swearwords, and even if it does, that it shouldn’t inform me of that. -- Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail| always bottom-post http://asciiribbon.org| http://caliburn.nl/topposting.html _

Re: [Tutor] (no subject)

2013-02-04 Thread Kwpolska
.org/mailman/listinfo/tutor > Move the print out of the loop. Also, do not post screenshots, use copy-paste. So, this becomes: binnum = input("Please enter a binary number: ") decnum = 0 rank = 1 for i in reversed(binnum): decnum += rank * int(i) rank

Re: [Tutor] Need a mentor, Any help would be great

2013-03-03 Thread Kwpolska
gt; Probably should flag BitBucket and GitHub as well ? Not “as well”, “instead”. Because SF is anywhere near human-friendly, and many awesome coders are on BitBucket (eg. the Pocoo team) and GitHub (eg. Kenneth Reitz), you can also find some good people on Launchpad. -- Kwpolska <http://kwpolska.t

Re: [Tutor] Fixing Globals

2013-03-16 Thread Kwpolska
foo_the_bar = Ugh, you don’t need variables for this. You should do: if c == '<' or c == '>' Or, even more Pythonically: if c in '<>' Now, for other cases, I suggest OOP and class member values or stuff like that.

Re: [Tutor] change of email

2013-03-31 Thread Chris “Kwpolska” Warrick
gh having a cat sit on your keyboard? -- Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail| always bottom-post http://asciiribbon.org| http://caliburn.nl/topposting.html ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] string.Template

2013-04-23 Thread Chris “Kwpolska” Warrick
use it. 2. Do you need “$”? Why not use the newfangled {} syntax (since Python 2.6)? Example: '2 + 2 = {val}'.format(val='fish') Or: '2 + 2 = {0}'.format('fish') Or even: '2 + 2 = {}'.format('fish') 3. I doubt

Re: [Tutor] Why do I get an "unvalid syntax" on the print line for number1

2013-04-23 Thread Chris “Kwpolska” Warrick
Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > You are probably using Python 3 (check with `python --version`). In this version, print is a function. You need to do the following instead: print(number

Re: [Tutor] totalViruses[i] /= float(numTrials),

2013-04-24 Thread Chris “Kwpolska” Warrick
Trials) > -- > Sydney > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > Yup. Similar expressions exist for other binary operators (+, -, *, etc.

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Chris “Kwpolska” Warrick
ge subscription options: > http://mail.python.org/mailman/listinfo/tutor > Two options: (a) replace `totalCost =` with `return` -OR- (b) add `return totalCost` under the equation. You already used return before, so why didn’t you do it there? Or was this code auto-added by codecademy? -- Kwpolsk

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Chris “Kwpolska” Warrick
_trip_cost(city) + hotel_cost(days) + rental_car_cost(days) -- Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail| always bottom-post http://asciiribbon.org| http://caliburn.nl/topposting.html ___ Tutor maillist -

Re: [Tutor] when is a generator "smart?"

2013-06-03 Thread Chris “Kwpolska” Warrick
3 for now to avoid confusion, but at > some point, since a lot has not been ported to 3.3 http://python3wos.appspot.com/ seems to think otherwise. 60.5% of the top 200 packages are ported, and two more are getting close (werkzeug+flask[0]). [0]: http://www.reddit.com/r/Python/comments/

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-15 Thread Chris “Kwpolska” Warrick
in d.items(): do_stuff_with_dict_items_here() You can use the .keys() and .values() in a similar way. You don’t need a list 99% of the time. And if you do, it is not hard to make it one. -- Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail

Re: [Tutor] What is the difference between checking false?

2013-06-16 Thread Chris “Kwpolska” Warrick
None`/`is not None` comparisons and not much else. -- Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail| always bottom-post http://asciiribbon.org| http://caliburn.nl/topposting.html ___ Tutor maillist - Tutor@python.

Re: [Tutor] 2 basic problems

2013-06-16 Thread Chris “Kwpolska” Warrick
/write output”, while f.seek(0) is used to return the pointer back to the beginning of the file): f = open('acc', 'w+') f.write(lot) f.seek(0) print f.read() f.close() Or using the `with` syntax (a.k.a. the context manager syntax): with open('acc', 'w+')

Re: [Tutor] Hi, First question

2013-06-16 Thread Chris “Kwpolska” Warrick
;: 0.24; '\xa0so': 0.24; > [snip 11 more lines] (replaced tabstops with spaces) Can you guess what’s wrong in your code? You are reading only the first line. There are more. How do you handle that? You need to make your algorithm read all the further lines that begin with the

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Chris “Kwpolska” Warrick
true of older Pythons? Dicts have no order: >>> {'b': 'c', 'a': 'z'} {'a': 'z', 'b': 'c'} Moreover, the sorted() function sorts the keys only (something that list() does anyway). If you are looking for a wa

Re: [Tutor] How to redirect console output to a TextEdit box on a QT Python Gui ?

2013-06-16 Thread Chris “Kwpolska” Warrick
subprocess self.textEdit.setText(subprocess.check_output(('command', 'argument1', 'argument2'))) And you do that in the function that is called when you press OK. Bonus suggestion: do nice layouts instead of setting the coordinates manually. The option

Re: [Tutor] Opinion - help could use more examples

2013-06-19 Thread Chris “Kwpolska” Warrick
ttp://docs.python.org/3/library/functions.html?highlight=zip#zip Downloads for those docs, if you believe this would be more convenient for you, are available at http://docs.python.org/2/download.html and http://docs.python.org/3/download.html (for Python 2 and 3 respectively) -- Kwpolska <ht

Re: [Tutor] Opinion - help could use more examples

2013-06-19 Thread Chris “Kwpolska” Warrick
On Wed, Jun 19, 2013 at 8:11 PM, Jim Mooney wrote: > As for downloadable help, I have a chm file, and the Search is terrible. Get the sane html format, where the search is more useful. -- Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail| always bottom-

Re: [Tutor] How to redirect console output to a TextEdit box on a QT Python Gui ?

2013-06-21 Thread Chris “Kwpolska” Warrick
On Fri, Jun 21, 2013 at 4:59 AM, SM wrote: >> # Replace stdout if needed >> sys.stdout = self.oldstdout It’s better to do it no matter what. Otherwise, hell might break loose. -- Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail| alway

Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-20 Thread Chris “Kwpolska” Warrick
ste it into the To: field of your reply. And replying to the human instead of the list is almost never what you want. -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense _

Re: [Tutor] Cannot understand object initiation

2013-10-14 Thread Chris “Kwpolska” Warrick
right? Not quite. db.Model is basically a representation of a database record. Read this: http://docs.sqlalchemy.org/en/rel_0_8/orm/tutorial.html Note that the above document uses the name `Base` (declarative base) to describe what Flask-SQLAlchemy calls `db.Model`. -- Chris “Kwpolska” Warrick &

Re: [Tutor] Coding for a Secret Message in a Game

2013-12-13 Thread Chris “Kwpolska” Warrick
ging the message upon having that > occur at least 10 times is > #what's giving me trouble. You need to count it somewhere, and test it. With that, it becomes fairly obvious, but with a catch: a one-off error can be easily made. Have some code: print

Re: [Tutor] print in py3

2013-12-22 Thread Chris “Kwpolska” Warrick
without any commas whatsoever. -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] iterators

2014-01-18 Thread Chris “Kwpolska” Warrick
ign `i` to X.next() (or X.__next__() in Python 3; equivalent to next(X)) 3. if a `break` statement occurs anywhere, get out of the `for` block; elif StopIteration is raised, the `else` block is executed (if any) and then the program continues; else, go to

Re: [Tutor] Regarding Exceptions

2014-02-17 Thread Chris “Kwpolska” Warrick
, with the correct code. Also, do you mind phrasing your question more precisely? Do you need help with inheritance? What is the problem you’re having? -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense __

Re: [Tutor] from command prompt use interactive python and running script together

2014-02-21 Thread Chris “Kwpolska” Warrick
mode? > > > thanks > > Gabriele > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Chris “Kwpolska” Warrick <http://kwpolska.tk&g

Re: [Tutor] Why does the last loop not work?

2014-02-25 Thread Chris “Kwpolska” Warrick
referring to it. Do this: for x in myTeams: x.print_team() This causes this output: [kwpolska@kw-cassandra /tmp]% python foo.py code is: a code is: aa code is: b code is: bb code is: c code is: cc code is: d team code is: a debated: team code is: aa debated: team code is: b debated:

Re: [Tutor] Help Noob Question

2014-03-27 Thread Chris “Kwpolska” Warrick
code on the desktop, because the desktop is a pain to find from a command line. Painful? How painful can `cd Desktop` be? Certainly less than `D:` followed by `cd PythonProjects`… -- Chris “Kwpolska” Warrick ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Help Noob Question

2014-03-28 Thread Chris “Kwpolska” Warrick
On Fri, Mar 28, 2014 at 2:17 AM, Alan Gauld wrote: > On 27/03/14 21:01, Chris “Kwpolska” Warrick wrote: >> Painful? How painful can `cd Desktop` be? Certainly less than `D:` >> followed by `cd PythonProjects`… > > > Because the desktop is hardly ever anywhere near where th

Re: [Tutor] conditional execution

2014-04-01 Thread Chris “Kwpolska” Warrick
# normal key press, append it to end of display > self.display.setText(text+key) > > def run(self): > # infinite event loop to process button clicks > while True: > key = self.getButton() > self.processButton(key) > > #this runs the

Re: [Tutor] Final review

2014-05-01 Thread Chris “Kwpolska” Warrick
, [2.0, 5, [10, 20]]] x contains: 0. the string 'a' 1. the list: 0. the float 2.0 1. the integer 5 2. the list: 0. the integer 10 1. the integer 20 -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 m

Re: [Tutor] Advice needed by a new to Python but abit experience software dev

2014-05-04 Thread Chris “Kwpolska” Warrick
the official Python tutorial if you are an experienced developer.) Also, Bootstrap is a front-end framework: http://getbootstrap.com/ — and you’re better off asking HTML/CSS people for advice, after you read the extensive docs. -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16

Re: [Tutor] HELP! How do I remove the black after "s="

2014-05-10 Thread Chris “Kwpolska” Warrick
print('s={0} {1}'.format(s, n)) This will produce "s=8 5". If you want "s=85", remove the space in the format string. -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense __

Re: [Tutor] Option on How to create web Interface

2014-05-22 Thread Chris “Kwpolska” Warrick
.cgi Sadly, this is not the modern way to do it. These days, it’s recommended to use something like Flask, or Django, or whatnot. CGI is ancient, and problematic. -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense

Re: [Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread Chris “Kwpolska” Warrick
orrect way is compiling it on your own (the usual Unix way, but using `make altinstall` for the install step). virtualenv won’t help in this case, it’s not what virtualenv is for. -- Chris “Kwpolska” Warrick <http://kwpolska.tk> PGP: 5EAAEA16 stop html mail | always b

Re: [Tutor] How to Create Webpage with Python

2014-07-10 Thread Chris “Kwpolska” Warrick
th Nikola’s development; however, even with that aside, I believe Nikola is much more human-friendly than Pelican. To each their own, though. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense __

Re: [Tutor] How to Create Webpage with Python

2014-07-10 Thread Chris “Kwpolska” Warrick
For local testing, use python -m SimpleHTTPServer or, if you’re on Python 3, python3 -m http.server -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor

Re: [Tutor] How to Create Webpage with Python

2014-07-11 Thread Chris “Kwpolska” Warrick
eSpeech.net/>). On Fri, Jul 11, 2014 at 6:21 AM, Danny Yoo wrote: > The ones I use for my personal and professional use are webfaction.com and > appengine.google.com. I'm sure others can give more suggestions. Both are services used for hosting webapps, not static websites. --

Re: [Tutor] How to Create Webpage with Python

2014-07-15 Thread Chris “Kwpolska” Warrick
utput that's very close to Excel’s, why not just use Excel’s save as webpage capabilities? You can automate that, with Python or something else (like Excel macros or Windows-specific automation software). It's much easier to do it this way, and it guarantees good output without much effort.

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
e -e option to fail when a command exits with a non-zero status. You should always have a shebang line in your shell files, and execute them as ./shellTest.sh (after chmod +x shellTest.sh); moreover, one for Python files is recommended, like this: #!/usr/bin/env python -- Chris

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
need is: python test.py && python second.py However, you need to explicitly stack all the commands you want to execute this way — so, if there are more things, `set -e` might also be of use. (you would need an even uglier tree for `if`s.) -- Chris “Kwpolska” Warrick <http://chriswarrick

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
On Thu, Jul 24, 2014 at 2:14 PM, Wolfgang Maier wrote: > On 24.07.2014 14:09, Chris “Kwpolska” Warrick wrote: >> >> On Thu, Jul 24, 2014 at 2:01 PM, Wolfgang Maier >> wrote: >>> >>> Try something like this (assuming bash): >>> >>> python

Re: [Tutor] Error Handling in python

2014-07-24 Thread Chris “Kwpolska” Warrick
On Thu, Jul 24, 2014 at 2:23 PM, Wolfgang Maier wrote: > On 24.07.2014 14:19, Chris “Kwpolska” Warrick wrote: >> >> >>>>> python test.py >>>>> if [ $? = 0 ]; then >>>>> python second.py >>>>> fi >>&g

[Tutor] Fwd: Printing multi-line variables horizontally

2014-08-09 Thread Chris “Kwpolska” Warrick
It looks ilke this WONDERFUL mailing list which does not do something as basic as a sane Reply-to header made me send a response to the OP only. Here it is again: -- Forwarded message -- From: Chris “Kwpolska” Warrick Date: Fri, Aug 8, 2014 at 7:36 PM Subject: Re: [Tutor

Re: [Tutor] read cell phone's directory?

2014-08-14 Thread Chris “Kwpolska” Warrick
ang.python). Long story short, modern Android phones are using the MTP protocol and do not behave like usual USB drives. You must use a module that implements MTP if you want to access your phone. > import os; No need for a semicolon here. -- Chris “Kwpolska” Warrick <http://chriswarrick.co

Re: [Tutor] re module

2014-08-14 Thread Chris “Kwpolska” Warrick
ilman/listinfo/tutor > Don't use regular expressions for HTML. Use lxml instead. Also, why would you need that exact thing? It's useless. Also, this code is very ugly, with too many s and — worse — s which should not be used at all. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/

Re: [Tutor] read cell phone's directory?

2014-08-14 Thread Chris “Kwpolska” Warrick
about the protocol. You can Google the term “python MTP”, you may find some answers there. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> Sent from my SGS3. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Alert to all Experienced Python Software Object Oriented Programmers-Novice Needs Help In Understanding Textbook

2014-08-17 Thread Chris “Kwpolska” Warrick
On 18 August 2014 02:45 "ALAN GAULD" wrote: > > At the Community College we used Python version 3.4.0 which I guess is up to date. > > Yes indeed, the latest and greatest. The “latest and greatest” is actually 3.4.1. -- Chris “Kwpolska” Warrick <http://chriswarric

Re: [Tutor] Preparing virtualenvwrapper for Django 1.6 development

2014-08-23 Thread Chris “Kwpolska” Warrick
opment). I personally recommend you just get a virtual machine running some Linux instead of playing with Windows. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___

Re: [Tutor] Preparing virtualenvwrapper for Django 1.6 development

2014-08-24 Thread Chris “Kwpolska” Warrick
n both OSes (and even in some Windows VMs). -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

Re: [Tutor] time vs. timeit

2014-08-26 Thread Chris “Kwpolska” Warrick
r of times through the loop, defaulting | to one million. The main statement, the setup statement and | the timer function to be used are passed to the constructor. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAE

Re: [Tutor] debug and execute python code in Mac

2014-08-28 Thread Chris “Kwpolska” Warrick
t; Just as an aside — Apple has stopped charging for OS-X. Sebastan probably meant “free” as in Stallman: http://www.gnu.org/philosophy/free-sw.html (most people believe free = $0. FSF people, however, want to steal that word for their concept. Not very successful at that, as you can se

Re: [Tutor] Python 3.4.1 question for Mac users

2014-08-29 Thread Chris “Kwpolska” Warrick
ile_contents = infile.read() > > infile.close() > > print(file.contents) > > > > main() > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.or

Re: [Tutor] Python 3.4.1 question for Mac users

2014-08-29 Thread Chris “Kwpolska” Warrick
here; the main drive is just /. Also, the path separator is a forward slash (/). This also lets you remove the r in front of the string, which is needed for backslashes unless you escape them. The corrected code is: infile = open('/Users/richarddillon/Desktop/my_file', 'r

Re: [Tutor] This is driving my crazy! My file hasn't been corrupted

2014-08-31 Thread Chris “Kwpolska” Warrick
;) It’s better to let Python show the exceptions. -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense ___ Tutor maillist - Tutor@python.org To unsubscribe or change s

Re: [Tutor] how to express shift+enter in python

2014-09-28 Thread Chris “Kwpolska” Warrick
combination to an app? What is it, exactly, that you want to do? What app uses Shift+Enter in the way you want to use it? -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense

Re: [Tutor] Insert time into email

2014-10-20 Thread Chris “Kwpolska” Warrick
x27;html') > msgAlternative.attach(msgText) > > for image in l: > with open(image, 'rb') as fh: > msgImage = MIMEImage(fh.read()) > msgImage.add_header('Content-ID', '<{0}>'.format(image)) > msgRoot.attach(msgI

Re: [Tutor] Insert time into email

2014-10-20 Thread Chris “Kwpolska” Warrick
Text = MIMEText('…rest of your HTML here, complete with {time} and {date} tags…'.format(time=t, date=d), 'html') msgAlternative.attach(msgText) -- Chris “Kwpolska” Warrick <http://chriswarrick.com/> PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes