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
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
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
, 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
(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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
> &
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
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
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.
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
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
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
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/
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
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
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
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?
>> >
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
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
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:
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",
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
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
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
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
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
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
> 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
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
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 ...
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
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
*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
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
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
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
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
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](*&*
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
future releases?
Thanks
Regards, Andrew
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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:
27;UI', "ReferencedTransferSyntaxUIDInFile", '1', ''),
(0x0004,0x1600):('UL', "NumberOfReferences", '1', ''),
# data tags
..
..
.}
Correct I have no idea how to use the dictionaries t
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
, 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
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
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
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,
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
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
-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
-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
-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
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
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
-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
-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
-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
-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
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
_
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/
___
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
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
-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
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:
>
-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
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
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
-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--
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
-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
-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
>>
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-
-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,
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
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
-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
-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
.
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
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
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
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
>
>
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
>>
>> 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 - 100 of 165 matches
Mail list logo