Re: [Tutor] Beginner - explaining 'Flip a coin' bug

2014-02-14 Thread David Hutto
Just to add a footnote to the above remember: http://en.wikipedia.org/wiki/Random_seed unless setting your own random seed algorithm is applied. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.o

Re: [Tutor] Beginner - explaining 'Flip a coin' bug

2014-02-14 Thread David Hutto
On Fri, Feb 14, 2014 at 10:49 PM, David Hutto wrote: > Here is a problem I've come across, from empirical evidence, that also > relates to your equation. We always assume > that their are always two probabilities, that a coin can be either head > or tails. > > However, th

Re: [Tutor] Beginner - explaining 'Flip a coin' bug

2014-02-14 Thread David Hutto
flips* each time until the loop > becomes false. > > Can somebody explain the reason of the bug. > Cheers, > > Marc > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://m

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread David Hutto
) errorsq += (lin_estimate - y[m]) * (lin_estimate - y[m]) #print errorsq # insert print for quick in line debugging by uncommenting return errorsq #Call function minimize minimize(max_elements) Don't forget the tabs , or spaces, and the forced indentation. On Sun, Feb 2, 2014 at 6:44 PM,

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread David Hutto
On Sun, Feb 2, 2014 at 6:44 PM, David Hutto wrote: > > > > On Sun, Feb 2, 2014 at 3:46 PM, Kipton Moravec wrote: > >> I am new to Python, and I do not know how to traverse lists like I >> traverse arrays in C. This is my first program other than "Hello World&quo

Re: [Tutor] Traversing lists or getting the element you want.

2014-02-02 Thread David Hutto
lin_estimate = y[istart] + ((y[iend] - y[istart]) * ((x[m] - x[istart]) / (x[iend] - x[istart]))) errorsq += (lin_estimate - y[m]) * (lin_estimate - y[m]) return errorsq > At the end the three values I want are mini, minj, mink; > or x[mini], x[minj], x[mink] > > > So how do I do this (or approa

Re: [Tutor] Shelve & immutable objects

2014-01-02 Thread David Hutto
> Separately, I'm also curious about how to process big files. For example, I > was trying to play 100 million games of chutes & ladders Without doing the 100,000,000, you could try either researching the nums, or trying an algorithm that tried intervals, and narrowed down the best , and numerical

Re: [Tutor] Quantum computing

2013-12-15 Thread David Hutto
Well, it would fit the market penetration, of corporate-upper middle class-middle class- the lower socioeconomic level. It would also fit the market of individuals that have a population control that intertwines with the dissemination -- Best Regards, David Hutto *CEO:* *http

[Tutor] Quantum computing

2013-12-14 Thread David Hutto
l the instruction sets of these newer technologies effect us considerably? Just to kick off a topic. -- Best Regards, David Hutto *CEO:* *http://www.hitwebdevelopment.com <http://www.hitwebdevelopment.com>* ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] inconsistent destruction

2013-08-08 Thread David Hutto
variable that corresponds within the lst global variable which uses list methods. On Thu, Aug 8, 2013 at 12:15 AM, David Hutto wrote: > if the variable is the range in the first one, then just don't append it, > and replace it with something else. > > The second, you use cnt2, but it

Re: [Tutor] inconsistent destruction

2013-08-08 Thread David Hutto
l cnt right after the for, but that seems > artificial. > > -- > Jim > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > -- Best Regards, David Hutto *CEO:* *http://www.hitwebdevelopm

Re: [Tutor] 3 Dimensional Dictionaries

2013-07-23 Thread David Hutto
nt => class containing countries > >> country => class containing states > >> state => class containing data > >> > >> It then becomes easier to build helper methods to extract/manipulate > the data you are interested in. > >> > >> Alternatively, if you have a large

Re: [Tutor] suggestions for splitting file based on date

2013-07-23 Thread David Hutto
Why not use the actual month? With a simple x/y canvas in Tkinter you could plot by the months with polygon coordinates as your data visualization, or in 30 day /etc windows, just the price(y) being a derivative of x(the frequency of changes), and create simple line segments with polygon coordinat

Re: [Tutor] suggestions for splitting file based on date

2013-07-23 Thread David Hutto
You could also begin a little stats(I think steven D'aprano did pystats), which would show rhythms within those particular frequency windows, using y as a basis for your model On Sat, Jul 20, 2013 at 1:10 AM, David Hutto wrote: > Why not use the actual month? With a simple x/y c

Re: [Tutor] A list of 100+ projects to complete to master Python.

2013-07-23 Thread David Hutto
| > Resume<http://www.goel.im/Karan.Goel.Resume.pdf> > | Github <https://github.com/thekarangoel> > > > On Wed, Jul 17, 2013 at 5:09 AM, David Hutto wrote: > >> First thing you should learn is offsite backups, I've lost several >> projects in the works becaus

Re: [Tutor] A list of 100+ projects to complete to master Python.

2013-07-18 Thread David Hutto
ns. > > - Karan Goel > Goel.im <http://www.goel.im/> | > Resume<http://www.goel.im/Karan.Goel.Resume.pdf> > | Github <https://github.com/thekarangoel> > > ___ > Tutor maillist - Tutor@python.org > To unsu

Re: [Tutor] Strings.

2012-10-26 Thread David Hutto
; S has nothing inside of it. > >> >> print(s[0:])# it does not give error > #what does it give? >> print (s[13:13]) # this too does not give error > #What is the output >> why? > Did you at any point use s = {}? -- Best Regards, David Hutto CEO: http://w

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
ng.center(center_num).lower() a_string = raw_input("Give me a word, or letter: ") upper_or_lower = raw_input("upper, or lower character(s): ") center_num = int(raw_input("Where should number be centered?: ")) SwapCaseAndCenter(a_string, upper_or_lower, cent

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
ng = raw_input("Give me a word, or letter: ") upper_or_lower = raw_input("upper, or lower character(s): ") center_num = int(raw_input("Where should number be centered?: ")) SwapCaseAndCenter(a_string, upper_or_lower, center_num) -- Best Regards,

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
a_string = raw_input("Give me a word, or letter: ") upper_or_lower = raw_input("upper, or lower character(s): ") center_num = int(raw_input("Where should number be centered?: ")) SwapCaseAndCenter(a_string, upper_or_lower) -- Best Regards,

Re: [Tutor] Help Passing Variables

2012-10-26 Thread David Hutto
input("Where should number be centered?: ")) #call the function with the params, and look above to the function SwapCaseAndCenter(a_string, upper_or_lower) -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com ___ Tutor maillist

Re: [Tutor] On off Toggle

2011-03-12 Thread David Hutto
You want toggle_power to turn on or off. class Television(object): def __init__(self): pass def toggle_power(self, choice): if choice == 0: poweroff() if choice == 1: poweron() # you set a choice that won't work unless user says choice =

Re: [Tutor] Help with python-gnupg

2011-03-11 Thread David Hutto
On Sat, Mar 12, 2011 at 2:07 AM, David Hutto wrote: > As a matter of fact, looking at them with know *no* knowledge of the > module, it says it's a typeerror, and that it expects string or > buffer, but gets file. If this is the same error in both instances, > then it's t

Re: [Tutor] Help with python-gnupg

2011-03-11 Thread David Hutto
As a matter of fact, looking at them with know knowledge of the module, it says it's a typeerror, and that it expects string or buffer, but gets file. If this is the same error in both instances, then it's that output needs to be a string or buffer, so just string either the datae variable, or the

Re: [Tutor] Help with python-gnupg

2011-03-11 Thread David Hutto
On Sat, Mar 12, 2011 at 1:39 AM, Becky Mcquilling wrote: > If anyone is familiar with python-gnupg, I am having some difficulty with > the syntax.  I've tried the following: > f = open('c:/test/filename.txt', 'r') > datae = gpg.encrypt_file(f.read(), 'ladym...@gmail.com', > output=open('c:/gpg_tes

Re: [Tutor] Help with python-gnupg

2011-03-11 Thread David Hutto
Show the entire code, and error for both usages. The usages and a single error message for them both may be enough for someone not to try them out, and who can help you, if they knew more about the problem. Not everyone here will be an expert, but we do read direct code vs direct error, if we've b

Re: [Tutor] PyQuery

2011-03-10 Thread David Hutto
pseudo: for line in file: query = {} columnheader = line[0] headercontent = line[1] query[columnheader] = [header1content] ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailm

Re: [Tutor] help

2011-03-08 Thread David Hutto
The first hundred pages of a thorough python tutorial, and a c++ tutorial should have you doing both of those quite well in a day or so. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/

Re: [Tutor] Error while using calendar module in Python 2.7

2011-03-04 Thread David Hutto
>>> >>> while monday.weekday() != calendar.MONDAY: ... monday -= oneday ... oneweek = datetime.timedelta(days=7) ... nextweek = today + oneweek ... print "next week" ... Traceback (most recent call last): File "", line 1, in NameError: name 'monday' is not defined >>> This means

Re: [Tutor] Error while using calendar module in Python 2.7

2011-03-04 Thread David Hutto
Could you paste the whle code, because I get: >>> import datetime >>> import calendar >>> >>> >>> >>> while monday.weekday() != calendar.MONDAY: ... File "", line 2 ^ IndentationError: expected an indented block >>> monday -= oneday File "", line 1 monday -= oneday ^ Indentati

Re: [Tutor] Need some help on output

2011-03-04 Thread David Hutto
That depends on what your motivation is for learning python. I'd start with a few hello world tutorial online. like print "hello world"/ python 3.0 print("hello world"), and on that not, decide on the version you want to use on your system first. ___ Tuto

Re: [Tutor] Help!

2011-03-03 Thread David Hutto
On Thu, Mar 3, 2011 at 4:56 PM, Knacktus wrote: > Am 03.03.2011 22:28, schrieb Andrew Bouchot: >> >> okay so this is my comp sci lab >> * >> >> Problem: >> >> *ProductionTime.py It takes exactly 2 minutes and 7 second to produce an >> item. Unfortunately, after 143 items are produced, the fabricat

Re: [Tutor] Socket and Changing IP's

2011-02-28 Thread David Hutto
On Mon, Feb 28, 2011 at 7:02 PM, Jacob Bender wrote: > On 2/28/2011 6:57 PM, Wayne Werner wrote: > > On Mon, Feb 28, 2011 at 5:49 PM, Jacob Bender > wrote: >> >> Tutors, >> >>    I was looking into network programming, and I came across a problem. >> Socket programs need an IP address to function

Re: [Tutor] Bitwise operation

2011-02-28 Thread David Hutto
On Mon, Feb 28, 2011 at 4:43 AM, Martin A. Brown wrote: > >  : i'm confused with & and AND. for eg: >  : >>> 1110 & 0110 >  : 64 >  : >>> 1110 and 0110 >  : 72 >  : >  : i'm expecting if 1110 and with 0110 will get 0110 or 6. >  : pls advise. > > Above, python thinks you are representing one numbe

Re: [Tutor] licensing python work?

2011-02-23 Thread David Hutto
That's why I said to check the licenses from what you work upon(that gives more insight into what license you should use, and how you use it). More and more it's just docs, and functions for me, but initially, all of your "great" beginner projects, utilize what you find, and tutorials online are us

Re: [Tutor] licensing python work?

2011-02-23 Thread David Hutto
And in the end it is called open source, for a reason, so if you're not worried, just throw your name at the top, and don't even use a license, unless you want your name to be kept, in which case you might want to include"whether copied in whole, or part". We all scavenge for examples, until we ca

Re: [Tutor] licensing python work?

2011-02-23 Thread David Hutto
Remember to check the licenses of what your wrapper utilizes. According to theoretical physics, the division of spatial intervals as the universe evolves gives rise to the fact that in another timeline, your interdimensional counterpart received helpful advice from me...so be eternally pleased for

Re: [Tutor] licensing python work?

2011-02-23 Thread David Hutto
Read the licenses, and see which one fits your needs, or just put your own conditions at the top of each file. They can use it under your stated terms. http://www.google.com/search?client=ubuntu&channel=fs&q=open+source+licensing&ie=utf-8&oe=utf-8 On Wed, Feb 23, 2011 at 10:05 PM, Wayne Werner wr

Re: [Tutor] Python + Sound

2011-02-12 Thread David Hutto
On Sat, Feb 12, 2011 at 4:43 AM, Alan Gauld wrote: > > "David Hutto" wrote > >> and what is sound, electromagnetically transmitted, then turned into >> ones and zeroes. > > Just to be picky sound is mechanical waves not electromagnetic. > The ear is prima

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
> Pardon me while I chortle :) > > Like I said, start here: http://www.google.com/search?client=ubuntu&channel=fs&q=the+modern+telephone&ie=utf-8&oe=utf-8 Steven forgot a little in his elaboration,that he isn't an expert in this: -- According to theoretical physics, the division of spatial int

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
There doesn't even have to be a source file, or .o and.h and.c, it just executes the command lines in it. So just a makefile in a directory and typing make at the command line executes those commands. So you can do a whole reorientation of a system with just command line s in a makefile.

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
and a simple makefile, as I've recently understood, or a file that executes command lines, can do that. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
This is how i zip the file: david@david-HP-Pavilion-dv9700-Notebook-PC:~$ sudo gzip /usr/lib/openoffice/basis-link/share/gallery/sounds/apert.wav > /home/david/examp.gz[sudo] password for david: david@david-HP-Pavilion-dv9700-Notebook-PC:~$ Then they: david@david-HP-Pavilion-dv9700-Notebook-PC:

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
>> I have any file, gzip it, turn it to a sound file, you have a sound file, then gzip it. and then gunzip it on >> the other end. which requires an unzip utility on the other end, and then an app to play the sound files format. Using tones to specify bit patterns, I'll work that out >> after

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
On Sat, Feb 12, 2011 at 1:32 AM, Corey Richardson wrote: > On 02/12/2011 01:26 AM, David Hutto wrote: >> On Sat, Feb 12, 2011 at 1:24 AM, David Hutto wrote: >>>> The point is to specifically transmit the data as sound, and then turn >>>> the sound back into the g

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
On Sat, Feb 12, 2011 at 1:24 AM, David Hutto wrote: >> The point is to specifically transmit the data as sound, and then turn >> the sound back into the gzipped file. If I were doing this for anything >> other than my own entertainment and education, I'd do it some

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
> The point is to specifically transmit the data as sound, and then turn > the sound back into the gzipped file. If I were doing this for anything > other than my own entertainment and education, I'd do it some way that > made sense :-) > Do you mean just a wav file, and then send it to someone? _

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
On Sat, Feb 12, 2011 at 1:20 AM, Corey Richardson wrote: > On 02/12/2011 01:10 AM, David Hutto wrote: >> for some reason, if you're on linux, I wanna say use python's >> subprocess, and man pppd. also look into proc and a thread in the >> archives I did a

Re: [Tutor] Python + Sound

2011-02-11 Thread David Hutto
for some reason, if you're on linux, I wanna say use python's subprocess, and man pppd. also look into proc and a thread in the archives I did a while back. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail

Re: [Tutor] Splitting a string

2011-02-08 Thread David Hutto
On Tue, Feb 8, 2011 at 8:36 AM, Christian Witts wrote: > On 08/02/2011 15:04, tee chwee liong wrote: >> >> hi all, >> >> thanks for the advice. i modified my code to be: >> >> c=('01101') >> i=-1 >> try: >>    while 1: >>        i=c.index('0',i+1) >>        print "Lane fail",i >> except ValueError

Re: [Tutor] Splitting a string

2011-02-08 Thread David Hutto
Don't use the try and except, use a if else. I'm not as good as an explainer as the pros, but I can make enough sense if you respond back with a useful set of examples you've tried. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscrip

Re: [Tutor] Splitting a string

2011-02-08 Thread David Hutto
> To get a list, just ask for one: > list("abcd") > ['a', 'b', 'c', 'd'] > or., and this isn't to argue with anyone;), you could: >>> x = 'abcd' >>> y = [] >>> for letter in x: ... y.append(letter) ... >>> print y ['a', 'b', 'c', 'd'] which explains that the list is derived from the st

Re: [Tutor] Converting From Unicode to ASCII!!

2011-02-07 Thread David Hutto
And I forgot, that you don't have to install another version, but just boot from the live disk, and mount the partition. But from looking, you should be able to recover with linux utilities. Look here: http://aplawrence.com/Linux/lostlinuxpassword.htmlhttp://aplawrence.com/Linux/lostlinuxpassword.

Re: [Tutor] Converting From Unicode to ASCII!!

2011-02-07 Thread David Hutto
Also, If you can install a second version, then you should be able to mount the other version you're locked out of, then recover your files, and reinstall. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.

Re: [Tutor] Converting From Unicode to ASCII!!

2011-02-07 Thread David Hutto
On Mon, Feb 7, 2011 at 10:15 PM, Nevins Duret wrote: > Hello all, > > > >     Don’t know if I’ll be bashed on this forum for doing this, > but I will assure you I have the best intentions and > > simply want to apply a real world problem and how to go about solving it > using python3.1

Re: [Tutor] oops...sorry, just top posted again

2011-01-31 Thread David Hutto
On Mon, Jan 31, 2011 at 8:11 AM, Elwin Estle wrote: > ...but I have an excuse.  I had the thing saved in a drafts folder and just > hit send without thinking about it. > > ...I'll just go super glue broken glass to my hands and sprinkle itching > powder all over my body.  Is that penance enough?

Re: [Tutor] Accessing a secured webpage

2011-01-28 Thread David Hutto
On Fri, Jan 28, 2011 at 11:30 PM, Steven D'Aprano wrote: > Karim wrote: >> >> Hello, >> >> I want to create a client to access a webpage. But when I access it >> interactively  there is a dialog box >> which ask for login and password. > > You should read this: > > http://www.voidspace.org.uk/pyth

Re: [Tutor] placing widgets

2011-01-25 Thread David Hutto
Note when you answer yourself, it shows initiative and responsiveness to the situation you're trying to comprehend. -- The lawyer in me says argue...even if you're wrong. The scientist in me... says shut up, listen, and then argue. But the lawyer won on appeal, so now I have to argue due to a co

Re: [Tutor] Not understanding a bit of code behavior

2011-01-24 Thread David Hutto
On Tue, Jan 25, 2011 at 2:42 AM, Alan Gauld wrote: > > "Bill Allen" wrote > >> I am convinced that I had previously assigned part_list to out_list by >> reference, not value as I mistaken thought when I first wrote the code, > > In Python variables are names which refer to objects. > So your assi

Re: [Tutor] Telephone app

2011-01-23 Thread David Hutto
> Can you step back a bit and explain what it is you are trying to > accomplish? "flow through" and "functional flow through" are meaningless > terms in telecomms - at least so far as I am aware (after my 35 years in > telecomms engineering...) It's two fold. First is the obvious of conducting a

Re: [Tutor] Telephone app

2011-01-22 Thread David Hutto
I'm getting ahead and behind my self here. I'm going from electrician to programmer. So I'm tring to construct the 'flow through' and the functional flow through. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http:

Re: [Tutor] Telephone app

2011-01-22 Thread David Hutto
No, its just wondering whether it works like the USB, with two data pins, and -+, I know how the original works, but interpreting through computer language is a little disabling. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

[Tutor] Telephone app

2011-01-22 Thread David Hutto
This is just a reach question. What modules would i want to use if i wanted to just send the signal, and receive the signal, other than maybe, signal. In other words please tone.dumb it down, and show a pseudo example. -- The lawyer in me says argue...even if you're wrong. The scientist in me...

Re: [Tutor] Exercise suggestions

2011-01-22 Thread David Hutto
On Sat, Jan 22, 2011 at 3:02 PM, Corey Richardson wrote: > On 01/22/2011 11:56 AM, michael scott wrote: >> >> I am new to programming, I intend to get an entry level job programming >> next year (or a little bit longer). I am switching fields and not going >> to college, but kinda "self teaching"

Re: [Tutor] Tkinter in classes...why?

2011-01-20 Thread David Hutto
On Thu, Jan 20, 2011 at 2:43 PM, Elwin Estle wrote: > I have some experience in Tcl\Tk, and so far, Tkinter is striking me as > harder to use that Tk in it's "native" environment. > > I am attempting to re-write a program I originally did in Tcl\Tk in Python.   > I managed to get a GUI done using

Re: [Tutor] How to plot graph?

2011-01-19 Thread David Hutto
actually i just want to plot a simple x and y graph. any suggestion? how about using excel to plot? any sample code that i can follow to: 1) launch excel 2) read x-y from a text file 3) plot graph thanks x,y is simple in many modules(beyond is more computational. What version of python, platform

Re: [Tutor] Add rownumber to list of .arff files

2011-01-15 Thread David Hutto
>>> filename = ['file1','file2','file3'] >>> fileprefix = 'TRE_' >>> for item in filename: print('%s%s'%(fileprefix,item)) ... TRE_file1 TRE_file2 TRE_file3 or with list comp >>> combined = [('%s%s'%(fileprefix,item)) for item in filename] >>> combined ['TRE_file1', 'TRE_file2', 'TRE_file3'] >>>

Re: [Tutor] Add rownumber to list of .arff files

2011-01-15 Thread David Hutto
On Sat, Jan 15, 2011 at 12:02 PM, Daan Raemdonck wrote: > Dear all, > > > > I am reaching out to you because I have a small issue I need to deal with, > yet I feel that it requires pretty advanced coding to solve. > > I have a whole lot of .arff files that would simply need a case number added > t

Re: [Tutor] how to print random number multiply

2011-01-14 Thread David Hutto
On Fri, Jan 14, 2011 at 8:01 PM, David Hutto wrote: > Sorry , the tab button doesn't work for text in google mail, and it > jumped to send > >>> > >   import random >> for x in range(1,10): num = random.random() >       print (num) this should 

Re: [Tutor] how to print random number multiply

2011-01-14 Thread David Hutto
Sorry , the tab button doesn't work for text in google mail, and it jumped to send >>  import random > for x in range(1,10): print (random.random()) This assigns a new random each time, where as outside the for loop it assigns it once. ___ Tut

Re: [Tutor] how to print random number multiply

2011-01-14 Thread David Hutto
>  import random for x in range(1,10) > print (random.random()) -- Sometimes...my mama...says I get over excited about technology. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/li

Re: [Tutor] turn a path into nested list

2011-01-13 Thread David Hutto
It's like the were psychic...or intuitive . ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] turn a path into nested list

2011-01-13 Thread David Hutto
> Its not clear what exactly the sort criteria is, however have you looked > at the os.walk() function for traversing directory trees? It may be all > you need. it's amazing what the designers of the builtins left for your disposal. ___ Tutor maillist

Re: [Tutor] Command line scripts

2011-01-13 Thread David Hutto
On Thu, Jan 13, 2011 at 8:41 AM, David Hutto wrote: > As you can tell, I was excited, and impressed by my own work, and > therefore thought you should follow my wise and almighty work. On the flip side, it's like being an electrician, and seeing the lights come on when you hook

Re: [Tutor] Command line scripts

2011-01-13 Thread David Hutto
As you can tell, I was excited, and impressed by my own work, and therefore thought you should follow my wise and almighty work. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo

Re: [Tutor] Command line scripts

2011-01-12 Thread David Hutto
Although, you did just that, didn't pay attention to the whole thing. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Command line scripts

2011-01-12 Thread David Hutto
Although, I'd just go with a function that gets passed the text, that way it was reusable, like the one I gave. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Command line scripts

2011-01-12 Thread David Hutto
I think it works great as an easy integration for the blind(although I'm sure there is already a python module for that somewhere), as long as they have espeak(or it can be easily adapted), but also if you just like the ai feel of a voice in your apps. __

Re: [Tutor] Command line scripts

2011-01-12 Thread David Hutto
On Sun, Jan 9, 2011 at 9:03 AM, ALAN GAULD wrote: > > >> The following line is what I mean by calling a  command line from within the >>app >> using subprocess. >> >> self.espeak =  subprocess.Popen(['espeak', word],stdout  = >> subprocess.PIPE).communicate()[0] > > OK, Now I understand. > You wan

Re: [Tutor] Command line scripts

2011-01-09 Thread David Hutto
On Sat, Jan 8, 2011 at 9:10 AM, Alan Gauld wrote: > "David Hutto" wrote > >> If I use as command line script, is there any disruption in the >> execution of the code using wxpython. > > I don't understand the question. > wxPython is a GUI toolkit so

[Tutor] Command line scripts

2011-01-08 Thread David Hutto
This is somewhat of a cross post,but I think it applies here as well. If I use as command line script, is there any disruption in the execution of the code using wxpython. In other words, is a command line app different from bindings in a compiled app? @ trace def play(self, event =

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

2011-01-01 Thread David Hutto
You also can place: else: print " this is not a number" And: if guess == number: break if guess == number: guessesTaken = str(guessesTaken) print 'Good job, ' + myName + "! You guessed the number in " + guessesTaken + ' guesses!' which could be combined. if guess =

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

2011-01-01 Thread David Hutto
On Sat, Jan 1, 2011 at 12:02 PM, pete wrote: > Hi, > Please help just starting out and have come up with the following code to > create a simple guessing game. > > on line 30 print good job etc i get a syntax error! sure it's simple but > i've looked for ages and cant spot it! > > Regards > Pete

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread David Hutto
So in the end it boils down to: What you want the db to hold? When do you need the db to hold it? And... When and where is it necessary to access it by the user? Ah! Not an algorithm. Many paths, same destination...grasshoppa. ___ Tutor maillist

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread David Hutto
On Tue, Dec 28, 2010 at 9:18 PM, David Hutto wrote: > But in the case you need the db constantly open(such as tracking > something, where you update the db This assumes you don't connect directly to, but update from, for data analysis, not real time tracking. through some other

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread David Hutto
But in the case you need the db constantly open(such as tracking something, where you update the db through some other offsite db), then just committing the current would be suggestible(in my opinion), and keeping the update live to check periodically for changes in the timestamps of data from the

Re: [Tutor] Opening and closing SQLite db

2010-12-26 Thread David Hutto
Unless intermittent > saves are necessary within the app loop. Which is suggestible just in case the app or program crashes during use. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/

Re: [Tutor] Opening and closing SQLite db

2010-12-26 Thread David Hutto
On Sun, Dec 26, 2010 at 11:16 AM, Noah Hall wrote: > As a rule, I tend to open and close a connection based on what I'm doing > with the database. I +1 that. Usually if I open the db in a function, I commit and close. If it's in an app, for me personally, that should be the only place it takes pl

Re: [Tutor] Opening and closing SQLite db

2010-12-26 Thread David Hutto
Just for future reference, when it's part of the python standard library, always go to the docs for the full functions and methods available. http://docs.python.org/library/sqlite3.html It can make the usage a lot easier. ___ Tutor maillist - Tutor@py

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

2010-12-21 Thread David Hutto
On Tue, Dec 21, 2010 at 1:23 PM, Luke Paireepinart wrote: > You're not going to win any friends here Dave. Wasn't trying to. Steven is well known on this list. And that means something to you only. He is sometimes abrasive but it's rarely if ever malicious. Anytime he's ever been rude to me

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

2010-12-21 Thread David Hutto
On Tue, Dec 21, 2010 at 10:03 AM, Stefan Behnel wrote: > Alan Gauld, 21.12.2010 15:11: >> >> "Stefan Behnel" wrote And I thought a 1G file was extreme... Do these people stop to think that with XML as much as 80% of their "data" is just description (ie the tags). >>> >>> A

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

2010-12-21 Thread David Hutto
And a lesson of what you really are to anyone listening. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

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

2010-12-21 Thread David Hutto
you got nothing of real value. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

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

2010-12-21 Thread David Hutto
Me and you, apparently know exactly what i'm talking about... http://code.activestate.com/lists/python-tutor/79293/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

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

2010-12-21 Thread David Hutto
On Tue, Dec 21, 2010 at 9:40 AM, David Hutto wrote: > On Tue, Dec 21, 2010 at 9:36 AM, Steven D'Aprano wrote: >> David Hutto wrote: >>> >>> Establish that with fact that initiatially I didn't have a reason to >>> be hostile, and that your comment

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

2010-12-21 Thread David Hutto
On Tue, Dec 21, 2010 at 9:36 AM, Steven D'Aprano wrote: > David Hutto wrote: >> >> Establish that with fact that initiatially I didn't have a reason to >> be hostile, and that your comment of my kubit kaba here, and your >> comment on comp.pytho

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

2010-12-21 Thread David Hutto
And furthermore, I'm not the first, nor the last to get angry and frustrated on the internet. I'm not the first to get drunk, and type. And I dare any employer to deny me the right to MY personal time. ___ Tutor maillist - Tutor@python.org To unsubscrib

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

2010-12-21 Thread David Hutto
On Tue, Dec 21, 2010 at 9:32 AM, David Hutto wrote: > Take a look at the flame wars individuals see, comments by programmers > who are sarcastic, and think of the response you might have had to the > initial questions you had , and maybe even a few paranoid delusions > you got hack

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

2010-12-21 Thread David Hutto
Take a look at the flame wars individuals see, comments by programmers who are sarcastic, and think of the response you might have had to the initial questions you had , and maybe even a few paranoid delusions you got hacked. It's not a rewarding experience not being a college educated individual

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

2010-12-21 Thread David Hutto
Establish that with fact that initiatially I didn't have a reason to be hostile, and that your comment of my kubit kaba here, and your comment on comp.python.lang about your pystats, aftger our conversation, and your reference to it not being "set in stone", wasn't a reference tyo our statrs argume

  1   2   3   4   >