ew_file.write(line)
new_file.close()
assignment_file.close()
When the code runs, the file path has the slashes converted to double
slashes. When try to escape them, i just seemto add more slashes. What am i
missing?
--
Regards,
Sithembewena
@Wayne, sorry to have replied to you directly..
On Sun, Feb 21, 2010 at 9:23 PM, Sithembewena Lloyd Dube
wrote:
> Solved by moving the file just under C:\
>
> Must be an issue with directory name spaces.
>
> By the way, my code was riddled with bugs. readlines() returns a list
Wow, thank you Steve. This certainly answers a few questions i've had
simmering for a while.
On Mon, Feb 22, 2010 at 1:01 AM, Steven D'Aprano wrote:
> On Mon, 22 Feb 2010 05:22:10 am Sithembewena Lloyd Dube wrote:
> > Hi all,
> >
> > I'm trying to read
; The string holds 1 char; its representation (also a string, indeed) holds
> 4.
>
> > The best advice is to remember that Windows allows both forward and
> > backwards slashes as the path separator, and just write all your paths
> > using the forw
I believe i encountered repr()in the Python tutorial, but i had not kept the
relevance of it in my memory..
On Mon, Feb 22, 2010 at 9:35 PM, Sithembewena Lloyd Dube
wrote:
> @spr, thanks for the explanation, especially on representations of strings.
> To think that i freely used repr(vari
specific table row whose only
identifying attribute is its CSS class?
Thanks.
--
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
indAll('tr', class="rs1")
print weather_row
The call to soup.findAll is failing because "class" is a reserved keyword in
Python. Using BeautifulSoup, how can I find a specific table row whose only
identifying attribute is its CSS class?
Thanks.
--
Regards,
Sithembe
Thanks all, I found the solution: using the attributes dictionary as
follows:
weather_row = soup.findAll('tr', { "class" : "rs1" })
Many thanks.
On Mon, May 31, 2010 at 1:32 AM, Sithembewena Lloyd Dube
wrote:
> Hi everyone,
>
> I am using urllib to scrape
er
> recommendations about doing some parts different.
>
> Kind regards,
> Nethirlon
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
^^ I meant time.sleep(x), rather. Please excuse the double post.
On Wed, Jun 23, 2010 at 4:29 PM, Sithembewena Lloyd Dube
wrote:
> My two cents' worth added below. Seems to do what you want. You probably
> want to call sys.wait(x) after printing an error, so it can be read befor
gt; Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
_
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com
___
Tutor mailli
e:
> On Sat, Jun 26, 2010 at 11:55, Sithembewena Lloyd Dube
> wrote:
> > Richard, I think you may go ahead without trepidation. I am not a Windows
> > fan at all, I prefer Ubuntu. But I started using Win. 7 at work about a
> > month ago, and I have to say it hasn't give
,
Sithembewena Lloyd Dube
http://www.lloyddube.com
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
er on the server or the local machines; it's best to keep those out of
> SVN, or have a little if-else clause in settings.py that takes care
> server-dependent settings.
> Otherwise, all your code can (and should) be machine/server agnostic, an
Hi folks,
Supposing I had the float 4.4348 and I wished to round it off to the nearest
half-integer upwards or downwards, how would I go about it?
Many thanks...
--
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com
___
Tutor maillist
I realise that one cannot have a half integer :) I meant how would one round
off to the first decimal nearest to either 0.5, or a whole number.
Ugh...does anyone get what I'm trying to articulate? :)
On Fri, Oct 8, 2010 at 2:51 PM, Sithembewena Lloyd Dube
wrote:
> Hi folks,
>
> S
ulate? :)
>
> Multiply by 2, round(), divide by 2?
>
>
> >
> > On Fri, Oct 8, 2010 at 2:51 PM, Sithembewena Lloyd Dube <
> zebr...@gmail.com> wrote:
> > Hi folks,
> >
> > Supposing I had the float 4.4348 and I wished to round it off to the
>
gt; r
>> [1.0, 1.0, 1.0, 1.5, 1.5, 1.5, 1.5, 1.5, 2.0, 2.0]
>> >>>
>>
>>
> --
> Joel Goldstick
>
>
> _______
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
>
Thanks everyone.
On Fri, Oct 8, 2010 at 11:44 PM, Wayne Werner wrote:
> On Fri, Oct 8, 2010 at 7:58 AM, Sithembewena Lloyd Dube > wrote:
>
>> I realise that one cannot have a half integer :) I meant how would one
>> round off to the first decimal nearest to either 0
a floating point number. Precision may be
> negative.
> ===
>
> >>> round(1.23423,2)
> 1.23
> >>> round(1.23623,2)
> 1.24
>
>
> HTH.
>
> On Mon, Oct 11, 2010 at 13:51, Sithembewena Lloyd Dube
> wrote:
>
>> Thanks everyone.
>>
>>>
> >>> python_stuff.process(largestuff, otherparams1) # It's important that
> this data can be read (and I hope written) by python code
> >>> python_stuff.process(largestuff, otherparams2)
> >>>
> >>> c_stuff.write(largestuff) #write result
>
&g
>
> [1]
> http://blog.chrischou.org/2010/02/28/simple-benchmark-between-cython-and-boost-python/
>
> Thank you,
> Paul
>
> And a link I found today.
> [2]
> http://koichitamura.blogspot.com/2008/06/various-ways-to-integrate-python-and-c.html
>
> On Sun, Oct 17, 2010 at 1:56 PM, Sit
> --
> Brett Ritter / SwiftOne
> swift...@swiftone.org
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
--
Regards,
Sithembewena Lloyd Dube
<<338.gif>>_
teger
(to see that the document is traversed) I get the same result - the int
remains at 0.
>>> i = 0
>>> for node in xml_content.getiterator('contest'):
... i += 1
...
>>> i
0
What am I getting wrong? Any hints would be appreciated.
--
Regards,
Sithemb
way = contest_child_node.text
contest_list.append(contest)
try:
os.remove(current_path)
except:
pass
return contest_list
Many thanks!
On Tue, May 24, 2011 at 12:35 PM, Stefan Behnel wrote:
> Sithembewena Lloyd Dube, 24.05.2011 11:59:
>
Hi Stefan,
Thanks for the code review :) Only just noticed this.
On Wed, May 25, 2011 at 3:10 PM, Stefan Behnel wrote:
> Sithembewena Lloyd Dube, 25.05.2011 14:40:
>
> Thanks for all your suggestions. I read up on gzip and urllib and also
>> learned in the process that I could
;
>
> Why wouldn't it be errno.e instead of e.errno?
>
>>
>> --
>> Colton Myers
>>
>>
>
>
> --
> Michael J. Lewis
>
> mjole...@gmail.com
> 415.815.7257
>
>
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
Regards,
Sithembewena Lloyd Dube
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
,
Sithembewena Lloyd Dube
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
HI,
Would anyone have tips on how to generate random 4-digit alphanumeric codes
in python? Also, how does one calculate the number of possible combinations?
Thanks in advance.
--
Regards,
Sithembewena Lloyd Dube
___
Tutor maillist - Tutor
Hi all,
A colleague and I are embarking on a project for a client. We have agreed
to implement a REST API in Falcon (www.falconframework.org) and colleague
wants to implement it in Python 3.
Are there any advantages/ disadvantages of using Python 3? I have always
stuck to Python 2.
--
Kind rega
@Steven, @Mark,
Thanks for the feedback.
On Sat, Sep 5, 2015 at 5:37 PM, Mark Lawrence
wrote:
> On 05/09/2015 14:25, Steven D'Aprano wrote:
>
>> On Sat, Sep 05, 2015 at 03:06:25PM +0200, Sithembewena Lloyd Dube wrote:
>>
>>> Hi all,
>>>
>>>
This has turned into a very interesting discussion. Thank you to everyone
who's participating and sharing nuggets of information on 2 vs 3.
On Mon, Sep 7, 2015 at 1:58 PM, Steven D'Aprano wrote:
> On Mon, Sep 07, 2015 at 11:01:00AM +0100, Alan Gauld wrote:
> > On 07/09/15 10:32, Laura Creighton
Hi everyone,
I have a function which accepts an alpha2 country code and a price string,
where the aim is to get the country's currency and use the currency.letter
property of that currency to format the supplied price string.
The above works fine so far - yet it falls over when called with German
e?
On Sun, May 4, 2014 at 10:25 PM, Sithembewena Lloyd Dube
wrote:
> Hi everyone,
>
> I have a function which accepts an alpha2 country code and a price string,
> where the aim is to get the country's currency and use the currency.letter
> property of that currency to format the
Thanks for this response, this is exactly what I needed to know.
On Mon, May 5, 2014 at 6:26 AM, Marc Tompkins wrote:
> On Sun, May 4, 2014 at 1:55 PM, Sithembewena Lloyd Dube > wrote:
>
>> Thanks, i was actually getting the error information to update the post.
>> Apoligi
Thank you all, babel works just fine. I also tried ccy, which isn't bad
either - except that it returns non-unicode currency letters for countries
in the Eurozone.
On Mon, May 5, 2014 at 10:10 AM, Peter Otten <__pete...@web.de> wrote:
> Sithembewena Lloyd Dube wrote:
>
Hi everyone,
I am developing on a Windows 8.1 machine and wold like to setup
virtualenvironment via virtualenvwrapper so as to have a properly set up
Python development environment.
I am referring to Jeff Knupp's guide at
http://www.jeffknupp.com/blog/2013/12/18/starting-a-django-16-project-the-r
38 matches
Mail list logo