Search Results

Search found 10029 results on 402 pages for 'import contacts'.

Page 5/402 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What's the purpose of "import package"?

    - by codethief
    As I just found out import package does not make the package's modules available through package.module. The same obviously holds true for from package import subpackage as well as from package import * What's the purpose of importing a package at all then if I can't access its submodules but only the objects defined in __init__.py? It makes sense to me that from package import * would bloat the namespace, which, however, doesn't apply in case of the other two ways! I also understand that loading all submodules might take a long time. But I don't know what these unwanted side-effects, "that should only happen when the sub-module is explicitly imported", are which the author of the previous link mentions. To me it looks like doing an import package[.subpackage] (or from package import subpackage) makes absolutely no sense if I don't exactly want to access objects provided in __init__.py. Are those unwanted side effects really that serious that the language actually has to protect the programmer from causing them? Actually, I thought that Python was a little bit more about "If the programmer wants to do it, let him do it." In my case, I really do want to import all submodules with the single statement from package import subpackage, because I need all of them! Telling Python in the init.py file which submodules I'm exactly talking about (all of them!) is quite cumbersome from my point of view. Please enlighten me. :)

    Read the article

  • How do I override a python import?

    - by Evan Plaice
    So I'm working on pypreprocessor which is a preprocessor that takes c-style directives and I've been able to make it work like a traditional preprocessor (it's self-consuming and executes postprocessed code on-the-fly) except that it breaks library imports. The problem is. The preprocessor runs through the file, processes' it, outputs to a temp file, and exec() the temp file. Libraries that are imported need to be handled a little different because they aren't executed but rather loaded and made accessible to the caller module. What I need to be able to do is. Interrupt the import (since the preprocessor is being run in the middle of the import), load the postprocessed code as a tempModule, and replace the original import with the tempModule to trick the calling script with the import into believing that the tempModule is the original module. I have searched everywhere and so far, have no solution. This question is the closest I've seen so far to providing an answer: http://stackoverflow.com/questions/1096216/override-namespace-in-python Here's what I have. # remove the bytecode file created by the first import os.remove(moduleName + '.pyc') # remove the first import del sys.modules[moduleName] # import the postprocessed module tmpModule = __import__(tmpModuleName) # set first module's reference to point to the preprocessed module sys.modules[moduleName] = tmpModule moduleName is the name of the original module, tmpModuleName is the name of the postprocessed code file. The strange part is, this solution still runs completely normal as if the first module completed loaded normally; unless you remove the last line, then you get a module not found error. Hopefully someone on SO know a lot more about imports than I do because this one has me stumped.

    Read the article

  • Java import statement

    - by nattyP
    I am using java on debian 5 java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing) Why is there a difference between the following Case 1: import java.util.*; Case 2: import java.util.*; import java.util.Arrays; import java.util.List; Why doesnt the first case cover the second case? The code only compiles when I import Arrays and List explicitly. Code: import java.util.*; import java.util.Arrays; import java.util.List; public class Test { public static void main (String[] args) { List<Integer> i = new ArrayList(Arrays.asList(1,2,3,4,5,6,7,8,9,10)); List<Integer> j = new ArrayList(); ListIterator<Integer> n = i.listIterator(i.size()); while(n.hasPrevious()) { j.add(n.previous()); } println(j); } static void println(Object o) { System.out.println(o); } static void print(Object o) { System.out.print(o); } }

    Read the article

  • google contacts api service account oauth2.0 sub user

    - by user3709507
    I am trying to use the Google Contacts API to connect to a user's contact information, on my Google apps domain. Generating an access_token using the gdata api's ContactsService clientlogin function while using the API key for my project works fine, but I would prefer to not store the user's credentials, and from the information I have found that method uses OAuth1.0 So, to use OAuth2.0 I have: Generated a Service Account in the developer's console for my project Granted access to the service account for the scope of https://www.google.com/m8/feeds/ in the Google apps domain admin panel Attempted to generate credentials using SignedJwtAssertionCredentials: credentials = SignedJwtAssertionCredentials( service_account_name=service_account_email, private_key=key_from_p12_file, scope='https://www.google.com/m8/feeds/', sub=user_email') The problem I am running into is that attempting to generate an access token using this method fails. It succeeds in generating the token when I remove the sub parameter, but then that token fails when I try to fetch the user's contacts. Does anyone know why this might be happening?

    Read the article

  • Portable Contacts for PHP?

    - by Felix
    I can see Google is implementing the Portable Contacts API for developers to fetch a user's contacts. That seems like exactly what I want to do and I especially like the fact that the protocol is open and through it I can support more than just Google. What I'd like to know is whether there is a library for PHP that implements this protocol, as I don't feel like writing one from scratch / reinventing the wheel. I wouldn't generally post such questions which could be answered by simply googling, but I've done my googling on the subject and can't seem to find any relevant info. BTW, I don't use Zend, so please don't suggest that to me, unless it's the only way possible.

    Read the article

  • Import exponetial fixed width format data into Excel

    - by Tom Daniel
    I've received a bunch of text data files consiting of Lots of records (30K/file) of 3 fields each of 5-place numbers in exponential format: s0.nnnnnEsee (where s is +/-, n is a digit and ee is the exponent (always 2 digit). When I open the file in Notepad, the format is perfectly uniform throughout each file, but when I import it to Excel using Data|Import|Fixed Width, many of the data values get messed up, no matter what format (text, exponential, various custom tries) I assign to the cells. Looking at the Notepad version, it appears that leading + signs were replaced with a space in the data file, but the sign of the exponential is always there. This means that some fields begin with a space, and this appears to confuse the Excel import routine. I get the same result in Excel 2003 and 2007. I'm sure there's a straightforward solution (hopefully without a messy VBA routine), but I can't figure out what to try next. :-) To clarify (hopefully), here are some input records and the corresponding text input to Excel: Notepad Excel -0.11311E+01 0.10431E-04 0.27018E-03 -0.11311E 1.0431E-05 2.7018E-04 0.19608E+00-0.81414E-02-0.89553E-02 0.19608E -8.1414E-03 8.9553E-03 etc. Whoopee! Solved my own problem - in the spirit of Jeopardy, now that I've begun the question, here's the answer - Use a different "File Origin" - several other than the default "Unicode UTF..." work fine! What a pain. Hope this helps somebody else avoid a few unpleasant hours! Aloha from Kona, Tom

    Read the article

  • Is this __import__ functionality correct?

    - by Jason Baker
    I have a package named jiva_tasks, which I'm trying to import via celery (using the CELERY_IMPORTS attribute of celeryconfig. The import statement that celery is using is this: __import__(module, [], [], ['']) Oddly enough, when this syntax is used, the module gets imported twice, once as jiva_tasks and another time as jiva_tasks. (with a period at the end). Now, chances are good that celery should be passing in globals rather than an empty list, but this seems broken to me. It seems odd that even if given the wrong arguments, __import__ would import something that isn't a valid python module name. I know that the way to fix this is to pass in globals, but I want to understand why I'm getting this result. Is this a bug, or is there something I don't understand about how __import__ is working? Update: It also seems to be working fine if I use importlib.

    Read the article

  • How to import a module from a directory?

    - by Roman
    On my system I have two versions of Python (to call them I type python and python2 in the command line). When I use the first version of Python, I cannot import sklearn module but I can do it in the second version of Python. I would like to use the first version of python (because other modules are available there) and, at the same time, I would like to be able to import sklearn from this version of Python. My solution was to use: import sys sys.path.append('location_of_the_sklearn_module') To find the location of the sklearn module I started a python session (using the second version of python, in which sklearn works). The I type: import sklearn sklearn.__file__ As a result I got: /home/name/my_name/numpy/local/lib/python2.7/site-packages/sklearn/__init__.pyc In the session of the first version of Python I tried: import sys sys.path.append('/home/name/my_name/numpy/local/lib/python2.7/site-packages/sklearn') import sklearn Unfortunately it did not work. As a result I got: ImportError: No module named sklearn Does anybody know what I am doing wrong and if it is possible to reach the goal in the way I try?

    Read the article

  • python: importing modules with incorrect import statements => unexhaustive info from resulting Impor

    - by bbb
    Hi there, I have a funny problem I'd like to ask you guys ('n gals) about. I'm importing some module A that is importing some non-existent module B. Of course this will result in an ImportError. This is what A.py looks like import B Now let's import A >>> import A Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/tmp/importtest/A.py", line 1, in <module> import B ImportError: No module named B Alright, on to the problem. How can I know if this ImportError results from importing A or from some corrupt import inside A without looking at the error's string representation. The difference is that either A is not there or does have incorrect import statements. Hope you can help me out... Cheers bb

    Read the article

  • Indesign Import XML into Automatic Page generation, data merge

    - by taudep
    I've created some InDesign Pages that I want to use as templates. I've created an XML file with all the appropriate data. I want to merge the XML data with the InDesign page and have a few hundred pages automatically generated. I've been reading online and working with InDesign's "Import XML" features without any luck. The documentation has been pretty poor for me. And Google searches haven't returned much fruitful. Edit: I'm updating this to now include my present steps 1) I create a Master Page of my template 2) I add a bunch of text frames where I want the imported data from the XML file to be places 3) I open the "Tags" window and Import and XML file 4) I mark my text frames in the Master Document with the appropriate tags 5) I then add a lot of pages (like 200) to the document 6) Then I use "Import XML" to try and get the data brought in and filled across all 200 pages. This is where I fail. So there's something I'm missing. It might be that InDesign doesn't work as I'm expecting... Anyone have any good tips for mail-merge like functionality with an XML document and auto-generation of InDesign pages? BTW, here's an example of Adobe's great documentation for merging repeated XML elements. There's gotta be more...InDesign CS4 Docs: XML-Importing XML-Working with Repeating Data EDIT: Here's some of the sample XML, notice the ITEM will repeat. I've also truncated the data in the "desc" tag: <output> <item> <user_name>taude</user_name> <date>2009-02-21</date> <title>Wishful Thinking</title> <desc>Skiing up in Vermont on a beautiful day. This photo of</desc> <thumbnail>http://www.blipfoto.com/thumbs/5371/2009/big/color/96104200949a162672e1996.15963073.jpeg</thumbnail> </item> <item> <user_name>taude</user_name> <date>2009-02-22</date> <title>Skiing Self Portrait</title> <desc>I was inspired by ML's self-portrait while </desc> <thumbnail>http://www.blipfoto.com/thumbs/5371/2009/big/color/36547696749a2c5782308e0.91477014.jpeg</thumbnail> </item> </output> Here's what my imported XML looks like with the InDesign Structure

    Read the article

  • Indesign Import XML into Automatic Page generation, data merge

    - by taudep
    I've created some InDesign Pages that I want to use as templates. I've created an XML file with all the appropriate data. I want to merge the XML data with the InDesign page and have a few hundred pages automatically generated. I've been reading online and working with InDesign's "Import XML" features without any luck. The documentation has been pretty poor for me. And Google searches haven't returned much fruitful. Here are my present steps: I create a Master Page of my template I add a bunch of text frames where I want the imported data from the XML file to be places I open the "Tags" window and Import and XML file I mark my text frames in the Master Document with the appropriate tags I then add a lot of pages (like 200) to the document Then I use "Import XML" to try and get the data brought in and filled across all 200 pages. This is where I fail. There's something I'm missing. It might be that InDesign doesn't work as I'm expecting... Does anyone have any good tips for mail-merge like functionality with an XML document and auto-generation of InDesign pages? By the way, here's an example of Adobe's great documentation for merging repeated XML elements. There's got to be more... InDesign CS4 Docs: XML-Importing XML-Working with Repeating Data Here's some of the sample XML, notice the ITEM will repeat. I've also truncated the data in the "desc" tag: <output> <item> <user_name>taude</user_name> <date>2009-02-21</date> <title>Wishful Thinking</title> <desc>Skiing up in Vermont on a beautiful day. This photo of</desc> <thumbnail>http://www.blipfoto.com/thumbs/5371/2009/big/color/96104200949a162672e1996.15963073.jpeg</thumbnail> </item> <item> <user_name>taude</user_name> <date>2009-02-22</date> <title>Skiing Self Portrait</title> <desc>I was inspired by ML's self-portrait while </desc> <thumbnail>http://www.blipfoto.com/thumbs/5371/2009/big/color/36547696749a2c5782308e0.91477014.jpeg</thumbnail> </item> </output> Here's what my imported XML looks like with the InDesign Structure:

    Read the article

  • What approach should I take to export my iPhone contacts to Gmail?

    - by codeLes
    I'm on the iPhone OS3, I want to get my contacts on my phone in sync with my Google contacts, but I don't want to lose what is currently in my phone. So far I have been under the impression that by just turning the Google Sync on that it will overwrite the info on my phone. I don't currently have all the info on my phone in Google contacts so this would not be desired. Other than manually inputting all the info from my phone into my Google Contacts, what approach could I take to get that info on the Google cloud so that I can turn on sync without fear of losing any information?

    Read the article

  • Cannot import video from a DV camcorder over FireWire

    - by qbeuek
    I have a JVC GR-D320 miniDV camcorder that has a FireWire interface. I recently upgraded to Windows 7 RTM (64 bit, fresh installation). When I connect my camcorder through FireWire, I can see it in Device Manager without any warnings or problems, but I cannot capture videos from my miniDV tapes. After connecting, AutoPlay displays "Import Video could not find a compatible digital video device. Verify that the digital video device is properly connected and turned on." When using Windows Live Photo Gallery after selecting the import option, my camera is not listed. The camera used to work perfectly on the same hardware before upgrading to Windows 7 RTM 64 bit (it used to work fine on Windows XP SP3 32 bit). Googleing revealed that people had the exact same problems in Vista, but no solution was provided. Any help?

    Read the article

  • How can I synchronize Google contacts and calendar with Palm Centro and Outlook 2000?

    - by meomaxy
    Seeking a free solution to synchronize my calendar and contacts between my Palm Centro and Google contacts and calendar. I currently sync my Palm contacts and calendar with Outlook 2000 on Windows XP. Google Calendar Sync does not support Outlook 2000, and I would rather not pay to upgrade Outlook just for this, as I don't even use Outlook much anymore. I wouldn't mind migrating my calendar and contacts off of it, as long as I can still sync with the Palm. I don't have an unlimited data plan for my Centro, so I can't use a solution that wirelessly syncs directly to Google. I have set up GCALDaemon to sync up my Google calendar with multiple machines running Rainlendar, but I have not yet figured out a way to synchronize that data with the Palm.

    Read the article

  • Command line import of database using latin1 encoding

    - by chrisjlee
    I'm using a particular cloud hosting solution (one which i won't name) and they don't provide ssh access so i'm at a whim on how the database is dumped. I downloaded the dump which is packed into a tar.gz file. I discover that this file utilizes latin1 encoding. Which i don't get to specify the encoding for the host i'm using because i don't have SSH access or DB access. I try to import it via command line for my local development environment (mysql -uroot foodb < file.db) like i usually do with other databases but am having problems. Is it possible to import a database via command line by specifying which encoding (preferably latin1) before importing it? Or do i have to convert it to UTF8?

    Read the article

  • Cannot import video from a DV camcorder over FireWire

    - by qbeuek
    I have a JVC GR-D320 miniDV camcorder that has a FireWire interface. I recently upgraded to Windows 7 RTM (64 bit, fresh installation). When I connect my camcorder through FireWire, I can see it in Device Manager without any warnings or problems, but I cannot capture videos from my miniDV tapes. After connecting, AutoPlay displays "Import Video could not find a compatible digital video device. Verify that the digital video device is properly connected and turned on." When using Windows Live Photo Gallery after selecting the import option, my camera is not listed. The camera used to work perfectly on the same hardware before upgrading to Windows 7 RTM 64 bit (it used to work fine on Windows XP SP3 32 bit). Googleing revealed that people had the exact same problems in Vista, but no solution was provided. Any help?

    Read the article

  • Access or import an Outlook 2003 .pst file without Outlook

    - by Nobler
    I have a 450 meg .pst file (MS Outlook 2003 backup file) saved from a PC before it crashed. I would like to break it up into its components i.e. Save attachments to folders on my PC Paste text-emails into a word processor, etc. But I don't want to buy MS Office Professional 2003 or later solely for importing the .pst into MS Outlook 2003+. Outlook Express cannot import .pst files, only Outlook “proper” can. Is there some free email client out there, e.g. Thunderbird, that can import .pst files? Or is there some other way to access the 450meg file?

    Read the article

  • Is there an application or way to sync address book, Facebook, LinkedIn, Gmail contacts?

    - by denislexic
    I'm looking for a Mac application or an Web application to sync all my Facebook, LinkedIn, Gmail contacts and Mac OS X address book contacts in one place. At the same time, it would be great if it didn't create a bunch of duplicates. (PS: The default sync between gmail contacts and address book seems to only create duplicates and doesn't seem to really work well together). Does anyone have a solution?

    Read the article

  • Google Contacts Error: If-Match or If-None-Match header or entry etag attribute required

    - by Ali
    Hi guys I'm following the example code as defined on this website: http://www.ibm.com/developerworks/opensource/library/x-phpgooglecontact/index.html I want to be able to integrate with my google apps account and play around with teh contacts. However I get this error whenever I try to run the modify contacts code: If-Match or If-None-Match header or entry etag attribute required This is my code: Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Http_Client'); Zend_Loader::loadClass('Zend_Gdata_Query'); Zend_Loader::loadClass('Zend_Gdata_Feed'); $client = getGoogleClient('cp'); // this is a function I made - its working fine $client->setHeaders('If-Match: *'); $gdata = new Zend_Gdata($client); $gdata->setMajorProtocolVersion(3); $query = new Zend_Gdata_Query($id);// id is the google reference $entry = $gdata->getEntry($query); $xml = simplexml_load_string($entry->getXML()); $xml->name->fullName = trim($contact->first_name).' '.trim($contact->last_name); $entryResult = $gdata->updateEntry($xml->saveXML(), $id);

    Read the article

  • Why are static imports of static methods with same names legal?

    - by user1055638
    Lets say we have these packages and classes: package p1; public class A1 { public static void a() {} } package p2; public class A1 { public static void a() {} } package p3; import static p1.A1.a; import static p2.A1.a; public class A1 { public static void test() { } } I am wondering, why the static import of methods is legal (won't result in compile time error) in package p3? We won't be able to use them further in the test() method as such usage will result in the compile time error. Why it is not the same as with a normal import of classes. Lets say we would like to import classes A1 from packages p1 and p2 into p3: package p3; import p1.A1; import p2.A1; such import is illegal and will result in the compile time error.

    Read the article

  • Skip subdirectory in python import

    - by jstaab
    Ok, so I'm trying to change this: app/ - lib.py - models.py - blah.py Into this: app/ - __init__.py - lib.py - models/ - __init__.py - user.py - account.py - banana.py - blah.py And still be able to import my models using from app.models import User rather than having to change it to from app.models.user import User all over the place. Basically, I want everything to treat the package as a single module, but be able to navigate the code in separate files for development ease. The reason I can't do something like add for file in __all__: from file import * into init.py is I have circular references between the model files. A fix I don't want is to import those models from within the functions that use them. But that's super ugly. Let me give you an example: user.py ... from app.models import Banana ... banana.py ... from app.models import User ... I wrote a quick pre-processing script that grabs all the files, re-writes them to put imports at the top, and puts it into models.py, but that's hardly an improvement, since now my stack traces don't show the line number I actually need to change. Any ideas? I always though init was probably magical but now that I dig into it, I can't find anything that lets me provide myself this really simple convenience.

    Read the article

  • Go import error while trying to import web.go package after using goinstall

    - by Metropolis
    With halfdans advice, I was successfully able to use goinstall github.com/hoisie/web.go without any errors after installing git first. However, now when I try to compile the sample code given, go is not finding the web package. I get the error, main.go:4: can't find import: web On this code package main import ( "web" ) func hello(val string) string { return "hello " + val } func main() { web.Get("/(.*)", hello) web.Run("0.0.0.0:9999") } Is there something special I need to do in order for it to recognize the package? I found the package source at $GOROOT/src/pkg/github.com/hoisie/web.go/web. I tried that path as the import and it still did not like that.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >