[Tutor] How would I replace the data of a Pandas Series with the values of a dictionary?

2019-07-16 Thread Daniel Bosah
Hi all, I have a problem trying to match items in a dict and pandas series in Python. I have a dict ( called city_dict )of cities and city_id's ; for each city ( which is a key in the dict ), a unique city_id is a value in that dict. So for example, city_dict = { New York : 1001, LA : 1002, Chic

[Tutor] Parsing and collecting keywords from a webpage

2018-06-20 Thread Daniel Bosah
# coding: latin-1 from bs4 import BeautifulSoup from urllib.request import urlopen import re #new point to add... make rest of function then compare a list of monuments notaries ( such as blvd, road, street, etc.) to a list of words containing them. if contained, pass into new set ( ref notes in c

[Tutor] Recursion depth exceeded in python web crawler

2018-06-14 Thread Daniel Bosah
I am trying to modify code from a web crawler to scrape for keywords from certain websites. However, Im trying to run the web crawler before I modify it, and I'm running into issues. When I ran this code - *import threading* *from Queue import Queue* *from spider import Spider* *from domain i

[Tutor] Figuring out selective actions in Python

2018-05-05 Thread Daniel Bosah
Hello, I'm trying to figure out how to do blank in blank things. For example, if I want to delete 5 MB ( or anything ) for every 20 MB, how would the could look like? I'm essentially trying to do an action in one order of the sequence out of an entire sequence. Thank you for your help __

[Tutor] Matplotlib scatterplot help

2018-04-30 Thread Daniel Bosah
I have a function in which returns scatterplot of a Isomap function, which takes output from a TF-IDF function, which calculated TF-IDF values of certain articles online. I used four articles and I want to show the

[Tutor] How to Load Every Revised Wikipedia Page Revision

2018-02-19 Thread Daniel Bosah
Good day, I'm doing research for a compsci group. I have a script that is supposed to load every revised page of a wikipedia article on FDR. This script is supposed to, in while loop access the wikipedia api and using the request library, access the api if the continue is in the requests update

[Tutor] How to get all previous revision entries of a wikipedia page?

2018-02-16 Thread Daniel Bosah
Hello, I'm doing research for a compsci group. I'm new at Python, and my task is the use the Wikipedia API to get all the previous revision entries of a Wikipedia page and collect them in one list. Now, I'm totally lost on how to do this. I have never used a API before, and I'm not sure how to us

[Tutor] Data Structures printing and Python Package creation

2018-02-03 Thread Daniel Bosah
I'm in a research group for school, and my first task is to learn how to make a Python package and to learn how to print out all types of data structures. Are there resources I can be pointed to to help me out. Thanks ___ Tutor maillist - Tutor@python.

[Tutor] Python Daemons

2017-08-01 Thread Daniel Bosah
I'm following an online tutorial about threading. This is the code I've used so far: import socket import threading from queue import Queue print_lock = threading.Lock() target = 'pythonprogramming.net' def portscan(port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try:

[Tutor] PYTZ Package not working.

2017-07-20 Thread Daniel Bosah
I'm trying to get my function to work: def deposit(self,amount): if amount > 0: self.balance += amount self.show_balance() self.transaction_list.append((pytz.utc.localize(datetime.datetime.utcnow()),amount)) # appends traction details to list def

[Tutor] Problems with pytz module

2017-07-19 Thread Daniel Bosah
I'm learning about OOP programming in Python. This is my code from my online course. import datetime import pytz class Account: """Simple account class with balance""" def __init__(self,name,balance): self.name = name self.balance = balance self.transaction_

Re: [Tutor] Question to Phyton and XBee

2017-04-12 Thread Daniel Berger
did not get any data frames, although the RSSI-diodes of router and coordinator are blinking independently from the software (XCTU or Python) I use. For me it is not clear what is going wrong and I would be happy to get some help to solve the problem. Regards and thank you very much

[Tutor] Question to Phyton and XBee

2017-04-11 Thread Daniel Berger
recommended (https://pypi.python.org/pypi/XBee) # Import and init xbee device from xbee import XBee import serial import arduino The interpreter gave the error message File "C:/Users/daniel/PycharmProjects/hardware_test/test_xbee.py", line 2, in from xbee import XBee I

[Tutor] Sklearn

2017-03-10 Thread Daniel Bosah
Can someone explain sklearns to me? I'm a novice at Python, and I would like to use machine learning in my coding. But aren't there libraries like matplotlib I can already use? Why use sklearns? ___ Tutor maillist - Tutor@python.org To unsubscribe or ch

[Tutor] vpython help

2016-04-29 Thread Craig, Daniel Joseph
To whom it may concern, I am writing a program where I have a ball with a position and velocity reach a wall in 3D space. I am able to drag the ball around after it is done moving but I would like to be able to move the ball prior to it moving towards the wall. Is there a way to do this, any

[Tutor] decision loops

2015-02-01 Thread Daniel M
Hello. I'm a complete beginner and I’m trying to write a very basic script to convert temperatures, just for some practice. I have that part down, but I can’t figure out how to make the script switch between the two. What I would like it to do is let the user go back to the “What do you wish to con

[Tutor] Issue with Python

2014-11-13 Thread Daniel Williams
Hi, I'm dw0391 I have an issue with a class task that my teacher can't seem to fix. We were asked to write the code for a 'no interest loan repayment calculator'. I tried, but it did not work. Attached is the relevant file, 'Prog 6' Could you please tell me what I am doing wrong? Thanks. # No Inter

Re: [Tutor] Making a Primary Number List generator

2013-05-13 Thread Daniel Magruder
n primelist Sincerely, Dan On May 12, 2013, at 6:43 AM, Dave Angel wrote: > On 05/11/2013 09:58 PM, Daniel Magruder wrote: > > Please respond to the list, not the individual. Otherwise you're robbing > yourself and others of the possibility of learning from and helping multipl

[Tutor] Making a Primary Number List generator

2013-05-11 Thread Daniel Magruder
Dear Tutor at Python.org, I am new to the python language and have been teaching myself through various online resources. I found an exercise where I am to create a program that prints a list of the first 1000 prime numbers. After many attempts and looking at other answers for other ways around

[Tutor] Help - Using Sort and Join

2012-10-22 Thread Daniel Gulko
Hi Python Tutor, I have an issue trying to figure out how to print out final answers using sort and join functions. Assignment Specification: make a function that is a magic eight ball emulator. emulator will be a function that returns one of the possible answers. Make another function that r

Re: [Tutor] Objects, object references, object values and memory addresses

2012-10-19 Thread Daniel Gulko
Great explanation Alan. I am a newbie at Python but descriptions like this really help me better understand. Thanks again. > To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Thu, 18 Oct 2012 08:32:41 +0100 > Subject: Re: [Tutor] Objects, object references, object values and

Re: [Tutor] Help Passing Variables

2012-10-19 Thread Daniel Gulko
Thanks David. This has been helpful in understanding a bit more on how parameters are passed through. > Date: Thu, 18 Oct 2012 04:44:55 -0400 > Subject: Re: [Tutor] Help Passing Variables > From: dwightdhu...@gmail.com > To: dangu...@hotmail.com > CC: tutor@python.org > > #A little more complex

[Tutor] Help Passing Variables

2012-10-18 Thread Daniel Gulko
Hi Python Tutor, I have a write a simple function named "SwapCaseAndCenter(a_string, width). The idea is to use the function swapcase and center so that when the userenters a string it centers it and swaps the case (e.g. upper to lower and vice versa). The function calls for passing in two

[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

[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

Re: [Tutor] What made Python differ from other Languages?

2012-02-20 Thread Carlos Daniel Ruvalcaba Valenzuela
and flexible enough to cover different application types. Regards, Carlos Daniel Ruvalcaba Valenzuela ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Application packaging

2011-09-05 Thread Carlos Daniel Ruvalcaba Valenzuela
Hello list, Lately I have been working on a windows desktop application for a client, using python and pyside, everything working fine, but I'm getting a bit stuck when trying to distribute the application to the client. Currently I'm using a combination of py2exe and clickonce, what are your exp

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

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...@

[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] Reading the CDROM in Linux

2010-11-05 Thread Carlos Daniel Ruvalcaba Valenzuela
This is more of a Linux question, but here is some advice: All files under /dev are more or less raw representations of the devices, meaning that /dev/cdrom or /dev/sr0 files represent the CDROM devices, however this is for raw access to the device data, now really for normal use, the sistem may "

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] 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

[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] 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,

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

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

[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.

Re: [Tutor] Reading Excel Files

2010-06-22 Thread Carlos Daniel Ruvalcaba Valenzuela
er to convert the format, lets see how they take that. Regards, Carlos Ruvalcaba On Tue, Jun 22, 2010 at 10:44 PM, Lang Hurst wrote: > Carlos Daniel Ruvalcaba Valenzuela wrote: >> >> Hello list, >> >> I was wondering if anyone has worked with excel 2007 files (importing &

[Tutor] Reading Excel Files

2010-06-22 Thread Carlos Daniel Ruvalcaba Valenzuela
Hello list, I was wondering if anyone has worked with excel 2007 files (importing data from), I have done so for old format (xls) via a number of modules like xlrd and the old pyexcelerator, however none of those packages currently support new 2007 format, although xlrd may have support for it lat

[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

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] 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] 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

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] 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

[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] 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] 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] 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] 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

[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] 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] 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

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] 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

[Tutor] Code documentation

2009-03-03 Thread Carlos Daniel Ruvalcaba Valenzuela
Hello list, I have been coding in python a short while and I have been wondering which approach should I take on documentation (API docs) for a python library I have been working on, there is currently code docstrings, docstrings with some markup (epydoc, etc), or external programs such as Sphinx

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

[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] 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] importing images and sound

2008-12-02 Thread Daniel J Kramer
, I do not know where to begin thank you -- Daniel J Kramer Constant Fables 249 12th st #3 Brooklyn, NY 11215 (h) 347 223 4571 (m) 646 427 7430 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python question

2008-11-25 Thread Daniel J Kramer
Hi Kent got it! Is it because Python must recognize the answer as lower case? sorry if that might seem like a dumb question, but I am looking to understand this program. cheers Daniel On Tue, Nov 25, 2008 at 12:38 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Tue, Nov 25, 2008 at

[Tutor] python question

2008-11-21 Thread Daniel J Kramer
you soon -- Daniel J Kramer Constant Fables 249 12th st #3 Brooklyn, NY 11215 (h) 347 223 4571 (m) 646 427 7430 test.py Description: Binary data ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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] 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

[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] 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

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] 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] 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] mod python

2008-04-22 Thread Carlos Daniel Ruvalcaba Valenzuela
Hello, I think this is a problem with mod_python and Apache configuration, you should checkout mod_python configuration for Apache+Windows. Most likely your problem is the mod_python library file, use this instead (more appropiate for windows): "LoadModule python_module modules/mod_python.dll" I

[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

[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

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

Re: [Tutor] performance

2007-09-16 Thread Carlos Daniel Ruvalcaba Valenzuela
g modules for python (profile, hotshot, etc). Forwarded to Tutor list, I forgot it sorry! Regards, Carlos Daniel Ruvalcaba Valenzuela On 9/16/07, Jeff Peery <[EMAIL PROTECTED]> wrote: > Hello, > I've got a quick question regarding performance of lists. I am taking > measuremen

Re: [Tutor] Plz help me from this

2007-09-04 Thread Carlos Daniel Ruvalcaba Valenzuela
Yes is very possible to do this with python. Checkout the os.system and os.popen functions to run external commands (chmod, chown). Reading the list of users and groups should be easy, just open the file and read line by line and parse, you can do it as simple as splitting the line on colon chara

[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] gotoxy

2007-08-01 Thread Carlos Daniel Ruvalcaba Valenzuela
You should have a look at the curses module, basically gotoxy is a borland think, in linux and other unix systems there is the curses library for working with text screens. Module documentation: http://docs.python.org/lib/module-curses.html Some tutorials: http://www.amk.ca/python/howto/curses/ h

Re: [Tutor] Running another program from Python

2007-07-20 Thread Carlos Daniel Ruvalcaba Valenzuela
, this may not be what you want. Spawn will create a subprocess, you can wait for it to finish or let it run free knowing its process id to check it latter, it is roughly similar to fork. Good luck! Regards, Carlos Daniel Ruvalcaba On 7/20/07, Chris Smith <[EMAIL PROTECTED]> wrote: > Howdy,

[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

Re: [Tutor] wxPython GUI builders?

2007-06-13 Thread Carlos Daniel Ruvalcaba Valenzuela
wxGlade is a good GUI builder, very much like Glade, however it may o may not integrate with your coding style but you should definitively give it a try. PythonCard is a nice concept I personally do something similar but with XML, parse and build the GUI from it, then tweak the layout manually, wi

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

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] 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

[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] (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

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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[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

  1   2   >