Re: [Tutor] JBUS and Python which way

2005-07-30 Thread Danny Yoo
On Fri, 29 Jul 2005, Miguel Lopes wrote: > I understand the subject is advanced, but I'm a newbie without a > technological background making some technology research for a company I > work for. Hi Miguel, You may want to ask this on comp.lang.python instead. The Modbus/JBUS protocol might be

Re: [Tutor] Help with file I/O.

2005-07-30 Thread Danny Yoo
On Sun, 31 Jul 2005, Nathan Pinno wrote: > Well, you saw my password program. That was my first attempt at using > file I/O. Thought I'd try it big time. You saw where that went. Ok, let's take a look. It was from this message, right? http://mail.python.org/pipermail/tutor/2005-July/03947

Re: [Tutor] cant get started

2005-07-30 Thread Danny Yoo
On Sat, 30 Jul 2005 [EMAIL PROTECTED] wrote: > it said this is for newbies but I download the 2.4 and I tried the stuff > it said on the tutorial like the control-z or sys.exit () I tried the > control-p or the python -c but it always says "'something' is not > defined" or " invalid syntax" He

Re: [Tutor] Help with file I/O.

2005-07-30 Thread Nathan Pinno
Well, you saw my password program. That was my first attempt at using file I/O. Thought I'd try it big time. You saw where that went. Nathan - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Sunday, July 31, 2005 12:13 AM Subject:

Re: [Tutor] Help with file I/O.

2005-07-30 Thread Danny Yoo
> If anyone will help me learn file I/O, it would be appreciated. I went > through Josh Cogliani's Non-Programmer's Tutorial for Python, and I > still can't understand it. Hi Nathan, Can you point out what parts don't make sense? We can try to explain better, but we can only do so if you eithe

Re: [Tutor] Socket Programming

2005-07-30 Thread Danny Yoo
> I have no idea how to get the server to receive and print a message or > for the client to send the message. Does anyone know of some good python > networking tutorials designed for newbies? (Not ones on > www.awaretek.com. They seem to expect you to know some things that I > don't even know ab

Re: [Tutor] learning classes (kinda long)

2005-07-30 Thread luke
hello. I didn't read or understand your code that well. but you asked: > for section in config.sections(): > section = bsserver.Server() > > first I would like for this instance to be named the name of the host in > the section > but i keep getting instances named section I think doing it m

[Tutor] learning classes (kinda long)

2005-07-30 Thread Reed L. O'Brien
This is a little long a program consisting of bsserver.py ## to define server class and methods bscaller.py ## to define a test class subclasses for services (imap http pop dns et al) bslogger.py ## to log and analyze tests and send emails on exceptions/failures bsmain.py ## that instantiates

Re: [Tutor] Help with file I/O.

2005-07-30 Thread python-tutor
Have you worked through the diveintopython.org tutorial/book? Chapter 6 covers file handling. If/When you get stuck post your code/question and ask for help. --Todd On Saturday 30 July 2005 11:49 pm, Nathan Pinno wrote: > If anyone will help me learn file I/O, it would be appreciated. I went

Re: [Tutor] cant get started

2005-07-30 Thread Nathan Pinno
This is an easy one. Go to the IDLE, I found it was easier. The latest Python refused to work on mine, so I'm using 2.2.3, and it works fine. - Original Message - From: [EMAIL PROTECTED] To: tutor@python.org Sent: Friday, July 29, 2005 10:22 PM Subject: [Tutor] cant g

[Tutor] question on numarray in python

2005-07-30 Thread Xiangyi Meng
Hi there, I ran across this error when running a few lines of code in debian python, but this runs perfectly in windows python. Basically I created a dummy matrix called "gamma" (using kroneckerproduct in numarray) and printed out its mean. Here is the code: gamma = kroneckerproduct(ones((N, 1))

[Tutor] JBUS and Python which way

2005-07-30 Thread Miguel Lopes
Hi, I understand the subject is advanced, but I'm a newbie without a technological background making some technology research for a company I work for. I wonder if there is a library for accessing/interpreting JBUS protocol in Python. Also, I've searched the net looking for some information so

[Tutor] cant get started

2005-07-30 Thread F22AceRaptor
it said this is for newbies but I download the 2.4 and I tried the stuff it said on the tutorial like the control-z or sys.exit () I tried the control-p or the python -c but it always says "'something' is not defined" or " invalid syntax" where do I go or what do I do. do i go the the command

[Tutor] Help with file I/O.

2005-07-30 Thread Nathan Pinno
If anyone will help me learn file I/O, it would be appreciated. I went through Josh Cogliani's Non-Programmer's Tutorial for Python, and I still can't understand it.   Thanks in advance, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mai

Re: [Tutor] Now what do I do?(was Re: When I run this code, it just keeps repeating.)

2005-07-30 Thread Nathan Pinno
Glad I didn't put up my mini calculator apps on my site. Would have had complaints from people. But this thread has given me ideas on how to fix them all, and how to fix Giant Calculator as well. - Original Message - From: "Reed L. O'Brien" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PR

[Tutor] Socket Programming

2005-07-30 Thread Joseph Quigley
I've got a little problem with my socket program(s): #Client import socket #create an INET, STREAMing socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) s.connect(("localhost", 2000)) s.send('hello!'[totalsent:]) #Server import socket #create an INET, STREAMing socket serversocket

Re: [Tutor] How do I get rid of blank space when running a program I'vecoded?

2005-07-30 Thread Nathan Pinno
I never have it. Although when I ask for option I use int(raw_input('Option:')) instead of raw_input('Option:'). That's usually near the top, but part of a while loop. - Original Message - From: "Kent Johnson" <[EMAIL PROTECTED]> Cc: Sent: Saturday, July 30, 2005 8:55 PM Subject: Re: [T

Re: [Tutor] Now what do I do?(was Re: When I run this code, it just keeps repeating.)

2005-07-30 Thread python-tutor
You are almost there. Do you undestand why you are getting the output that you are getting? Pretend that you are the computer and walk through what happens when you enter 9 at the menu: while cal_opt != 9: menu() cal_opt = cal() # This is where you entered '9' so cal_opt

Re: [Tutor] How do I get rid of blank space when running a program I'vecoded?

2005-07-30 Thread Kent Johnson
Do you have a call to raw_input() at the end of your program? That will make you press return to exit the program. It's useful for command-line programs that you want to run by double-clicking them but you can take it out if you find it annoying. Kent Nathan Pinno wrote: > I meant the return k

[Tutor] Now what do I do?(was Re: When I run this code, it just keeps repeating.)

2005-07-30 Thread Nathan Pinno
Here is another screen shot: Mini Calculator By Nathan Pinno CALCULATE MENU 1) Add 2) Subraction 3) Multiplication 4) Division w/o remainder 5) Division with remaider 6) Exponation 7) Square roots 9) Exit Option: 3 First number:4 Second number:6 4 * 6 = 24 CALCULATE MENU 1) Add 2) Subraction 3) M

Re: [Tutor] When I run this code, it just keeps repeating.

2005-07-30 Thread Nathan Pinno
Thanks Todd. Can you please look at my other messages that you haven't answered, and see what's wrong with them, or what the answer is. - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Saturday, July 30, 2005 8:10 PM Subject: Re: [Tutor] When I run this code, it just keeps repeat

Re: [Tutor] When I run this code, it just keeps repeating.

2005-07-30 Thread python-tutor
Looks like you are making some pretty good progress. The short answer to your question is that the menu & user input need to be inside the while loop. That way cal_opt has a chance to change value before it gets evaluated by the while loop again. Another comment - the global cal_opt is conside

[Tutor] When I run this code, it just keeps repeating.

2005-07-30 Thread Nathan Pinno
When I run the following code it just keeps repeating. Here is a screen shot showing what I mean: Mini CalculatorBy Nathan Pinno   CALCULATE MENU1) Add2) Subraction3) Multiplication4) Division w/o remainder5) Division with remaider6) Exponation7) Square roots9) ExitOption: 5First number:4Seco

Re: [Tutor] How do I make a Python program keep repeating?

2005-07-30 Thread python-tutor
How does the user indicate that they are done with the program? One solution is to ask at the end of each iteration if they want to repeat. Psuedocode: keep_going=True while(keep_going) Run your program stuff keep_going = get_user_response("Do you want to run again?") --Todd On Saturd

[Tutor] How do I make a Python program keep repeating?

2005-07-30 Thread Nathan Pinno
Hi all,   How do I make a program keep repeating until the user is done with it?   Thanks, Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What's the invalid synax? Error message and codesupplied.

2005-07-30 Thread Nathan Pinno
There is only 1 parenthesis on the prior line, but lots of commas. - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Saturday, July 30, 2005 5:22 PM Subject: Re: [Tutor] What's the invalid synax? Error message and codesupplied. > > I'd count the parenthesis on the prior line: >

Re: [Tutor] What's the invalid synax? Error message and code supplied.

2005-07-30 Thread python-tutor
    I'd count the parenthesis on the prior line: option = int(raw_input('Option (1,2,3,4,5,6,9): ') while option != 9: Also when you notice that you are copying and pasting the same line over and over, it may be time to think about reorganizing the code a little bit (Once you have it working)

[Tutor] What's the invalid synax? Error message and code supplied.

2005-07-30 Thread Nathan Pinno
Here's the message:   File "D:\Python22\prog4.py", line 19    while option != 9:    ^SyntaxError: invalid syntax And the code: #This program finds the area and perimeter of circles, rectangles, and squares.def menu():    print '1) Area (Circle)'    print '2) Area (Rectangle)'    print '

Re: [Tutor] How do I get rid of blank space when running a program I'vecoded?

2005-07-30 Thread Nathan Pinno
I meant the return key, not the spacebar. Sorry for the mix-up. - Original Message - From: Nathan Pinno To: tutor@python.org Sent: Saturday, July 30, 2005 3:50 PM Subject: [Tutor] How do I get rid of blank space when running a program I'vecoded? Hi all,  

[Tutor] How do I get rid of blank space when running a program I've coded?

2005-07-30 Thread Nathan Pinno
Hi all,   I'll be brief. I always get a blank line whenever I run my Python programs that I've coded. How can I get rid of it. It's kind of annoying to press the spacebar in order to return to >>> in IDLE or the C:\ prompt in DOS.   Thanks, Nathan _

[Tutor] mysterious Python error

2005-07-30 Thread Tom Cloyd
I'm working on a WinXP SP-2 OS. I'm too ill-informed to figure this out: When I execute C:\Python24\python.exe I get 'import site' failed.; use -v for traceback ActivePython 2.4.1 Build 247 ... I then ran this from a DOS window, and tried to redirect the -v output to a text file, so I could

Re: [Tutor] fourier transform

2005-07-30 Thread Christian Meesters
Jeff Peery wrote: > > Hello, I have a signal that I want to do a fourier transform on. I > tried using FFT.fft(data).real but I don't understand the output. > what is output from this function, and why doesn't it require > amplitude and time as inputs? Hi Jeff, As Danny wrote, your input are

Re: [Tutor] return values from function

2005-07-30 Thread Alan G
> I have the following code to traverse a directory structure from a > given path: I'm not sure what you are using the browse function for. Normally with path.walk you would use browse)() to modify the namelist argument value and thus modify the path walked by path.walk(). You appear to be trying

Re: [Tutor] return values from function

2005-07-30 Thread Kent Johnson
Jorge Louis De Castro wrote: > Hi all, > > I have the following code to traverse a directory structure from a given > path: > > import os, fnmatch, re > folders = [] > r = re.compile(r'file_filter') # msn_username is passed by the user > > def browse(junk, dirpath, namelist): > for name in na

Re: [Tutor] fourier transform

2005-07-30 Thread Pawel Kraszewski
> Hello, I have a signal that I want to do a fourier transform on. I tried > using FFT.fft(data).real but I don't understand the output. what is output > from this function, and why doesn't it require amplitude and time as > inputs? Please write the package you use for FFT. Standard Python doesn'

[Tutor] return values from function

2005-07-30 Thread Jorge Louis De Castro
Hi all, I have the following code to traverse a directory structure from a given path: import os, fnmatch, re folders = [] r = re.compile(r'file_filter') # msn_username is passed by the user def browse(junk, dirpath, namelist): for name in namelist: if r.search(name): folders.append