Pine Marten wrote:
Did you create this code, or did someone give it to you? It looks
like it's been made with BoaConstructor. If you're using Boa for
development, you'd probably be better off using it to add your save
functionality, rather than writing the code by hand.
Unfortunately,
Chris Hengge wrote:
I chose the way I used the names because to me...
outFile = open(aFile.lower(), 'w') # Open output buffer for writing.
= open a file with lowercase name for writing.
it is implied that aFile is from the zip, since it is created in the
loop to read the zip..
Hello,
When I import a module in Python, I see that 6 file system operation
are being made. All requests are for opening.
I know very well what are the .py and and .pyc files. But I'm not so
sure what are .pyd and .pyw, and why it's looking for a dll. Anyone
can shed some light on this?
Also, if
Kent Johnson wrote:
Chris Hengge wrote:
I chose the way I used the names because to me...
outFile = open(aFile.lower(), 'w') # Open output buffer for writing.
= open a file with lowercase name for writing.
it is implied that aFile is from the zip, since it is created in the
loop to
Hello,
I'm evaluating a way to build applets in python.
Actually google told me that I can use
Grail
Jython
Can you add/suggest other ways?
The more easy to learn wins !!!
thanks a lot for any answer.
Picio
___
Tutor maillist - Tutor@python.org
Picio wrote:
Hello,
I'm evaluating a way to build applets in python.
Actually google told me that I can use
Grail
Jython
Grail is a very old, very dead project to write a web browser in Python.
Your users would have to use Grail for this to work.
You can write Java applets in Jython, see
I am trying to write to a file, but I am getting this errror.
IOError: (0, 'Error')
Can someone explain what is it and whats the solution??
Thanks.
Regards,
Asrar
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I am writing code that people I work with want to pick up instantly for their own machines. BUT they may be using different platforms and different installations on those platforms.
I'm writing on a Mac, using Python 2.4, numpy, and Tkinter. They are using Macs and PC's, who-knows-what vintage
I find your example rather amusing, since it makes it sound like you want this fictional mechanic to pick his parts by the brand name, rather then by how well the part works (in description vs context)... Your analogy seems to push that the brand name would inherently give the descriptive name
I get what you are trying to say.. but I'm looking at the code after changing names, and I think it makes more sense in the code my way because of the following lines..outFile = open(aFile.lower(), 'w')#open 'afile' named with lowercase to 'w'rite
outFile.write(zFile.read(insideZip))#write what
Asrarahmed Kadri wrote:
I am trying to write to a file, but I am getting this errror.
IOError: (0, 'Error')
Can someone explain what is it and whats the solution??
No.
Give us the actual source and the full traceback.
Cheers,
-Luke
___
Tutor
Joel Levine wrote:
I am writing code that people I work with want to pick up instantly
for their own machines. BUT they may be using different platforms and
different installations on those platforms.
I'm writing on a Mac, using Python 2.4, numpy, and Tkinter. They are
using Macs and
I am trying to write to a file, but I am getting this errror.
IOError: (0, 'Error')
Can someone explain what is it and whats the solution??
Hi Asrarahmed,
Did you read my response from the last few days?
http://mail.python.org/pipermail/tutor/2006-October/049958.html
Did you find it
Oops, I replied off-list. Forwarding to list.
---BeginMessage---
Mike Hansen wrote:
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Luke Paireepinart
Sent: Tuesday, October 17, 2006 11:50 AM
To: Asrarahmed Kadri
Cc: pythontutor
Subject: Re:
On Sat, 14 Oct 2006, John Fouhy wrote:
From the python_dev LiveJournal community ---
Predict the outcome of the following code:
##
from random import *
seed()
[choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0]
##
On ActivePython 2.4.3:
from random import *
seed()
On 18/10/06, Terry Carroll [EMAIL PROTECTED] wrote:
On Sat, 14 Oct 2006, John Fouhy wrote:
From the python_dev LiveJournal community ---
Predict the outcome of the following code:
##
from random import *
seed()
[choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0]
In continuation to :
Re: [Tutor] extracting numbers from a list
hello list
I have coordinates for exons (chunks of sequence). For
instance:
10 - 50 A
10 - 20 B
35 - 50 B
60 - 70 A
60 - 70 B
80 - 100 A
80 - 100 B
(The above coordinates and names are easier than in
dat)
Here my aim is to
contents = readlines(myfile, 'r')Ok, I'm under the impression this is a list of strings (array)How in the world do I cycle through them looking for words?for line in contents: if line.contains(something)
print lineThats a mock up of what I'm looking for. I tried to figure out how to use re, but
Chris Hengge wrote:
contents = readlines(myfile, 'r')
Ok, I'm under the impression this is a list of strings (array)
Nope. No such thing as arrays in Python.
It is a list of strings, that's it. :)
How in the world do I cycle through them looking for words?
for line in contents:
if
I remove those lines, but I was trying to usefor line in contents: result = re.search(something, line) print resultthis printed out something like NoneNoneNonehex memory address of goodness
NoneNone...On 10/17/06, Luke Paireepinart [EMAIL PROTECTED] wrote:
Chris Hengge wrote: contents =
Chris Hengge wrote:
I remove those lines, but I was trying to use
for line in contents:
result = re.search(something, line)
print result
I'm pretty sure this isn't how you use regular expressions.
I have to go to class right now but if no one else has replied when I
get back I'll look
An article at devshed was using it like that... but the output wasn't what I was looking for.. I was getting the hex address where the result was, but not printing the line.. I think the simple code you recommended in your first reply will do the trick, I'm not looking for anything magical, just
On 18/10/06, Chris Hengge [EMAIL PROTECTED] wrote:
I remove those lines, but I was trying to use
for line in contents:
result = re.search(something, line)
print result
this printed out something like
None
None
None
hex memory address of goodness
None
None
If you don't need a
I remove those lines, but I was trying to use
for line in contents:
result = re.search(something, line)
print result
'result' here is going to either be None, as you've seen, or a match
object. We have several options available to use once we have a
match. Take a look at a few of
I changed to append mode and itis working.
But the thing is that I have another problem.
I am trying to insert usernames that are unique. Please look at the code and help me.
import sys
fd = open('usr.txt','a')
def chk(str): global fd fd.seek(0,0) print fd done = 0 list1 = [] answer = True while
I am so sorry.. if anyone felt offended..
I am a bit nervous about teh whole thing.. I am learning the language as well as i have a deadline to complete my project which is on Tkinter..
Dont mind.. I acknowledge the help from all the people out here..
Thanks.
God Bless.
Regards,
Asrar
On
Asrarahmed Kadri wrote:
I changed to append mode and it is working.
But the thing is that I have another problem.
I am trying to insert usernames that are unique. Please look at the
code and help me.
import sys
fd = open('usr.txt','a')
append mode is write-only.
more comments further
Asrarahmed Kadri wrote:
I am so sorry.. if anyone felt offended..
I don't think anyone was offended :)
I am a bit nervous about teh whole thing.. I am learning the language
as well as i have a deadline to complete my project which is on Tkinter..
Why do you have a deadline?
Is it a
-- Forwarded message --
Date: Mon, 16 Oct 2006 14:19:53 -0700 (PDT)
From: anil maran [EMAIL PROTECTED]
To: Danny Yoo [EMAIL PROTECTED]
Subject: followup on python cookies/sessions
Dear Danny
My login code looks like this for session and cookie i dont know how to combine
both
(in reference to a question I had about how to simply save the content of a
textCtrl to a text file)
#Okay, here is the function we need to change.
def OnSaveButton(self, event):
#from John's save(event) function:
#
#savefile = open(self.filename, 'w')
On Mon, 16 Oct 2006, kumar s wrote:
I have a simple question to ask tutors:
list A :
a = [10,15,18,20,25,30,40]
Hi Kumar,
If you're concerned about correctness, I'd recommend that you try thinking
about the problem inductively. An inductive definition for what you're
asking is
I tried it and it did work this time, thanks so much. Your effort may keep
me trying bit by bit to gain a little profiency.
I'm glad that you're not going to give up just yet! Don't worry, I have
much more effort in store for you :)
And yes, I believe I see how much of this ought to
John Fouhy wrote:
From the python_dev LiveJournal community ---
Predict the outcome of the following code:
##
from random import *
seed()
[choice(dict((x+1,0) for x in range(1000))) for x in range(693)][0]
##
Well the discussion did not go very far! You got my prediction and one
33 matches
Mail list logo