[Tutor] Help

2004-12-02 Thread Daniel
I need to know how to run another module through one what is the command do I have to include a path name and if there is any special way I have to save the file ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinf

[Tutor] Python beginner having troubles understanding word lists and character lists

2010-04-28 Thread Daniel
Hello, I'm a beginner programmer, trying to learn python. I'm currently reading The programming Historian, http://wiki.python.org/moin/BeginnersGuide/NonProgrammers I stumbled into lists of words and lists of characters. I have no explications in that book for those two and I didn't found some expl

[Tutor] Python Book recomandation!

2010-07-15 Thread Daniel
Hello, I recently browsed the BeginnersGuide/NonProgrammers section of the Python website, but I have a question regarding it. With what book I should start learning Python? Or should I take them in the order they are presented there on the website?I have no previous programming experience, thanks.

[Tutor] Questions regarding strings

2010-08-08 Thread Daniel
Hello everyone! I would like to ask you two questions regarding strings which I do not know. Excuse me in advance if the questions may seem a bit dumb. I'm a beginner. So let's get back to the point, this is my string: msg= 'Hello world' If I do, msg[:3] I get the following output, 'Hel' If I do,

[Tutor] Question about strings

2010-08-09 Thread Daniel
Hi, I'm trying to solve an exercise, a beginners one but I have a question. So the exercise sounds like this: Define a string s = ’colorless’. Write a Python statement that changes this to ’colour- less’, using only the slice and concatenation operations. So I did wrote this: *1)s = 'colorless'

[Tutor] Function object

2010-08-25 Thread Daniel
Hello again, seems like in my journey to learn Python I have stumbled into another problem regarding understanding a concept- function object. As I said, I do not understand what a function object is, what it does, and what can I do with it? I'm currently reading Think python, but the book is not c

Re: [Tutor] Function object

2010-09-12 Thread Daniel
What can I say except, thanks so much everyone for taking your time and writing me an explication. I finally understood what function objects are. Thanks, really thanks for helping me out. I wish everyone the best. ___ Tutor maillist - Tutor@python.org

[Tutor] get bytes back from string representation?

2009-04-12 Thread Daniel
e rawByte from string to bytes, then explain it as text with encoding (like "UTF-8"). Any simple way to convert this string back to bytes? I am not clear with that. Thanks, Daniel. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] get bytes back from string representation?

2009-04-13 Thread Daniel
(also cc tutor) Thank you, Alan. I found the solution. the type of rawByte in SOAP is so I need to convert it back to ascii with binascii module, like: >>> btxt = binascii.a2b_base64(page.rawByte) then btxt can be treated as a normal string. thanks, Daniel On Mon, Apr 13, 2009 a

[Tutor] problem with a simple logger with RotatingFileHandler

2009-04-14 Thread Daniel
7;__main__': test_logger() but the mylog.txt is empy after running. is there something I missed. Thanks, Daniel. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread Daniel
Hi Tutors, I want to use python to finish some routine data processing tasks automatically (on Windows). The main task could be split to sub small tasks. Each can be done by executing some small tools like "awk" or by some other python scripts. One example of such task is conducting a data proces

Re: [Tutor] any best practice on how to glue tiny tools together

2009-02-06 Thread Daniel
These are really valuable info. I will try. Thanks a lot. On Fri, Feb 6, 2009 at 7:44 PM, Kent Johnson wrote: > On Fri, Feb 6, 2009 at 4:11 AM, Daniel wrote: > > Hi Tutors, > > > > I want to use python to finish some routine data processing tasks > > automaticall

Re: [Tutor] python function to know the path of the program in execution *

2010-02-05 Thread Daniel Sarmiento
go once. I don't know if that's what you are looking for. You might want to take a loook at http://pyref.infogami.com/__file__ HTH Daniel ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Bowing out

2010-03-03 Thread Daniel Sarmiento
ou keep it online... again, thank you for all the years you helped the python community. Farewell Kent. Daniel ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tutor Digest, Vol 78, Issue 8

2010-08-01 Thread Daniel Sarmiento
gs ( http://en.wikipedia.org/wiki/Time-of-check-to-time-of-use ) Without knowing what your code does, I think it will be something like: try: F_unused = open(path1, 'rb') F_used = open(path2, 'rb') except IOError: print("no") . else: unused_ints = p

Re: [Tutor] How to get script to detect whether a file exists?

2010-08-01 Thread Daniel Sarmiento
hat your code does, I think it will be something like: try: F_unused = open(path1, 'rb') F_used = open(path2, 'rb') except IOError: print("no") . else: unused_ints = pickle.load(F_unused) .. HTH Daniel Sarmiento S. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Getting exposure to high quality Python code

2009-05-27 Thread Daniel Brown
ative sources to help me develop my Python style... Cheers, Daniel “The best laid schemes o' mice an' men, gang aft agley” ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] PyQt Signal

2009-06-11 Thread Daniel Sarmiento
Hello I am starting to use PyQt, and I'm trying to send a signal across threads, but I get the following error: Traceback (most recent call last): File "/home/daniel/NetBeansProjects/aeropuerto/main.py", line 34, in form = AeropuertoDlg() File "/home/daniel/NetBean

[Tutor] Very basic Python question

2009-06-26 Thread Daniel Sato
n I enter Python from the terminal, by typing python, I can no longer import items in this way unless the .py file is in my user folder /Users/Me. How can I change my settings so that I can import .py files from a separate directory such as /Users/Me/Documents/PyMods? Thank you. -daniel s

Re: [Tutor] Very basic Python question

2009-06-26 Thread Daniel Sato
, 2009 at 10:16 PM, Luke Paireepinart wrote: > Daniel Sato wrote: > >> Hi, >> >> Let me preface this by saying that I purchased O'Reilly's "Learn Python" >> yesterday and have no programming experience (I am a photographer by trade) >> except fo

[Tutor] GASP on OSX 10.5.6

2009-06-29 Thread Daniel Sato
help would be greatly appreciated. Thanks! -Daniel -- Daniel Sato http://www.danielsato.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Needing Help

2009-06-30 Thread Daniel Woodhouse
You can use something like pastebin.com if you don't want to post huge chunks of code. You could also just tell us what problem occurred, was there a traceback (error message)? On Tue, Jun 30, 2009 at 8:06 PM, Bob Rea wrote: > I am jsut beginning to learn python form a book. I have run > into a

[Tutor] Python Programming exercise

2009-06-30 Thread Daniel Sato
is here: http://python.pastebin.com/m6036b52e -- Daniel Sato http://www.danielsato.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is my style OK in this elementary student exercise?

2009-07-04 Thread Daniel Woodhouse
our code in get_dict() was repeated (basically the same operations to get the key and the value). You should try to avoid duplication if possible, either by putting the code in a seperate function, or just collecting everything at once as I have done. Regards, Daniel Woodhouse On Sat, Jul 4, 20

Re: [Tutor] Saving class instances

2009-07-13 Thread Daniel Woodhouse
Regards, Daniel Woodhouse On Mon, Jul 13, 2009 at 5:21 PM, Thomas Scrace wrote: > Hi everyone, > > I am new to Python (and to programming) and, now that I have worked through > most of Learning Python, I have set myself the exercise of writing a little > text-based program t

Re: [Tutor] Challenge

2009-09-22 Thread Daniel Sarmiento
[20]: outcomes = {'head':0, 'tail':0} In [21]: for i in range(100): : outcomes[choice(pos)] += 1 : : In [22]: print outcomes ---> print(outcomes) {'head': 46, 'tail': 54} HTH Daniel Sarmiento. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Is Tkinter the Gui in python

2005-01-13 Thread Abel Daniel
better of with say, pygtk. However, pygtk afaict isn't available on as many platforms as tkinter. So tkinter is a good module to use if you only want simple widgets, but be prepared to switch to something newer when you hit it's limitations. -- Abel Daniel

[Tutor] Re: python's default argument value handling in functions - weird syntax? problem grappling with the concept

2005-02-09 Thread Abel Daniel
labels", a bit longer) ps. For extra wierdness, in python "there is only one number 5" isn't true for large numbers: >>> a=100 >>> b=100 >>> a is b False Using a large number is important: integers up to 99 are cached, so they _are_ unique (we would get True above). For larger numbers, the cacheing is more subtle, for example: >>> a, b = 100, 100 >>> a is b True -- Abel Daniel ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Perl Symbology

2005-02-10 Thread Abel Daniel
Bill Mill writes: > I get the impression that many pythonistas don't like string > interpolation. I've never seen a clear definition of why. >From "import this": Explicit is better than implicit. And doesn't perl's method mean that you have to escape _every_ _single_ '$' in strings? I think

Re: [Tutor] Fixing garbled email addresses

2007-05-01 Thread Daniel Yoo
Hi Dotan, Just for reference, the weirdness that you're seeing before the email addresses in your text file are "MIME-encoded" strings. http://en.wikipedia.org/wiki/MIME Concretely, the string "=?UTF-8?B?157XqNeZ15Qg15nXoNeY16bXnw==?=" is an encoding of a string in MIME format, and

Re: [Tutor] (no subject)

2007-05-20 Thread Daniel McQuay
Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Daniel McQuay boxster.homelinux.org H: 814.825.0847 M: 814-341-9013 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] smtplib howto send with a subject line

2007-05-23 Thread Daniel McQuay
bject line. Any help would be much appreciated. ### #Created by: Daniel McQuay #This script will send and email #to verify if the backup was #successful or not. ### import smtplib import sys emmssg = "/tmp/backup.log" smt

Re: [Tutor] smtplib howto send with a subject line

2007-05-23 Thread Daniel McQuay
; [mailto:[EMAIL PROTECTED] On Behalf Of Daniel McQuay > Sent: Wednesday, May 23, 2007 1:49 PM > To: tutor@python.org > Subject: [Tutor] smtplib howto send with a subject line > > Hey Guys, I'm having a problem with my script that sends out > an email using smtplib. Whats happenin

Re: [Tutor] smtplib howto send with a subject line

2007-05-23 Thread Daniel McQuay
> [mailto:[EMAIL PROTECTED] On Behalf Of Daniel McQuay > Sent: Wednesday, May 23, 2007 3:52 PM > Cc: tutor@python.org > Subject: Re: [Tutor] smtplib howto send with a subject line > > Thanks Mike, it seems that I'll be easy to incorporate that > into my script as well. >

Re: [Tutor] trouble with indents

2007-05-28 Thread Daniel McQuay
Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Daniel McQuay Linux Padawan Jaluno.com H: 814.825.0847 M: 814-341-9013 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Automating Windows (Maintenance)

2007-07-02 Thread Daniel McQuay
ments the hard drive but I would like to know if Python is a good candidate for this or should I just stick to what is built into Windows. Thank in advance, -- Daniel McQuay HDR Time Traveler www.pittbullsecure.com www.Jaluno.com H: 814.341.9013 M: 814.421

[Tutor] How to put an event into the Tcl/Tk event queue?

2007-08-26 Thread Daniel Knierim
Hi All, I'm starting to learn how to use the TkInter module. So far I've got a couple versions of 'hello world' working. I'd like to simulate user input to TkInter applications from another Python script, by inserting events in the Tcl event queue. Tcl/Tk has a couple functions for this (Tk_

Re: [Tutor] Counting method calls

2007-09-23 Thread Daniel Kavic
Ok I have been a multimedia major for a few years now. I have tried javascript and that was bad, Java is just too difficult, so I joined this mailing list a while back. I have been frustrated because I just don't get entirely how OOProgramming works and how to actually write the stuff corre

[Tutor] TypeError in base class __init__ after reload

2008-01-23 Thread Daniel Knierim
Hello Pythonistas, Running the script 'instantiate_and_reload.py' gives me the error TypeError: unbound method __init__() must be called with ParentClass instance as first argument (got ChildClass instance instead) on the last call to ChildClass(), at line 23. The earlier calls don't trigge

[Tutor] Website Retrieval Program

2005-08-24 Thread Daniel Watkins
I'm currently trying to write a script that will get all the files necessary for a webpage to display correctly, followed by all the intra-site pages and such forth, in order to try and retrieve one of the many sites I have got jumbled up on my webspace. After starting the writing, someone introduc

[Tutor] Remote Directory Reading

2005-08-25 Thread Daniel Watkins
n general as I would quite like to develop it myself as a learning project (this being my first proper script). Cheers muchly, Dan spider.py """ import re import urllib import distutils.dir_util site = "http://www.aehof.org.uk"; localdir = "/home/daniel/test/" d

Re: [Tutor] Print Output Location in Windows XP

2005-09-02 Thread Daniel Watkins
On Sat, 2005-09-03 at 03:30 +0100, Tom Strickland wrote: > > How do I get the output window to stay open, or where is the output > stored? You can open up a command prompt before running the program, which will allow you to see the output as the program runs. You get to this by 'Start > Run..' or

Re: [Tutor] python strings?

2005-09-08 Thread Daniel Watkins
On Thu, 2005-09-08 at 15:15 +0100, [EMAIL PROTECTED] wrote: > for i in range(10): > principal = principal * (1 + apr) To calculate compound interest, you in fact don't need to use a loop at all (you could use: 'final = principal * (apr ** years)') but if you really want to use a loop,

Re: [Tutor] python strings?

2005-09-08 Thread Daniel Watkins
On Thu, 2005-09-08 at 21:00 +0100, Alan G wrote: > Not so. print automatically calls str() on all its arguments so > the programmer doesn't need to. So it does. I think I was trying to concatenate, which it doesn't like. Sorry if I caused any confusion. Dan ___

Re: [Tutor] FW: Frustrated Beginner

2005-09-29 Thread Daniel Watkins
Rosalee Dubberly wrote: > ## Now I am trying to modify the function to replace eggs with toast > and spam with jelly. I have spent days and nothing works. Can you send > me in the right direction?? The obvious answer (that has already been mentioned) is to simply replace the words in the actual p

Re: [Tutor] FW: Help Needed

2005-10-05 Thread Daniel Watkins
When I am in Python Shell of the IDLE GUI, when I click Edit/Run Script, I am getting a dialog box that is titled “Not saved” and states “The buffer for Python shell is not saved. Please save it first.” With an “OK” button that just takes me back to the

[Tutor] Importing Modules Within Classes

2005-10-06 Thread Daniel Watkins
Recently, there has been an example of someone importing modules within a class definition. eg: class Exemplar: import re ...use re... It seems obvious to me that this is incorrect, though more through training than actual observation on my part, and it should be: import re clas

Re: [Tutor] FW: Is it Posible? To Crack And HowTo

2005-10-07 Thread Daniel Watkins
> > I've already read before, it's not hacking I'm into now but a > similar thing, Cracking Hacking and cracking are two completely different things. Hacking is a developer with some real talent actually making a contribution to computing by writing something of use. Cracking is a jackass who's too

Re: [Tutor] FW: FW: Is it Posible? To Crack And HowTo [horribly OT]

2005-10-08 Thread Daniel Watkins
> Really? I was of the impression that proprietory code developers *ate* > small children. Goes to show, can't believe everything you read on > Slashdot. I heard that they write all their programs using the blood of cute-looking puppies (though how that doesn't short-circuit anything I'd like to

[Tutor] Code Inspection

2005-10-09 Thread Daniel Watkins
Hey list, I've been working on my spider program (albeit not very much :P) and I would appreciate it if I could get some comments on the code. I'm fairly sure I haven't chosen the best method to do what I want to do, but if we can just assume that I have, that'll make things easier. ;) In particul

Re: [Tutor] line question

2005-10-10 Thread Daniel Watkins
> There are four points with coordinates: > 2,3;4,9;1,6;3,10. > How to use Python to draw one perpendicular bisector between (2,3) and > (4,9); > the other perpendicular bisector between (1,6)和(3,10); > then, makes the output like: > l1 a b c > l2 a b c > (Note: l indicates the perpendicular

[Tutor] Storing Dictionaries Externally

2005-10-22 Thread Daniel Watkins
Currently, I'm writing a little project which needs to store a dictionary in an external file (so it can be accessed by another program). However, no matter how much I try, I cannot get Python to import the dictionary from the file properly. However, I know the problem. Whatever format I put the da

[Tutor] problem with IDLE

2005-12-01 Thread Daniel McQuay
ess a port? if so, what port? I would like to be able to make rule so that I can keep the firewall running and have no problem starting IDLE. Thank you in advance,-- Daniel McQuay814.825.0847 ___ Tutor maillist - Tutor@python.org http://mail.python.o

Re: [Tutor] problem with IDLE

2005-12-01 Thread Daniel McQuay
ED] [mailto: [EMAIL PROTECTED]] On Behalf Of Daniel McQuaySent: Friday, 2 December 2005 1:48 p.m.To: Tutor@python.orgSubject: [Tutor] problem with IDLEHello list, I just got a Windows box up and running. When I go to use IDLE I get an error saying something along the lines of, "ID

[Tutor] Guessing a number with limited no. of tries game gone wrong.

2006-03-28 Thread Ros Daniel
I am a newbie at Python. Just bought Python Programming 2nd ed. by Michael Dawson. While I understand the concepts as the book is going through the code, and I am able get the same results, when it comes to applying what I've learned to the exercises at the end of each chapter, I seem to be stu

[Tutor] Urgent question about program debugging

2006-04-05 Thread Ros Daniel
I just created a "who's your daddy?" program--one of the challenges in the michael dawson book. It was working well, and I tested all the different instructions, and then for some reason, it stopped working. Specifically, whenever I enter the name of a father, it tells me it doesn't exist, althoug

Re: [Tutor] Cancel Subscription

2006-04-21 Thread Daniel McQuay
? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > -- Daniel McQuay Dead Possum Prod

[Tutor] Splitting strings into blocks

2006-04-30 Thread Daniel Watkins
Hi list, I'm currently working on a program to parse LaTeX style maths expressions and provide an answer. For example, I have the expression "2^\frac{1}{2}". I'm trying to work out a way to split this into it's most basic blocks of LaTeX (i.e. 2^ and \frac{1}{2}) while maintaining a record of th

[Tutor] cisco router + telnetlib

2006-05-24 Thread Daniel McQuay
t;> I have also attached the script that I use. could you please point me in the right direction.thank you in advance,-- Daniel McQuayboxster.homelinux.org Dead Possum Productions814.825.0847 import getpass import sys import telnetlib HOST = raw_input("Enter IP: ") password =

[Tutor] crontab or python mistake

2006-05-25 Thread Daniel McQuay
recent call last):  File "/root/scripts/boxster_school_smtp.py", line 19, in ?    mssg = open('mssg.txt', 'r').read()IOError: [Errno 2] No such file or directory: ' emmssg.txt'the emmssg.txt file is in the /root/script directory so i don't know why it cant

Re: [Tutor] please remove this address from list: [EMAIL PROTECTED]

2006-06-12 Thread Daniel McQuay
_Tutor maillist  -  Tutor@python.org http://mail.python.org/mailman/listinfo/tutorsorry,-- Daniel McQuay[EMAIL PROTECTED] boxster.homelinux.orgH: 814.825.0847M: 814-341-6233 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Beginner Question

2006-06-18 Thread Daniel McQuay
nt>>>>which gives me the number of characters in the message.  I tried to use a>for loop:>>>>for i in range(len(message)-1,-1, -1): >> print i,>>>>but I just get the numeric values of the string.  Can anyone help?>>>>Also, does any

Re: [Tutor] activestate

2006-07-09 Thread Daniel Watkins
Danny Yoo wrote: > If it turns out that this is a good long-term solution, we'll change the > links on the Tutor mailing list page from ActiveState's searchable archive > to the one on gmane. I've been using gmane for a few months now, without any problems. Dan __

Re: [Tutor] Splitting

2006-07-09 Thread Daniel Watkins
Abhinav Gaurav wrote: > Example :- > >>> a="43;dsds;d" b=a.split(';') > Can anybody help on resolving this issue? This is what it looks like on my computer: >>> a="43;dsds;d" >>> b=a.split(";") >>> print b ['43', 'dsds', 'd'] This is using Pyt

Re: [Tutor] how to remove html ags

2006-08-12 Thread Daniel McQuay
t to remove and i triedstr = str.replace('(.*)','')it doesnt workthanks Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. ___Tutor maillist  -  Tutor@python.org http://mail.python.org/

Re: [Tutor] suggestions for read unread items datastructure

2006-08-13 Thread Daniel McQuay
useful response. Please tell us more.--Bob Gailer510-978-4454___Tutor maillist  -  Tutor@python.org http://mail.python.org/mailman/listinfo/tutor-- Daniel McQuay[EMAIL PROTECTED] boxster.homelinux.orgprowisegu

Re: [Tutor] Where to post a Python Program

2006-09-05 Thread Daniel McQuay
are several websites that allow you to post your code for review. I think one of the best ones is [http://pastebin.com/]. You should also have a look at [http://pastebin.ca/] (not sure if they are affiliated) which happened to turn up during a google search.   HTH, Daniel McQuay www.prowiseguy

[Tutor] Looking for an edutainment-type introduction to programming book

2006-09-29 Thread Abel Daniel
ubtle, and more motivating than that. Any suggestions? -- Abel Daniel ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] One million and counting

2006-11-02 Thread Daniel McQuay
  -  Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor -- Daniel McQuayboxster.homelinux.orgH: 814.825.0847M: 814-341-9013 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Best way to learn python

2006-12-29 Thread Daniel kavic
What is the best way for someone who is not very efficient in mathematics to learn Python, I was turned away from C++ and others because of the math issue. Ruby has been recommended as well. ___ Tutor maillist - Tutor@python.org http://mail.python.

[Tutor] Starting python from a DOS prompt from any directory?

2006-12-30 Thread Daniel McQuay
execute python from there. but there seems to me to be a way to achieve what i want to do. sorry for such a newbie question but i would like to figure this out because there are some situations where i need that to work from any directory. thanks in advance, -- Daniel McQuay boxster.homelinux

Re: [Tutor] Starting python from a DOS prompt from any directory?

2006-12-31 Thread Daniel McQuay
illist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Daniel McQuay boxster.homelinux.org H: 814.825.0847 M: 814-341-9013 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Starting python from a DOS prompt from any directory?

2007-01-02 Thread Daniel McQuay
if in fact you can. Curious, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor regards, -- Daniel McQuay boxster.

[Tutor] learning curve

2007-01-29 Thread Daniel Klose
Hi all, All I would like to do is take a file and count the number of times a letter occurs in it. It so happens that there letters are amino acids. There are also some other checks in the script but these are not a concern just yet. What I would like to do is create a dictionary of arrays. In p

Re: [Tutor] learning curve

2007-01-29 Thread Daniel Klose
! I am only running python 2.4 and the system admin doesn't like me so I won't ask him to upgrade it. Kent Johnson wrote: > Daniel Klose wrote: >> Hi all, >> >> All I would like to do is take a file and count the number of times a >> letter occurs in it. It so

Re: [Tutor] curious struct problem

2007-02-05 Thread Daniel Yoo
On Mon, 5 Feb 2007, Marcus Goldfish wrote: > I think I found the problem: the last chunk read is incomplete, so there > is size(chunk) is not sufficient to unpack according to the format > string. Good! I'm glad you found the problem. ___ Tutor mai

Re: [Tutor] CRC calculation with python

2007-02-06 Thread Daniel Yoo
On Tue, 6 Feb 2007, Johan Geldenhuys wrote: > I'm not a C++ expert at all and I would like to find out if somebody can > explain to me how the statement below can be done in Python? > > """ > _uint16 ComCRC16(_uint8 val, _uint16 crc) > { >_uint8 i; >_uint16 cval; > >for (i=0

Re: [Tutor] How does this work?

2007-02-06 Thread Daniel Yoo
On Tue, 6 Feb 2007, Tony Cappellini wrote: > this is the caller > ## > callee=open("tester.py").read() > exec(callee) > eval("main(['', 'argument'])") > > ## > this is the callee which is saved in tester.py > ##

Re: [Tutor] How does this work?

2007-02-06 Thread Daniel Yoo
On Tue, 6 Feb 2007, Daniel Yoo wrote: >> this is the callee which is saved in tester.py >> ## >> import sys >> >> def main(arg): >> if arg != []: >> print"\nArgument is %s" % arg

Re: [Tutor] Range of float value

2007-02-08 Thread Daniel Yoo
On Thu, 8 Feb 2007, Johan Geldenhuys wrote: > OK, this what I wanted: > > I have a value: a = 48.41 > > My lowValue is: lowValue = 48.35 > My highValue is : highvalue = 48.45 Range does not work on floats: it's meant to work on integers. > I though that it could be possible to have a range b

Re: [Tutor] Identity operator (basic types)

2007-02-09 Thread Daniel Yoo
>> Why does the identity operator return "True" in the below cases, >> that is when assigning the same value to basic variable types >> (float, integer, string, bool..)? Are these rcopied by reference >> (shallow)? If so why? >> > i = 10 > j = 10 > i is j >> True The above you have

Re: [Tutor] Creating an Identifier or Object Name from a String?

2007-02-10 Thread Daniel Yoo
>> I thought when I read the 2002 thread with the subject (Creating an >> Identifier or Object Name from a String?), that I had found a solution >> to my problem. Wait. But what was the solution you ended with? If the conclusion of that thread was to use eval(), then that was the wrong lesso

Re: [Tutor] Unpickling data after passing over the network

2007-02-11 Thread Daniel Yoo
> a socket. Right now, I am pickling a basic string base 64 encoding and > sending the data over the network. After the recipient client/server > receives the data, it is decoded and then unpickled. The unpickling > fails with an EOFError, and I am not sure why. Hi Adam, Did you "flush" the

Re: [Tutor] please help me

2007-04-13 Thread Daniel Yoo
> If this is homework, please tell your teacher I helped - I need the > extra credit. Please avoid giving homework answers like this. Rather than actually help the person, it can do harm, because it encourages a lazy attitude toward solving problems. ___

Re: [Tutor] Command line args

2007-04-13 Thread Daniel Yoo
Hi Teresa, Has anyone on this thread already suggested the 'fileinput' module? From what I understand, what 'fileinput' does is exactly what you're asking from: http://mail.python.org/pipermail/tutor/2007-April/053669.html Here's documentation on 'fileinput': http://www.python.org/

Re: [Tutor] beautifulSoup and .next iteration

2007-04-13 Thread Daniel Yoo
> anchors = soup.findAll('a', { 'name' : re.compile('^A.*$')}) > for x in anchors: >print x >x = x.next >while getattr(x, 'name') != 'a': > print x > And get into endless loops. I can't help thinking there are simple and > obvious ways to do this, probably many, but as a rank beg

[Tutor] Fwd: Begining Python

2008-03-12 Thread Daniel kavic
Begin forwarded message: From: Meftah Tayeb <[EMAIL PROTECTED]> Date: March 12, 2008 4:39:46 AM EDT To: Terry Carroll <[EMAIL PROTECTED]>, python tutor Subject: Re: [Tutor] Begining Python hi my friend, i have active python installed and the python-Win is Ready but i have a Very Small proble

Re: [Tutor] getting error in uploading a file

2008-07-15 Thread Daniel Sarmiento
That's a web server error, not a python error. You can find more information by checking the server's log. >From the error message it look like you are using apache and red hat. I use debian and my error logs are stored is in /var/log/apache2 by default. Check you apache configuration file and f

Re: [Tutor] Advice for my function, isPrime(n), please

2008-07-21 Thread Daniel Sarmiento
What about the following function? if x == 0: return False return True I am a beginner, but I think it is more clear (at least to me) what the function does. And it is only one line longer than value = (x != 0) return value ___ Tutor maillist -

Re: [Tutor] Memory error - how to manage large data sets?

2008-07-28 Thread Daniel Sarmiento
Hi I tried to run your code and checked (with top) the memory ussage and it uses more than 2 Gb of memory. I tried to modify the code a little bit to use less memory and came up with this: fib = {0:0,1:1} even = [] def fibonacci(x,y): return x+y for j in xrange (2,100): i = fib[j-1]

Re: [Tutor] Memory error - how to manage large data sets?

2008-07-28 Thread Daniel Sarmiento
>(the solution, of course, is to avoid storing all those numbers in the >first place) I tried this: fib = {0:0,1:1} sum = 0 for j in xrange (2,100): i = fib[j-1] + fib[j-2] if i % 2 == 0: sum += i fib = {j-1:fib[j-1], j:i} print sum I guess it should come up with the ri

[Tutor] Graphically Display Binary Trees

2008-08-23 Thread Daniel Sarmiento
Hi I am working on a red-black binary tree class. I would like to print it in a nice, graphical way. I have never done any GUI programming, or generated any graphics in python, before. What libraries would you use, what's the most straight forward way to achieve what I want? Thank you. _

Re: [Tutor] Graphically Display Binary Trees

2008-08-24 Thread Daniel Sarmiento
Thank you for your suggestions, I created a working prototype now, http://dpaste.com/73630/ Daniel > On Sat, Aug 23, 2008 at 4:08 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Graphviz's dot is an amazing way to produce graphics from graph data. > pydot can produce the

Re: [Tutor] Name Generator

2008-09-19 Thread Daniel Sarmiento
Try taking a look at nltk: http://nltk.org > Date: Fri, 19 Sep 2008 12:05:39 +0200 > From: Daniele <[EMAIL PROTECTED]> > Subject: [Tutor] Name Generator > To: tutor@python.org > Message-ID: ><[EMAIL PROTECTED]> > Content-Type: text/plain; charset="utf-8" > > Hi list, > I'd like to implem

Re: [Tutor] casting string to integer in a list of lists

2009-01-09 Thread Daniel Sarmiento
I am not an expert and don't know if this is considered 'elegant', but this is what I would try conv = [[j[0], int(j[1]), int(j[2])] + j[3:] for j in LoL] > Hi Your, > > I work with genomic datasets as well and have recently only started > working with python (so my advice is a bit naive) > >

[Tutor] PMW combobox won't display properly using X

2011-02-09 Thread Daniel Barnette
I've written a Python gui using Python Mega Widgets (PMW) that works beautifully when run natively on Windows or Linux. However, when I run the app on a Linux box and try to display it back to my Windows box using an X server (like freeXer or XMing), the combobox widget's drop-down menu is squashe

Re: [Tutor] Tutor Digest, Vol 84, Issue 56

2011-02-14 Thread Daniel Otero
tutor-requ...@python.org wrote: >Send Tutor mailing list submissions to > tutor@python.org > >To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/tutor >or, via email, send a message with subject or body 'help' to > tutor-requ...@

Re: [Tutor] Tutor Digest, Vol 84, Issue 78

2011-02-22 Thread Daniel Bankston
On 2/22/2011 8:03 PM, tutor-requ...@python.org wrote: Send Tutor mailing list submissions to tutor@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/tutor or, via email, send a message with subject or body 'help' to

[Tutor] PYLOTDB open source MySQL database management and analysis tool now available

2012-05-08 Thread Daniel Barnette
Many readers have asked whether there's Python GUI software for creating, managing, and analyzing MySQL databases. I have just released such software as completely open source. Source code is available on GitHub as follows: 1. Install Git on your machine from github.com 2. Initialize the target di

[Tutor] Python help

2012-09-15 Thread Daniel Hulse
Hi. I am trying to solve a problem and I'm stuck. The problem is something like as x goes up by 1, y goes up by the previous value times 2. I have no idea where to start. So lets say x = 10 and y=5, when x=11, why would be equal to 10. ___ Tutor maill

  1   2   >