usefull page
> http://www.velocityreviews.com/forums/t355467-tree-and-graph-structures-in-python.html
>
thanks again
Ced.
--
Cedric BRINER
Geneva - Switzerland
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo
Kakada wrote:
> Hi list,
>
> I was just wondering why the below function return different location on
> different machine?
>
> import distutils.sysconfig
> distutils.sysconfig.get_python_lib()
> On my computer:
> '/usr/lib/python2.5/site-packages'
> On my friend's computer:
> '/usr/local/lib/pytho
Hello,
I have a html document here which goes like this:
Table of Contents
.
Preface
Can someone tell me how I can get the string between the tag for
an a tag for a given value of the name attribute.
Thanks,
Shriphani Palakodety
___
Tutor mail
bill.wu gmail.com> writes:
>
>
>
> i am new guy.
> i ask a easy question.
>
> why the first one have"x",the second one doesn't have "x". what
> is different? when write "x",when don't write "x".
>
> in my point,the second one don't def variable.
>
>
Variable scope. By declaring the
Hi list,
I was just wondering why the below function return different location on
different machine?
import distutils.sysconfig
distutils.sysconfig.get_python_lib()
On my computer:
'/usr/lib/python2.5/site-packages'
On my friend's computer:
'/usr/local/lib/python2.5/site-packages'
What is the
i am new guy.
i ask a easy question.
why the first one have"x",the second one doesn't have "x". what is different?
when write "x",when don't write "x".
in my point,the second one don't def variable.
(1)
def func(x):
print 'x is', x
x = 2
print 'Changed local x to', x
x = 50
func
Kent and Bob,
Are you thinking of the first problem in Bentley's Programming Pearls?
The original poster's questions sounds like it could be in that domain.
http://netlib.bell-labs.com/cm/cs/pearls/cto.html
So I agree: the next questions we probably should ask the original poster:
* W
> Of course I know and use reg. exps., the point of the function is not to
> validate input but to force the proper input.
So? Are you going to try to tell me that you can force particular input
without actually determining if its valid or not first? ;-)
Just a thought.
___
Ricardo Aráoz wrote:
> _validChars = {
> 'X' :
> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
> , '9' : '1234567890'
> , '-' : '-1234567890'
> , 'A' :
> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>
Did you read the entire discussion at
http://www.ibiblio.org/g2swap/byteofpython/read/local-variables.html?
What did you understand and not understand?
Sincerely,
e.
bill.wu wrote:
> i am new guy.
> i ask a easy question.
> why the first one have"x",the second one doesn't have "x". what is
> di
i am new guy.
i ask a easy question.
why the first one have"x",the second one doesn't have "x". what is different?
when write "x",when don't write "x".
in my point,the second one don't def variable.
(1)
def func(x):
print 'x is', x
x = 2
print 'Changed local x to', x
x = 50
func(
Tiger12506 wrote:
> Try regular expressions in the re module. This should make this code below
> much much simpler. Downside is you have to learn a slightly different
> syntax. Upside is - regular expressions are very powerful.
>
Of course I know and use reg. exps., the point of the function is
Try regular expressions in the re module. This should make this code below
much much simpler. Downside is you have to learn a slightly different
syntax. Upside is - regular expressions are very powerful.
> Last week someone had an issue with raw_input() and how to get input for
> a number. So
I'd like to be clear, this isn't a clean thing for the middle of a big
program. I was thinking the entire time I was testing it "I wonder why
anyone would need to do this"
But if you have a python program you'd probably call a script, used
for one simple task, it can be appropriate (with Kent'
Dinesh B Vadhia wrote:
> For some significant data pre-processing we have to perform the
> following simple process:
>
> Is the integer x in a list of 13K sorted integers. That's it except
> this has to be done >100m times with different x's (multiple times).
> Yep, a real pain!
>
> I've
cedric briner wrote:
> hello,
>
> I'm wanting to do a GUI for to help people using rsync, du, tar . it
> will provide the --exclude and --include of them.
>
> And I thought that the best way to store data relative to the hierarchy
> filesystem was to store them in a tree structure. But after brow
lechtlr wrote:
> I want to read an input file (file.csv) that has two columns. I want
> to read 2nd column and assign variables that are strings and floats.
> Currently, I use the following split() function to read from the input
> file and create a list, and then assign each element to a variab
Last week someone had an issue with raw_input() and how to get input for
a number. So I remembered my CP/M times and got to think of a little
function I had there. The function is lost and my time is scarce but I
made a little effort and here you have the results. It has loads of room
for improveme
Michael Langford wrote:
> for subscript,line in enumerate(file("file.csv")):
> s = line.split(",")[1]
> try:
>f = float(s)
>locals()["x%i" % subscript]=f
> except:
>locals()["x%i" % subscript]=s
Don't do this!
For one thing, writing to locals() d
Accidentally cut off a 0 there...
Think about using ConfigParser instead of your csv. Doug Hellman wrote
a good article on that:
http://blog.doughellmann.com/2007/04/pymotw-configparser.html
But if you really want to load your data this way, this will work:
for subscript,line in enumerate(file("f
for subscript,line in enumerate(file("file.csv")):
s = line.split(",")[1]
try:
f = float(s)
locals()["x%i" % subscript]=f
except:
locals()["x%i" % subscript]=s
print x1
print x
On Jan 15, 2008 3:26 PM, lechtlr <[EMAIL PROTECTED]> wrote:
> I wa
lechtlr wrote:
> I want to read an input file (file.csv) that has two columns. I want to
> read 2nd column and assign variables that are strings and floats.
> Currently, I use the following split() function to read from the input
> file and create a list, and then assign each element to a variab
Python has a cvs module that will make this slightly more elegant
http://docs.python.org/lib/module-csv.html
j
On Jan 15, 2008 2:26 PM, lechtlr <[EMAIL PROTECTED]> wrote:
> I want to read an input file (file.csv) that has two columns. I want to
> read 2nd column and assign variables that are st
I want to read an input file (file.csv) that has two columns. I want to read
2nd column and assign variables that are strings and floats. Currently, I use
the following split() function to read from the input file and create a list,
and then assign each element to a variable.
I am wondering th
Dinesh B Vadhia wrote:
> For some significant data pre-processing we have to perform the
> following simple process:
>
> Is the integer x in a list of 13K sorted integers. That's it except
> this has to be done >100m times with different x's (multiple times).
> Yep, a real pain!
>
> I've
hello,
I'm wanting to do a GUI for to help people using rsync, du, tar . it
will provide the --exclude and --include of them.
And I thought that the best way to store data relative to the hierarchy
filesystem was to store them in a tree structure. But after browsing
ages on the web, I didn't f
For some significant data pre-processing we have to perform the following
simple process:
Is the integer x in a list of 13K sorted integers. That's it except this has
to be done >100m times with different x's (multiple times). Yep, a real pain!
I've put the 13K integers in a list S and am u
There is at least on client library that the mysql package needs to link
against. You either need to install the libraries on the client machine
or else build the package statically linked on the server machine and
move it over prebuilt.
John wrote:
> Hello,
>
> Does anyone know how to inst
Dear Sir;
Thank you very much for the information. After I read your e-mail, I
have started to think that our codes are not highly but moderately
valuable. Therefore, I am satisfied, by using .pyc files. I am not
very affraid of determined hackers from outside because they will not
understand th
Hello,
Does anyone know how to install MySQLdb into a python installation when the
machine you are working on does not have MySQL installed? I.E. the MySQL
installation is on a different server, but the site.cfg file for the MySQLdb
installation asks for the location of the mysql_config:
"
# The
30 matches
Mail list logo