Re: [Tutor] Importing XML files.

2019-01-21 Thread mhysnm1964
. The tutorials I have viewed didn't explain this information. I will continue investigating. The library provided has addressed my concerns for now. -Original Message- From: Tutor On Behalf Of Peter Otten Sent: Tuesday, 22 January 2019 5:22 AM To: tutor@python.org Subject:

Re: [Tutor] Importing XML files.

2019-01-21 Thread Peter Otten
mhysnm1...@gmail.com wrote: > I am trying to import ITunes XML files. I have been doing some reading and > I am somewhat confused with some XML terminology. > What is: > > > > Tag – I think it is the in the itunes library file. > > Text = The text between the > > Attrib -- don’t know. >

Re: [Tutor] Importing XML files.

2019-01-21 Thread Alan Gauld via Tutor
On 21/01/2019 03:17, mhysnm1...@gmail.com wrote: > confused with some XML terminology. > > What is: > Tag – I think it is the in the itunes library file. > > Text = The text between the > > Attrib -- don’t know. You really need to find a tutorial on XML (And maybe even start with one on HTML

[Tutor] Importing XML files.

2019-01-21 Thread mhysnm1964
All, I am trying to import ITunes XML files. I have been doing some reading and I am somewhat confused with some XML terminology. What is: Tag – I think it is the in the itunes library file. Text = The text between the Attrib -- don’t know. If I am correct in my thinking. If y

Re: [Tutor] Importing classes

2017-01-11 Thread Alan Gauld via Tutor
On 11/01/17 02:53, kay Cee wrote: > Is there a proper way to import a class from a module? If so, please tell. The most common way is probably: >>> from mymodule import Myclass >>> myobject = Myclass() but its just as good to do >>> import mymodule >>> myobject = mymodule.Myclass() -- Al

[Tutor] Importing classes

2017-01-11 Thread kay Cee
Is there a proper way to import a class from a module? If so, please tell. Thank You, Unee0x ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Importing from classes

2015-02-11 Thread Steven D'Aprano
On Tue, Feb 10, 2015 at 06:39:50PM -0800, daaku gee wrote: > Hi > > When importing from other modules, I've seen syntax like: > > import from > import > > And another one: > import from as Not quite. The syntax is: import import as from import # not necessarily a class from imp

Re: [Tutor] Importing from classes

2015-02-11 Thread Alan Gauld
On 11/02/15 02:39, daaku gee wrote: When importing from other modules, I've seen syntax like: import from from import Note you don't import classes from modules you import names. (The name might be the name of a class of course!) This form is for cases where you only want to use one or

[Tutor] Importing from classes

2015-02-11 Thread daaku gee
Hi When importing from other modules, I've seen syntax like: import from import And another one: import from as Is one better than the other or is it just personal choice? Thanks \d ___ Tutor maillist - Tutor@python.org To unsubscribe or chan

Re: [Tutor] Importing an existing plot and manipulating it !

2014-12-02 Thread Alan Gauld
On 02/12/14 08:53, ram rokr wrote: Hello people, I'm a beginner with Python and I'm new to the mailing list. It's nice to know that there is a mailing list with people/tutors who can help me learn Python. Hi Ram, While we are happy to try and help, Numpy is not part of standar

[Tutor] Importing an existing plot and manipulating it !

2014-12-02 Thread ram rokr
Hello people, I'm a beginner with Python and I'm new to the mailing list. It's nice to know that there is a mailing list with people/tutors who can help me learn Python. So, my difficulty now is that, I already have a script that plots a polygon. But now I'm trying t

Re: [Tutor] importing my module imports only one function

2014-01-30 Thread Dave Angel
Ian D Wrote in message: > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > 1) you forgot to escape the backslashes in your module path. Either use forward sl

Re: [Tutor] importing my module imports only one function

2014-01-30 Thread Alan Gauld
On 30/01/14 15:43, Ian D wrote: if I create a module called "modtest.py" like this: import turtle def square(): def tri(): if __name__ == "__main__": tri() And then call it like this: import modtest modtest.square() modtest.tri() why would I just get ability to call the 'square()

[Tutor] importing my module imports only one function

2014-01-30 Thread Ian D
if I create a module called "modtest.py" like this: import turtle def square(): for i in range(4): turtle.fd(100) turtle.lt(90) def tri(): for i in range(3): turtle.fd(100) turtle.lt(120) if __name__ == "__main__": tri() And then call it

Re: [Tutor] Importing Pygame

2014-01-28 Thread Alan Gauld
On 28/01/14 20:47, Glenn Lester wrote: I think you typed a comma instead of a period when you coded import pygame.sys Or it may be my display. Check it out. No, it was deliberate. He was importing pygame *and* sys. A comma separated import list is fine. I agree with Dave it looks like there ar

Re: [Tutor] Importing Pygame

2014-01-28 Thread Glenn Lester
I think you typed a comma instead of a period when you coded import pygame.sys Or it may be my display. Check it out. Best of Luck On Tue, Jan 28, 2014 at 1:13 PM, myles broomes wrote: > I am trying to import pygame but everytime I do, I get an ImportError. > Here is the code I'm trying to run:

Re: [Tutor] Importing Pygame

2014-01-28 Thread Dave Angel
myles broomes Wrote in message: > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > I'm guessing you're attempting to post here in this text newsgroup using h

[Tutor] Importing Pygame

2014-01-28 Thread myles broomes
I am trying to import pygame but everytime I do, I get an ImportError. Here is the code I'm trying to run: import pygame,sys from pygame.locals import * pygame.init() DISPLAYSURF=pygame.display.set_mode((400,300)) pygame.display.set_caption('Hello World!') while True: #main game loop for eve

Re: [Tutor] importing into a function

2013-07-11 Thread Alan Gauld
On 11/07/13 19:47, Jim Mooney wrote: in the DOS box, but there's not much sense in using an IDE at all if it doesn't have everything to make life easy, very sensibly arranged, when you Do need something like a debugger or some snippets (an essential since I have a truly rotten memory ;') You c

Re: [Tutor] importing into a function

2013-07-10 Thread Steven D'Aprano
On 11/07/13 05:02, Jim Mooney wrote: The question is - does importing into a function ever make sense? It occurred to me that if you usefrom module import * , putting it in a function protects you from invisible namespace pollution by a big module with a lot of names. But importing has to b

Re: [Tutor] importing into a function

2013-07-10 Thread Dave Angel
On 07/10/2013 05:16 PM, eryksun wrote: On Wed, Jul 10, 2013 at 3:57 PM, Dave Angel wrote: Sure enough it did. The question is - does importing into a function ever make sense? It occurred to me that if you usefrom module import * , putting it in a function Can't be done. Locals of a fu

Re: [Tutor] importing into a function

2013-07-10 Thread Dave Angel
On 07/10/2013 03:02 PM, Jim Mooney wrote: Boy, is the list busy. Python must have been mentioned on USA today, or something ;') Anyway, I was reading the datamodel, and it mentioned imported modules going out of scope, which seemed odd, since I thought they were global and never went out, or am

Re: [Tutor] Importing data from a file.

2013-03-21 Thread Shall, Sydney
On 21/03/2013 16:17, Alan Gauld wrote: On 21/03/13 13:43, Shall, Sydney wrote: I have an elementary question provoked by another post today. 1. Is it the case that ALL imported data from a file is a string? Assuming you mean data read from a file rather than modules imported using 'import' t

Re: [Tutor] Importing data from a file.

2013-03-21 Thread Alan Gauld
On 21/03/13 13:43, Shall, Sydney wrote: I have an elementary question provoked by another post today. 1. Is it the case that ALL imported data from a file is a string? Assuming you mean data read from a file rather than modules imported using 'import' then the answer is 'it depends'. Most f

Re: [Tutor] Importing data from a file.

2013-03-21 Thread Dave Angel
On 03/21/2013 10:03 AM, Dave Angel wrote: A typo below; sorry. On 03/21/2013 09:43 AM, Shall, Sydney wrote: I have an elementary question provoked by another post today. 1. Is it the case that ALL imported data from a file is a string? No, the imported data is a module. For example

Re: [Tutor] Importing data from a file.

2013-03-21 Thread Robert Sjoblom
>> 3. Are there defined procedures for doing the required processing? > > If you meant conversion functions, int() and float() are examples of > those. You of course (most of the times) have to make use of string > manipulation functions (strip(), rstrip(), etc) to extract the exact > data item yo

Re: [Tutor] Importing data from a file.

2013-03-21 Thread Dave Angel
On 03/21/2013 09:43 AM, Shall, Sydney wrote: I have an elementary question provoked by another post today. 1. Is it the case that ALL imported data from a file is a string? No, the imported data is a module. For example import sys print type(sys) At this point, sys is a object of

Re: [Tutor] Importing data from a file.

2013-03-21 Thread Shall, Sydney
On 21/03/2013 13:54, Amit Saha wrote: On Thu, Mar 21, 2013 at 11:43 PM, Shall, Sydney wrote: I have an elementary question provoked by another post today. 1. Is it the case that ALL imported data from a file is a string? 2. Does this therefor imply that said data has to be processed appropriat

Re: [Tutor] Importing data from a file.

2013-03-21 Thread Amit Saha
On Thu, Mar 21, 2013 at 11:43 PM, Shall, Sydney wrote: > I have an elementary question provoked by another post today. > > 1. Is it the case that ALL imported data from a file is a string? > 2. Does this therefor imply that said data has to be processed appropriately > to generate the data in the

[Tutor] Importing data from a file.

2013-03-21 Thread Shall, Sydney
I have an elementary question provoked by another post today. 1. Is it the case that ALL imported data from a file is a string? 2. Does this therefor imply that said data has to be processed appropriately to generate the data in the form required by the program? 3. Are there defined procedures

Re: [Tutor] Importing libraries

2012-02-04 Thread Devin Jeanpierre
On Sat, Feb 4, 2012 at 6:35 AM, Steven D'Aprano wrote: > Michael Lewis wrote: >> >> Why don't I have to import str or list to access their attributes like I >> do >> with the math or random or any other library? > > > > Because they are built-in. That means they live inside the Python > compiler/i

Re: [Tutor] Importing libraries

2012-02-04 Thread Steven D'Aprano
Michael Lewis wrote: Why don't I have to import str or list to access their attributes like I do with the math or random or any other library? Because they are built-in. That means they live inside the Python compiler/interpreter itself. They are built-in because str, list, etc. are fundame

Re: [Tutor] Importing libraries

2012-02-04 Thread Blockheads Oi Oi
On 04/02/2012 05:37, Michael Lewis wrote: Why don't I have to import str or list to access their attributes like I do with the math or random or any other library? -- Michael J. Lewis mjole...@gmail.com 415.815.7257 ___ T

[Tutor] Importing libraries

2012-02-03 Thread Michael Lewis
Why don't I have to import str or list to access their attributes like I do with the math or random or any other library? -- Michael J. Lewis mjole...@gmail.com 415.815.7257 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Importing functions in IPython

2012-01-22 Thread bob gailer
On 1/22/2012 5:43 PM, Alan Gauld wrote: On 22/01/12 22:10, Jaidev Deshpande wrote: In[1]: from mymodule import myfunc In[3]: from mymodule import myfunc it doesn't work as per the new changes. I have to close IPython and start all over again. You can use reload() to reload the entire module

Re: [Tutor] Importing functions in IPython

2012-01-22 Thread bob gailer
On 1/22/2012 5:10 PM, Jaidev Deshpande wrote: Dear List, Suppose I have a function myfunc() in a module called mymodule.py As usual, I import this function in IPython with In[1]: from mymodule import myfunc Now if I find that there is something wrong with myfunc, I can open mymodule.py with a

Re: [Tutor] Importing functions in IPython

2012-01-22 Thread Alan Gauld
On 22/01/12 22:10, Jaidev Deshpande wrote: In[1]: from mymodule import myfunc In[3]: from mymodule import myfunc it doesn't work as per the new changes. I have to close IPython and start all over again. You can use reload() to reload the entire module, but I confess I don't know how to relo

Re: [Tutor] Importing functions in IPython

2012-01-22 Thread Steven D'Aprano
On Mon, Jan 23, 2012 at 03:40:26AM +0530, Jaidev Deshpande wrote: > Dear List, > > Suppose I have a function myfunc() in a module called mymodule.py [...] > Now when I delete the original function and import the changed one, > > In[2]: del myfunc > In[3]: from mymodule import myfunc > > it doesn

[Tutor] Importing functions in IPython

2012-01-22 Thread Jaidev Deshpande
Dear List, Suppose I have a function myfunc() in a module called mymodule.py As usual, I import this function in IPython with In[1]: from mymodule import myfunc Now if I find that there is something wrong with myfunc, I can open mymodule.py with a suitable editor and make the required changes.

Re: [Tutor] importing modules and packages

2011-10-31 Thread neubyr
On Mon, Oct 31, 2011 at 4:38 AM, Steven D'Aprano wrote: > neubyr wrote: >> >> Is it possible to tell whether import statement is importing a module >> or package?  I am going through some example code with some import >> statements - like 'import os, sys, time', 'import packed'. I know os, >> sys

Re: [Tutor] importing modules and packages

2011-10-31 Thread Steven D'Aprano
neubyr wrote: Is it possible to tell whether import statement is importing a module or package? I am going through some example code with some import statements - like 'import os, sys, time', 'import packed'. I know os, sys and time are (built-in) modules and 'packed' is a package here . But can

[Tutor] importing modules and packages

2011-10-30 Thread neubyr
Is it possible to tell whether import statement is importing a module or package? I am going through some example code with some import statements - like 'import os, sys, time', 'import packed'. I know os, sys and time are (built-in) modules and 'packed' is a package here . But can I determine whe

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Alexandre Conrad
2011/5/30 Marilyn Davis : > If we are coding via a vote, I'd be with Alan. > > If Timo adds non-parser modules, and they get through his glob filter, > then surely his code will break with a nice error statement and that would > remind him of his convention. Sure. From my point of view, I prefer a

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Steven D'Aprano
Timo wrote: Hello all, I have a question about how this is done the best way. In my project I have a folder with multiple file parsers, like this: - src -- main.py -- parsers --- __init__.py --- parser1.py --- parser2.py This gives you a stand-alone module called "main.py", and a sepa

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Marilyn Davis
If we are coding via a vote, I'd be with Alan. If Timo adds non-parser modules, and they get through his glob filter, then surely his code will break with a nice error statement and that would remind him of his convention. Or maybe it would just give a verbose report and go on to the next file.

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Alan Gauld
"Alexandre Conrad" wrote Why not use the os functions to read the file names dynamically and build the list that way? Provided the files use a standard naming scheme you don't need to change the init code. I wouldn't do that. If Timo adds non-parser modules in that directory (say some util

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Alexandre Conrad
2011/5/30 Alexandre Conrad : > selected_parser = "parser1" > parser = parsers[selected_parser] > parser = Parser() > ... I meant to have a capital P on the second line of course: selected_parser = "parser1" Parser = parsers[selected_parser] parser = Parser() or just (less readable though): pars

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Alexandre Conrad
2011/5/30 Alan Gauld : > But this means having to maintain the list in init.py. > Why not use the os functions to read the file names > dynamically and build the list that way? Provided > the files use a standard naming scheme you don't > need to change the init code. I wouldn't do that. If Timo a

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Alexandre Conrad
2011/5/30 Timo : > When the user clicks a button, I want to show all available parsers and use > the choosen one when the user clicks "ok". > Is it ok to place the following code in the __init__.py? > from parser1 import Parser1 > from parser2 import Parser2 > def get_parsers(): >    return [Parser

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Peter Otten
Timo wrote: > Hello all, > > I have a question about how this is done the best way. > > In my project I have a folder with multiple file parsers, like this: > - src > -- main.py > -- parsers >--- __init__.py >--- parser1.py >--- parser2.py > > The parsers just contain a class wh

Re: [Tutor] Importing classes when needed

2011-05-30 Thread Alan Gauld
"Timo" wrote When the user clicks a button, I want to show all available parsers and use the choosen one when the user clicks "ok". Is it ok to place the following code in the __init__.py? from parser1 import Parser1 from parser2 import Parser2 def get_parsers(): return [Parser1(), Parser

[Tutor] Importing classes when needed

2011-05-30 Thread Timo
Hello all, I have a question about how this is done the best way. In my project I have a folder with multiple file parsers, like this: - src -- main.py -- parsers --- __init__.py --- parser1.py --- parser2.py The parsers just contain a class which do the work. When the user clicks a bu

Re: [Tutor] Importing sub modules

2011-04-01 Thread Prasad, Ramit
>However the sub-modules co.py and order.py are *not* imported by the >main module. They are only loaded on demand, when you say "import >stats.co" or "from stats.order import median" or similar. >So it depends on the module. That is exactly what I wondering and an excellent example to illustra

Re: [Tutor] Importing sub modules

2011-04-01 Thread Alan Gauld
"bob gailer" wrote On 3/31/2011 1:07 PM, Prasad, Ramit wrote: This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, .

Re: [Tutor] Importing sub modules

2011-03-31 Thread bob gailer
On 3/31/2011 1:07 PM, Prasad, Ramit wrote: This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information

Re: [Tutor] Importing sub modules

2011-03-31 Thread Steven D'Aprano
Prasad, Ramit wrote: In any event, you shouldn't be worrying about something like overhead until after your base prorgram is written. Base programs are written. I was just looking into insight about the mechanics behind importing :) For instance, do these libraries normally lazy load? If you

Re: [Tutor] Importing sub modules

2011-03-31 Thread Steven D'Aprano
Prasad, Ramit wrote: The joins are really just random calls. I was just curious if importing os.path could avoid any reading/overhead that might occur by importing os. No. Python has no way of knowing what os.path is until it has imported os and can do an attribute lookup on os.path. This is

Re: [Tutor] Importing sub modules

2011-03-31 Thread Prasad, Ramit
>> In any event, you shouldn't be worrying about something like overhead until >> after your base prorgram is written. Base programs are written. I was just looking into insight about the mechanics behind importing :) For instance, do these libraries normally lazy load? If you have mod1.mod2 and

Re: [Tutor] Importing sub modules

2011-03-31 Thread eire1130
import. If not I just import the enchilada Sent from my Verizon Wireless BlackBerry -Original Message- From: "Prasad, Ramit" Sender: tutor-bounces+eire1130=gmail@python.org Date: Thu, 31 Mar 2011 17:11:50 To: 'Emile van Sebille'; 'tutor@python.org' Su

Re: [Tutor] Importing sub modules

2011-03-31 Thread Prasad, Ramit
-Original Message- From: tutor-bounces+ramit.prasad=jpmchase@python.org [mailto:tutor-bounces+ramit.prasad=jpmchase@python.org] On Behalf Of Emile van Sebille Sent: Thursday, March 31, 2011 3:17 PM To: tutor@python.org Subject: Re: [Tutor] Importing sub modules On 3/31/2011 11:07 AM

Re: [Tutor] Importing sub modules

2011-03-31 Thread Emile van Sebille
On 3/31/2011 11:07 AM Prasad, Ramit said... Hi everyone, I was wondering if there is a difference in import os os.path.join(string1,string2) AND import os.path os.path.join(string1,string2) A quick test shows they're the same: ActivePython 2.6.6.15 (ActiveState Software Inc.) based on

[Tutor] Importing sub modules

2011-03-31 Thread Prasad, Ramit
Hi everyone, I was wondering if there is a difference in >>>import os >>>os.path.join(string1,string2) AND >>>import os.path >>>os.path.join(string1,string2) The only difference that I could think of is if the os module does not get loaded on the second example. I am not sure if it does. Ram

Re: [Tutor] Importing packages

2011-01-21 Thread Jerry Hill
On Fri, Jan 21, 2011 at 4:10 AM, arun kumar wrote: > Hi, > > I'm trying to program with gdata > (http://code.google.com/p/gdata-python-client/) using python > library.I'm having problem in writing import statements. Have you read the Getting Started document linked from their wiki? Particularly,

Re: [Tutor] Importing packages

2011-01-21 Thread arun kumar
hi, I am not understanding what you are saying. I included those modules in the sys.path. i want to know how to write the import statement for the modules and packages. I downloaded the gdata client library and extracted it. It contained a scr directory which contained two directories: 1)atom 2)g

Re: [Tutor] Importing packages

2011-01-21 Thread Pacific Morrowind
Hi; On 21/01/2011 1:10 AM, arun kumar wrote: Hi, I'm trying to program with gdata (http://code.google.com/p/gdata-python-client/) using python library.I'm having problem in writing import statements. The source directory content is like this: atom(folder): this folder contains some files with

[Tutor] Importing packages

2011-01-21 Thread arun kumar
Hi, I'm trying to program with gdata (http://code.google.com/p/gdata-python-client/) using python library.I'm having problem in writing import statements. The source directory content is like this: atom(folder): this folder contains some files with the .py extension gdata (folder):this folder co

Re: [Tutor] Importing photo-python

2010-10-21 Thread Alan Gauld
"steven nickerson" wrote i I would like to somehow import and output a photo to the screen via tkinter window Check out the PhotoImage widget. It can be inserted into a Text field or Canvas. HTH, Alan G. ___ Tutor maillist - Tutor@python.or

[Tutor] Importing photo-python

2010-10-20 Thread steven nickerson
I would like to somehow import and output a photo to the screen via tkinter window not very described sorry, I just would like to know how i can get photos into python ex. .gif (In photo format not video), .jpg ect.

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

2010-06-18 Thread Steven D'Aprano
On Thu, 17 Jun 2010 05:10:32 pm 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 I don't use Windows, so

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

[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.

Re: [Tutor] importing

2009-12-22 Thread Emile van Sebille
On 12/22/2009 1:14 PM Robert Johansson said... Hi all, suppose I need to import a module inside a class and that I need to use it in to different methods. Is this is the way to do it? Well, neither is really (see comments below). I generally import only at the top of a module. You can of cou

Re: [Tutor] importing

2009-12-22 Thread Lie Ryan
On 12/23/2009 8:14 AM, Robert Johansson wrote: Hi all, suppose I need to import a module inside a class and that I need to use it in to different methods. Is this is the way to do it? generally you should keep all imports at the top of the file. There are times when importing only to specific

[Tutor] importing

2009-12-22 Thread Robert Johansson
Hi all, suppose I need to import a module inside a class and that I need to use it in to different methods. Is this is the way to do it? class test(): import time def method1(self): print 'method 1: ', time.clock() def method2(self): print 'method 2: ', time.clo

Re: [Tutor] importing variables

2009-11-12 Thread Dave Angel
Stefan Lesicnik wrote: On Thu, Nov 12, 2009 at 6:26 PM, bob gailer wrote: Stefan Lesicnik wrote: Hi guys, Im trying to do something and hit a bit of a wall, potentially im going about this the wrong way. Essentially the problem is: features file contains rt='text''' import features

Re: [Tutor] importing variables

2009-11-12 Thread Alan Gauld
"bob gailer" wrote I need to use features.a as i am iterating through a list and a would be the different features i want to check if they exist, and then use the variable. I hope that makes sense, or if anyone has any suggestion on how properly to do this! Even though Alan missed your poin

Re: [Tutor] importing variables

2009-11-12 Thread Stefan Lesicnik
On Thu, Nov 12, 2009 at 6:26 PM, bob gailer wrote: > Stefan Lesicnik wrote: >> >> Hi guys, >> >> Im trying to do something and hit a bit of a wall, potentially im >> going about this the wrong way. Essentially the problem is: >> >> features file contains >> rt='''text''' >> >> import features >> >

Re: [Tutor] importing variables

2009-11-12 Thread bob gailer
Stefan Lesicnik wrote: Hi guys, Im trying to do something and hit a bit of a wall, potentially im going about this the wrong way. Essentially the problem is: features file contains rt='''text''' import features a = 'rt' print features.rt #this works print features.a #this fails I need to u

Re: [Tutor] importing variables

2009-11-12 Thread Stefan Lesicnik
On Thu, Nov 12, 2009 at 4:38 PM, Alan Gauld wrote: > > "Stefan Lesicnik" wrote > >> features file contains >> rt='''text''' >> >> import features >> >> a = 'rt' >> print features.rt  #this works >> print features.a  #this fails > > Because you defined a in your current file. > You need to define

Re: [Tutor] importing variables

2009-11-12 Thread Alan Gauld
"Stefan Lesicnik" wrote features file contains rt='''text''' import features a = 'rt' print features.rt #this works print features.a #this fails Because you defined a in your current file. You need to define it in features. I need to use features.a as i am iterating through a list and

[Tutor] importing variables

2009-11-12 Thread Stefan Lesicnik
Hi guys, Im trying to do something and hit a bit of a wall, potentially im going about this the wrong way. Essentially the problem is: features file contains rt='''text''' import features a = 'rt' print features.rt #this works print features.a #this fails I need to use features.a as i am ite

Re: [Tutor] importing images and sound

2008-12-02 Thread W W
On Tue, Dec 2, 2008 at 2:02 PM, Steve Willoughby <[EMAIL PROTECTED]> wrote: > > That depends on what GUI toolkit you're using. If you're > going to be doing a lot with sound and images, particularly > video clips, you might want to look at pymedia or pygame Pyglet is another option. -Wayne __

Re: [Tutor] importing images and sound

2008-12-02 Thread Steve Willoughby
On Tue, Dec 02, 2008 at 02:56:33PM -0500, Daniel J Kramer wrote: > Hi > > I am writing a program based around a pub quiz. I have been able to write > the program so it runs through a series of questions and gives users a score > at the end. > > I need to import a specific font, images and sound.

[Tutor] importing images and sound

2008-12-02 Thread Daniel J Kramer
Hi I am writing a program based around a pub quiz. I have been able to write the program so it runs through a series of questions and gives users a score at the end. I need to import a specific font, images and sound. Does anyone know a good place to look for tutorials for this? At the moment,

Re: [Tutor] importing strings

2008-09-11 Thread Jeff Younker
On Sep 11, 2008, at 2:15 PM, Patrick wrote: I have been able to import a string from another module threw a dictionary but I can't seem to figure out how to do it so that I can insert a value into the %s placeholder afterwards. The % operator is probably what you are looking for. format = "th

[Tutor] importing strings

2008-09-11 Thread Patrick
I would like to import a string with a "placeholder" in it. for example "this is a %s" I would then like to insert the value into it after importation, "this is a %s" (test) I have been able to import a string from another module threw a dictionary but I can't seem to figure out how to do it so

Re: [Tutor] importing path question

2008-08-10 Thread Kent Johnson
On Sat, Aug 9, 2008 at 6:03 PM, dave selby <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a main directory 'kmotion2' where python scripts live. They > access a library of scripts in 'kmotion2/core' as 'kmotion2/core' has > a __init__.py file. However I now need to create a new directory > 'utili

[Tutor] importing path question

2008-08-09 Thread dave selby
Hi all, I have a main directory 'kmotion2' where python scripts live. They access a library of scripts in 'kmotion2/core' as 'kmotion2/core' has a __init__.py file. However I now need to create a new directory 'utilities' inside 'kmotion2' that also needs to access scripts in 'core' kmotion2 dir

Re: [Tutor] importing

2007-11-04 Thread Kent Johnson
Lawrence Shafer wrote: > What is the difference between "from name import *" and "import name"? http://effbot.org/pyfaq/tutor-whats-the-difference-between-import-foo-and-from-foo-import.htm Kent ___ Tutor maillist - Tutor@python.org http://mail.python

[Tutor] importing

2007-11-04 Thread Lawrence Shafer
What is the difference between "from name import *" and "import name"? The reason I ask is because I was using the former, and switched to the latter only to find out "NameError: global name 'name' is not defined" and I think using the latter is going to fix another problem I have. I just want

Re: [Tutor] Importing Excel sheet data

2007-09-06 Thread Kent Johnson
Ian Witham wrote: > HI Saradhi, > > I too am fairly new to Python, but I use the csv module successfully for > my work. Could you be a little more specific as to what your > requirements are and where you are finding difficulty? > > Ian. > > On 9/6/07, *saradhi dinavahi* <[EMAIL PROTECTED] >

Re: [Tutor] Importing Excel sheet data

2007-09-06 Thread Steve Willoughby
saradhi dinavahi wrote: > I am new to the Python Programming. I want to Import Excel sheet data > using Python. Can any one please provide me the code and explain the > basic steps and method of executing the code. If you can get your Excel data into CSV format, the csv module others have alrea

[Tutor] Importing Excel sheet data

2007-09-05 Thread János Juhász
Dear Saradhi, I am using COM on Win32 for this, based on the sample of Mark Hammond & Andy Robinson in the "Programing Python on Win32" book. That is a fairly simple way to do that. The code itself can be downloaded from http://examples.oreilly.com/pythonwin32/ppw32_samples.zip You can find s

Re: [Tutor] Importing Excel sheet data

2007-09-05 Thread Ian Witham
Hi Saradhi, The first step is to export your excel data to the .csv format. This is done in Excel from the file menu. CSV means "comma separated values". If you have exported the data correctly it may look something like this: "8803","16/9/2007","299000","BEO","13B Mandeville Crescent","Grenada

Re: [Tutor] Importing Excel sheet data

2007-09-05 Thread Ian Witham
HI Saradhi, I too am fairly new to Python, but I use the csv module successfully for my work. Could you be a little more specific as to what your requirements are and where you are finding difficulty? Ian. On 9/6/07, saradhi dinavahi <[EMAIL PROTECTED]> wrote: > > hi Ian , > > I have read the CS

Re: [Tutor] Importing Excel sheet data

2007-09-05 Thread Ian Witham
Hi, You should look at the 'csv' module in the Python Standard Library. If you export your excel data to csv format, you can easily import the data in to python using the csv module. Ian On 9/6/07, saradhi dinavahi <[EMAIL PROTECTED]> wrote: > > hello all, > > I am new to the Python Programming.

[Tutor] Importing Excel sheet data

2007-09-05 Thread saradhi dinavahi
hello all, I am new to the Python Programming. I want to Import Excel sheet data using Python. Can any one please provide me the code and explain the basic steps and method of executing the code. Thank You All ___ Tutor mail

Re: [Tutor] Importing question

2007-07-14 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > You can find out where any module is located using its __file__ > attribute. This works for modules written in C, too. But not on Windoze. If it's built-in there is no __file__ attribute. But the print trick tells you if it's builtin and if it's not __f

Re: [Tutor] Importing question

2007-07-13 Thread Kent Johnson
Dick Moores wrote: > At http://wiki.python.org/moin/SimplePrograms I found this code: > > > import itertools > > def iter_primes(): > # an iterator of all numbers between 2 and +infinity > numbers = itertools.count(2) > > # generate pri

Re: [Tutor] Importing question

2007-07-13 Thread Dick Moores
At 02:50 PM 7/13/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote in > > > > import itertools > > > > def iter_primes(): > > # an iterator of all numbers between 2 and +infinity > > numbers = itertools.count(2) > > ... > > > It works for me in Win XP, Python 2.5. > > > > Ho

  1   2   >