Searched on google and couldn't find anything :S
On Mon, Apr 21, 2008 at 11:28 AM, [EMAIL PROTECTED] wrote:
Just saw at amazon.com reference to the following book that might be
available later this year:
Financial Modeling with Python [IMPORT] (Hardcover)
by Shayne Fletcher (Author),
I don't get this thread. At all. I want my 15 minutes back.
(OTOH, some of your replies were quite funny or interesting, including
- as usual - Gabriel and Steve's)
On Feb 19, 2008 11:29 PM, Grant Edwards [EMAIL PROTECTED] wrote:
On 2008-02-19, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
What
is this some kind of joke?
if you get no answers, then the answer is no
On Jan 30, 2008 7:40 PM, Blubaugh, David A. [EMAIL PROTECTED] wrote:
I do not understand why no one has answered the following question:
Has anybody worked with Gene Expression Programming
David Blubaugh
Try contacting Ryan O'Neil ryanjoneil at gmail.com. He is the author
of pygep http://code.google.com/p/pygep/ , and is probably working
here: http://www.gepsoft.com/
If you don't get an answer, it means that THEY found him first.
This message will self destruct in ... range(3, 0, -1) ...
On Jan
So in this case it is REALLY better to ask for permission rather than
forgiveness?
On Jan 30, 2008 10:30 PM, Ben Finney [EMAIL PROTECTED] wrote:
MRAB [EMAIL PROTECTED] writes:
On Jan 31, 12:57 am, Asun Friere [EMAIL PROTECTED] wrote:
Ouch!! If on the other hand 'females' is populated by
See this:
http://www.regular-expressions.info/python.html
(the Search and Replace part)
You are referring to the group as (?P=id), when you should be using
r\gname.
HTH,
Sergio
On Jan 30, 2008 10:01 PM, Astan Chee [EMAIL PROTECTED] wrote:
Hi,
I have a html text stored as a string. Now I want
This is what's happening:
1) The chef thread releases the sema
2) While the chef thread is saying Andiamo, decreasing i, and
ending the while loop, the waiter thread SERVES the dish and RUNS to
reacquire the lock
3) Back in the main loop, chef.join() is run, and then the waiter's
variable is
Both of you are correct.
x = set([1,2,3])
y = set([4,5])
x |= y
x
set([1, 2, 3, 4, 5])
On Jan 15, 2008 11:07 AM, Skip Montanaro [EMAIL PROTECTED] wrote:
Why is that? Doesn't the |= operator essentially map to an update() call?
No, according to 3.7 Set Types, s | t maps to
import sys, xml, urllib
dummy = [sys.stdout.write(city + ': ' + str(num) + '\n') for city, num in
set([[(a, o.count(a)) for a in p] for o, p in [2*tuple([[city for city in
((xml.dom.minidom.parseString(urllib.urlopen('
http://api.etsy.com/feeds/xml_user_details.php?id='
+
I once made a small app that used threads on IDLE.
There was a strange error when using 'print' threads. When what I printed
filled the entire screen, instead of moving all the text up, IDLE just
hanged. Try running your code from the shell instead, to see if the problem
is in IDLE.
HTH,
Sergio
On Dec 4, 2007 10:40 AM, Nick [EMAIL PROTECTED] wrote:
Is this expected behavior?
s = '123;abc'
s.replace(';', '\;')
'123\\;abc'
Everything is Ok. It's still a single backslash. Try:
print s.replace(';', '\;')
Or
x = s.replace(';', '\;')
print x
Best,
Sergio
--
Although I'm a python fan; for that kind of stuff, I use autohotkey (
http://www.autohotkey.com/download/ )
Best,
Sergio
On Dec 1, 2007 3:30 AM, farsheed [EMAIL PROTECTED] wrote:
I have a big problem. I have a list of files that my script find and
list them in a little gui.
I need this
Bluebird:
If you are using python 2.5, relative imports are no longer an issue:
http://docs.python.org/whatsnew/pep-328.html
That problem solved, what you sometimes want is to change the version
of your package. I just change the text in the PTH file, to point to
another version, and voilá (no
This may help:
http://effbot.org/zone/re-sub.htm#strip-html
You should take care that there are several issues about going from html to txt
1) p What should bwe/bdo aboutbr /this?/p
You need to strip all tags..
2) quot;, amp;, lt;, and gt... and I could keep going.. we need to
convert all
If you are talking about events and all that, I suppose you are using
(or should be using) threads.
Why don't try running the length_function as a Thread that on every
loop checks a semaphore and if the condition is met, exits itself?
Kinda like this:
Let's see:
1) Should I put my unittests in a subdirectory? Does the subdirectory
have to be a package?
Sure, to avoid cluttering put the tests in a folder called 'tests'
(and any input the tests require, like mock files, output files used
to test if the output is correct, etc etc, should be
Hey Mike,
Welcome to Python!
About your first issue, just change the line
outfile.write( '%s', % (LoL[x][y]))
With
outfile.write( '%s', % (LoL[x][y][:-1]))
Why? Because when you do the line.split, you are including the '\n' at
the end, so a new line is created.
Now, what you are doing is not
As a side note, I find much easier to drop a PTH file than messing
with pythonpath. If you are not familiar with PTH files, what I do is
this
1) Go to C:\Program Files\Python25\Lib\site-packages or whatever is
appropiate in your case.
2) Create a text file, name it something like MyProjects.PTH
Just a few notes:
1) get_countries_list
What is the purpose of that function? Besides a few errors (an
argument named list, no value returned), it seems you just want to
remove duplicates from a list called countries. You can do that
transforming the list to a 'set'.
new_countries = list(
About the sort:
Check this (also on http://pastebin.com/f12b5b6ca )
def make_regions():
# Values you provided
EU = [Austria,Belgium, Cyprus,Czech Republic,
Denmark,Estonia, Finland]
NA = [Canada, United States]
AP = [Australia, China, Hong Kong, India, Indonesia,
Japan]
I think the -print- command, as used in IDLE, is not thread-safe. I
was bitten by an issue like that today, and the problem ended up being
the -print- command I used.
On the cmd line, it works per-fect-ly.. but IDLE seems to be the culprit.
A possible answer seems to be to write a wrapper for
)
for symbol in sorted(symbols):
qSymbols.put_nowait(symbol)
Worker(qSymbols) # Start thread
qSymbols.join()
print The End...
On 9/26/07, Sergio Correia [EMAIL PROTECTED] wrote:
I think the -print- command, as used in IDLE, is not thread-safe. I
was bitten by an issue like that today
Sergio Correia added the comment:
Thanks for the update,
Sergio
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1176
__
___
Python-bugs-list mailing list
Unsubscribe:
http
New submission from Sergio Correia:
str.split() does not accept maxsplits as a keyword argument.
If i want to split a string, and, say, get its first word, I do this:
'SPAM eggs eggs spam spam ham'.split(None, 1)[0]
'SPAM'
However, as documented on help(str.split), the separator is optional
Sergio Correia added the comment:
As a side note, this is slightly related with:
http://mail.python.org/pipermail/python-dev/2000-October/009694.html
http://bugs.python.org/issue1123
(but check the date of the first link!)
__
Tracker [EMAIL PROTECTED]
http
Thanks for the replies, very instructive!
On 9/7/07, Steve Holden [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Fri, 07 Sep 2007 01:30:00 -0500, Sergio Correia wrote:
Hi, I'm kinda new to Python (that means, I'm a total noob here), but
have one doubt which is more about consistency
Hi, I'm kinda new to Python (that means, I'm a total noob here), but
have one doubt which is more about consistency that anything else.
Why if PEP 8 says that Almost without exception, class names use the
CapWords convention, does the most basic class, object, is lowercase?
I found a thread
Thanks!
It worked straightforward, and it's easier than messing with the
enviromental variables or the registry.
BTW, I'm still wondering how did Autohotkey got included in sys.path
(there are no other .pht files on my PC)
Regards,
Sergio
On 9/3/07, olivier [EMAIL PROTECTED] wrote:
Hi,
Any
This works:
# Module spam.py
import eggs
print getattr(eggs, 'omelet')(100)
That is, I just call the function omelet inside the module eggs and
evaulate it with the argument 100.
But what if the function 'omelet' is in the module where I do the
getattr (that is, in spam.py). If I do any of
Alex, Gabriel,
Thanks for the reply. Works great!
On 9/3/07, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Mon, 03 Sep 2007 20:13:43 -0300, Sergio Correia
[EMAIL PROTECTED] escribi�:
# Module spam.py
import eggs
print getattr(eggs, 'omelet')(100)
That is, I just call
Hi,
I'm trying to add a personal folder to the path used by python in
searching for packages and modules. This folder, C:\docs\utils , has
some packages not yet ready for site-packages.
First, I tried sys.path.append(C:\docs\utils) BUT this only lasts
for the current python session.
Then, I
Larry, Gabriel
Thanks for the replies. Both ways work great.
Sergio
On 4/4/07, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Wed, 04 Apr 2007 20:14:37 -0300, Larry Bates [EMAIL PROTECTED]
escribió:
Sergio Correia wrote:
I have a program in 'C:\Python25\Lib\site-packages\spam\spam.py
I have a program in 'C:\Python25\Lib\site-packages\spam\spam.py'
Importing and everything works fine:
from spam import spam
But the program calls a file located on the same folder (that is:
C:\Python25\Lib\site-packages\spam\).
How do i do that?
spam.eggs()
Traceback (most recent call
I'm writing a class, where one of the methods is kinda complex. The
method uses a function which I know for certain will not be used
anywhere else. This function does not require anything from self, only
the args passed by the method.
Where should I put the function?
a) Inside the module but
I also found out I can't use `unittest` with nested functions :-(
Thank you all for the responses,
Best,
Sergio
On 7 Mar 2007 14:57:54 -0800, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Diez B. Roggisch:
If it really has no other use as in this class, put it as an
instancemethod in there.
Hi,
I'm looking for an easy way to flatten a two level list like this
spam = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
Into something like
eggs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
There are *no* special cases (no empty sub-lists).
I have found two ways:
1) Accumulator
eggs = []
!
Sergio
On 3/7/07, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Wed, 07 Mar 2007 21:14:43 -0300, Sergio Correia
[EMAIL PROTECTED] escribió:
I'm looking for an easy way to flatten a two level list like this
Try google.
PS: Why does `sum` works only with numbers?
Try google
O_o
List comprehensions never cease to amaze me.
Thanks,
On 3/7/07, Gabriel Genellina [EMAIL PROTECTED] wrote:
En Wed, 07 Mar 2007 21:41:16 -0300, Sergio Correia
[EMAIL PROTECTED] escribió:
I forgot to say: I've already checked the discussions about
recursive/iterative/etc flatten
The above suggestions seem nice, but I find this one easier:
import urllib2
ext_ip = urllib2.urlopen('http://whatismyip.org/').read()
print ext_ip
The nice thing about the above code is that http://whatismyip.org/
only contains exactly what you want (the ip, nothing more, nothing
less), so no
39 matches
Mail list logo