Getting Started with Python

Source: Internet
Author: User

Procrastination lazy cancer late, from graduation said to start to learn code, has been wandering around the door and then tempted to shrink back, now do nothing of their own slow start to update a little learning progress ....

1. Install Python version 2.7;

2. Need to connect the company's database Oracle, MySQL, SQL Server;

You have to spit it out here. There is no local admin with a computer in the company, it is really separated by a branch of a mountain ...

Finally really understand the meaning of this string of URLs (because using Python to connect the database requires database name/username/password, oneself once the order is wrong, find a half-day error);

Install Cx_oracle:

It's been a whole couple of hours.

Because is to let it landed admin account, the current wood has reservations, heart good plug, boss boss is really stone ....

In the cmd direct command line using PIP, in the first pip install cx_oracle when the error, first doubt whether it is a wooden pip ... It turns out that this is not the reason;

Then the error shows:

(1) After Baidu found that because the visual studio! is not installed

The first time to play this, why the paste of anything is this ghost look.

Problem on the next download this Visual Studio problem, ask colleagues, and then go to the official website downloaded the last two people are downloaded wrong, so, still error, and then two people are a face Meng forcing, finally no way to download a 2008 version of the Web site posted above, the netizen said need to change, environment variables, Pro Test I installed 2008 version of the wood has changed the environment variable is successful (because no admin can not change the environment variable ...) )

(2) There is also a Microsoft official website, there is a link, recommended wheel installation, this after Baidu, do not know the reason, I did not install the success, the late hope can be understood;

    

Connect the database with Cx_oracle, all in OneNote, paste it in this way ...

3. How to import the module you have written:

The. py file that you write can be import as your own module, but you need to add the path of your py file to Sys.path () to directly adjust it;

Sys.path.append ("C:\Python27\My_Functions\myFunction.py") such append way is wrong;

Sys.path.append ("C:\Python27\My_Functions") is correct, so you can import your own py file;

Tomorrow to ask colleagues to understand how EXE run their own code, what is the principle; technology slag take a step to see a step!

Getting Started with Python

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.