At 07:55 AM 7/16/2008, Dick Moores wrote:
I mean something equivalent to what you get when you do a Ctrl+F6 in IDLE:
>>> import math
>>> math.log(3)
1.0986122886681098
>>> === RESTART
===
>>> math.log(3)
T
You get the "D" characters when decoding Russian encoded in UTF-8 using Latin-1
instead.
# coding: utf-8
x=u'Зарегистрироваться'
print x.encode('utf-8').decode('latin-1')
ÐаÑегиÑÑÑиÑоваÑÑÑÑ
Check that your html encoding is declared correctly.
--
Mark
"Oleg Oltar" <[EMAIL P
>
> I'm iterating through a vey large tarfile (uncompressed, it would be about
> 2.4G, with about 2.5 million files in it) and I can see from some external
> monitors that its virtual storage usage just grows and grows, until my
> whole system finally grinds to a halt after about 1.2 million member
On Thu, 17 Jul 2008, Monika Jisswel wrote:
> Well, you can check whether your system has reached its limits or not, but
> what for ?
So I can debug the problem.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Win XP, Python 2.51, IPython 0.84
In my ipy_user_conf.py I have put this line:
ipy_editors.install_editor("C:\Program Files\TextPad 5\TextPad.exe")
I use IPython -debug to start IPython, and this is what it tells me:
'editor': '"C:\\Program Files\\TextPad 5\\textpad.exe"',
but
In [3]: ed versi
beryl:~ oleg$ env
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TMPDIR=/var/folders/PC/PCtFE4gQGiqpQymiAScfnk+++TM/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-UNXiC6/Render
TERM_PROGRAM_VERSION=237
USER=oleg
COMMAND_MODE=unix
And also:
Getting this in console when trying to generate report via HTMLTestRunner
(it displayed text correctly when tried simple unittest.main)
pass
output_list['pt1.1'] =
'!!! True\nÐ"омен \'foobar\' занÑÑ. РекомендованнÑе
ÑвободнÑе доменÑ: ffoobar foobar.
I see no problem, if you open very BIG files then your memory will get
filled up & your system will halt,
can you buy more food than your fridge can handle , and write to a list
asking to invistigate the problem ?
2008/7/17 Terry Carroll <[EMAIL PROTECTED]>:
> On Thu, 17 Jul 2008, Monika Jisswel
Hello, I am taking python this summer, and have run into a problem.
The assignment is to create a dictionary from a text file:
"12/07/0526 = St Felix IV begins his reign as Catholic Pope"
"12/07/1109 = Crusaders capture Syria's harbor city of Tripoli"
"12/07/1191 = Richard Coeur de Lion and Crusa
hi all,
i am new to programming, i just started writing scripts in python about
functions.There is a program by name hangman where in i take input three
characters and then concatenate the resultant output is compared to a three
letter string, if it is similar it will display the word as correct if
josetjr wrote...
>Hello, I am taking python this summer, and have run into a problem.
Let me suggest some improvements. You can process all the lines in a
textfile like this:
for line in open("dates.txt").readlines():
print line
Furthermore, if you have a string in the form of
Dates = {}
def read_Dates (Dates):
if os.path.exists(FILE_NAME):
store = open(FILE_NAME,'r')
for line in store:
name = line.rstrip()
entry = store.next().rstrip()
Dates[name] = entry
store.close()
def save_Dates (Dates):
store =
Several reactions:
---
As I understood it the list policy is:
1) not solve homework problems.
2) request students to tell us exactly what problems they were running into
e.g. expected output, actual output, exceptions, ...
3) then give
"Monika Jisswel" <[EMAIL PROTECTED]> wrote...
I see no problem, if you open very BIG files then your memory will
get
filled up & your system will halt,
Only if you were to foolishly read the whole file into memory at once.
Early computers only had memories of a few kilobytes but could
process
<[EMAIL PROTECTED]> wrote
The assignment is to create a dictionary from a text file:
ok, since it's 'homework' I won't give the whole answer but will try
to point you in the right direction.
Your program should start by creating an empty dictionary called
dates.
Then your program will get
"Michiel Overtoom" <[EMAIL PROTECTED]> wrote
Let me suggest some improvements. You can process all the lines in a
textfile like this:
for line in open("dates.txt").readlines():
print line
Or just
for line in open("dates.txt"):
print line.rstrip()
So, your little homework prog
"bob gailer" <[EMAIL PROTECTED]> wrote
As I understood it the list policy is:
1) not solve homework problems.
2) request students to tell us exactly what problems they were
running into
e.g. expected output, actual output, exceptions, ...
3) then give specific suggestions
We seem to hav
"Dick Moores" <[EMAIL PROTECTED]> wrote
In my ipy_user_conf.py I have put this line:
ipy_editors.install_editor("C:\Program Files\TextPad 5\TextPad.exe")
escape the spaces and backslashes(raw string might work as well)
ipy_editors.install_editor("C:\\Program\ Files\\TextPad
5\\TextPad.exe")
At 08:13 AM 7/17/2008, Alan Gauld wrote:
"Dick Moores" <[EMAIL PROTECTED]> wrote
In my ipy_user_conf.py I have put this line:
ipy_editors.install_editor("C:\Program Files\TextPad 5\TextPad.exe")
escape the spaces and backslashes(raw string might work as well)
Yeah, I tried that (except for t
"vanam" <[EMAIL PROTECTED]> wrote
i am new to programming, i just started writing scripts in python
about
functions.
You need to check the section of your tutorial/book that
discusses loops. That will make your solution much easier.
characters as input. The problem is i am not getting a runt
Would a program using a continuouse loop such as in this code take up
resources on the system if left for long period ?
import sys
>
> while 1:
> self.data = sys.stdin.readline()
> self.function_1(data)
>
What are my other options is I want to have a running program & other
programs commu
"Monika Jisswel" <[EMAIL PROTECTED]> wrote
Would a program using a continuouse loop such as in this code take
up
resources on the system if left for long period ?
Any running program takes up some resources but whether this
one would increase its resource usage over time, which I assume
is w
On Thu, 17 Jul 2008, Monika Jisswel wrote:
> I see no problem, if you open very BIG files then your memory will get
> filled up & your system will halt,
I'm going to disagree with you on this one.
First, in general, it is not the case that opening a very large file will
cause memory to be fille
I m really sorry if no one of you liked/agreed with the fridge analogy but
that's what my brain could come up with at the time, I have to say it's not
a very scientific argument. but I only meant to say that if you are piping
data into memory & this data is larger than that memory then there is no
Hello. I'm new to Python and I was wondering how to read all the files in a
folder. I used this program or command for single files.
import pprint
pprint.pprint(open(r'c:\text\somefile.txt').readlines())
And if possible, is there a way to make it so that it waits at the end of each
file for a
Monika Jisswel wrote:
> Would a program using a continuouse loop such as in this code take up
> resources on the system if left for long period ?
>
> import sys
>
> while 1:
> self.data = sys.stdin.readline()
> self.function_1(data)
Not much, I would think, until somethin
I am almost done with a stack class that I wrote:
#!/usr/bin/python
class Stack(list):
def isempty(self):
length = len(self)
if length == 0:
return True
else:
return False
def peek(self):
length = len(self)
if le
On 18/07/2008, Christopher Spears <[EMAIL PROTECTED]> wrote:
> How come the stack doesn't shrink when I pop off the last value? I tested
> the code in the interpreter:
>
> >>> lista = [1,2,3,4]
> >>> lista[:len(lista)-1]
> [1, 2, 3]
> >>> lista = lista[:len(lista)-1]
> >>> lista
> [1, 2, 3
2008/7/15 Martin Walsh <[EMAIL PROTECTED]>:
> > Any pragmatic advice on building or working with a framework to get
> > to the point where i can do analysis on my logs would be cool.
> >
>
>
> As an exercise, I think it would be a reasonable approach to write
> python derivatives of the s
2008/7/16 Jeff Younker <[EMAIL PROTECTED]>:
> Parsers as referenced in your link are intended for heavy-duty lifting
> such as parsing programming languages.
>
> Sendmail logs are very simple, so those parsers are vast overkill. Split
> on whitespace combined with regular expressions should be u
I have the challenge / opportunity to learn Python quickly. I
am technically-minded, but I am not a programmer. When I have
tried / used Python before (I've written 5-6 python programs/utilities),
it has been solving a particular issue but not learning the proper
structure/procedures
to learn Pytho
>
> First, a tip:
>
> Instead of lista[:len(lista)-1], you can (and should) just
> write lista[:-1].
>
> Now, what if we wrap that in a function:
>
> >>> def shorten(lst):
> ... lst = lst[:-1] # identical to: lst =
> lst[:len(lst)-1]
> ...
>
> Then test it:
>
> >>> lista = [1, 2, 3, 4]
>
"Mitchell Nguyen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello. I'm new to Python and I was wondering how to read all the files
in a folder.
Take a look at the fileinput module, I think it will do what you want.
Alan G
___
"Christopher Spears" <[EMAIL PROTECTED]> wrote
I am almost done with a stack class that I wrote:
Some comments...
class Stack(list):
def isempty(self):
length = len(self)
if length == 0:
return True
else:
return False
This can just be
return bool(len(self)
34 matches
Mail list logo