Hi,
I don't know why you are forking shells using os.system. You should
either use system commands to do the job or plain python, but mixing
both should never be an option.
Here is a plain portable python script (using the with statement. Your
python should not be to old)
from __future__
Hello,
A way to do it
===
from __future__ import with_statement
res = []
with open("sentences.txt","r") as f:
sentences = [elem for elem in f.read().split('\n') if elem]
for sentence in sentences:
res.append(sentence.split())
p
Maybe you run the configure, make, make install without addind devel
packages on your system. I mean:
openssl-devel
readline-devel
...
Regards,
emallove wrote:
> I'm running into the below "No modules named _sha256" issue, with a
> python installed in a non-standard location.
>
> $ python
> Py
Maybe the walk method in os module is what you need
http://docs.python.org/lib/os-file-dir.html
Regards
Jon Clements wrote:
> On 16 Mar, 09:02, "Jon Clements" <[EMAIL PROTECTED]> wrote:
>> On 16 Mar, 03:56, "hiro" <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>
>>
>> > Hi there,
>>
>> > I'm very new to p
Hi,
You need to have readline installed.
Laurent
ThomasC wrote:
> Hello,
>
> How to configure Python2.5's interactive interpreter to get command
> history ?
>
> I always got ^[[A and ^[[B .
>
> Thank you !!
>
> Thomas#
--
http://mail.python.org/mailman/listinfo/python-list
Maybe you should take a look at sqlalchemy
king kikapu wrote:
> Hi to all,
>
> i have started a month ago to seriously studying Python. I am now
> looking at the databases stuff
> and i want the opinion of more experienced Python programmers (than
> me) at the following :
>
> I see that there a
And using the codecs module
[CODE]
import codecs
f = codecs.open("show_btchina.user.js","r","utf-8")
modf = codecs.open("modified.js","w","utf-8")
for line in f:
idx = line.find(u"//")
if idx==0:
continue
elif idx>0:
line = line[:idx]+u'\n'
modf.write(line)
m
Hi,
I known this can be impossible but what about an "HTML" GUI ?
Daniel Jonsson wrote:
> So, I've reached the point where my building pipeline tools actually
> needs to be used by other people in my company. By this reason I
> actually need to think about the usability, and I've come to the
> c
Hi,
I guess you could take a look at pydev extension for eclipse and if you
wan't an almost straight forward installation, you should consider this
link :
http://www.easyeclipse.org/site/distributions/python.html
Regards,
Laurent
W. Watson a écrit :
> I downloaded python-2.5.msi and installed
Hi,
I guess you should take a look at BeautifulSoup
(http://www.crummy.com/software/BeautifulSoup/).
And take a clooser look at the findAll method.
http://www.crummy.com/software/BeautifulSoup/documentation.html#The%20basic%20find%20method
%20findAll(name,%20attrs,%20recursive,%20text,%20limit,%2
Hi,
What about :
import os.path
print os.path.abspath(__file__)
hg a écrit :
> Hi,
>
> Is there an easy way for a script being executed (from anywhere) to know
> where is is ... something in os.path ?
>
> Thanks,
>
> hg
>
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Using exec or eval ISN'T what should be done ever. When you have
troubles importing you should :
- Add some repository to your sys.path
and/or
- Use the buildin import method
and/or
- Use Mr Eby's Importing module (http://python.org/pypi/Importing)
Regards,
Laurent
hg a écrit :
> Hi,
>
>
Hi,
I have a much to smart problem for my brain.
Here is the deal :
I got a metaclass named Foo
Then I got two others classes:
class Bar(Foo):
pass
class Baz(Foo):
pass
I know how to add some attrs, methods to Bar and Baz when the module is
loaded but I need to do something m
Hi,
I guess stripogram would be more pythonic :
http://sourceforge.net/project/showfiles.php?group_id=1083
Regards,
Laurent
Diez B. Roggisch wrote:
> Ksenia Marasanova wrote:
>
>> Hi,
>>
>> I am looking for a library that will give me very simple text
>> representation of HTML.
>> For exampl
Hari Sekhon wrote:
> Is it better to do:
>
> message = """This is line1.
> This is line2
> This is line3\n"""
>
> or
>
> message = "This is line1.\n
> message = message + "This is line2\n"
> message = message + "This is line3\n"
>
>
> Since the first method does not follow python's clean and
[EMAIL PROTECTED] wrote:
> Like in C we comment like
> /*
> Bunch of lines of code
> */
>
> Should we use docstring """ """
>
> Or there is something else too ??
>
> Every help is appreciated.
>
> Thanks
Hi,
Maybe this sounds simplier than regexp and so, just use the """ marker like
this :
"
Bruno Desthuilliers wrote:
> [EMAIL PROTECTED] a écrit :
>> Hi,
>>
>> I read the mod_python documentation on the Django site but I'm getting
>> this error:
>>
>> EnvironmentError: Could not import DJANGO_SETTINGS_MODULE
>> 'accesshiphop.settings' (is it on sys.path?): No module named
>> accesshi
sandorf wrote:
> I'm new to python. Have a simple question.
>
> "open" function can only open an existing file and raise a IOerror when
> the given file does not exist. How can I creat a new file then?
fic = open('test.txt', 'w')
fic.write('Hello world')
fic.close()
--
http://mail.python.org/
metiu uitem wrote:
> Say you have a flat list:
> ['a', 1, 'b', 2, 'c', 3]
>
> How do you efficiently get
> [['a', 1], ['b', 2], ['c', 3]]
>
> I was thinking of something along the lines of:
> for (key,number) in list:
> print key, number
>
> but it's not working...
>
> Thank you
Hi,
newLis
Hi,
I guess you need to look at __import__
Regards,
Laurent.
Joerg Schuster wrote:
> Hello,
>
> I need to import modules from user defined paths. I.e. I want to do
> something
> like:
>
> module_dir = sys.argv[1]
>
> my_path = os.path.join(module_dir, 'bin', 'my_module')
>
> from my_path i
John Machin wrote:
> Laurent RAHUEL wrote:
>> RFQ wrote:
>>
>>
>>>Hi, I'm struggling here to do the following with any success:
>>>
>>>I have a comma delimited file where each line in the file is something
>>>like:
>>&
RFQ wrote:
> Hi, I'm struggling here to do the following with any success:
>
> I have a comma delimited file where each line in the file is something
> like:
>
> PNumber,3056,Contractor,XYZ Contracting,Architect,ABC Architects,...
This is NOT a CSV file. A CSV file would be :
PNumber,Contracto
22 matches
Mail list logo