On 13/10/11 01:41, Max S. wrote:
I've been doing some research into C++, and I've noticed the for loops.
If you are trying to program in Python you should probably research
Python rather than C++. Any tutorial will provide information about for
loops...
Is there a way to use the C++ versio
Thanks!
On Wed, Oct 12, 2011 at 8:56 PM, bob gailer wrote:
> On 10/12/2011 8:41 PM, Max S. wrote:
>
>> I've been doing some research into C++, and I've noticed the for loops.
>> Is there a way to use the C++ version of the loops instead of the Python
>> one? For example, I believe that the Py
On 10/12/2011 8:41 PM, Max S. wrote:
I've been doing some research into C++, and I've noticed the for
loops. Is there a way to use the C++ version of the loops instead of
the Python one? For example, I believe that the Python syntax would be:
for a=1, a < 11, a += 1:
print(a)
print("Loop
I've been doing some research into C++, and I've noticed the for loops. Is
there a way to use the C++ version of the loops instead of the Python one?
For example, I believe that the Python syntax would be:
for a=1, a < 11, a += 1:
print(a)
print("Loop ended.")
if the 'for' keyword did it's f
Hi there,
I'm sorry to ask this, I tried and example that was posted in 2009 but I
couldn't make it work. I'm trying to parse a log file and retrieve what I
just need.
Hope you can help me with this, this is part of the log file:
[2011-10-11 20:43:54:307] INFO [QuoteCompareDaoWSImpl: 24]
Anna Olofsson wrote:
The thing is, I don't know where to start. I know how to open the
attached file, but I don't know how to work inside the file. Is this
a csv file? Do I need to use a split function? In what way should I
look at the file? As a string? As lines?
It looks like a CSV file. Try
On 10/12/2011 03:59 PM, Anna Olofsson wrote:
(PLEASE don't top-post. And don't start multiple similar threads a
couple of hours apart. Send your message as text without tons of blank
lines, and don't assume the attachments will make it. In my case, I
haven't a clue to what the file looks li
The thing is, I don't know where to start. I know how to open the attached
file, but I don't know how to work inside the file. Is this a csv file? Do I
need to use a split function? In what way should I look at the file? As a
string? As lines?
Best,
Anna
From: waynejwer...@gmail.com
Date: Wed,
From: olofsson_anna...@hotmail.com
To: tutor@python.org
Subject: FW: [Tutor] extract specific column
Date: Wed, 12 Oct 2011 21:59:34 +0200
The thing is, I don't know where to start. I know how to open the attached
file, but I don't know how to work inside the file. Is this a csv file? D
On 12/10/2011 18:21, Anna Olofsson wrote:
Hi,
I'm a beginner at python and I'm trying to extract a specific column
from a txt file ( see attached file).
In the attached file I want to extract the entire column/pph2_prob
/(i.e. column 16). But I want to get all the values from that column
wi
On Wed, Oct 12, 2011 at 12:21 PM, Anna Olofsson <
olofsson_anna...@hotmail.com> wrote:
> Hi,
>
> I'm a beginner at python and I'm trying to extract a specific column from a
> txt file ( see attached file).
>
> In the attached file I want to extract the entire column* pph2_prob *(i.e.
> column 16)
Hi,
I'm a beginner at python and I'm trying to extract a specific column from a txt
file ( see attached file).
In the attached file I want to extract the entire column
pph2_prob (i.e. column 16). But I want to get all the values from tha
Hi,
I'm a beginner at python and I'm trying to extract a specific column from a txt
file ( see attached file).
In the attached file I want to extract the entire column
pph2_prob (i.e. column 16). But I want to get all the values from that
>for item in list:
>print item
Or you could do this inline with:
print ' '.join( myList ) # Change ' ' to be the separator you desire if you
want something other than a space between elements?
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Stre
On 10/12/2011 09:57 AM, lina wrote:
I do have problems to write each blocks (differentiated by chainID) back
one by one, but this will leave it at the end. at present I still have
following problems
Q1: why the D E F G H I stopped being processed.
In what sense do you mean stopped? There are
Hugo Arts wrote:
>> f = open('/etc/passwd', 'r')
> users = f.readlines()
> for user in users:
...
You can iterate over the file directly:
for user in f:
...
The version using readlines() reads the whole file into a list of lines
where the alternative just has to remember the current
On Wed, Oct 12, 2011 at 8:50 PM, Andreas Perstinger <
andreas.perstin...@gmx.net> wrote:
> On 2011-10-12 10:27, lina wrote:
>
>> $ python3 map-to-itp.py
>> {'O4': '2', 'C19': '3', 'C21': '1'}
>> {'C': '3'}
>> {'C': '2'}
>> {'C': '1'}
>>
>> for print(mapping) part, {'O4': '2', 'C19': '3', 'C21': '
Fantastic,
Thanks Hugo that makes 100% sense now! Testing both regex for including /
and doing split and when done throwing both away and using the default
module.
Regards
On Wed, Oct 12, 2011 at 2:49 PM, Hugo Arts wrote:
> On Wed, Oct 12, 2011 at 3:41 PM, Gerhardus Geldenhuis
> wrote:
> > Hi
On Wed, Oct 12, 2011 at 3:41 PM, Gerhardus Geldenhuis
wrote:
> Hi
> I wrote the following code:
> f = open('/etc/passwd', 'r')
> users = f.read()
> userelements = re.findall(r'(\w+):(\w+):(\w+):(\w+):(\w+):(\w+):(\w+)',
> users)
> print userelements
> for user in userelements:
> (use
Hi
I wrote the following code:
f = open('/etc/passwd', 'r')
users = f.read()
userelements = re.findall(r'(\w+):(\w+):(\w+):(\w+):(\w+):(\w+):(\w+)',
users)
print userelements
for user in userelements:
(username, encrypwd, uid, gid, gecos, homedir, usershell) = user #
unpack the tupl
On 2011-10-12 10:27, lina wrote:
$ python3 map-to-itp.py
{'O4': '2', 'C19': '3', 'C21': '1'}
{'C': '3'}
{'C': '2'}
{'C': '1'}
for print(mapping) part, {'O4': '2', 'C19': '3', 'C21': '1'} the value
doesn't keep the 1, 2, 3 order any more.
That's fine, because "mapping" is a dictionary which h
On Wed, Oct 12, 2011 at 3:29 PM, Andreas Perstinger <
andreas.perstin...@gmx.net> wrote:
> On 2011-10-12 05:31, lina wrote:
>
>> I tried to write one (not working one) as below, so many problems here.
>>
>
> Just some quick remarks:
Thanks,
Now the newly-improved one as following: but still the
On 12/10/11 02:32, Ryan Strunk wrote:
The keyboard module I currently have access to is a wrapper for the wx
keyboard handler, which is fine, but it prevents me from holding one key and
pressing another.
So use raw wx key events. They include key down,up and press events.
I thought of using
On 2011-10-12 05:31, lina wrote:
I tried to write one (not working one) as below, so many problems here.
Just some quick remarks:
#!/usr/bin/python3
import os.path
LINESTOSKIP=0
CHAINID="CDEFGHI"
INFILENAME="pdbone.pdb"
DICTIONARYFILE="itpone.itp"
mapping={}
valuefromdict={}
def sortfile()
24 matches
Mail list logo