Dragos Ionescu wrote:
- Original Message
From: bob gailer [EMAIL PROTECTED]
To: David [EMAIL PROTECTED]
Cc: tutor@python.org
Sent: Saturday, October 4, 2008 10:15:10 PM
Subject: Re: [Tutor] bug in exam score conversion program
Lots of good responses. And now for something completely
Dragos Ionescu wrote:
Original Message
From: Steve Willoughby [EMAIL PROTECTED]
To: Dragos Ionescu [EMAIL PROTECTED]
Cc: bob gailer [EMAIL PROTECTED]; David [EMAIL PROTECTED]; tutor@python.org
Sent: Saturday, October 4, 2008 11:04:30 PM
Subject: Re: [Tutor] bug in exam score conversion
and connections between them exists in _data_ instead
of _code_. Something to simmer on the back burner until you're
ready for that step.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist
to? What's the bigger context
this fits into? Although you *can* do this sort of thing,
it quite often ends up not being the most elegant thing
to do.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware
might be:
for major_key, subdict in my_dict.iteritems():
print The stuff stored under, major_key, is:
for minor_key, value in subdict.iteritems():
print (%s) %s=%s % (major_key, minor_key, value)
Thanks,
JJ
On Fri, 2008-10-03 at 10:39 -0700, Steve Willoughby wrote:
On Fri, Oct
and let
us know.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
to people as it stands now.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
environments things get reused in ways you don't expect,
and even if not, get used to good programming habits).
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http
David
Bill Campbell wrote:
On Thu, Oct 02, 2008, Steve Willoughby wrote:
On Fri, Oct 03, 2008 at 01:38:48AM +0800, David wrote:
Does that mean input() is obsolete (after all, Zelle's book is not the
freshest on the shelf)? Or do they have different uses?
Depends on how
there?
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
:
print grades_file_2, %.2f % grade
grades_file_2.close()
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Arun Tomar wrote:
hi!
I've a list
new_array = ['n1', 'm1', 'p1', 'n2', 'm2', 'p2', 'n3', 'm3', 'p3']
I am trying to convert this to a csv in 3 columns so that the final
output would look something like this
n1,m1,p1
n2,m2,p2
n3,m3,p3
This can easily be done with the csv module in the
literally looking for this pattern in your program.
pat.findall(a)
findall is really for finding all the occurrences of a pattern
in a string, not all the matching strings in a list.
you can do this in a filter() to get what I think you're trying
to accomplish.
--
Steve Willoughby| Using
Don Parris wrote:
Hi all,
After a rather long (and unfortunate) break from tinkering with Python,
I am back at it. I am working through the book Learning Python (based
on 2.2/2.3 - I use 2.5), and in the chapter on while/for loops, ran
across the following example:
L = [1, 2, 3, 4, 5]
I've written a save/load function for a simple program using cPickle. Upon
saving, a master list, to which all instances are added in their __init__,
is pickled. when the program starts, if the user wishes to load, a variable
load is set to one, and the pickled list is loaded. All the classes
On 9/25/08, Kent Johnson [EMAIL PROTECTED] wrote:
On Thu, Sep 25, 2008 at 4:24 AM, Steve Collins [EMAIL PROTECTED]
wrote:
However, some of the instances refer explicitly to other instances
instances. It's obvious why this causes problems. It occurred to me to
simply replace the instances
, this computes (1*2)*3)*4)*5)*6) = 720
So our factorial function could have been implemented like this using
reduce:
def factorial(n):
return reduce(lambda x,y: x*y, range(1,n+1))
HTH
HAND
steve
___
Tutor maillist - Tutor@python.org
http
on the
end or use long() to construct one explicitly, unless you
really want it to be long type from the beginning.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor
. But NFS doesn't represent that case
well so a temporary filename is used.)
Unless your Python program is what's holding the offending
file(s) open... any idea what's keeping the file in use?
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt
Dinesh B Vadhia wrote:
I have looked (honestly!) and cannot see an array structure to allow different datatypes per column. I need a 2 column array with column 1 = an integer and column 2 = chars, and after populating the array, sort on column 2 with column 1 sorted relatively.
If by array
Dinesh B Vadhia wrote:
Thanks Steve. How do you sort on the second element of each list to get:
a' = [[42, 'fish'],
[1, 'hello']
[2, 'world']
]
something like this would do the trick:
a_prime = sorted(a, key=(lambda i: i[1]))
sorted(a) returns a new list consisting
('#', 2)
23 tn.read_until('#', 2)
24 tn.write('show call history voice last 100\n')
HTH,
Steve
On Sep 20, 2008, at 8:43 AM, James wrote:
Folks,
Does anyone here have experience with pexpect? I'm trying to write a
pexpect script which will log into a network device, gather
statistics
, and None. I'd really strongly encourage
the first form. Your mileage may vary, of course.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http
is a silly pseudo code example:
bash command | some-python-script.py | some.other-script.sh
thanks in advance-Patrick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
--
Steve Willoughby| Using billion
an existing
network RPC call or something, to as complicated as creating a web
service on windows that the linux client(s) connect to.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor
a simple Linux-side Python script which would
connect to the web service and request it to run.
Be careful, though. What you're describing is fraught with security
issues and vulnerabilities that need to be skillfully addressed.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL
On Wed, Sep 17, 2008 at 11:37:39AM -0600, Spencer Parker wrote:
Yes...you do have it all correct. Luckily this is all behind a private
network that is firewalled. There is no way to get to this network unless
you are physically on site. Since there isn't even VPN access to this
network
, n):
remember what n means in range(1, n). You may have a fencepost
error (off-by-one), depending on what you intended to happen here.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor
without doing the work for you
because we don't do homework exercises for people :)
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org
document (like an
auto-generated template from the IDE).
They're just tools. Pick the ones that work for the jobs you need to
get done, but don't assume that the other ones are pointless. They may
either have points you don't need, or you may not have realized their
importance yet.
--steve
Steve Willoughby wrote:
Likewise, there's a reason the IDE environments like Visual Studio or
Eclipse, and pointy-clicky-WYSIWYG editing tools exist. They're much
easier for beginners to learn, not as intimidating, but in the end they
For example, I use pyWin or IDLE all the time if I want
a
new language is always a good thing to do if it changes how you look at
programming. Only knowing how to edit text in one fashion with one tool
makes as much sense as only knowing one way to write a program, in one
language.
--steve
___
Tutor maillist
Johan Nilsson wrote:
'text http:\123\interesting_adress\etc\etc\ more text'
Does this really use backslashes in the text? The standard for URLs (if
that's what it is) is to use forward slashes.
For your RE, though, you can always use [...] to specify a range
including whatever you like.
Steve Willoughby wrote:
Johan Nilsson wrote:
In [74]: p.findall('asdsa123abc\123jggfds')
Out[74]: ['123abcS']
By the way, you're confusing the use of \ in strings in general with the
use of \ in regular expressions and the appearance of \ as a character
in data strings encountered by your
Kent Johnson wrote:
Is os.popen(find) faster or slower than os.path.walk to find file pattern
in the
The general answer to is find faster than os.[path.]walk faster is it
depends. Find is optimized, compiled, and fast at what it does.
However, what it does is somewhat limited. If you want
Joseph Bae wrote:
Thanks for the help!
I have managed to get a good temperature converter program working! I am
working on beefing it up a bit with some exception handling and an and-or
trick. The error handling works okay but I am having problems using and-or.
Here's my updated code:
def
Jaggo wrote:
Why do you use your editor rather than using Pywin? What feature has editor
X got that PyWin hasn't?
(That is, other than My editor runs on unix / linux; while that does count
for something it is rather irrelevant to my current situation.)
I use a different editor (in my case vim)
Hi
In order to execute python script by fedora terminal ; insert #! /bin/env
python as the first line in the script.
Python scripts end with a file extension of .py, as
indicated above.
It is also possible in Unix to automatically launch the Python
interpreter without explicitly invoking it
Fred,
What is/are the exact error message(s)?
You may want to look at the module glob.
Steve
Ar e you typing this in the python interpreter or
On Aug 1, 2008, at 10:41 PM, Fred @ Mac wrote:
Hello,
new to python, so please go easy on me!
I am using
for f in os.listdir(watch_dir
:
string ='ab'
so, if I type:
print string.join(string)
aabb
but if string is 'abc'
print string.join(string)
aabcbabcc
print string ='a' returns on a in this example, whit string='a '
returns aa. So, I am not catching
the pattern.
Thanks.
Steve
('ReferencePositionX').isdigit() =='True':
refx = float(INPUT['ReferencePositionX'])/10
refy = float(INPUT['ReferencePositionY'])/10
refz = float(INPUT['ReferencePositionZ'])/10
Steve
On Jul 30, 2008, at 6:43 PM, Bryan Fodness wrote:
I am populating a dictionary from an input file, and would
(4)
key/value
pairs, the display order is the same as I entered the them. With 5 or
more key/value
dictionaries, the printed result is not sequential.
Any thoughts?
Steve
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman
Mike Meisner wrote:
I need to do some statistical analysis by binning values into an array.
Being new to Python, I tried to use a list of lists. I've extracted
just the minimum code that I'm having trouble with:
What you need to remember is that Python works with *objects*, and
variables
To answer the specific question about square roots below, Python's
square root function is in the math module. You can either include this
module and invoke it like this:
import math
.
.
.
y = math.sqrt(x)
-or- if you want the sqrt() function brought into your main namespace,
you can do it
Neven Goršić wrote:
Hi!
In every manual and book I read only one way to make a raw string:
re:\mm tests\1. exp files\5.MOC-1012.exp.
I don't know how to make a string raw string if it is already
contained in a variable.
s.raw() or something like that ...
Actually, there's no such thing as a
bob gailer wrote:
I'm guessing you want
x.raw() # to display
r\t
Is that true. That's the only way I can interpret your question.
Hm... or did you (speaking to the OP) intend for your script to
interpret strings you're reading from another source, like user input or
a text file, and
Joe,
It's an online class without a specific time. The class runs for six weeks
with two assignments
per week.
Steve
On Sun, Jul 20, 2008 at 3:51 PM, Joe Bennett [EMAIL PROTECTED] wrote:
What time where the classes? Web site seems to be missing that info...
-Joe
On Sun, Jul 20, 2008
Anyone taken or know of any online classes
teaching Python? I know O'Reilly Press
teaches online technical courses, through the University of
Illinois, but no Python
.
Thanks.
Steve
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman
.
Python Programming for the Absolute Beginner, Second Edition.
Thanks so much for your advice/help in advance.
Steve
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Dick Moores wrote:
Yes! A rule, not logic. I'm not contradicting Kent, just helping myself
understand. First the rule, then logic in the application of the rule.
And I assume the rule is there in Python because it makes things work
better.
Yes, so a statement like if foo: becomes an idiom
Monika Jisswel wrote:
import sys #a module that gives access to the system
import os#a module that gives access to the os
print sys.argv[0] #prints file name of the script
print os.getcwd() #print current working directory
print os.getcwd()+sys.argv[0] #
but os.getcwd()
You might also want to consider using the path walk
facility in Python's standard lib as well, so you
can recurse into subdirectories doing this (if that
is helpful)
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware
On Thu, Jun 26, 2008 at 04:53:14AM +0700, Lie Ryan wrote:
I'm not sure what caused your problem, but...
Look at where you're checking the file time. You're
not checking the file itself, but '.' (the time of the
current directory).
--
Steve Willoughby| Using billion-dollar satellites
Shrutarshi Basu wrote:
I've been writing a simple Tkinter interface to one of my programs.
But it looks rather bad on OS X leopard. I was wondering why that was
the case, since it seemed to take up at least some GUI elements (like
button styles). I then came upon the following page:
From: [EMAIL PROTECTED]
To: tutor@python.org
Date: Tue, 3 Jun 2008 15:39:18 -0400
Subject: [Tutor] env variable
have a question about setting up an env. variable.
i own a macbook pro laptop running mac os x 10.5.2.
i downloaded MacPython 2.5.
my problem
On Thu, May 8, 2008 10:51, Dick Moores wrote:
html
body
Could someone tell me what's wrong with this regex?brbr
The main thing is that you're forgetting that a RE matches anywhere
in the string.
\b\d+/\d+/\d{2,4}\b matches
4/4/2009
12/12/555
\b\d{1,2}/\d{1,2}\b matches
4/4/2009
4/4/12345
Changing to br
ttregex = rquot;^\d+/\d+/\d{2,4}$|^\d{1,2}/\d{1,2}$quot;brbr
/ttdid the job, and I learned several important points.brbr
Thanks, Kent and Steve!brbr
Dickbr
/body
/html
___
Tutor maillist - Tutor@python.org
http://mail.python.org
On Thu, May 8, 2008 12:40, Dick Moores wrote:
At 11:46 AM 5/8/2008, Steve Willoughby wrote:
Be aware that \d{2,4} matches 2, 3 or 4 digits, which may be
different than what you're looking for, since 1/12/234 would
match
Yes, I wanted to permit that. In my script, mxDateTime turns 1/12/234
On Thu, May 8, 2008 14:40, Dick Moores wrote:
At 01:30 PM 5/8/2008, Steve Willoughby wrote:
On Thu, May 8, 2008 12:40, Dick Moores wrote:
But here's a chance to ask: What regex would match 2-digit strings
and 4-digit strings only?
^\d\d(\d\d)?$
Ah. And so ^\d\d(\d\d)?(\d\d)?$ matches all
On Thu, May 8, 2008 16:32, Steve Willoughby wrote:
On Thu, May 8, 2008 14:40, Dick Moores wrote:
At 01:30 PM 5/8/2008, Steve Willoughby wrote:
On Thu, May 8, 2008 12:40, Dick Moores wrote:
But here's a chance to ask: What regex would match 2-digit strings
and 4-digit strings only?
^\d\d(\d
Dick Moores wrote:
At 04:32 PM 5/8/2008, Steve Willoughby wrote:
On Thu, May 8, 2008 14:40, Dick Moores wrote:
At 01:30 PM 5/8/2008, Steve Willoughby wrote:
On Thu, May 8, 2008 12:40, Dick Moores wrote:
But here's a chance to ask: What regex would match 2-digit strings
and 4-digit strings
On Tue, May 6, 2008 11:35, Dick Moores wrote:
Could someone just come right out and do it for me? I'm lost here.
That '*' is just too magical..nbsp; Where did you guys learn about
'%*s'? Does the '%s' still mean a string?
Python's % operator (for string formatting) is derived from the C
now :)
And glad to help.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
of the first
why use the list comprehension here, instead of simply saying:
return sum(range(1,101) ** 2
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor
), it will know
to properly quote or escape special characters in those
data values.
Some modules use ? as the place holder, others use %s (even
for numeric values, interestingly enough). Check with
your documentation.
--steve
___
Tutor maillist - Tutor
located in the
cgi-bin folder.
It's likely your web server is set up to *execute* (not deliver as text)
files in your cgi-bin directory.
Thanks!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
--
Steve
linuxian iandsd wrote:
ok - as i mentioned in my first email i use procmail to put THE BODY of all
incoming mail into a file (that is one per incoming email as i use the
variable $date-$time in the name).
now this file can contain only one email but it can also contain 2 or more
(this
script, you'd say something like
:0
*Subject:.*pattern to look for
|/home/me/scriptname
For more information see procmailrc(5) and procmailex(5).
Your Python script will see the message input on stdin.
On Wed, Apr 2, 2008 at 7:18 AM, Steve Willoughby [EMAIL PROTECTED] wrote:
linuxian iandsd
format might not be wrong?
Some error checking might be good to add at some point.
On Wed, Apr 2, 2008 at 9:50 AM, Steve Willoughby [EMAIL PROTECTED] wrote:
linuxian iandsd wrote:
well, i don't know how to pipe the file to my script !!
It's how procmail works. Presuming you
='-42.0001\29.8001'
LeafJawPositions
'-42.0001\x029.8001'
x1, x2 = LeafJawPositions.split('\x0')
ValueError: invalid \x escape
x1, x2 = LeafJawPositions.split('\')
Try
x1, x2 = LeafJawPositions.split('\\')
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL
of problems with properly quoting
data (what if a ';' is in one of the data fields?), as well as making it
unnecessary to carry out another post-processing step of gathering this
script's output and stuffing it into MySQL.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED
Dinesh B Vadhia wrote:
I spent fruitless hours trying to get a (normal) division x/y to work and
then saw that you have to declare:
normal division x/y works just as expected, with one caveat: remember
that if you divide two *integer* values, you will get an *integer*
division operation
elis aeris wrote:
is it possible to return two values?
Yes and no. You can return a value, but that value may itself be a
tuple of values. Or a list, dictionary or other kind of object.
how do I create an empy int array of 10?
If an int array has 10 things in it, it's not empty. You don't
elis aeris wrote:
arra = [0] * 10 ?
If you want a list of ten zeroes, yes.
A couple of suggestions:
Find a tutorial introduction to Python such as those on python.org, or
google for dive into python, and go through the examples in there.
Also, use the interactive Python interpreter to try out
.
non_null = 'Trondheim'
which is a True value. If you said:
if non_null:
print non_null, 'is not null'
else:
print it's null
The result would be to print:
Trondheim is not null
Hope that helps
steve
On Mar 20, 2008, at 4:32 PM, Guba wrote:
Dear list
Kent Johnson wrote:
Hans Fangohr wrote:
In [2]: 2 in [1,2,3] == True
On a slightly different tangent from the other answers you've received
to this question, if you're using a conditional expression, don't
compare it explicitly with True or False, just state the condition:
if 2 in [1,2,3]:
Kent Johnson wrote:
Try
list.append({'id': 'name', 'link': ('YY','XX')[total 0]})
I'd caution against that, though. It's clever and cute, sure, but the
meaning of it is obfuscated enough to be unpythonic because [total 0]
as a subscript doesn't mean anything unless you know you're
a ValueError, the code here will
deal gracefully with that, and carry on. Any other exception
will still be handled normally.
There's a lot more detail, but that's the basic gist of it.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware
Dave Kuhlman wrote:
On Wed, Dec 19, 2007 at 09:41:13PM -0500, bob gailer wrote:
1 - I see no value in introducing variables. I'd just use string constants:
action = moving
.
.
if action == jumping:
etc.
I agree. But, some people do prefer something that looks a bit
like an enum.
On Dec 10, 2007 11:14 PM, earlylight publishing
[EMAIL PROTECTED] wrote:
Is it tuh-ple (rhymes with supple)
or is it two-ple (rhymes with nothing that I can think of)?
How unscrupulous of you!
___
Tutor maillist - Tutor@python.org
Michael Langford wrote:
On 11/23/07, elis aeris [EMAIL PROTECTED] wrote:
is it possible to do this with python?
a server script to listen for
a client script, it sends a line of text to server when a given criteria is
met.
Sounds like python may not be simplest path to solving your
Ryan Hughes wrote:
Hello,
Why does the following not return [1,2,3,4] ?
x = [1,2,3].append(4)
print x
None
because the append() method doesn't return a copy of the list object; it
just modifies the list itself.
so your code constructs a list object with 3 elements, appends a fourth
Varsha Purohit wrote:
Hello everyone,
I wanted to know what are the differences between perl and
python, since both of them are scripting languages...
There is plenty of difference between them and between all the other
scripting languages. Look beyond the notion of scripting and look
This is where it's an advantage to setting up an old PC as a firewall
for your network. Stick Linux on it, set up your filtering rules, and
let it sit between your home network and the outside world. You can
then have it block that PC's access to the Internet via cron scripts,
possibly even
Rick Pasotto wrote:
(ip,fqdn) = line.split(',')
updatequery = update resultstable set %s where ip = %s % (fqdn,ip)
cursor.execute(updatequery)
connection.close()
Alternatively you could do:
connection = MySQLdb.connect(db=self.todatabase,host-self.host,
.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
in
the sendmail() parameter but not in the To: or Cc: headers, and
they are blind-carbon-copied.
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED] | to hunt for Tupperware.
___
Tutor maillist - Tutor@python.org
http://mail.python.org
On Wed, Oct 03, 2007 at 02:09:07PM -0700, Steve Willoughby wrote:
On Wed, Oct 03, 2007 at 05:02:52PM -0400, Kent Johnson wrote:
One gotcha is that msg must also include From and Two headers. A
slightly longer example is here:
http://docs.python.org/lib/SMTP-example.html
Yes, that's
a script which
serves the page if it exists, or creates a blank one if it doesn't.
You can use Python's string template module as an easy way to format up
variable text into style templates you set up as text files, or use a
database backend, or whatever.
--steve
-Sam
, and contains enough information that
almost every Python programmer will find it a useful addition to his or
her bookshelf.
You will enjoy it whether you choose to read from the beginning or just
dip in.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd
Ryan wrote:
I am running a Linux box and cannot find my Apache cgi-bin to put some
python scripts in. I know I probably have to create one but don't know
where and how.
On Linux under Apache 2.2, I've seen it in /usr/lib/cgi-bin which always
struck me as weird, but there you go. On BSD, it
John wrote:
Steve,
If you're interested in just banging out a Python app, though, my
experience
was writing a calendaring tool for a group of my friends who get
together
[...]
This sounds very cool, is it something you could post?
Okay. It's not the greatest
Christopher Spears wrote:
I have written a script that reads and displays text
files:
#!/usr/bin/env python
'readTextFile.py -- read and display text file'
import os
# get filename
while True:
fname = raw_input('Enter file name: ')
print
if os.path.exists(fname):
saradhi dinavahi wrote:
I am new to the Python Programming. I want to Import Excel sheet data
using Python. Can any one please provide me the code and explain the
basic steps and method of executing the code.
If you can get your Excel data into CSV format, the csv module others
have already
in the normal calendar
view.
The whole thing only took 318 lines of straight Python code, including all
the HTML displayed on all those forms.
The calendar module is your friend for apps like this, by the way :)
--
Steve Willoughby| Using billion-dollar satellites
[EMAIL PROTECTED
() and os.chown() to make the changes. (Note that
os.chown() changes the owner and/or group in one call.)
HTH
--steve
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Carlos Daniel Ruvalcaba Valenzuela wrote:
Yes is very possible to do this with python.
Checkout the os.system and os.popen functions to run external commands
(chmod, chown).
While those are ways of calling external commands, it is best to use
built-in language features like os.chmod() and
values) into a normally distributed random
value. Check out Wikipedia's normal distribution entry. The math is really
juicy. You may end up with a recipe for the Python Cookbook.
Have fun.
Steve
___
Tutor maillist - Tutor@python.org
http
day, I will have free time to work on my million dollar app.
(LOL!)
Thanks,
Steve Oldner
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Kirk Bailey
Sent: Wednesday, March 21, 2007 10:14 PM
To: tutor@python.org
Subject: [Tutor] MONEY MATTERS
ok, SHOULD
.
To print the labels the way I want, I will need extended control over the
printer: positioning the printer precisely and changing fonts, colors, and
background colors. Is there a public python library that could give me this
level of control?
Thanks
Steve
201 - 300 of 369 matches
Mail list logo