From: Steven D'Aprano
To: tutor@python.org
Sent: Thursday, March 8, 2012 7:51:33 AM
Subject: Re: [Tutor] Tuple - Immutable ?
col speed wrote:
> I was just thinking about the immutability of things and tried this
> (which -at least I- find interesting:
>
Hi All,
I'm new to programming and wondering about an IDE for Python on Linux. I'd
appreciate any feedback on this and good tutorials or books on Python 3 and the
IDEs suggested. There are many available and I'm wondering what you as users
find effective.
Thanks,
John_
Hi,
I want to build python-2.7.2 and omit some modules that I don't need in order
to create a smaller Python interpreter.
Am I able to do this?
Any recommendations?
Thank you ___
Tutor maillist - Tutor@python.o
Hi all,
I have attempted to create a programme which removes every Nth person
from the list until there is only one name remaining. N is inputted by
the user.
Here is the code:
def survivor(names, step):
next = names
while len(next) > 1:
index = step - 1
next.remove (next[i
Hi all,
I have wriiten the following code:
[Segment]
def survivor(names, step):
index = step - 1
next = names
while len(next)> 1:
next.remove (next[index])
However when ever i run it i get this error message:
Traceback (most recent call last):
File "", line 1, in
Hi all,
When i run a doctest on this piece of code (shown at bottom) i get this error
message [from the doctest]:
Trying:
rot13('5 The Parade')
Expecting:
'5 Gur Cnenqr'
**
File "F:\Uni\Rot13_1.py", line 12, in Rot13_
On Friday, October 14, 2011 09:45:57 am Tony Pelletier wrote:
> Hi,
>
> I have a question regarding the speed of my program on linux in comparison
> to windows.
>
> I'm using geopy and contacting Google for geocodes for records in a csv I
> created. Like such:
>
> try:
> reader = csv.r
Following up on this...
Why does pylint seem to think it is a bad idea?
Description ResourcePathLocationType
ID:W0142 plot_ts_array_split_x: Used * or **
magic tsplot.py /research.plot line 299PyLint Problem
Thanks,
john
On Thu, Aug 25, 2011 at 10:44
Ha! Inheritance!
On Thu, Aug 25, 2011 at 7:51 PM, John wrote:
> Hello, I am writing a module that will have two classes ('runners') I
> am calling them, as they will ultimately use subprocess to run a
> command line program, so they are basically option parsers, etc...
>
&
Not entirely sure, but I think it is as simple as:
scanResults = open('scanResults.txt', 'r').readlines()
verifiedList = open('verifiedList.txt', 'r').readlines()
Now both are lists. I assume each mac address is on it's own line?
-john
On Thu,
Hello, I am writing a module that will have two classes ('runners') I
am calling them, as they will ultimately use subprocess to run a
command line program, so they are basically option parsers, etc...
As I wrote the second 'runner', I realized many of the methods are
going to be the same as the f
Thanks for the feedback. I wasn't aware about the assert usage not
being intended for production code.
On Wed, Aug 24, 2011 at 11:37 PM, Alan Gauld wrote:
> On 24/08/11 21:03, Prasad, Ramit wrote:
>>
>> I was under the impression that asserts are more for testing
>
>> than for production code
>
>
eys)))
for kw in keys:
print("{0} => {1}".format(kw, kwargs[kw]))
Are there some good examples of when this would be a good idea to implement?
--john
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Thank you. I've corrected the KeyError, and changed the function to:
def overide_options(self, options, run_id=None):
""" completely overide the options dict """
assert isinstance(options, dict), "override options requires a dict"
if run_id in self.run_queue:
method is fine, but I'm not sure about the override_options method...
and for that matter, I'm not sure this is the best approach overall...
any comments, critiques?
Thank you,
john
class Runner(object):
""" Initiate with an optional dictionary of settings.
De
a long single line
beginning with a "[", containing a mixture of integers and signed real
numbers separated only by a commas, and ending in a "]".
Any help to begin my understanding of print (re)assignments, and, fixing
this script would be MOST welcome, thanks to you all!
Hi I am new to python and was wondering what the best way to create an
order(bid and offer) queue, then match a bid and offer so that if
bid==offer, creates a filled order FIFO in python cgi using mysql? Does
anybody have any ideas? It would be greatly appreciated.
Best
chuck
___
On Saturday, June 25, 2011 06:18:14 am Adam Carr wrote:
> Good Morning:
>
> I am very new to Python but I am enjoying the learning process. I have a
> question about the application of Python to a problem at the industrial
> business where I work. My two main questions are:
>
> 1. Can Python be u
I noticed some odd behavior relating to eval(). First, a baseline case for
behavior:
>>> def test():
... x = 5
... return [a for a in range(10) if a == x]
...
>>> test()
[5]
So far so good. Now let's try eval:
>>> c = compile('[a for a in range(10) if a == x]', '', 'single')
>>> eval(c, globals(
Hi Mark -
The characters skipped were unintentional, I sliced up the report based on
starting/ending column numbers that I somewhat guessed and massaged by
merely comparing the output of the openPOs list to the actual report. There
might even been some room to massage those boundaries further to
to have a list like this to get another set of eyes reviewing the
code, very very helpful.
Thanks again Steve for your response, I really appreciate it.
I'll report back once I get the changes implemented.
On Thu, Feb 10, 2011 at 7:31 PM, Steven D'Aprano wrote:
> John Martinetti wrote
o modify my code and I'll get back to the
list if I have any other issues that I need help with.
Lastly - this list is great...I think I'm going to learn a lot here.
Thanks.
On Thu, Feb 10, 2011 at 5:52 PM, Dave Angel wrote:
> On 01/-10/-28163 02:59 PM, John Martinetti wrote:
>
Hello -
I'm a novice programmer, not even amateur level and I need some help with
developing an algorithm to process a list of strings.
I hope this list is tolerant of n00bs, if not, please let me know and I'll
take this elsewhere.
Some background.
I cut up a text based report from a reporting
Andre Engels gmail.com> writes
> Is:
>
> [start] + items + [end]
>
> lightweight enough?
Oh man, duh. I knew it was something simple. Thanks :)
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org
x27;+', 'def', ')']
Of course, the star doesn't work there. Is there any easy,
syntactically-lightweight way to get that output?
Thanks,
John
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
ing the time to answer and explain such a basic concept.
I appreciate it!
-jlr
On Sat, Dec 11, 2010 at 6:39 PM, Steven D'Aprano wrote:
> John Russell wrote:
>
> So, my question is this, and I realize that this is *very* basic - what is
>> going on with the last element? Why is
Last night I started working through a book (Beginning Python: Using Python
2.6 and Python 3.1) I bought to learn Python, and there is an example in it
that doesn't make sense to me.
There is an example on slicing sequences that goes like this:
slice_me=("The", "next", "time", "we","meet","the",
ts).
But when I passed the same FlightData object to the function and
called it inside it would not work. It would still return a
numpy.ma.core.MaskedArray, but the max and min methods on the array
returned empty values, which caused my function to crash.
On Wed, Dec 8, 2010 at 2:18 AM, Alan Gauld w
Hello,
I have a strange problem with a piece of code I've written. It's a bit
overly complicated to make an example with, but the gist is below. But
in the example below, it works. However, in my example, when I call
the method from within the function, it returns something other than
what I expec
generic class, no?
class Structure(object):
pass
Then, you could easily say:
S = Structure()
S.this = ['my slice of cheese']
and perhaps I would be being more 'pythonic'?? This I could quite
easily do, as, where I have used this class, I almost never actually
use the 'di
Hello all,
I have been using this class extensively in my modules / scripts. It
provides the ability to .reference dictionary values. I find it handy,
but am afraid it may come back to haunt me at some point. Is there
anything wrong with using this?
class Structure(dict):
""" A 'fancy' dicti
On 11/30/2010 7:27 PM, Adam Bark wrote:
On 01/12/10 01:00, John Smith wrote:
Hi, Walter -
I got pywin32-214.win32-py2.7.exe because I have the Intel i7 (I'm
guessing that the AMD versions are for the AMD processor). However,
all of the exe offerings have the same "Python not found i
On 11/30/2010 6:23 PM, Walter Prins wrote:
Hello John,
(snip)
Apparently so. Well, win32file is part of the PyWin32 package, which
are a set of modules that wrap many Windows API's. I'm not sure why it
was't/isn't required for PySerial 2.5 or whether as you say pe
On 11/30/2010 10:37 AM, Walter Prins wrote:
Hello John
(snip)
In any case, to fix it let's delete all instances of pySerial and then
install it again, as follows:
1.) Open up your Python "site-packages" folder in Windows Explorer, e.g.
open up:
E:\Python27\lib\site-packages
On 11/29/2010 9:41 PM, Rance Hall wrote:
On Mon, Nov 29, 2010 at 8:21 PM, John Smith wrote:
On 11/29/2010 5:56 PM, Emile van Sebille wrote:
(snip)
Hmmm... any chance you don't have administrative rights on the account
performing this? I never got to Win7 (having stopped at XP) but I
ser=403744
Emile
I'll consider that, Emile. First, though, I would like to hear from
Walter again after my last post.
Thanks for your suggestions.
Cheers,
John
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 11/29/2010 4:20 PM, Emile van Sebille wrote:
On 11/29/2010 1:44 PM John Smith said...
But, when I tried it in Python, I got the same as before:
>>> import serial
>>> ser = serial.Serial(0, timeout = 1)
out of curiosity, if you change the timeout above to 5
&
On 11/28/2010 8:06 PM, Walter Prins wrote:
John,
(snip stuff)
Ugh, you're probably not going to like this. I've done some googling
and it appears this may be a 64-bit issue with the "ctypes" module...
apparently "64-bit ctypes can only import 64-bit libraries"
On 11/28/2010 10:57 AM, Emile van Sebille wrote:
On 11/28/2010 7:55 AM John Smith said...
Can anybody tell me why the handle below is invalid? I'm running Win7.
TIA,
John
Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)]
on win32
Type "copyright"
Can anybody tell me why the handle below is invalid? I'm running Win7.
TIA,
John
Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import serial
Thank you both! Broadcasting is a concept I hadn't yet read about, but
knew was important for efficient python programming... thanks for the
link!
On Sat, Nov 27, 2010 at 6:44 PM, Eike Welk wrote:
> Hello John!
>
> On Friday 26.11.2010 23:23:51 Peter Otten wrote:
>> John wro
since in Java i can pass an anonymous class to a function, and this anon class
has member functions that can contain a
body of implementation codes having the full expression of permissible syntax
(if,for,while...), my question is, after
seeing various examples of lambda in python being ALL one-l
I know this is a simple problem, but I want to do it the most
efficient way (that is vectorized...)
import numpy as np
a = np.array(([1,2,3,4],[1,.2,3,4],[1,22,3,4]))
b = np.sum(a,axis=1)
for i,elem in enumerate(a):
a[i,:] = elem/b[i]
suggestions?
_
Hi, Walter -
Thanks to you, pyserial is installed and imports into Python. Not having
double backslashes was the latest problem that you got me through.
I am grateful for the support and education you have given me.
Cheers,
John
___
Tutor maillist
stop now before I install a bunch of extra
applications that I need only to install one or two Python modules.
I like Python itself. Very powerful. But I guess I'll look for some
other language which provides the features I need without the hassle.
Thanks again for your help.
Cheers,
John
e"
>> #
>> dst2 = "/home/joseph/Projects/Training/Python/example/Two/"
>> dst3 = "/home/joseph/Projects/Training/Python/example/Three/"
>> #
>>
>> #
>> #shutil.move(src, dst)
>> shutil.copy(src,dst2)
>> shutil.move(src,dst3)
>>
>> ##
#shutil.move(src, dst)
shutil.copy(src,dst2)
shutil.move(src,dst3)
##
--
Thanks
Joseph John
http://www.oss101.com/
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hello, I thought the following should end with G[1] and G[0] returning
20. Why doesn't it?
In [69]: a = 10
In [70]: G = {}
In [71]: G[0] = [a]
In [72]: G[1] = G[0]
In [73]: a = 20
In [74]: G[1]
Out[74]: [10]
In [75]: G[0]
Out[75]: [10]
??
___
Tutor mail
hehe. yeah, I had to go check my old PC that's collecting dust on how
to navigate the 'happy dungeon' of windows wizards...
I do prefer:
export PYTHONPATH=/my/custom/dir
On Mon, Nov 1, 2010 at 11:03 PM, Vince Spicer wrote:
>
>
> On Mon, Nov 1, 2010 at 4:00 PM, Vince Spicer wrote:
>>
>>
>> On
Chris,
I haven't worked on windows in ages, but I think you can set a
PYTHONPATH variable if you right click on My Computer and maybe the
advanced tab, there is a place to set ENVIRONMENT VARIABLES. Create a
new one called PYTHONPATH pointing to your directory.
-john
On Mon, Nov 1, 2010
Autumn,
Here's a basic script, if you save this in a file called hello.py and
type 'python hello.py' at the prompt, or as others are saying using
the python launcher, you should get some output. hth, john
SCRIPT (include lines below here):
#!/usr/bin/env python
import os
user =
e:
> m.append(a[I])
> m=map(float,m)
> print m;print len( m )
> >> [1,2,3]
> >> 3
>
> looking forward to seeing your help,
> regards,
> Ahmed
>
>
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
Right thanks for all the help guys, finally got it working. It was because
as previously suggested, I was using Idle instead of the terminal.
Again thanks for all the help
John
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
line with the word in it off the
screen, but I don't really like it to be honest. The getpass module seems to
be the best solution i just don't understand why its not working for me.
Regards
John
On 19 July 2010 16:02, wrote:
> Send Tutor mailing list submissions to
&g
dh6SX3q>, which uses Steve
> D'Aprano's random_digits function, took 201 seconds (3.35 minutes).
>
> Still, I understand yours, and not his (the return line). I'd never
> noticed random.sample() before, nor tried out extend() on a list. So
> thanks, Bob.
>
> Dick
On Tuesday 06 July 2010 05:35:34 pm Nick Raptis wrote:
> Please excuse if I'm jumping on the topic. Haven't done any GUI work so
> this interests me too.
>
> wxPython always seemed a great choice as it works on all platforms, and
> uses GTK+ for linux.
> Well, what mainly bugs me about wxPython is
yntax
I've tried every changing where the white space is and the commas but i just
cant get it to work.
any help would be much appreciated and thank you in advance
John
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Friday 02 July 2010 08:19:24 pm bob gailer wrote:
> On 7/2/2010 5:56 PM, Jeff Johnson wrote:
> > [snip]
> >
> > Visual FoxPro ... is very similar to Access
>
> I differ. Access and FoxPro are very different. Yes they both use
> tables, relationships, indexes and SQL. Yes they both have visual
>
ly common as part of
integrating a Python app with Gnome. I cannot image every app maintains
their own list of recently used docs when it is already stored within
the desktop.
If anyone has any ideas, please let me know.
Thanks,
John S.
___
Tutor maillist -
On Friday 26 March 2010 08:33:35 am Lowell Tackett wrote:
> >From the virtual desk of Lowell Tackett
>
> --- On Fri, 3/26/10, Bala subramanian wrote:
>
> From: Bala subramanian
> Subject: [Tutor] python magazine
> To: tutor@python.org
> Date: Friday, March 26, 2010, 8:07 AM
>
> Friends,
> I am s
elds'. But what is it yielding too?
John
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hello,
I'm not a Mac user, but I'm a promoter of Python! I have a good friend using
a Mac who's becoming sceptical of python due to frustrations with the
PYTHONPATH. I'm trying to help...
Everything is fine running vanilla python. Importing modules works fine. But
in ipython, the module paths ne
Can someone please let me know how to read a file one record at a time (just
say fixed block for now - see small example below) and assign columns to
fields. Then reference the field names with if-then-else logic.
Sample Fixed Block File:
John98762
John82634
John11234
Thank you.
John Filben
On Tuesday 15 December 2009 09:20:16 am bob gailer wrote:
> Kent Johnson wrote:
> > OpenHatch is a new web site that compiles entry-level opportunities
> > with open-source programming projects. Many of the projects are in
> > Python. If you are looking for a way to get involved with an open
> > so
On Wednesday 09 December 2009 01:45:38 pm bob gailer wrote:
> John wrote:
> > I realize that some may consider this an advance question. But there are
> > many here that are advance. So I'm hoping some nice soul will help me.
> >
> > I'm attempting to use a
I realize that some may consider this an advance question. But there are many
here that are advance. So I'm hoping some nice soul will help me.
I'm attempting to use a OCX designed to talk with QuickBooks. I'm using
win32com for the first time and have discovered an issue that I'm sure others
On Friday 20 November 2009 09:48:38 am Alan Gauld wrote:
> "John" wrote
>
> > class A (wx.Panel);
> > def__init__(...)
> >
> > class B(wx.PyPanel):
> >
> > def __init__(..):
> > self.pages = A(...)
> >
> > class C (B)
On Friday 20 November 2009 04:48:59 am Lie Ryan wrote:
> Is this what you want?
>
> class C(B):
> �...@property
> def wxpanelFontSize(self):
> return self.pages.wxpanelFontSize
> �...@wxpanelfontsize.setter
> def wxpanelFontSize(self, value):
> self.pages.wxpanel
Hi,
I'm not to sure I can explain myself. But I need to ask because I do not
understand how it works or what is possible.
class A (wx.Panel);
def__init__(...)
class B(wx.PyPanel):
def __init__(..):
self.pages = A(...)
class C (B)
def __init__(...)
I can't change the code in eith
e that's what your method returns.
What you need to do is put an actual function in there, instead of a
function call.
Here's a toy example:
>>> def say_hello():
... print 'Hello world!'
...
>>> myDict = { 1:say_hello }
On Tuesday 27 October 2009 06:25:13 am John wrote:
> I use a 'SuperDict' all the time in my code. Not sure it's a good idea, but
> I find it convenient. Also, I wouldn't mind comments on why/why not to use
> something like this:
>
> class SuperDict(dict
I use a 'SuperDict' all the time in my code. Not sure it's a good idea, but
I find it convenient. Also, I wouldn't mind comments on why/why not to use
something like this:
class SuperDict(dict):
def __getattr__(self, attr):
return self[attr]
def __setattr__(self, attr, value):
On Friday 23 October 2009 08:05:29 am John wrote:
> I'm using python 2.5
>
> I have a long list of if, elif, else. I always thought it was very NOT
> pythonic. It's easy to read but not pretty.
>
> for fldType in fieldList:
> if "int" in fldType:
>
I'm using python 2.5
I have a long list of if, elif, else. I always thought it was very NOT
pythonic. It's easy to read but not pretty.
for fldType in fieldList:
if "int" in fldType:
fld = "I"
elif "char" in fldType :
fld = "C"
elif "bool" in fldType :
fld = "B" .
On Tuesday 20 October 2009 12:41:28 pm Alan Gauld wrote:
> "John" wrote
>
> > As you guys can see I'm just starting out in the authentication world.
>
> This is a list for beginners in Python not authentication.
> You would probably be better off posting on
Hi,
Is there a general discussion (somewhere on the web) on how to
1. determine what authentication the platform requires
2. can #1 be determine dynamically
3. If I know #1 will it be cross platform?
Googling reveals that there are many authenticating modules, LDAP, PAS,
RADIUS, Active Directo
On Monday 12 October 2009 05:17:16 am Dotan Cohen wrote:
> I have a simple PHP web application with a form, which enter the
> information entered into the form into a database. However, I will be
> several weeks without internet access so I now have two choices:
>
> 1) Run the script locally on my
On Sunday 20 September 2009 03:43:32 pm Eike Welk wrote:
> On Sunday 20 September 2009, John wrote:
> > Hi,
> >
> > I think I understand what decorators are and how they work. Maybe
> > it's just me but I don't know where I'd use them in my real world
Hi,
I think I understand what decorators are and how they work. Maybe it's just
me but I don't know where I'd use them in my real world programming. I see
how they work with profile or coverage but does anyone have real world uses.
I mostly create wxPython apps and don't see where they migh
For the time being, I would like to be removed from the Tutor Mailing List
for Python Users.
Thanks,
- John Jenkinson
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Monday 17 August 2009 05:43:05 pm Kent Johnson wrote:
> Forwarding to the list with my reply.
>
> On Mon, Aug 17, 2009 at 4:04 PM, John wrote:
> > Thanks for taking the time to write. But I was really looking for a
> > simple way of calling a report writer (like using a
On Monday 17 August 2009 01:08:15 pm Oxymoron wrote:
> (Posting to list!)
>
> On Tue, Aug 18, 2009 at 6:01 AM, John wrote:
> > First I love your handle. And second, thanks for taking the time to
> > explain
> >
> :-)
> :
> > jython world. But I was reall
Hi,
I have been searching for a report writer to work with my python programs. I
did find reportlab. But most of the other report writers are java based. I
am confused by all the jargon associated with Java and have very little
working knowledge of the environment. So I'm hoping someone will
//www.crummy.com/cgi-bin/msm/map.cgi/ASCII%2C+Dammit
--
John Krukoff
Land Title Guarantee Company
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Tuesday 21 July 2009 11:12:23 am Deb wrote:
> My son suggested I play around with Python. I was wondering if anybody has
> any real life applications? It appears to be able to do quite a lot, but
> is anybody really doing it with Python? I am very curious about this
> language. I used to be a
Sanders,
The problem is I don't want date, I want the date AND hour, just not
minutes.
As for the comparison, in numpy here's what happens when I change the way I
construct the where statements:
--> 196 ind = np.where( (t1 < Y[:,0] < t2) ) #same result
with/without inner parens
197
Alan Gauld wrote:
>
>
> I assume there is a good reason to use a numpy array instead of
> a regular list? ie You need a numpy array elsewhere in the code?
> I've never used numpy bt there is a possibility that array access
> is slower than list access, but I have no idea. It just adds an extra
points in the data.
As for your comment regarding the invariant... would it be:
while hr q:
NOT
while hr not q:
The latter makes more sense to me, but I'm not familiar with this
approach...
Thanks,
john
Bob Gailer wrote:
>
> John [H2O] wrote:
>> Here's a function I wro
Here's a function I wrote to calculate hourly averages:
It seems a bit slow, however... any thoughts on how to improve it?
def calc_hravg(X):
"""Calculates hourly average from input data"""
X_hr = []
minX = X[:,0].min()
hr = dt.datetime(*minX.timetuple()[0:4])
while hr
spir wrote:
>
>
> What you're looking for is a dictionary...
> s = {"cheese":"Brie", "country":"France", ...}
>
> Or maybe a kind of object type that works ~ like a dict, but with object
> syntax (get rid of {} and "" for keys). Example:
>
> class Stuff(object):
> def __iter__(self):
>
Thanks everyone, all of this feedback is valuable!
--
View this message in context:
http://www.nabble.com/creating-a-dict-like-class---asigning-variables...-this-one-may-take-some-thought--%29-tp23759398p24218879.html
Sent from the Python - tutor mailing list archive at Nabble.com.
__
2009/6/23 Alan Gauld :
> Interesting! How is a NaN stored in Python?
> ie. How do you get to the point of having one in the first place?
Well, you can do this:
>>> float('nan')
nan
(try float('inf') too)
--
John.
_
sure you could find many discussions
on this topic in the list archives.
--
John.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
n)
(oh, there is a third source for python: MacPorts. Are you using macports?)
--
John.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hello, I am trying to create a class to hold and reference things similar to
matlab's structure.
## A class definition to hold things
class stuff(object):
""" holds stuff """
def __init__():
pass
@classmethod
def items(cls):
stuff = []
for i in cls.__dict__
2009/5/26 Eduardo Vieira :
> Now, a little farther on the topic of a Bible database. I'm not sure
> how I should proceed. I don't really have the db file I need, I will
> have to generate it somehow, from a bible software, because the
> version I want is for Portuguese. I have found a bible in sql,
2009/5/22 Eduardo Vieira :
> I will be looking for lines like these:
> Lesson Text: Acts 5:15-20, 25; 10:12; John 3:16; Psalm 23
>
> So, references in different chapters are separated by a semicolon. My
> main challenge would be make the program guess that 10:12 refers to
> the
;1', '1', '1', '1', '1', '1', '1'], 'names': ['RA7',
'RA6', 'RA5', '-', 'RA3', 'RA2', 'RA1', 'RA0']}
If regular expressions aren't powerful enough, you could look into a
full-fledged parsing library. There are two I know of: simpleparse
and pyparsing. SimpleParse works well if you're familiar with writing
grammars: you write a grammar in the usual style, and simpleparse
makes a parser out of it. pyparsing is more OO.
--
John.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
help
me for this project.
- John Jenkinson
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
0001, 11.6, 12.0]
However, the builtin range() only works with integers. I think there
is a range() function in the python cookbook that will do fractional
step sizes.
But really, there's nothing wrong with your while loop.
--
John.
___
Tuto
101 - 200 of 1089 matches
Mail list logo