Re: [Tutor] Python Help (shits killing me)

2018-10-26 Thread Andrew Van Valkenburg
nth = n1 + n I don't see where n is defined anywhere. Should be n2? On Fri, Oct 26, 2018 at 6:09 AM Ben Placella wrote: > So I have to make a fibonacci sequence, and I'm not sure what is wrong with > my code > #This program illustrates the fibonacci sequence > nterms=int(input("Please enter ho

[Tutor] Installing Scrapy using Pip

2018-06-23 Thread Andrew Gabler
Hi, I am trying to install Scrapy using pip and keep getting an error message. I have tried to fix the problem in a variety of ways, ensuring that my setuptools are installed and up-to-date and creating a virtualenv to install to. However, I keep getting the error message, and I am at a loss for w

Re: [Tutor] Python help

2016-10-17 Thread Andrew Koe
Hi, Also, you have a typo in your elif path == '2' statement. It should be rock = input('Do you want to pick up the rock') with one equal sign not rock == input ('Do you want to pick up the rock'). -Andrew On Sat, Oct 15, 2016 at 6:48 PM, Nicholas Hopkins w

[Tutor] Missing Standard Libraries on Python 3.5 for Mac

2015-11-03 Thread Andrew Machen
, however I was hoping to learn and use Python 3. The library is present in the Linux version of Python 3.5 that I have tried. Your help is greatly appreciated. -Andrew ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

[Tutor] Asking for help with installation of pyttsx (text to speech)

2015-02-11 Thread Andrew K.
(text to speech). I would be very grateful for any help with installation and programming. Thank you very much, Andrew PS I would be very thankful if any mature Python programmer would like to participate in my project. Thank you, Andrew ___ Tutor maillist

[Tutor] help with tic-tac-toe program

2014-11-16 Thread Andrew McReynolds
quot;)*4))*3      #for line in board:                  return () Any advice for continuing?  Thanks in advance for assistance, Andrew ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Where do I start learning Python

2013-09-09 Thread Andrew Van Valkenburg
codecademy.com has a pretty good tutorial imo On Sun, Sep 8, 2013 at 4:00 PM, olatunde Adebayo wrote: > hey everyone, > I am taking a graduate level class this fall that required python > programming. > can anyone direct me to where can i get a free python training crash > course / program > an

Re: [Tutor] Problems understanding code output

2013-07-18 Thread Andrew Van Valkenburg
I'm not really sure what you are asking, but the formatting for your code is pretty screwy. I reformatted it and changed the print statements slightly to make it more readable and it works fine from what I can see. def printMax(a, b): if a > b: print a, 'is maximum' elif a == b: print

[Tutor] Python 2 or 3?

2013-06-23 Thread Andrew Cooper
Dear Pythoners, Sorry I am completely new to this but so far as I can see there are two versions of Python, version 2 (which is more established and has much more support) and version 3 which is relatively new. As a beginner, which of the versions (2 or 3) would it be advisable to start with fir

[Tutor] Presenting text in different ways by using quotes!

2013-05-23 Thread Andrew Triplett
I am asked to present text in different ways by using quotes in strings. for example: print("Program "Game Over" 2.0") print("same", "message", "as before") print("just",    "a bit",     "bigger") print("Here", end=" ") print("it is...") print(   """     """ ) I ca

[Tutor] challenge-chapter 2

2013-05-21 Thread Andrew Triplett
I am on chapter two for Python Programming working on the challenges and the question is: 1. Create a list of legal and illegal variable names. Describe why each is either legal or illegal. Next, create a list of "good" and "bad" legal variable names. Describe why each is either a good or bad c

Re: [Tutor] LCM

2012-11-18 Thread Andrew
On Wed, 14 Nov 2012 19:52:03 +0200, Selby Rowley Cannon wrote: Hey, I've been trying to write a function to find the Lowest Common Multiple of two numbers, but it isn't working and I've kinda hit a dead end on the thought-process end of things. Anyone mind looking at it, and tell

[Tutor] floating point rounding inconsistency

2012-09-28 Thread Andrew Tritt
Hello, I am new to python, and I was experimenting with the round function, and came across what appears to be a bug in floating point rounding. I am guessing there is a valid explanation for it. When I round the floating points 10.6[0-9]5 to two decimal places, it rounds as expected for 6 of the

[Tutor] Python

2012-09-06 Thread Andrew Rosen
I have a Windows Computer and I'm trying to make a shortcut on my desktop that will run a program, so I don't have to open up a New Window form Python Shell and use that to run the program. I can't figure out how to do it, can you help me?___ Tutor mai

[Tutor] While Loop

2012-06-12 Thread Andrew Brunn
Let me preface by saying that I am currently taking my first programming class; so I have been a "programmer" for just over a week now. Here is my question; I am trying to create a while loop that will allow me ask for a username and password.  If a wrong username and password is entered, I wo

[Tutor] Python Fails to Change Directory

2012-04-14 Thread Andrew Jahn
Hi all, I am attempting to use a Python program to change into a specified directory before executing some commands. However, when I call the Python program from my Unix shell (tcsh) using a command such as "python myprogram.py" It runs without changing directory. Just to clarify, the lines of c

[Tutor] Threads and Signals

2011-12-20 Thread Andrew Heagle
uery it". I attached my test script in case that helps, so feel free to critique my code at the same time, if you like as I just starting learning Python recently. Thanks, Andrew # -*- coding: utf-8 -*- #!/usr/bin/python import threading import Queue import time import random import signal

[Tutor] Help!

2011-03-03 Thread 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 fabricator must cool off for 5 minutes and 13 seconds before it can continue. Write a program that will calculate the amount o

[Tutor] Exec function problem

2010-09-01 Thread Currall, Andrew
t make any difference either way, nor does it make any difference if I read the file using read() and then execute the string- in all cases the top-level command works; placed in a function it doesn't. Regards and thanks, Andrew Currall MPhys Senior Consultant, Transportation D +44 (0)1727

Re: [Tutor] Trouble with exercise regarding classes

2010-08-28 Thread Andrew Martin
Ok I think I got it. Thanks everybody. And sorry for the late reply. My classes have just started so learned python unfortunately must be bumped down on the priority list On Thu, Aug 26, 2010 at 4:32 AM, Alan Gauld wrote: > > "Andrew Martin" wrote > > I want to compare ze

Re: [Tutor] Trouble with exercise regarding classes

2010-08-25 Thread Andrew Martin
be retrieved by Projectile.getY. And how do I call the getY using the instance? On Wed, Aug 25, 2010 at 7:24 PM, Alan Gauld wrote: > > "Andrew Martin" wrote > > > However, when I did so I got this error: "TypeError: unbound method getY() >> must be call

[Tutor] Trouble with exercise regarding classes

2010-08-25 Thread Andrew Martin
I just starting programming and am trying to learn some python (ver 2.6). I am reading Python Programming: An Introduction to Computer Science by John Zelle. In chapter ten, the first programming exercise asks the reader to modify code from the chapter (below) . The code I added is highlighted. How

Re: [Tutor] Difficulty Understanding Example Code for Blender Script

2010-07-23 Thread Andrew Martin
ins > wrote: > > On Wed, Jul 21, 2010 at 9:48 PM, Andrew Martin > > wrote: > >> > >> This code was part of a Blender script to build a 3d bar graph, so I > don't > >> know if understanding Blender is a prereq for understanding this code. > The > &

[Tutor] Difficulty Understanding Example Code for Blender Script

2010-07-21 Thread Andrew Martin
This code was part of a Blender script to build a 3d bar graph, so I don't know if understanding Blender is a prereq for understanding this code. The function is for the axis labels. def label(text,position,orientation='z'): txt=Text3d.New('label') txt.setText(text) ob=Scene.GetCurrent

Re: [Tutor] Return error message for my script in Blender

2010-07-18 Thread Andrew Martin
Yeah ok I get it. I have to return something. I looked at the sample code provided on the book's website and found out what I am supposed to return. Thanks. I appreciate the responses, especially to this bonehead question. ___ Tutor maillist - Tutor@py

[Tutor] Return error message for my script in Blender

2010-07-17 Thread Andrew Martin
I am new to Blender and Python (2.6 on vista) and was trying to follow a tutorial in the book Blender 2.49 Scripting by Michel Anders. I was trying to write a script that would create a user interface where the user could select various aspect of an insect and the code would create a polygonal bug.

Re: [Tutor] Problems installing

2010-06-29 Thread Andrew Martin
How exactly can I go about deleting __init__.pyc? Sorry, I am new to this so I need everything spelled out for me. On Wed, Jun 30, 2010 at 2:30 AM, Marc Tompkins wrote: > On Tue, Jun 29, 2010 at 10:35 PM, Andrew Martin wrote: > >> I just downloaded Python 2.6.5 onto my windows vista

[Tutor] Problems installing

2010-06-29 Thread Andrew Martin
I just downloaded Python 2.6.5 onto my windows vista laptop. I am attempting to install "escript version 3: Solution of Partial Differential Equations (PDE) using Finite Elements (FEM)." I downloaded the files and manually placed them in their appropriately place on my computer according to the Rea

Re: [Tutor] pydoc?

2010-06-18 Thread Andrew Martin
On Fri, Jun 18, 2010 at 7:13 PM, Andrew Martin wrote: > Alright I got it. Although i didn't end up doing any typing. All I did was > go to start/module docs and then press open browser. > > Thanks again and next time i will supply more info

Re: [Tutor] pydoc?

2010-06-18 Thread Andrew Martin
Alright I got it. Although i didn't end up doing any typing. All I did was go to start/module docs and then press open browser. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/

[Tutor] pydoc?

2010-06-18 Thread Andrew Martin
Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am attempting to follow 4.11 of the tutorial called "How to Think Like a Computer Scientist: Learning with Python v2nd Edition documentation" ( http://openbookproject.net/thinkcs/python/english2e/c

[Tutor] Problems with Importing into the Python Shell

2010-06-11 Thread Andrew Martin
Hey, everyone, I am new to programming and just downloaded Python 2.6 onto my windows vista laptop. I am attempting to follow 4.11 of the tutorial called "How to Think Like a Computer Scientist: Learning with Python v2nd Edition documentation" ( http://openbookproject.net/thinkcs/python/english2e/c

[Tutor] parsing a "chunked" text file

2010-03-02 Thread Andrew Fithian
Hi tutor, I have a large text file that has chunks of data like this: headerA n1 line 1 line 2 ... line n1 headerB n2 line 1 line 2 ... line n2 Where each chunk is a header and the lines that follow it (up to the next header). A header has the number of lines in the chunk as its second field. I

[Tutor] fast sampling with replacement

2010-02-21 Thread Andrew Fithian
On Sat, Feb 20, 2010 at 11:55 AM, Luke Paireepinart wrote: > > > On Sat, Feb 20, 2010 at 1:50 PM, Kent Johnson wrote: > >> On Sat, Feb 20, 2010 at 11:22 AM, Andrew Fithian >> wrote: >> > can >> > you help me speed it up even more? >> >

[Tutor] fast sampling with replacement

2010-02-20 Thread Andrew Fithian
Hi tutor, I'm have a statistical bootstrapping script that is bottlenecking on a python function sample_with_replacement(). I wrote this function myself because I couldn't find a similar function in python's random library. This is the fastest version of the function I could come up with (I used c

[Tutor] confidence interval

2010-01-13 Thread Andrew Fithian
Hi tutor, I have this code for generating a confidence interval from an array of values: import numpy as np import scipy as sp def mean_confidence_interval(data, confidence=0.95): a = 1.0*np.array(data) n = len(a) m, se = np.mean(a), sp.stats.stderr(a) h = se * sp.stats.t._pp

Re: [Tutor] When are strings interned?

2009-07-02 Thread Andrew Fithian
My guess is that Python sees the space and decides it isn't a short string so it doesn't get interned. I got the expected results when I used 'green_ideas' instead of 'green ideas'. -Drew On Wed, Jul 1, 2009 at 6:43 PM, Marc Tompkins wrote: > On Wed, Jul 1, 2009 at 5:29 PM, Robert Berman wrote:

Re: [Tutor] import sys; sys.exit()

2008-01-10 Thread Andrew Volmensky
Thanks Alan, When typing the commands [statements?] in the terminal I get this: Last login: Sat Jan 5 22:20:44 on ttyp2 Welcome to Darwin! warewerks-01:~ andrew$ python Python 2.4.4 (#1, Oct 18 2006, 10:34:39) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help",

[Tutor] import sys; sys.exit()

2008-01-10 Thread Andrew Volmensky
s supposed to exit the program, but that does not appear to be happening. This is with MacPython 2.4 - Thanks! IDLE 1.1.4 >>> RESTART >>> Traceback (most recent call last): File "/Users/andrew/pyth

[Tutor] help

2007-12-03 Thread Andrew Critchley
I recently downloaded the newer version of python, the 2.5.1 one, and when ever i try to make an input what ever i type into the brackets appears on the next line and when i try to add the next line it carries on from the input,This is what happens: I type this down: # Area calculation program

Re: [Tutor] Regular Expression help - parsing AppleScript Lists as Strings

2007-11-01 Thread Andrew Wu
Ah - thanks for the correction! I missed the extra grouping and the extra spacing ... doh! Sorry about the HTML-formatted e-mail ... Thanks also for the pyparsing variant as well - I didn't know the module existed before! Andrew On 11/1/07, Kent Johnson <[EMAIL PROTECTED]> wrot

[Tutor] Regular Expression help - parsing AppleScript Lists as Strings

2007-10-31 Thread Andrew Wu
t the AppleScript list into a Python list - I've read a bit about the findall() method of the re module and was wondering if that would work in this instance (there's also split() but I've been having issues with that, probably b/c my pattern matching isn't correct). Thank you! A

Re: [Tutor] os.sys

2007-10-28 Thread Andrew Nelsen
On 10/28/07, Lawrence Shafer <[EMAIL PROTECTED]> wrote: > > Why doesn't this fill otp with the output of ls?? (I know python has > it's own file tools, I'm just playing around ;) > > import os > cmd="""ls""" > otp=os.system(cmd) > print otp > ___ > Tutor

Re: [Tutor] Help with packages and namespaces please

2007-10-17 Thread Andrew Wu
into package files (i.e. add the __init__.py files, or can I simply place them into a subdirectory structure and do something else so python can find the modules? Or is it better practice whenever a hierarchical directory structure exists to treat it as a package? Thanks! Andrew

Re: [Tutor] Help with packages and namespaces please

2007-10-15 Thread Andrew Wu
> you can say >from wavread import read_wav > > This imports the name read_wav into the Formats package namespace so > other code will be able to say >from Sound.Formats import read_wav This above seems to be closest to what I'm hoping to achieve ... I will tr

Re: [Tutor] Help with packages and namespaces please

2007-10-15 Thread Andrew Wu
comments inline ... On 10/13/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Andrew Wu wrote: > > > Let's say I have these files in one directory: > > > > PrintBase.py > > PrintHello.py > > PrintBye.py > > > I'd like to reorganize the file

[Tutor] Help with packages and namespaces please

2007-10-12 Thread Andrew Wu
rectories (er package?) so that files in one subdirectory can subclass base classes from a sibling (not parent) directory, ideally in a way that doesn't require each file to state something like 'from 'PrintMe.PrintHello ... import ...' but instead 'from PrintHello import ...

Re: [Tutor] random number generator

2007-10-06 Thread Andrew James
I'm tempted to suggest using a hack to avoid floating point errors. Anyway, it isn't choosing a number to ten decimal places. It's actually out to 11 in both examples you gave. And it evaluates to correct because your guesses were to at least 10 places, which is as far as you account for in the

Re: [Tutor] random number generator

2007-10-04 Thread Andrew James
I need to start using the reply all button... Andrew James wrote: > while guess != number: >guess = float(raw_input("Make another guess: ")) >if guess > number: >print "Lower..." >elif guess < number: >print "Highe

Re: [Tutor] creating the equivalent of string.strip()

2007-10-02 Thread Andrew James
*headbang* I'm an idiot. s=s[:-2] should be s=s[:-1]. Andrew James wrote: > And as soon as I send it again I realise a pretty stupid error. The > two loops shouldn't be nested. > > Andrew James wrote: >> Helps if I send it to the group... >> >> And Ken

Re: [Tutor] creating the equivalent of string.strip()

2007-10-02 Thread Andrew James
And as soon as I send it again I realise a pretty stupid error. The two loops shouldn't be nested. Andrew James wrote: > Helps if I send it to the group... > > And Kent, I didn't post it originally because I figured the other guy > was still working on his script. Beside

Re: [Tutor] creating the equivalent of string.strip()

2007-10-02 Thread Andrew James
Helps if I send it to the group... And Kent, I didn't post it originally because I figured the other guy was still working on his script. Besides, I didn't think it'd be that far fetched for you to assume I was using something like "while s[0] == ' ':" Andre

Re: [Tutor] creating the equivalent of string.strip()

2007-10-01 Thread Andrew James
I've gone ahead and created a script that does this, however it also strips punctuation. I was originally just comparing each character to a string containing a single space ' ' but even using s[-1].isspace() I lose punctuation marks. Any idea why that's happening? (Not the OP, I just thought t

Re: [Tutor] Where can I find simple python scripts to edit and play around?

2007-09-26 Thread Andrew Nelsen
On 9/26/07, Ulrich Holtzhausen <[EMAIL PROTECTED]> wrote: > > Well I guess the subject/topic here describes it all. I am looking for a > nice collection of SIMPLE python scripts, IE: How to manipulate files, > text, how to create a bot, how to work with socks...making a > server/client, converting

Re: [Tutor] Finding all the letters in a string?

2007-09-17 Thread Andrew Nelsen
Thanks, everyone, for your help. It was a pretty narrow question because it's a pretty specific task, but only because I was guessing there was more than one way of shelling an acorn. My original idea was something a lot like: lst = [] chars = '@*&^$&[EMAIL PROTECTED](&@$*(&[EMAIL PROTECTED](*&*

[Tutor] Finding all the letters in a string?

2007-09-17 Thread Andrew Nelsen
I was wondering, recently, the most expedient way to take a string with [EMAIL PROTECTED]&*] and alpha-numeric characters [ie. "[EMAIL PROTECTED]@*$g@)$&^@&^$F"] and place all of the letters in a string or list. I thought there could be obvious ways: A) Find all the letters, put them in a list, o

[Tutor] comparing lists, __lt__ and __gt__

2007-07-25 Thread Andrew Purdea
future releases? Thanks Regards, Andrew ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] The '45' bug in round()

2007-03-19 Thread andrew clarke
On Mon, Mar 19, 2007 at 03:04:03AM -0700, Dick Moores wrote: > Yesterday I was shocked, SHOCKED, to discover that round() is > occasionally rounding incorrectly. For example, "Garbage In, Garbage Out" :-) Floating point numbers in Python (and other computer languages) are only an approximation:

Re: [Tutor] DICOM Header

2007-02-22 Thread Andrew Liimatta
27;UI', "ReferencedTransferSyntaxUIDInFile", '1', ''), (0x0004,0x1600):('UL', "NumberOfReferences", '1', ''), # data tags .. .. .} Correct I have no idea how to use the dictionaries t

[Tutor] DICOM Header

2007-02-22 Thread Andrew Liimatta
Hello, I am having a hard time figuring something out. I have Files that are written in DICOM format. I want to be able to pull out select elements from the header of these files I have a dictionary file that contains enteries like this. dicomdict = { # meta tags (0x0002,0x0001):('OB', "Fil

[Tutor] best book?

2007-02-05 Thread Andrew Purdea
, but also make it easyer to understand it ;-) I have previous programming knowledge (Pascal/Delphi, C, Java, Assembler) Thanks Andrew ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Regarding licensing GPL terms

2007-01-31 Thread Andrew Ball
Cool! Do you know about rpath/conary? It may not be worth tons here, but it is good for custom Linux distributions. http://www.rpath.com/corp/ On 1/31/07, Anup Rao <[EMAIL PROTECTED]> wrote: Hi Andrew, A minor correction in the URL it is *http://sarovar.org/projects/pylinux/* Sor

[Tutor] Fwd: Regarding licensing GPL terms

2007-01-31 Thread Andrew Ball
amazon.com/Open-Source-Licensing-Software-Intellectual/dp/0131487876/sr=8-1/qid=1170241424/ref=pd_bbs_sr_1/104-1060065-2524701?ie=UTF8&s=books -- Forwarded message ------ From: Andrew Ball <[EMAIL PROTECTED]> Date: Jan 31, 2007 4:22 AM Subject: Re: [Tutor] Regarding licensing GP

Re: [Tutor] Question on joining out of order dictionary elements

2007-01-11 Thread Andrew Robert
ligent. > > > > Are there a more efficient/compact ways of doing this kind of > > operation or is this it? > > > > Maybe you like: > print "\\".join([config[val] for val in ["val2","val1","val3"]]) > > -- > Andre Engels,

[Tutor] Question on joining out of order dictionary elements

2007-01-10 Thread Andrew Robert
his kind of operation or is this it? The key/value pairs in these examples are contrived for purposes of this discussion but the end goal is to piece together server and directory path information for use with pysvn. I have a Perl programmer who is learning Python and he is griping that this kind

[Tutor] Testing the status of NFS mounts

2007-01-04 Thread Andrew Robert
attempt a write on the share and clean up after itself but I am hoping for a more elegant solution. Any insight anyone can provide on this would be greatly appreciated. -- Thank you, Andrew Robert Senior MQ Engineer Information Technologies Massachussetts Financial Services Phone: 617-954-5882

[Tutor] pysvn samples

2006-12-15 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi guys, I am looking to experiment with pysvn and was wondering if anyone knew of a location for code samples/snippets using it? I'm reviewing the pysvn programmers guide and tutorial but some live examples would be great. If anyone can point me at

Re: [Tutor] sending mails from python

2006-10-21 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 How about something like this? Create a function and then call it with the required optins of server url, sender address, destination address, subject, and message text? def send(serverURL=None, sender='', to='', subject='', text=''): """ F

Re: [Tutor] Python code to split and reassemble files

2006-10-01 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Never mind.. :) found it at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/224800 However, if someone has something better, I would be very interested. Andrew Robert wrote: > Hi guys, > > Awhile back, I believe I saw a cookbo

[Tutor] Python code to split and reassemble files

2006-10-01 Thread Andrew Robert
to smaller chunks would improve efficiency. - -- Thank you, Andrew Robert Senior MQ Engineer Information Technologies MFS Investment Management Phone: 617-954-5882 E-mail: [EMAIL PROTECTED] Linux User Number: #201204 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (MingW32) Comment: GnuPT

Re: [Tutor] Help with parsing

2006-09-18 Thread Andrew Robert
Bryan Leber wrote: > > Hello, I am trying to create a script that reads from the command line > and puts the sysargv into a list. I have this part done. I have added > code for testing and one of those testing procedures is to print the > list out in a text file. Not all field are required and may

Re: [Tutor] Simple SQL server access...

2006-09-06 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Hengge wrote: > I've been doing some searching for ways to access existing SQL server > databases, but I'm finding so many different ways to do it, is there one > that anyone recommends for a "new to python" programmer? I've used VB > and C# for

Re: [Tutor] Simple SQL server access...

2006-09-06 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Hengge wrote: > I've been doing some searching for ways to access existing SQL server > databases, but I'm finding so many different ways to do it, is there one > that anyone recommends for a "new to python" programmer? I've used VB > and C# for

Re: [Tutor] omnicomplete vim python

2006-08-29 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Hansen wrote: > > >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Alan Gauld >> Sent: Tuesday, August 29, 2006 1:26 AM >> To: anil maran >> Cc: tutor@python.org >> Subject: Re: [Tutor] omnic

Re: [Tutor] [whitelist] Re: regular expressions question

2006-08-22 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Nimrodx, In case you haven't found a solution yet, I developed a program to encode/decode stuff similar to this. You may want to take a look at it at http://home.townisp.com/~arobert/python/file_encoder.py nimrodx wrote: > Hi Alan, > > I fou

Re: [Tutor] [tutor] ipconfig

2006-08-10 Thread andrew clarke
On Thu, Aug 10, 2006 at 04:47:43PM +0300, [EMAIL PROTECTED] wrote: > is there in python an independent from the system way to obtain the IP >>> import socket >>> hostname = socket.gethostname() >>> ip = socket.gethostbyname(hostname) >>> print ip 192.168.1.10 _

Re: [Tutor] IDE for Python

2006-07-25 Thread andrew clarke
On Tue, Jul 25, 2006 at 08:34:39PM +0530, Basavaraj SP. wrote: > I am new to Python. > > I want to know which IDE I should use for programming. > > If so from where can I get it? ActivePython is a good start: http://www.activestate.com/Products/ActivePython/ ___

Re: [Tutor] I am not really convinced using Python...

2006-07-25 Thread andrew clarke
On Tue, Jul 25, 2006 at 05:14:35PM +0200, Rob Sinclar wrote: > Yep Python is an interpreted language. In other words every python app needs > the python interpreter to be able to run. I'm not sure, but I don't think there's anything particular about the language that says it should be interprete

[Tutor] Using python to create and save a Ms Word file

2006-07-21 Thread Andrew Robert
ormat document from it. The program is not platform dependent but it does require installation of the PyRTF module. I hope someone finds this useful/interesting. #!C:\Python24\python # # program: rtfmaker.py # Author: Andrew Robert # # Function: Take a supplied file and dump its contents to an RTF

Re: [Tutor] Using python to create and save a Ms Word file

2006-07-21 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks for your help on this. Here is the completed code in case anyone is interested. #! C:\Python24\python # # program: mswword.py # Author: Andrew Robert # # Ver Date ProgrammerModification # 1.0 07/20/06 AAR

Re: [Tutor] Using python to create and save a Ms Word file

2006-07-20 Thread andrew clarke
On Thu, Jul 20, 2006 at 01:25:26PM -0400, Andrew Robert wrote: > I have a text file being broadcast on a web site and I would like to download > it > and save it as an MS Word file. ... > I found the following code on the web that comes close to what i need. > > It: >

[Tutor] Using python to create and save a Ms Word file

2006-07-20 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Everyone, I have a text file being broadcast on a web site and I would like to download it and save it as an MS Word file. The download from web is relatively painless. #!C:\Python24\Python import sys from urllib import urlopen if len(sys

[Tutor] Python module and HP OpenView

2006-07-12 Thread Andrew Robert
there were anything specifically created. Any insight you might have on this would be greatly appreciated. - -- Thank you, Andrew Robert Systems Architect Information Technologies MFS Investment Management Phone: 617-954-5882 E-mail: [EMAIL PROTECTED] Linux User Number: #201204 -BEGIN PGP

Re: [Tutor] How to check a files size

2006-06-28 Thread Andrew Robert
Perhaps this? stat = os.stat(self.file_name) file_size = stat[6] Thank you, Andrew Robert ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How can I add my folder to pythonpath?

2006-06-23 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What you need to do is append your existing path. for example: import sys sys.path.append(r'd:\python_modules') You can then import any modules that reside in that path as if they where part of the standard library. Andy -BEGIN PGP SIGNATURE--

[Tutor] Question regarding commit/backout of a message using the pymqi module

2006-06-22 Thread Andrew Robert
if csums.checksum_compare(sys.argv[0],sum,check,file_name) == True: queue.commit() sys.exit(0) else: queue.backout() mqevlog.event("error","CheckSums of r

Re: [Tutor] Universal error handler

2006-06-20 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 You may also want to try a error handling like this. It is platform clean and uses the system standard logging routines. import os, logging, logging.handlers def eventlogger(level,message): """ Sent trapped events to NT application

Re: [Tutor] If then else question

2006-06-14 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Excellent.. much better than testing each value independently. Thank you. Mike Hansen wrote: > > >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Robert >>

[Tutor] If then else question

2006-06-14 Thread Andrew Robert
f accomplishing the same thing? - -- Thank you, Andrew Robert -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (MingW32) Comment: GnuPT 2.7.2 iD8DBQFEkFgfDvn/4H0LjDwRAophAKCZbJaMWBr2G8dLjHO3VtOA98/+1gCbBsys 4B/Q6g9m+3DW+PzcnCpki6k= =t0E4 -END PGP SIGNATURE-

Re: [Tutor] Python related mags

2006-06-12 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Now that is a real pity. Wish I were talented enough to do it myself. Mike Hansen wrote: > On Jun 12, 2006, at 5:53 AM, Andrew Robert wrote: > >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Hi everyone,

[Tutor] Odd traceback - invalid token when extracting contents of XML data element

2006-06-12 Thread Andrew Robert
it plays nice with existing perl code already in place. Not my choice, but what can you do. Any help you can provide on this would be greatly appreciated. -- Thank you, Andrew Robert #!c:\python24\python # Program: sender.py # Authors: Andrew Robert and Dariusz Suchojad # # Function: T

[Tutor] Python related mags

2006-06-12 Thread Andrew Robert
appears to be defunct. - -- Thank you, Andrew Robert Systems Architect Information Technologies MFS Investment Management Phone: 617-954-5882 E-mail: [EMAIL PROTECTED] Linux User Number: #201204 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (MingW32) Comment: GnuPT 2.7.2

Re: [Tutor] How to import a module which was not in the current working directory?

2006-05-26 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Linda, You can append your path to include the location of the module. An example of this would be: sys.path.append(r'\\share\somedirectory') linda.s wrote: > Hi, > How to import a module which was not in the current working directory? > Thanks

Re: [Tutor] Question on regular expressions

2006-05-25 Thread Andrew Robert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Everyone, Thanks for all of your patience on this. I finally got it to work. Here is the completed test code showing what is going on. Not cleaned up yet but it works for proof-of-concept purposes. #!/usr/bin/python import re,base64 # Eva

Re: [Tutor] Question on regular expressions

2006-05-25 Thread Andrew Robert
. The hex to char pass does not appear to work at all. No error is generated. It just appears to be ignored. Kent Johnson wrote: > Andrew Robert wrote: > > You have an argument in the wrong place. Stop trying to do everything in > one line! Put the lambda in a def'd

Re: [Tutor] Question on regular expressions

2006-05-25 Thread Andrew Robert
But I'd also recommend writing a helper function here. Just because you > can do this in one line doesn't mean you have to. *grin* It might be > useful to change the lambda back to a helper function. > - -- Thank you, Andrew Robert Systems Architect Information Techn

Re: [Tutor] Question on regular expressions

2006-05-25 Thread Andrew Robert
a format string. > > The syntax error is caused by mismatched parentheses. > > Kent > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > - -- Thank you, Andrew Robert Systems Architect Infor

Re: [Tutor] Question on regular expressions

2006-05-25 Thread Andrew Robert
any chance, do you see where the syntax issue is? Kent Johnson wrote: > Andrew Robert wrote: > Use int(s, 16) to convert a base 16 string to an integer, and chr() to > convert the int to a string. So something like this: > lambda s: chr(int(s.group(), 16))) > > Kent > >

Re: [Tutor] Question on regular expressions

2006-05-25 Thread Andrew Robert
stdout.write() instead of print: > for line i open(r'e:\pycode\sigh.txt','rb'): > line = re.sub(r'([^\w\s])', lambda s: '%%%2X' % ord(s.group()), line) > sys.stdout.write(line) > > Kent > - -- Thank you, Andrew Robert Systems Arc

Re: [Tutor] Question on regular expressions

2006-05-25 Thread Andrew Robert
>> >> Not familiar with lamda :). > > You ae absolutely right. > It creates an un-named(or anonymous function). :-) > >> The un-named function does in-place transformation of the character to >> the established hex value. > > Its actually the call

  1   2   >