Thank you for all the answers. Sorry for not replying but i have been
very busy this week I will try all the suggested ways.
//Magnus
Magnus Wirström skrev:
> Hi everyone
>
> I have written a app that makes a tar file and all works well... Now i
> want to expand that app so it can read read the
> Danny, "Python and Tkinter Programming" is still in its first
> edition, which came out in 2000. Python has changed a lot since
> then.
> Hasn't Tkinter? Is the book still usable by a Tkinter beginner?
Tkinter has not changed hardly at all.
The only shame about the book is that it strongly feat
Chris Hengge wrote:
> First question..
>
> This is the code that I have:
> for filename in zfile.namelist():
> outfile = open(filename, 'w')
> outfile.write(zfile.read(filename))
> outfile.close()
>
> Is there a way to say :
> for filename in zfile.namelist() contains '.tx
"Alan Gauld" <[EMAIL PROTECTED]> wrote
> Tkinter has not changed hardly at all.
Yuk, a double negative, sorry.
That should of course say:
Tkinter has hardly changed at all.
Hopefully that was obvious from my subsequent comments!
Alan G.
___
Tutor
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]
>##
>
>
>
random.choice( [ SyntaxError: invalid syntax, 42 the answer is young
I no im probally not the best pereson to go about this but maybe people in this community are. I was wondering if there was or maybe someone can start a Python maganize kinda like 3dCreative or 2d Artist. that is an PDF magazine with tutorials interviews, python news, and maybe a programming challe
Amadeo Bellotti wrote:
> I no im probally not the best pereson to go about this but maybe
> people in this community are. I was wondering if there was or maybe
> someone can start a Python maganize kinda like 3dCreative or 2d
> Artist. that is an PDF magazine with tutorials interviews, python
i saw it but it didnt quite meet what i wanted :\On 10/14/06, Glenn T Norton <[EMAIL PROTECTED]> wrote:
Amadeo Bellotti wrote:> I no im probally not the best pereson to go about this but maybe
> people in this community are. I was wondering if there was or maybe> someone can start a Python maganize
Folks,
I am trying to build a simple text editor which has a couple of options of editing, displaying and saving the file.
Now what I want to do is to allow teh user to keep entering the text unless he pressed ':q'.
How can I add this functionality??
Thanks.
REgards,
Asrar
-- To HIM you sha
> I am trying to build a simple text editor which has a couple of
> options of
> editing, displaying and saving the file.
Are you using a GUI or console?
The solution is potentially quite different depending on the choice.
> Now what I want to do is to allow teh user to keep entering the text
>
Is it possible to make the utility like in vi, where the user keeps on entering the data and when he hits ':wq', the work is saved and the application exists.
I guess the use of standard input file would be applicable???
Thanks.
Regrds,
Asrar
On 10/14/06, Alan Gauld <[EMAIL PROTECTED]> wrote
Title: Message
I have
code that uses variables to hold escaped characters like "\n" or "\03". As long
as the assignment is done within the code, like self.crChar = "\n", there is no
problem. But When I try to read the same character string from a text file
and assign it, the string is seen
David Heiser wrote:
>
> I have code that uses variables to hold escaped characters like "\n"
> or "\03". As long as the assignment is done within the code, like
> self.crChar = "\n", there is no problem. But When I try to read the
> same character string from a text file and assign it, the str
> I have code that uses variables to hold escaped characters like "\n" or
> "\03". As long as the assignment is done within the code, like self.crChar =
> "\n", there is no problem. But When I try to read the same character string
> from a text file and assign it, the string is seen as just a strin
> I am trying to build a simple text editor which has a couple of options of
> editing, displaying and saving the file.
> Now what I want to do is to allow teh user to keep entering the text unless
> he pressed ':q'.
reading of and writing of a text file is one of the examples i added
to "Core Py
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]
> ##
>
Hmm - interesting. Given that the argument of random.choice is sup
David Heiser wrote:
>
> I have code that uses variables to hold escaped characters like "\n" or
> "\03". As long as the assignment is done within the code, like
> self.crChar = "\n", there is no problem. But When I try to read the
> same character string from a text file and assign it, the str
Excellent suggestion! Thanks!I have a question... is endswith() case sensitive?On 10/14/06, Bill Burns <
[EMAIL PROTECTED]> wrote:Chris Hengge wrote:> First question..
>> This is the code that I have:> for filename in zfile.namelist():> outfile = open(filename, 'w')> outfile.write(z
Bill Burns wrote:
> Maybe take a look at 'endswith':
>
> Example:
> for filename in zfile.namelist():
> if filename.endswith('.exe') or filename.endswith('.txt'):
> # do something with filename
In Python 2.5 endswith() can take a tuple of strings to try:
if filename.endswith(('.e
Oops I get an error using that code.. if filename.endswith('.cap','.fru','.hex') or filename.endswith('.sdr', '.cfg'):TypeError: slice indices must be integers or None
On 10/14/06, Bill Burns <[EMAIL PROTECTED]> wrote:
Chris Hengge wrote:> First question..>> This is the code that I have:> f
Chris Hengge wrote:
> Oops I get an error using that code..
>
> if filename.endswith('.cap','.fru','.hex') or
> filename.endswith('.sdr', '.cfg'):
> TypeError: slice indices must be integers or None
With Python 2.5 you can do this with a tuple argument. You need an extra
set of parenthe
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote
> Is it possible to make the utility like in vi, where the user keeps
> on
> entering the data and when he hits ':wq', the work is saved and the
> application exists.
YES BUT THE ACTUAL CODE TO READ KEYSTROKES AS
THEY ARE TYPED WILL BE VERY DIFFERENT
Got that working now, thanks. I've been using activepythons release, and they dont have 2.5 prepared yet. Guess I should just upgrade without them?On 10/14/06,
Kent Johnson <[EMAIL PROTECTED]> wrote:Chris Hengge wrote:
> Oops I get an error using that code..>> if filename.endswith('.cap','
Ok, last problem with this whole shebang...When I write the file from the zip, if it is in a subfolder, it will error.. The code below will detect if the file in contained inside a directory in the zip, but I just want it to write it like it wasn't.
Another wordsZipfile.zip looks like thisfile.extf
Chris Hengge wrote:
> Ok, last problem with this whole shebang...
>
> When I write the file from the zip, if it is in a subfolder, it will
> error..
> The code below will detect if the file in contained inside a directory
> in the zip, but I just want it to write it like it wasn't.
> Another wor
I was using afile.split("/"), but I'm not sure how to impliment it... if "/" in afile: (for some reason I can't add 'or "\" in afile' on this line) outfile = open(afile, 'w') # Open output buffer for writing. (to open the file, I can't split here)
outfile.write(zfile.
Correction... The first comment I just realised I needed "\\" to make it work.. so that issue is gone.. On 10/14/06, Chris Hengge <
[EMAIL PROTECTED]> wrote:I was using afile.split("/"), but I'm not sure how to impliment it...
if "/" in afile: (for some reason I can't add 'or "\" in afile' on this
Guess nobody has had a chance to point me in the write direction on this problem yet?Thats ok, I've gotten a ton of other code written, and I'll come back to this tricky part later.This particular project I've been working on to automate some of my job at work has been an excellent learning experie
I'm afraid I don't have enough experience with Gnome to answer your
questions, Alfonso. I will share what I know, though. If you could,
run this:
$ gnomevfs-info .pyc | grep MIME
and see what it says? (If it gives you nothing back, then you need to
register a MIME type for .pyc files.
http
Is there a python equivalent of the perl readlink() function
(e.g. one that returns the relative path in cases where a command
such as ``ln -s ls /usr/local/bin/gls'' created the link?
Reading the documentation on the various os.path functions, the
only thing I see returns the fully resolved path
30 matches
Mail list logo