Re: word replacing in a paragraph

2014-01-06 Thread leo kirotawa
Since it is for a template you can round the keyword to be replaced ,
something like $data$ and then just  string.replace('$data','1234')




On Mon, Jan 6, 2014 at 12:01 PM, Frank Cui  wrote:

> Hey guys,
>
> I'm trying to automate a process by initially creating a standard template
> and then replace some text fields with variable values.
>
> [for example, "DATE" in the paragraph will be replaced by the current date
> value. it doesn't have to be a literal word of "DATE", "DATE" in "TESTDATE"
> can also be replaced.]
>
> Is there some lightweight built-in or 3rd party  libraries which are good
> for such kind of work ?
>
> Thanks
> Frank
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>


-- 
--
Leônidas S. Barbosa (Kirotawa)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: meaning of: line, =

2015-02-04 Thread leo kirotawa
You'll find some explanation here:
http://stackoverflow.com/questions/1708292/meaning-of-using-commas-and-underscores-with-python-assignment-operator

On Wed, Feb 4, 2015 at 12:08 PM, ast  wrote:
> hello
>
> I dont understand why there is a comma just after line in the following
> command:
>
> line, = plt.plot(x, np.sin(x), '--', linewidth=2)
>
>
> I never saw that before
>
> Found here:
> http://matplotlib.org/examples/lines_bars_and_markers/line_demo_dash_control.html
>
> thanks
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 

--
Leônidas S. Barbosa (Kirotawa)
blog: corecode.wordpress.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: AttributeError

2015-08-11 Thread leo kirotawa
assign using () creates tuple not a list. Tuples have not .sort() method.
correct would be:
ncount = [key,val]

On Tue, Aug 11, 2015 at 9:01 PM, Ltc Hotspot  wrote:
> Hi Everyone,
>
>
> What is the list equivalent to line 12: ncount.sort(reverse=True)
>
>
> count = dict()
> fname = raw_input("Enter file name: ")#
> handle = open (fname, 'r')#
> for line in handle:
> if line.startswith("From "):
> address = line.split()[5]
> line = line.rstrip()
> count[address] = count.get(address, 0) + 1
>
> for key,val in count.items():
> ncount = (key,val)
> ncount.sort(reverse=True)
> print key,val
>
>
> Error message, reads: AttributeError, line 12, below : 'tuple' object has no 
> attribute 'sort'
>
> Raw data code, available at http://tinyurl.com/ob89r9p
> Embedded data code, available at http://tinyurl.com/qhm4ppq
> Visualization URL link, available at http://tinyurl.com/ozzmffy
>
>
> Regards,
> Hal
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 

--
Leônidas S. Barbosa (Kirotawa)
blog: corecode.wordpress.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Vaga Java (Belgica, com tudo pago)

2015-08-13 Thread leo kirotawa
Wondering why a position for Java/JS was sent to this list...just wondering...

On Thu, Aug 13, 2015 at 11:59 AM,   wrote:
> https://walljobs.typeform.com/to/uWpUqj
>
> We seek a software developer with experience in web application development.
>
> Should you have the passion to work in the start-up environment and the 
> willingness to evolve in a fast-paced environment, then we'd like to get in 
> touch.
>
> We are located in Brussels, Belgium, in the center of Europe. You should be 
> able to work in an international team, show passion and commitment to towards 
> the project, and be able to adapt to challenging European working standards.
>
> Responsibilities
>
> Understand design documents, giving feedback when necessary, and implement 
> the required changes in the code base.
>
> Interact with an existing large software implementation and independently 
> perform the required actions
>
> Review code from peers
>
> Develop automated tests and other quality assurance techniques
>
> Interact with the marketing, psychology and business teams giving advice and 
> feedback
>
> Adapt and adjust to a fast pacing environment
>
> https://walljobs.typeform.com/to/uWpUqj
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 

--
Leônidas S. Barbosa (Kirotawa)
blog: corecode.wordpress.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: First time I looked at Python was(...)

2014-06-10 Thread leo kirotawa
Gzz,

Guys I'm from Brazil too, and I'm ashamed for this troll. And sorry by
his terrible taste in music.
Wondering now about moderation , have we one?

[]'s

On Tue, Jun 10, 2014 at 5:07 PM, Carlos Anselmo Dias
 wrote:
>
>
> Terry Jan Reedy ...
>
> https://www.youtube.com/watch?v=HbGHq2aUXDU (yhis one is portuguese ...
>
> I'm someone who did very probably more webpages than you in your entire life
> ...
>
> Do you exist?
>
>
>
>
>
> On 06/10/2014 08:57 PM, Terry Reedy wrote:
>>
>> On 6/10/2014 1:19 PM, Carlos Anselmo Dias wrote:
>>>
>>> Let me finish with this ...
>>>
>>> https://www.youtube.com/watch?
>>
>>
>> Yes, do finish with that. People, please quit responding to 'carlos' from
>> premium-sponsor.com (which apparently exists but has no web page).
>>
>
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 

--
Leônidas S. Barbosa (Kirotawa)
blog: corecode.wordpress.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question on for loop

2013-03-04 Thread leo kirotawa
In fact this code is already doing what you want, but if the second
character, by example, is not in secrectWord it'll jump out of the for and
return. If you want that interact through the all characters and  maybe
count how many them are in the secrectWord, just take of the return there
or do some list comprehension like: [ r for r in secrecWord if r in
lettersGuessed] .



[]'s



On Mon, Mar 4, 2013 at 9:18 AM, newtopython  wrote:

> Hi all,
>
> I'm super new to python, just fyi.
>
> In the piece of code below, secretWord is a string and lettersGuessed is a
> list. I'm trying to find out if ALL the characters of secretWord are
> included in lettersGuessed, even if there are additional values in the
> lettersGuessed list that aren't in secretWord.
>
> What this code is doing is only checking the first character of secretWord
> and then returning True or False. How do I get it to iterate through ALL of
> the characters of secretWord?
>
> for character in secretWord:
> if character not in lettersGuessed:
> return True
> return False
>
> Thanks!
>
> Ro
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Leônidas S. Barbosa (Kirotawa)

Engenheiro de Software - IBM (LTC - Linux Technology Center)
MsC Sistemas e Computação
Bacharel em Ciências da Computação.

blog nerd: corecode.wordpress.com/

User linux : #480879

"Mais sábio é aquele que sabe que não sabe" (Sócrates)
"smile and wave" - =D + o/ (Penguins of Madagascar)

日本語の学生です。
コンピュータサイエンスの学位.
-- 
http://mail.python.org/mailman/listinfo/python-list