[Tutor] Importing files not located on the home directory or standardard library

2010-06-17 Thread Independent Learner
I am having trouble figuring out how to import modules not located on the home directory or standard library of modules. Meaning say I write a module and instead of saving it on the home directory I save in a folder in my desktop. I do not know how to retrieve it by way of the import statement.

[Tutor] help

2010-06-17 Thread KB SU
help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] pickling/shelve classes

2010-06-17 Thread Eike Welk
Hello Payal! On Thursday June 17 2010 04:48:19 Payal wrote: > Hi all, > Can someone please help in this below? > > class F(object) : >...: def __init__(self, amt) : self.amt = amt >...: def dis(self) : print 'Amount : ', self.amt >...: def add(self, na) : >...:

Re: [Tutor] help

2010-06-17 Thread Modulok
Solution: width times height. On 6/17/10, KB SU wrote: > help > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Trouble with sockets...

2010-06-17 Thread Modulok
List, I'm new to sockets and having trouble. I tried to write a simple client/server program (see code below). The client would send a string to the server. The server would echo that back to the client. PROBLEM: I can send data to the server, and get data back, but only for the first call to the

Re: [Tutor] conventions for establishing and saving default valuesfor variables

2010-06-17 Thread Hugo Arts
On Thu, Jun 17, 2010 at 1:19 AM, Steven D'Aprano wrote: > On Thu, 17 Jun 2010 03:25:03 am Alan Gauld wrote: >> "R. Alan Monroe" wrote >> >> >> directory, I suppose. Under windows, probably the registry. >> >> There's the _winreg and configparser modules. >> > >> > Consider using the %USERPROFILE%

Re: [Tutor] help

2010-06-17 Thread Steven D'Aprano
On Thu, 17 Jun 2010 05:28:37 pm KB SU wrote: > help No no, don't tell us what you need help about! I love guessing games! Let me see now... I'm guessing that your problem is that don't know how to work out the length of a string. Here's one way: string = "something" count = 1 for char in string

Re: [Tutor] help

2010-06-17 Thread Mark Lawrence
On 17/06/2010 08:28, KB SU wrote: help ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor Help, I need somebody, Help, not just anybody, Help, you know I need someon

Re: [Tutor] How to model objects aimed to persistence?

2010-06-17 Thread Alan Gauld
"Knacktus" wrote ### my_favourite_movies = FavouriteMovies([Movie("Gladiator", "Russel Crowe")]) ### When I want to rebuild the data from a xml file

Re: [Tutor] Importing files not located on the home directory orstandardard library

2010-06-17 Thread Alan Gauld
"Independent Learner" wrote Lets say I want to load a file called quiz located in C:\Users\Julius Hernandez\Desktop\Python2.6.5\Online Course\Chp.4 How would I configure PYTHONPATH or .pth or what ever to import this file from IDLE The IDLE bit is irrelevant its how the underlying Python i

Re: [Tutor] help

2010-06-17 Thread Lowell Tackett
>From the virtual desk of Lowell TackettĀ  --- On Thu, 6/17/10, Mark Lawrence wrote: From: Mark Lawrence Subject: Re: [Tutor] help To: tutor@python.org Date: Thursday, June 17, 2010, 8:30 AM On 17/06/2010 08:28, KB SU wrote: > help > > > > > ___ >

Re: [Tutor] pickling/shelve classes

2010-06-17 Thread Eike Welk
On Thursday June 17 2010 11:11:11 Eike Welk wrote: > You should file a bug report in their bug tracker: > http://github.com/ipython/ipython/issues I believe tthis is the bug: http://github.com/ipython/ipython/issues/#issue/29 It seems that objects defined on IPython's top-level can't be pickled.

Re: [Tutor] help

2010-06-17 Thread Mark Lawrence
On 17/06/2010 19:22, Lowell Tackett wrote: From the virtual desk of Lowell Tackett --- On Thu, 6/17/10, Mark Lawrence wrote: From: Mark Lawrence Subject: Re: [Tutor] help To: tutor@python.org Date: Thursday, June 17, 2010, 8:30 AM On 17/06/2010 08:28, KB SU wrote: help Help, I need som

[Tutor] collectd application

2010-06-17 Thread Kaushal Shriyan
Hi, For example I do wget -O file.png "http://collectd.example.com/collectd/cgi-bin/collection.cgi?action=show_plugin;host=testdb;timespan=day;plugin=mysql"; for a single host "testdb" and plugin "mysql" I do /usr/bin/mime-construct --header 'Sender: mor_...@test.com' --header 'From: mor_...@tes

[Tutor] string encoding

2010-06-17 Thread Rick Pasotto
I'm using BeautifulSoup to process a webpage. One of the fields has a unicode character in it. (It's the 'registered trademark' symbol.) When I try to write this string to another file I get this error: UnicodeEncodeError: 'ascii' codec can't encode characters in position 31-32: ordinal not in ra

Re: [Tutor] string encoding

2010-06-17 Thread Lie Ryan
On 06/18/10 06:41, Rick Pasotto wrote: > I'm using BeautifulSoup to process a webpage. One of the fields has a > unicode character in it. (It's the 'registered trademark' symbol.) When > I try to write this string to another file I get this error: > > UnicodeEncodeError: 'ascii' codec can't encode

Re: [Tutor] string encoding

2010-06-17 Thread Rick Pasotto
On Fri, Jun 18, 2010 at 12:24:25PM +1000, Lie Ryan wrote: > On 06/18/10 06:41, Rick Pasotto wrote: > > I'm using BeautifulSoup to process a webpage. One of the fields has a > > unicode character in it. (It's the 'registered trademark' symbol.) When > > I try to write this string to another file I g

Re: [Tutor] collectd application

2010-06-17 Thread Steven D'Aprano
On Fri, 18 Jun 2010 04:53:49 am Kaushal Shriyan wrote: [...] > is that possible using python ? Yes. Python is a Turing complete language, it can do anything that any other language can do. This site will probably help you: http://www.catb.org/%7Eesr/faqs/smart-questions.html Good luck, and we

[Tutor] sqlite3 select extra characters

2010-06-17 Thread Lang Hurst
Is there a way to just return the values when using sqlite3? If I: names = c.execute('select names from students') for name in names: print names I get the list I want, but they look like (u'Cleese, John') (u'Jones, Terry') (u'Gillaim, Terry') is there a way to just return Cleese, John