Hello! I was reading the latest version of Mark Pilgrim's "Dive into
Python" and am confused with these example about the pluralization
rules. See http://diveintopython3.org/examples/plural3.py and
http://diveintopython3.org/generators.html#a-list-of-patterns
Here is part of the code:
import re
de
On Sat, Feb 13, 2010 at 7:59 AM, Kent Johnson wrote:
> On Fri, Feb 12, 2010 at 11:49 PM, Eduardo Vieira
> wrote:
>> Hello! I was reading the latest version of Mark Pilgrim's "Dive into
>> Python" and am confused with these example about the pluralization
>>
On Tue, Feb 23, 2010 at 7:27 AM, Dayo Adewunmi wrote:
> Hi all
>
> When i use PIL.Image in this script:http://dpaste.com/163588/ on an .svg
> file, I get this error: http://dpaste.com/163584/
> How do i process .svg files in python?
> Thanks
>
> Dayo
>
> ___
On Wed, Mar 17, 2010 at 1:11 PM, Azhagu Selvan wrote:
> Hi,
>
> I want to get a formatted plaintext and convert into HTML like what
> markdown does. I tried python-mardown. Is there any similar python
> libraries to do that parsing??
>
> -- Azhagu Selvan
> _
> Thanks for this thread. This is very helful. I'm learning a lot from you
> guys. :)
>
> -
> [url=http://crosspromotion.wizard4u.com/]joint ventures[/url]
>
> --
> View this message in context:
> http://old.nabble.com/-Tutor--large-file-tp28874185p28878191.html
> Sent from the Python - tutor
Hello, I've enjoying learning python for the first few years, and
appreciate all the help I have received from this list. I had some
interest in programming and am very glad to have made python my choice
of programming language. Since I didn't go to college for computer
studies, I feel my math is k
Hello, I'm getting confused about the usage of those 2 modules. Which
should I use one to get/manipulate data from a text file?
Regards,
Eduardo
www.express-sign-supply.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription op
I'm trying this example from python docs:
from time import gmtime, strftime
strftime("%a, %d %b %Y %H:%M:%S +", gmtime())
Output = 'Wed, 04 Aug 2010 17:58:42 +'
Is not there a string formatting option for the day without a leading
zero? Like: 'Wed, 4 Aug 2010 17:58:42 +'
It looks like
On Wed, Aug 4, 2010 at 12:45 PM, Eric Hamiter wrote:
> There are a few solutions here:
>
> http://stackoverflow.com/questions/904928/python-strftime-date-decimal-remove-0
>
> Eric
>
>
> On Wed, Aug 4, 2010 at 1:30 PM, Eduardo Vieira
> wrote:
>>
>> I
Hello, list! I'm trying to parse a text file. I'm getting confuse with
my strategy, and flags or how to use a sequence of ifs or elifs,
continue, etc. Anyhow, after several experiments this is close to what
I'd like to get, except, I can't find a way to include all the pin
numbers (12 number sequen
On Tue, Aug 10, 2010 at 1:56 PM, Adam Bark wrote:
>
> The problem is you don't call make_dict unless there's a "FUEL SURCHARGE" or
> multiple pins. Also you don't add the first pin to mydict["tracking"] unless
> there's a "FUEL SURCHARGE".
>
> HTH,
> Adam.
> __
On Fri, Aug 13, 2010 at 2:38 PM, Adam Bark wrote:
> On 11/08/10 18:14, Eduardo Vieira wrote:
>
> On Tue, Aug 10, 2010 at 1:56 PM, Adam Bark wrote:
>
>
>
> The problem is you don't call make_dict unless there's a "FUEL SURCHARGE" or
> multiple pins
On Thu, Sep 16, 2010 at 1:16 AM, Evert Rol wrote:
> The latter: they are not the same:
>
d = {'key': 'food'}
d['key'] == 'foo'
> False
'foo' in d['key']
> True
>
>
> Btw, generally don't use a reserved Python word for a variable, such as dict
> in this case (I know it's an example
The other day I was writing a script to extract data from a file from
the line where a text is found to the end of the file. The same
functionality is this sed script:
'1,/regexp/'d
I couldn't put my head to work around this and came up with a solution
using list slicing. But how can I do that? I w
Hello, I'm fairly new to programming and Python and am trying to
explore Python's email libraries. But I am having trouble making a
connection with an email server, I guess.
I'm running Windows XP, in a server environment. I have administrator
privileges to my machine (not the server machine) to in
Tim wrote:
>
>
> SMTP has to be enabled specifically on the Exchange Server:
> it usually uses its own built-in protocols. It looks
> as though your Exchange isn't running it. Either switch it
> on (or ask your admins to do so) or look at using MAPI
> or CDO instead.
>
> TJG
> _
Hello, list! I hope it's not too much out of place to ask this
question in the Tutor list.
I'm trying to process some information from email messages that goes
in a folder called: "SysAdmin". I could reproduce the recipe from
Python Programming on Win32 sucessfully to read the subject line of
the i
On Fri, Mar 20, 2009 at 2:29 PM, Eduardo Vieira wrote:
> On Fri, Mar 20, 2009 at 9:04 AM, Tim Golden wrote:
>> Eduardo Vieira wrote:
>>>
>>> Thank you very much, Tim for the thorough explanation. Much more than
>>> I could expect. It will be specially usefu
2009/3/24 Emad Nawfal (عماد نوفل) :
> Evaluating Swahili Part of Speech Tagging. How can I write a Python script
> for that?
> # The information provided herein about Swahili may not be accurate
> # it is just intended to illustrate the problem
>
Hello, Mr. Emad! Have you checked the NLTK (Natural
Hello, I'm making a script that daily grabs some information and email
it to some of my coworkers. It runs all the other parts while I'm
logged off, but this part doesn't. I need to be logged on for it to
work. Also, when I'm logged on to my Windows XP I just can't make it
send. It only sits in my
Hello! I’m not a programmer and am a beginner with Python, I would
like suggestion about ways of tackling the task I had to do. I have
bee been using the xlrd package to get data from some spreadsheets
successfully.
I have developed a simple report from a script that compares number of
shipments re
On Wed, Apr 22, 2009 at 12:15 PM, bob gailer wrote:
> Please use reply-all so a copy goes to the list.
>
Thank you very much for your help and suggestions, I've modified my
code following your guidelines and looks so much better.
Regards,'
Eduardo
___
Hello, I found interesting today, as I was playing with this code in the shell:
>>> arq = open('c:/myscripts/simple2.ttt', 'w')
>>> len(a)
9
>>> arq.write('The length is %d' % len(a))
>>> res = arq.read()
>>> print res
The print doesn't print the text I had written, but some thing else I
c
Hello, I'm planning to create a script to read a certain file, find
the line that contains Bible references and then use that to query a
bible database in order to print the verses in another file.
I will be looking for lines like these:
Lesson Text: Acts 5:15-20, 25; 10:12; John 3:16; Psalm 23
So
On Thu, May 21, 2009 at 7:03 PM, John Fouhy wrote:
> 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
>>
On Sat, May 23, 2009 at 3:37 AM, C or L Smith wrote:
> Here is something from my toolbox of routines that might be useful for the
> number ranges:
>
indices('-5--2')
> [-5, -4, -3, -2]
indices('3-4')
> [3, 4]
indices('3-4,10')
> [3, 4, 10]
>
> /chris
>
> def indices(s,n=None): #("1
Hello, I thought I understood **kwargs until I stumbled with this function:
def changeflexion(myword, mytag, **dicty):
global er_verbs
global ar_verbs
global ir_verbs
#global dicty
for item in dicty:
if myword in item and mytag in item[1]:
if dicty[item].end
On Sat, Jun 6, 2009 at 11:10 PM, wesley chun wrote:
>>> Hello, I thought I understood **kwargs until I stumbled with this
>>> function:
>>>
>>> def changeflexion(myword, mytag, **dicty):
>>> :
>>>
>>> but when I import the module and call:
>>> a = conjugate.changeflexion('estaban', 'VLFin',
On Wed, Jun 10, 2009 at 12:44 PM, Stefan Lesicnik wrote:
> Hi Guys,
>
> I have the following text
>
> [08 Jun 2009] DSA-1813-1 evolution-data-server - several vulnerabilities
> {CVE-2009-0547 CVE-2009-0582 CVE-2009-0587}
> [etch] - evolution-data-server 1.6.3-5etch2
> [lenny
Hello, I have a dictionary similar to this:
dyc = {
'a50' : ['textfield', 50, 40],
'k77' : ['othertext', 60, 10]
}
I was trying to write a csv with the csv module, by doing this:
import csv
myfile = open('c:/myscripts/csv-test.csv', 'wb')
mywriter = csv.writer(myfile, dialect='excel')
for item in
Hello, I am accessing a Pervasive SQL data source using odbc and I'm
having this trouble:
import dbi
import odbc
# the first execute works
pnumber = '09F153'
wh = '00'
qty = 3
myconn = odbc.odbc('DSN=MKPT01')
mycursor = myconn.cursor()
mycursor.execute("""
SELECT "INVENTORY"."CODE", "INVENTORY"."
On Wed, Jun 24, 2009 at 6:16 PM, Richard
Lovely wrote:
> (oops... forgot to reply-all)
>
>
> -- Forwarded message --
> From: Richard Lovely
> Date: 2009/6/25
> Subject: Re: [Tutor] Problems with parameter queries
> To: Eduardo Vieira
>
>
> 2009/
Hello! I have the code below to update a database from a csv file. I
have tested one time and it has worked fine, but I'm a bit fearful
that it should work right as I am updating a database and don't want
to cause troubles into the system.
Is this code safe for my personal use?
the update code is i
On Fri, Jul 10, 2009 at 12:51 PM, Emile van Sebille wrote:
> On 7/10/2009 11:29 AM Eduardo Vieira said...
>>
>> Hello! I have the code below to update a database from a csv file. I
>> have tested one time and it has worked fine, but I'm a bit fearful
>> that it shou
Hello, I have a file that was a resulted from a POS-Tagging program,
after some transformations, I wanted to restore to it's normal form.
So, I used sed to remove the POS-Tags and have something like this:
--- Example begins
No
,
thank...@+ # this +...@+ I inserted to mark paragraphs, because the
Hello, I'm scratching my head into solving a problem of transforming a
POS-Tagged text in a normal text. My biggest problem is that I can't
get the quotes to be placed properly.
I had tried a different approach but was advised in the nltk list to
use this example, but it does not solve the quoting
Hello, I'm enjoying learning python but then I come across some basic
things that makes me stumped... I have 2 csv files and I want to see
which ones are duplicates based on two criteria email, or telephone.
The order of fields in both csv files are different. Here are a sample
bogus data:
import
Hello, this is just a test. I have posted 2 different messages and
they have never reached this list.
Eduardo
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hello, list.
I can't understand why the print statement is not printed with the
operator '==', but is printed when using 'in'.
Here's the code:
#===
import csv
bv = """NAME,BVADDRTELNO1,BVADDREMAIL
Company1, 1234567788, t...@that.com
CompanyA, 1231234455, t...@this.com
CompanyC, 101101, n...@t
On Thu, Jul 30, 2009 at 4:49 PM, Sander Sweers wrote:
> 2009/7/30 Eduardo Vieira :
>
> With == you are testing if the 2 values are exactly the same. So 'one'
> == 'one' will return True but 'one; == 'one two' will return False.
>
> With in you t
On Thu, Jul 30, 2009 at 5:56 PM, Eduardo Vieira wrote:
> On Thu, Jul 30, 2009 at 4:49 PM, Sander Sweers wrote:
>> 2009/7/30 Eduardo Vieira :
>>
>> With == you are testing if the 2 values are exactly the same. So 'one'
>> == 'one' will retur
On Thu, Jul 23, 2009 at 1:24 PM, Che M wrote:
>
>
>> Date: Thu, 23 Jul 2009 14:05:36 +0800
>> From: ld...@gmx.net
>> To: Tutor@python.org
>> Subject: [Tutor] mnemonics to better learn Python
>>
>> Dear List,
>>
>> in order to memorize which Python sequences are mutable or immutable, I
>> focused on
On Fri, Jul 31, 2009 at 12:27 PM, Che M wrote:
>
>
>> To: tutor@python.org
>> From: alan.ga...@btinternet.com
>> Date: Fri, 31 Jul 2009 17:09:48 +0100
>> Subject: Re: [Tutor] mnemonics to better learn Python
>>
>>
>> "Eduardo Vieira" w
Hello, I have this sample script from beautiful soup, but I keep
getting an error because of encoding. I have google for solutions but
I don't seem to understand. Even this is dealt in Beautiful Soup's doc
but I am not able to understant/apply the solution successfully.
from BeautifulSoup import B
On Tue, Aug 18, 2009 at 5:59 AM, Kent Johnson wrote:
> On Tue, Aug 18, 2009 at 12:18 AM, Mal Wanstall wrote:
>> On Tue, Aug 18, 2009 at 9:00 AM, Eduardo Vieira
>> wrote:
>
>>> Here is the Error output:
>>> utf-8
>>> Traceback (most recent call last)
Hello, list. Sorry, for this basic question. But why in Windows (XP)
command prompt I get this message if, for example I type "python
myscript.py"? But it works if I simply type myscript.py? Maybe by
getting an answer for this question I could know how to make commands
"grep, diff" work from any fo
On Sat, Sep 12, 2009 at 10:53 PM, Lie Ryan wrote:
> ranjan das wrote:
>>
>> Hi,
>>
>> I am new to python and i wrote this piece of code which is ofcourse not
>> serving my purpose:
>>
>> Aim of the code:
>>
>> To read a file and look for lines which contain the string 'CL'. When
>> found, print th
On Sun, Sep 13, 2009 at 6:42 PM, bob gailer wrote:
> Please provide a meaningful subject (other than no subject)
>
>
> shellc...@juno.com wrote:
>>
>> I want to take two tuples and and print out all the elements in both
>> tuples
>>
>>
>
> You probably want something different. So explain please.
Hello, I have a csv file, using the ";" as a delimiter. This file
contains addresses. My problem is that some fields are missing in some
rows and I would like to normalize the rows for a smoother import into
Excel, for example.
Here is an example. This is the header:
Company;Telephone;Address;Prov;
Hello, I had a problem with a script yesterday that made me puzzled.
My time zone is US Mountain Time. This script was running nice last
week, but yesterday it reported the date of today instead
So, yesterday at 5:20pm this line:
hoje = time.strftime("%a, %b %d, %Y", time.gmtime())
Gave me this: "
On Tue, Sep 29, 2009 at 3:04 PM, Dave Angel wrote:
> Eduardo Vieira wrote:
>>
>> Hello, I have a csv file,
>
> a broken csv file
>>
>> using the ";" as a delimiter. This file
>> contains addresses. My problem is that some fields are missing in so
Hello I'm developing a script to compare two files, finding duplicate
entries and matching which id of one csv file corresponds to the id of
another csv file.
The first version was working nice, but I wanted to postpone the
writing to a file till the end and also make a correct csv file. The
code i
On Thu, Oct 8, 2009 at 3:36 PM, Luke Paireepinart
wrote:
> Oops, accidentally replied off-list.
>
> -- Forwarded message --
> From: Luke Paireepinart
> Date: Thu, Oct 8, 2009 at 3:36 PM
> Subject: Re: [Tutor] Troubles with lists and control flow
> To: Eduardo
Hello,
The other day I was making a script and decided to use a list
compreehension and I found out that this code:
mylist = ['John', 'Canada', 25, 32, 'right']
a = [item.upper() for item in mylist if type(item) == type('good')]
returned this: ['JOHN', 'CANADA', 'RIGHT']
I was expecting this: ['JOH
On Mon, Oct 19, 2009 at 1:20 PM, Alan Gauld wrote:
>
> "Sander Sweers" wrote
>
>>> mylist = ['John', 'Canada', 25, 32, 'right']
>>> a = [item.upper() for item in mylist if type(item) == type('good')]
>>
>> Usually it is recommended to use hasattr() instead of type()
>> hasattr(s, 'upper')
>
> N
Hello, I need your help in designing a function. I have created this
script to check out if certain column in some csv files has value "0":
import csv
def zerofound(csvfile, outputfile, lastcolumn ):
"""Finds columns with zero prices. Column have 0 index"""
final = csv.writer(open(outputf
On Tue, Oct 27, 2009 at 10:14 AM, Dave Angel wrote:
> Benno Lang wrote:
>>
>> On Tue, Oct 27, 2009 at 8:21 AM, Dave Angel wrote:
>>
>>>
>>> I agree with Luke's comments. But I'd like to point out an apparent bug
>>> (I
>>> haven't tried the code, this is just by inspection).
>>>
>>> You use the
On Tue, Oct 27, 2009 at 5:33 AM, bibi midi wrote:
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> '''
> Calculate internet data consumption
> of service provider
> Code as per help of python tutor mailing list
> Created: 26-Oct-2009
>
> '''
>
> intro = raw_input('press enter to view your int
On Tue, Oct 27, 2009 at 10:14 AM, Dave Angel wrote:
>
> But if the file contained 0.00 as one of its items, this code would still
> have the other problem I mentioned.
>
> DaveA
> ___
> Tutor maillist - tu...@python.org
> To unsubscribe or change sub
On Tue, Sep 29, 2009 at 8:11 AM, Eduardo Vieira wrote:
> Hello, I had a problem with a script yesterday that made me puzzled.
> My time zone is US Mountain Time. This script was running nice last
> week, but yesterday it reported the date of today instead
> So, yesterday at 5:20
Hello, this is my first post in this list and I'm not a programmer,
but am enjoying learning python.
I'm trying to make a script to add worksheets to excel files:
I managed to implement this code:
import os
folder = 'C:\\Personal\\oldxlsformat\\'
from win32com.client import Dispatch
xl = Dispatch(
den wrote:
> Eduardo Vieira wrote:
>>
>> Hello, this is my first post in this list and I'm not a programmer,
>> but am enjoying learning python.
>> I'm trying to make a script to add worksheets to excel files:
>> I managed to implement this code:
>>
>
Hello, I'm trying to teach my self programming with python and there
are some basic things that stumps me:
Given this code:
###
list1 = ['arr', 'bre', 'grau', 'lower', 'tudo']
for item in list1:
if 'arr' in item:
print list1
###
The output is (as expected):
['arr', 'bre', 'grau', 'lower
Wesley wrote:
On Mon, Dec 22, 2008 at 1:19 PM, wesley chun wrote:
>
> in addition, i think (and i may be wrong about this) that he really
> wanted to do:
>
> if 'arr' in list1 or 'bell' in list1...
>
Thanks for all the replies. Yes that was actually what I meant. My
mistake too was that I gave y
Hello, this weekend I had fun using Python for text processing. I
needed to change a qif converted from a ofx, using the tool MT2OFX
(http://www.xs4all.nl/~csmale/mt2ofx/en/index.htm)
I wanted to change transactions like these:
D11/14/2008
MCHEQUE 102 17590807;Cheque or Preauth. Debit
T-500.00
N102
Hello, I'm new to this list, and am enjoying it. I just wonder what
"OP" stands for, as I have seen quite a few mentions in the python
lists
Thanks
Edu
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hi. Try to find a tutorial on the steps to achieve such effect in a graphic
program. Then map it to the scrpting steps to do the same with pil, python
for gimp, for inkscape or simply Imagemagick.
On 2011-01-17 8:37 AM, "zhengqing gan" wrote:
Hi,
Thanks for the reply.
But I found that there
67 matches
Mail list logo