Hi Don!
Don Parris wrote:
The book, Programming Python, shows an example of os.chdir() on the
Windows platform, as follows:
os.chdir(r'c:\temp')
r ... raw Strings. There will no substitution be processed.
Otherwise the \t ( Tab ) will be inserted in the string:
print a\tb
a b
Let's see if I can get this right.as I am working on memory and not enough
sleep.
The 'r' means that using a raw string so the backslashes aren't escaped
out
The equivalent without using the 'r' would be: os.chdir('c:\\temp')
--Todd
On Monday 08 August 2005 03:07 am, Don Parris
: Tuesday, August 02, 2005 2:45 PM
Subject: Re: [Tutor] Question about resetting values
I am writing a Blackjack program, and was wondering how to reset the
values to zero, e.g. cash = 0?
Yes, that's how you do it. Now what is the bit you don't understand?
Alan G
Author of the Learn
Just curious to wonder if Python can be used to write a
program to check an HTTP mail server for mail,
Yes, you would probably use the urllib module for that.
and check more than one server,
Yes that would be a fairly typical use for Python as
a web client.
even if they are using
I had a co-worker say to me at work that Python was related
to or based upon BASIC. Is this true, and if not, how can I
tell my friend why they are similar?
Both Python and BASIC are interpreted languages intended to
be used (amongst other things) to learn how to program.
There the
I am writing a Blackjack program, and was wondering how to reset the values
to zero, e.g. cash = 0?
Thanks,
Nathan Pinno,Crew, Camrose McDonalds and owner/operator of
Woffee
BEGIN:VCARD
VERSION:2.1
N:Pinno;Nathan;Paul;Mr.
FN:Pinno, Nathan Paul
ORG:Woffee;Executive
TITLE:Owner/operator
Hi there,
I ran across this error when running a few lines of
code in debian python, but this runs perfectly in
windows python. Basically I created a dummy matrix
called gamma (using kroneckerproduct in numarray)
and printed out its mean. Here is the code:
gamma = kroneckerproduct(ones((N,
Hi there,
I would like to construct some string objects using the cprintf-style
format:
command_string = diff -u %s %s %s.patch % ( src, dst, file )
Of course it is illegal in python but I couldn't figure out a way to
construct strings with that kind of formatting and substitution.
I have
Gilbert Tsang wrote:
Hi there,
I would like to construct some string objects using the cprintf-style
format:
command_string = diff -u %s %s %s.patch % ( src, dst, file )
Of course it is illegal in python but I couldn't figure out a way to
construct strings with that kind of
On Mon, 1 Aug 2005, Xiangyi Meng wrote:
I ran across this error when running a few lines of code in debian
python, but this runs perfectly in windows python.
Hi Xiangyi,
This seems a bit specific to numarray; you may want to ask the Numeric
discussion group:
On Mon, 1 Aug 2005, Kent Johnson wrote:
I would like to construct some string objects using the cprintf-style
format:
command_string = diff -u %s %s %s.patch % ( src, dst, file )
Of course it is illegal in python but I couldn't figure out a way to
construct strings with that kind
I would like to construct some string objects using the
cprintf-style format:
command_string = diff -u %s %s %s.patch % ( src, dst, file )
Should work - assuming the 3 variables are defined! Although file
is a bad name for a variable since its also the name of the
function for opening
At 10:42 AM 8/1/2005, Gilbert Tsang wrote:
Hi there,
I would like to construct some string objects using the cprintf-style
format:
command_string = diff -u %s %s %s.patch % ( src, dst,
file )
Of course it is illegal in python
How did you conclude that? diff -u %s %s %s.patch % (
src, dst,
Thank you all for the enthusiastic responses. It must have been other
part of the script since the command string construction now works. I
also realized that "file" is a poor choice of variable name. Thanks
Danny for telling me about the subprocess module.
Best regards, Gilbert.
ZIYAD A.
Hi all,
I had a co-worker say to me at work that Python was related to or based
uponBASIC. Is this true, and if not, how can I tell my friend why they are
similar?
Nathan Pinno,Crew, Camrose McDonalds and owner/operator of
Woffee
BEGIN:VCARD
VERSION:2.1
N:Pinno;Nathan;Paul;Mr.
FN:Pinno,
Erm erm erm having used Visual Basic, XBasic and QBasic, I
can honestly say, that about the only similarity is that VB is more or
less object orientated, and that they use modules.
On 8/2/05, Nathan Pinno [EMAIL PROTECTED] wrote:
Hi all,
I had a co-worker say to me at work
At 06:13 PM 8/1/2005, Nathan Pinno wrote:
Hi all,
I had a co-worker say to me at work that Python was related to or based
upon BASIC. Is this true, and if not, how can I tell my friend why they
are similar?
There are many versions of BASIC (Beginners All-Purpose Symbolic
Instruction Code) (or
Hi!
I'd like to know what kind of Python I can download. I've tried but in vain!
My computer is windows xp servixe pack 1, version 2002.
Please, tell me what to do.
Jane.
_
Express yourself instantly with MSN Messenger! Download
Thanks Bob and Liam. I was wondering myself.
- Original Message -
From:
Bob
Gailer
To: Nathan Pinno ; Tutor mailing list
Sent: Monday, August 01, 2005 11:09
PM
Subject: Re: [Tutor] Question about BASIC
and Python
At 06:13 PM 8/1/2005, Nathan Pinno wrote
This link - http://www.python.org/ftp/python/2.4.1/python-2.4.1.msi
straight from the python.org website is for a Windows installer.
May I also recommend this - http://wiki.python.org/moin/BeginnersGuide
The Python Beginner's Guide?
Good luck,
Liam ClarkeOn 8/2/05, Jane MUIRI [EMAIL
Hi there,
I ran across this error when running a few lines of
code in debian python, but this runs perfectly in
windows python. Basically I created a dummy matrix
called gamma (using kroneckerproduct in numarray)
and printed out its mean. Here is the code:
gamma = kroneckerproduct(ones((N,
If that's your only question about programmers then you aint been around
them much.
I'm 45.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of [EMAIL PROTECTED]
Sent: Wednesday, June 22, 2005 14:38
To: tutor@python.org
Subject: [Tutor] question
What's the average age of a python user? This is my only question
about
programmers themselves.
There was a thread on this on comp.lang.python recently.
Try searching google groups and you should find literally
hundreds of replies!
From memory average was around 30 but with a distribution
Hey there,
i have some log files that i want to be able to work with.
the lines of the log files are comma - delineated.
i want to put those into a database where each piece of info (comma
delineated)
would be the fields of the database.
ok, so the first obstacle is learning how to make a list
nephish wrote:
Hey there,
i have some log files that i want to be able to work with.
the lines of the log files are comma - delineated.
i want to put those into a database where each piece of info (comma
delineated)
would be the fields of the database.
ok, so the first obstacle is
I haven't done much OO in Python yet. For various web apps we write, we usually
write up a DB schema in a spreadsheet. Then we write the sql script that would
create the tables in the database. I thought it would be neat to save the
spreadsheet as a csv file and have python write the sql
Mike Hansen wrote:
class DBField(object):
def __init__(self, fieldName):
self.fieldName = fieldName
self.type =
self.size = 0
self.notNull = False
self.unique = False
self.references =
self.default =
def
Subject:
Re: [Tutor] question about hiding a function/method in a class
From:
Kent Johnson [EMAIL PROTECTED]
Date:
Fri, 03 Jun 2005 09:45:20 -0400
CC:
tutor@python.org
Mike Hansen wrote:
class DBField(object):
def __init__(self, fieldName):
self.fieldName
I haven't done much OO in Python yet. For various web apps we write,
we usually
write up a DB schema in a spreadsheet.
Wow! How exactly do you represent a schema in a spreadsheet?
I confess I cannot conceive of such a thing. Can you send a
representative sample to illustrate?
create the
Alan G wrote:
I haven't done much OO in Python yet. For various web apps we write,
we usually
write up a DB schema in a spreadsheet.
Wow! How exactly do you represent a schema in a spreadsheet?
I confess I cannot conceive of such a thing. Can you send a
representative sample to
Maybe it's not a schema exactly.
|Table Name|Fields |Type |Size|Primary Key|Not
Null|Unique|Foreign Key| ...
|'s represent each cell. It's just a way to organize your thoughts,
and have
something a little more readable than an SQ script for a DB schema.
There's been
less than 20 tables
Could somebody explain to me why the code I used to complete this exercise doesn't work.
And how do you send an integer to len?
Thanks
Ben
==
As an exercise, write a loop that traverses a
list and prints the length of each element. What happens if
you send an
On Apr 14, 2005, at 14:14, Ben Markwell wrote:
Could somebody explain to me why the code I used to complete this
exercise doesn't work.
And how do you send an integer to len?
Well, I think you've successfully completed that exercise. len()
doesn't work on integers because integers don't have a
this sentence:
for element in foo:
print len(element)
Regards
AlbertoFrom: Ben Markwell [EMAIL PROTECTED] Reply-To: Ben Markwell [EMAIL PROTECTED] To: Python Tutor tutor@python.org Subject: [Tutor] Question regarding the len function of a list while using aloop Date: Thu, 14 Apr 2005 08:14:12 -0400
Ben Markwell said unto the world upon 2005-04-14 08:14:
Could somebody explain to me why the code I used to complete this exercise
doesn't work.
And how do you send an integer to len?
Thanks
Ben
==
*As an exercise, write a loop that traverses a list and prints
Yes this does make sense. Thank youOn 4/14/05, Brian van den Broek [EMAIL PROTECTED] wrote:
Ben Markwell said unto the world upon 2005-04-14 08:14: Could somebody explain to me why the code I used to complete this exercise
doesn't work. And how do you send an integer to len? Thanks Ben
The second option will do the trick. I use Pmw.Combobox but I didn't know there was a ScrolledFrame
Thanks a lot
Regards
Alberto
GauchoFrom: [EMAIL PROTECTED] To: "tutor@python.org" tutor@python.org Subject: Re: [Tutor] Question about Frames and Scrollbars Date: Wed, 13 Apr 2005 10:1
Hi everyone
I don't know if anyone posted something similar but I'll shoot.
Is there anyway to Scroll over a Frame??
Let me put this under water. I made a 2D blueprint inside a frame. I'm creating labels dynamically depending on how many rows and columns I want. Suppose you have an 8x8 matriz of
A couple of options...
You can pack a scrollbar on the right hand side of the containing frame and use
the yscrollcommand option to associate it with the frame --- see Fredrik Lundh's
Tkinter pages for an example.
Or you could grab Python MegaWidgets from http://pmw.sourceforge.com/ and use a
Dear all,
I was learning how to use the urllib, BUT there is nothing printed out
in the following example.
Could anyone hellp me or tell why?
import urllib
params = urllib.urlencode({'DN':'Adrenal glands disorders'})
address=http://xin.cz3.nus.edu.sg/group/cjttd/List.asp?SetQuery=Y;
f =
I've spent hours trying things out and I'm no better off.
I don't understand exactly what I'm supposed to do...
alieks__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
I've spent hours trying things out and I'm no better off.
I don't understand exactly what I'm supposed to do...
alieks
The tutor you are using is fairly specialised.
What are you trying to learn? Python or math in Python?
To learn Python use one of the other tutorials that
focus on Pyhon
On Fri, 4 Feb 2005, alieks lao wrote:
Once again i have a question concerning something from the tutorial im
being tortured by.
___
x.y= \ x (dot)y(dot)
/__ i
i
How would i express this in python.
If the above doesn't make any sense to ya'll.
It's at the bottom
On Sat, 29 Jan 2005, Roy wrote:
I am learning about python exception handling. I am reading Python in a
Nutshell. In the chapter of exception handling, it says: Note that the
try/finally form is distinct from the try/except form: a try statement
cannot have both except and finally clauses,
a Nutshell. In the chapter of exception handling, it says: Note
that
the try/finally form is distinct from the try/except form: a try
statement cannot have both except and finally clauses, as execution
order might be ambiguous.
I don't understand the reason why except and finally clauses
Hello, there:
I am learning about python exception handling. I am reading Python in
a Nutshell. In the chapter of exception handling, it says: Note that
the try/finally form is distinct from the try/except form: a try
statement cannot have both except and finally clauses, as execution
order might
901 - 946 of 946 matches
Mail list logo