psst, there is NO standardized reg-ex. you've been living in a perl bubble.
undoubtedly other people will have better advice.
"Life can only be understood backwards;
But it must be lived forwards" --S.K.
___
Tutor maillist - Tutor@python.or
hi steve, I have summer class for next three monday
and wednesday evenings. we'll catch up someday. sorry,
ron
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
in the US, # is a symbol for weight, not currency. How
do you write out, with a quick symbol, "I'm going to
buy 3# of potatoes? Of course now you're metric, but
did you also use 'pounds' for weight before that?
_
Here's the code and error message:
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121
___
myList)):
myList[index] += 1
print myList
File "", line 3
print myList
^
SyntaxError: invalid syntax
can someone tell me what the syntax error is, and how
to correct it?
my thanks, ron
near unexpected
token `('
./foreach.py: line 4: `for index in
range(len(myList)):'
I think I liked the first result better!
thanks again, ron
Park yourself in front of a world of choices in alter
thanks Luke, you folks are awesome!
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
__
A simple way to migrate to Linux and get a recent
version of Python by default would be to download a
copy of Ubuntu Linux. You can burn it onto a CD, then
pop it ino the cd drive and boot it on your Windows
machine. It runs in a virtual machine, so you are
assured that your Windows installation wi
When I run this program using your code on Ubuntu
Linux, I get:
~$ ./c2f.py 44
44\uF = 7\uC
Please notice that the code you have posted has
indentation block errors.
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protec
I think we should say that the number set is zero
through nine (not 1-10 as we were taught in school),
making "zero" the first number in the set; thus the
offset by one. Of course zero is not a number, but a
placeholder for a number. Thankfully this concept was
invented a few centuries ago in India
It seems that the confusion is exacerbated by the fact
that we're using the theoretical number set to
reference the common one. I suppose this is a
carry-over from binary, since in binary if you don't
have a zero, you also won't have a bunch of other
numbers like 2, 4 and so forth.
__
-code, but I don't want to
reinvent the wheel if there are existing modules that do
almost (or even better, exactly) what I need.
I work on WinXp, Linux, and WindowsCE. WindowsCE has a fairly
plain-vanilla Python build, so it's better if I stick to the core modules as far
as possible.
HIT_WALL_IMAGE =
wxImage('ouch2.png').ConvertToBitmap() File
"C:\Python23\Lib\site-packages\wx\_core.py", line 2282, in
ConvertToBitmap return _core_.Image_ConvertToBitmap(*args,
**kwargs)wx._core.PyNoAppError: The wx.App object must be created
first!
Ron
I just happened across an answer yesterday. PIL writes PDF s.
http://www.pythonware.com/products/pil/
Ron
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
sCE. WindowsCE has a fairly
plain-vanilla Python build, so it's better if I stick to the core modules as far
as possible.
Ron Phillips
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
thought maybe WorldDisplay.py, or RURmain.py?
Anyway, I really like the concept, and the screenshots look intriguing. You
have a nice writing style in English, by the way -- I think kids will pick right
up on the "fix the robot" metaphor.
Which program do I st
products (Python, LISP, VBA), and to support IT, I needed languages for Linux
servers (Python, C, etc.) and Windows servers and desktops (Python, VB, C#,
etc.) and WindowsCE(Python, VBCE).
What option did I really have, then? Besides, it's just so COOL.
I've had problems getting started with tkinter, but since reading these
lessons everything is beginning to make sense. If anyone is interested this
is the link.
http://bembry.org/tech/python/index.php
Ron A
___
Tutor maillist - Tutor@python.org
Can anyone tell me what I've done wrong in this
script.
I'm trying to get only the lines that start with
"This" for a text file.
Here's what I wrote:
>>> import re
>>> f = open('c:/lines.txt').readlines()
>>> for line in f:
match = re.search('^This',f)
if line == match:
I'm dping something very simple in RE.
Lets say I'm trying to match an American Phone number
I write the code this way and try to match it:
import re
string = 'My phone is 410-995-1155'
pattern = r'\d{3}-\d{3}-\d{4}'
re.match(pattern,string).group()
but I get this error message
Traceback (most r
How would I save a list to a new file
for example:
If line.startswith('XXX'):
save list to new file
But I get errors saying only stings can be saved this
way.
__
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://
Trying to scrape some headlines off a newspaper with
this code:
import urllib, re
pattern = re.compile("""(.*)""", re.DOTALL)
page =
urllib.urlopen("http://www.startribune.com";).read()
for (headline, code, description) in
pattern.findall(page):
print (headline, code, description)
I'm gett
Ignore my first posting. Here's what I'm trying to do.
I want to extract headlines from a newspaper's website
using this code. It works, but I want to match the
second group in (.*) and print
that out.
Sugguestions
import urllib, re
pattern = re.compile("""(.*)""", re.DOTALL)
page =
urllib.urlope
And now for something only slightly different: education research shows
that people process "positives" far more quickly and accurately than
"negatives", so for readability I often code like:
if os.path.exists('filename')
#no-operation
else
#operation
I know that you can do this to get a count of home
many times a word appears in a file
f = open('text.txt').read()
print f.count('word')
Other than using a several print statments to look for
seperate words like this, is there a way to do it so
that I get a individual count of each word:
word1
Thanks to everyone who replied to my post. All of your
suggestions seem to work. My thanks
Ron
--- Ryan Davis <[EMAIL PROTECTED]> wrote:
> You could use split() to split the contents of the
> file into a list of strings.
>
> ###
> >>> x = 'asdf foo bar f
Trying to scrape a newspaper site for articles using
this code whic ws done with help from the list:
import urllib, re
pattern = re.compile("""(.*).""", re.DOTALL)
page
=urllib.urlopen("http://www.startribune.com";).read()
for headline, body in pattern.findall(page):
print body
It should g
> pattern = re.compile(""" href="/(.*?)">(.*?)\.""", re.DOTALL)
>
> Kent
>
> Ron Nixon wrote:
> > Trying to scrape a newspaper site for articles
> using
> > this code whic ws done with help from the list:
>
he vaules in a list and doing
the replace, but came up short. Any suggestions?
Thanks in advance
Ron
__
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
___
The following program takes text data like this:
Jimi Hendrix
2100 South Ave
Seattle, WA 55408
and changes it to this
Jimi Hendrix, 2100 South Ave,Seattle,WA,55488
and writes it to a file. The problem I'm running into
is that it only writes this first address to a file
and there are several oth
Thanks to all who replied to my post earlier on re's.
I'm still preplexed by why re.search and re.match
works in the code below, but not re.findall.
re.findall is suppose to return all non-voerlapping
occurances of the pattern that matches in this
example, but it returns errors. Looking through th
% (name, address,
citystate,zipcd))
o.close()
print("%s,%s,%s,%s\n" % (name, address,
citystate,zipcd))
--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> Ron Nixon wrote:
> > Thanks to all who replied to my post earlier on
> re's.
> > I'm still preplexed by why
'shareable' python. Everything else I've done so far is either a quick-and-dirty for my own use, or a simple illustration for instructional purposes.
The script produces expected results, but if anyone is so inclined, I'd appreciate review/evaluation/critique of the 'python
Thank you, Andrei, that's just what I was hoping for -- I wondered about some of those issues, but was a little unsure how to approach a solution.
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
side=RIGHT, fill=Y)
listbox = Listbox(root, yscrollcommand=scrollbar.set)
for i in range(55):
listbox.insert(END, str(i))
listbox.pack(side=LEFT, fill=BOTH)
scrollbar.config(command=listbox.yview)
Ron A
___
Tutor maillist - Tutor@pytho
I was trying to put buttons in, but now I know why it wouldn't work. I'm
going to take a look at PMW.
Thanks.
Ron A
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
short version: I need a way to get max and min E and N out of [(E0,N0),(E1,N1)...(En,Nn)] without reordering the list
long version:
I would like a list of geographic coordinates (Easting, Northing) to maintain a "bounding box" [(minEasting,minNorthing),(maxEasting,maxNorthing)] attribute.
[i].N)) self.boundingBox=geoBox((min(Es),min(Ns)),(max(Es),max(Ns))) return(self.boundingBox)
which works fine, and I think will be pretty fast.
Ron>>> Pujo Aji <[EMAIL PROTECTED]> 5/25/2005 9:47 AM >>>
try this code: L = [(1,11),(2,22)] print max(L) print min(L)I don'
Ron Phillips wrote:>> short version: I need a way to get max and min E and N out of >> [(E0,N0),(E1,N1)...(En,Nn)] without reordering the list>>> Kent Johnson [EMAIL PROTECTED]> 5/25/2005 10:19 AM >>>For Python < 2.4 you need another set of [ ] e.g. min([e
Is there a site like Perl's CPAN for Python? I've seen
the stuff at ActiveState. Anything else?
Ron Nixon
__
Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
http://discover.yahoo.com/o
whatsoever.
I am using Python 2.3, Windows XP. I have run other CGI scripts in the same directory, so I know that works.
Has anyone used this successfully? Can you share demo server and client scripts -- just an echo function or something?
Ron
___
rs -- thanks again for responding!) was about xmlrpclib on the client side, not CGIXMLRPCRequestHandler on the server side, I can now conclude that it is terribly difficult, and slink off to publish using SOAP.
Ron
On 6/23/05, Ron Phillips <[EMAIL PROTECTED]> wrote:> > I believe I'
XMLRPC", which was what I really wanted to do.
Anyway, thank you -- if I can find them again, I'll respond to all those other posts with a link to yours in the archives.
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
some setting I need to change.
I wonder if that's the reason for all those unanswered posts -- it's not a Python problem, per se? Odd, though, that IIS is perfectly happy to run a Python script unless it has CGIXMLRPCRequestHandler in it.
Ron
_
all, anyway. I think I'll put Apache on my local machine and use that.
Thanks, again
Ron
>>> Danny Yoo <[EMAIL PROTECTED]> 6/24/2005 2:44:44 PM >>>
> The example code in the python online documentation calls a non-existant> "div" function, so
I've struggled... Now I'm asking...
What's wrong with this code? Or more to the point,
how do you set the focus to an Entry widget?
Traceback (most recent call last):
File "./run_dialogue.py", line 33, in ?
app = Run_dialogue( root )
File "./run_dialogue.py", line 23, in __init__
sel
> > tk = Tk()
> > tk.config(background='pink')
> > tk.geometry('400x400')
> >
# 320 = width
# 150 = height
#
# Left and down are relative to the screens uppeer
left
#
# 200 = position left (x)
# 200 = position down (y)
tk.geometry( "320x150+200+200")
hth
Ronald Weidner
http://www.techport80.c
This doesn't work. Not an error though. :) What I'm
trying to do is get the text value of a label.
def icon_click(self, event=None):
print event.widget.option_get("text", event.widget)
Or, more to the point... I need to dynamicaly create
clickable labels, each using the same callback. When
--- geon <[EMAIL PROTECTED]> wrote:
> Ron Weidner napsal(a):
>
> >This doesn't work.
> >def icon_click(self, event=None):
> > print event.widget.option_get("text",
> event.widget)
> >
> >
> >
> maybe event.widget[
rning programming python..so please help
I find CherryPy is easy and lightweight to get started. http://www.cherrypy.org
Ron
Header
Description: Binary data
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
--- Jorge Louis De Castro <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Any ideas how I can use Python and the Windows API
> to open a PC's mail client and send an attachment?
> The idea is saving some data onto a file and then
> invoke the email client (OE or Outlook or whatever
> is the default on
It's simple, without any bells and whistles. Move the
slider up and down to change the volume on your Linux
system. Written in Python and Tkinter, this little
program should work with any window manager.
http://www.techport80.com/soundctrl/sound_ctrl.tgz
--
Ronald Weidner
http://www.techport80.
e somewhat.
Anyway, given the string above, what regex will match the and characters, please? I have tried \x02BC and \x92 and \x2019 for the , but no result. I am sure it's simple; I am sure some other newbie has asked it, but I have Googled my brains out, and can
Gears http://www.turbogears.org/, which Kevin Dangoor put together. He does a "Wiki in 20 minutes" tutorial that's pretty impressive.
Ron PhillipsProgrammer/AnalystCounty of Summit Engineer538 E. South St.Akron, OH 44311
___
Tutor mail
hat forces all members to have the same
keys?
Is there an object structure that will let updates to one instance
affect all instances?
Am I even asking the right questions?
I suspect there's an elegant solution, but it's beyond me right now. If
not, fine; I'll happily go on w
tch and patch my code, it's usually because I am trying to do the
wrong thing altogether. And I wasn't using Class attributes properly,
either.
Thanks so much! Sorry for the vague question, but I really think the
class you made is close to what I needed.
Ron
field to a record
without adding at least some default value to all the others.)
I just thought about it, but a CSV file has kind of the same problem.
Thanks, everyone; this will be a real education, however I go!
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
n that table. I realize now that I might
have been
better off just to use a database; they know all about nulls, tables.
types, defaults, etc.
Still, I learned a LOT. So, no remorse!
Thanks again,
Ron
#magicvaluetable.py
###
# -*- coding: utf-8 -*-
#may u
--- Tim Johnson <[EMAIL PROTECTED]> wrote:
> Hello:
> I need to tighten my handling of CGI transmissions.
> I particular, I need to develop a strategy of safely
> dealing with "tainted" characters.
Ahh... tainted characters. If by "tainted" you mean
not UTF-8, there is a c tool called "iconv"
or making xml more
pythonic. Not to take anything away from ElementTree, it's a fine
package; but I find Amara easier to use. Some others that seem
'missing': PIL and NumPy. I didn't try to put it on the wiki page
because I wanted the tutors to have a chance to comment first.
A
is coming on strong as a full-featured, lightweight 'Pythonic" server.I like to use the browser for output because it does so much of the formatting for you and it's cross-platform, and I like using a framework because if you ever want to use your program over the web, you're nearly d
Hi, M-list, my name Ron Speerstra(the Netherlands)
my question: howtoo read the HD/CD/DVD serial-numbers with Python.
Volume-name, dir name, file name. no problem etc.
Gr Ron$
_
Vind alles terug op je PC: MSN Search Toolbar http
gt;> if serno < 0:
>...serno_str = "%X" % (0x1+serno)
>... else:
>...serno_str = "%X" % serno
>...
> >>> serno_str
>'8A73780D'
> >>>
>
>
Thanks Gr Ron Speerstr
Two things.
First, I've been watching this list for several weeks now. I wanted to
respond to Chris Andrew's question regarding Python tutorials (Complete
programming newbie requires tutorial. (Message-ID:
<[EMAIL PROTECTED]>Chris Andrew). Did I reply
correctly?
Second, I've found four Python tut
Anyone have or know where I can find working examples of python's mechanize modules. Try to reverse engineer a script to see how it works. Ron
Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and
er if security is an issue. Python's pprint module will be a help
if you go that route.
I find it useful in development, so even if I am going to use some
other storage, I'll leave any toJSON() and fromJSON() functions I write
in place, anyway.
Ron
__
no attribute 'shortmod'
--
My code follows. If you jump down to the section marked
"#---Logic---", you should be able to see the immediate culprit.
I greatly appreciate any help that anybody on this list can provide!
Thanks!
Ron
*
. It tells me "Database instance has no attribute
>> 'getattr'".
>
> Its actually a special method so needs the underscores __getattr__
> and accessed via a function. I got my syntax muddled:
>
> getattr(db, shortmod)
>
> is how it should be written.
That works! I knew there had to be a way!
Thanks for the help!
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Alan
Thanks for the thorough reply.
> Hi Ron, I'm confused and may be missing something but it
> sounds to me like a classic tree structure that you are trying
> to build for each module.
It seems like a tree to me.
> I''m not sure why you put filling the database
Regex aside, just for a moment the subject line gets my vote for "Most Succinct Description of Programmer Mindset", if there's a competition on.
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I like Karrigell ...http://www.karrigell.com/ for being flexible, complete, lightweight, and easy to learn. I don't know how it scales, but that's not really a consideration for the applications you describe.
Ron>>> "Chad Crabtree" <[EMAIL PROTECTED]> 5/8/20
Even if you don't
choose karrigell for some reason, at least the documentation can help
you sort out the variations on the python/xhtml theme!
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
he latest MySQLdb.py, too. Python 2.4.
I am using animal.py from http://www.kitebird.com/articles/pydbapi.html, but it's been the same thing with other scripts. Is it a setting, or a thinko, or what?
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
That was it all right! Thanks, Kent! Ron___Ron Phillips wrote:
> I am trying to write a script that adds data to a table using
> MySQLdb.py. For some reason, "INSERT" seems to work temporarily. I
> run a command to insert a row, and then do a select query, and it's
> there. Aft
_
the print newsql[:150] => "UPDATE sa2.outfalls SET photo_content =
ÿØÿá*EExif . . . "
and I get this error:
TypeError: argument 1 must be string without null bytes, not str
which sounds reasonable, but I don't know how to fix it. I
Is there a way to get the urlretrive module to grab multiple files similar to
wget?
Ron Nixon
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http
Hey.
I've created a website for learning Python interactively online. Check it
out, and I would really appreciate it if you can also contribute tutorials.
Thanks!
--
-- Ron
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscri
, Apr 20, 2011 at 9:16 PM, Ron Reiter wrote:
> Hey.
>
> I've created a website for learning Python interactively online. Check it
> out, and I would really appreciate it if you can also contribute tutorials.
>
> Thanks!
>
lable.
Best regards,
Ron Painter
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Hello, this is my first post. I'm glad a place like this exists. I'm coming
from primarily a shell scripting background and it was suggested I should
learn python because the two are closely related. I've been studying python
now for about a week and as of right now, I'm not really seeing many
simi
Help. We are upgrading our Win XP to Win7 (64bit) (intel) machines. We have a
legacy Python program we need to still run. We were using ver 2.4 and we had a
shortcut to C:\fileditor\main.py.I installed ver 2.7.9 "Windows x86-64 MSI
installer". Is that what I wanted???
When I pick the shortcut, a
81 matches
Mail list logo