This forum is in archive mode. You will not be able to post new content.

Author Topic: Starting Python scripting - Setting up a Python environment  (Read 27829 times)

0 Members and 1 Guest are viewing this topic.

EMOKDOOM

  • Guest
Re: Starting Python scripting - Setting up a Python environment
« Reply #15 on: February 24, 2013, 06:41:08 PM »
It is, i'm sure it's just a matter of getting use to it though.
I just got comfortable with the learning environment from codeacademy and thought it'd be cool to have on my PC.

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Python scripting - Setting up a Python environment
« Reply #16 on: February 24, 2013, 06:44:54 PM »
Well, Python shell is most likely the closest you can get with offline software.

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Starting Python scripting - Setting up a Python environment
« Reply #17 on: February 24, 2013, 11:39:57 PM »
Could also use the IDE it came with called Idle. It has a python shell in it.
>>>import this
-----------------------------

EMOKDOOM

  • Guest
Re: Starting Python scripting - Setting up a Python environment
« Reply #18 on: February 25, 2013, 04:36:42 AM »
IDLE (Python GUI) it say on task bar then Python Shell on top when it's open. I'm sure that's the one i have.
I think I'll just stick to it until I'm more familiar with programming jargon; I'm confused as hell as it is.

Offline TiRoX

  • NULL
  • Posts: 2
  • Cookies: 0
  • Learn, to grow, until perfection.
    • View Profile
Re: Starting Python scripting - Setting up a Python environment
« Reply #19 on: June 04, 2014, 04:30:22 AM »
It is great!  Tho something confuses me... Whenever i would say


Code: [Select]
Variable1="Hello World"
print Variable1
It follows
Code: [Select]
SyntaxError: invalid syntax

now this is starting to harass me.  =/ .. or to bother... at least.
« Last Edit: June 04, 2014, 04:33:08 AM by TiRoX »
Learning, and growing, until perfection.

Offline Architect

  • Sir
  • ***
  • Posts: 428
  • Cookies: 56
  • STFU
    • View Profile
    • Rootd IRC
Re: Starting Python scripting - Setting up a Python environment
« Reply #20 on: June 04, 2014, 07:08:13 AM »
Please don't dig up old posts, but I will answer your question.
You forgot the spaces around the "=" sign and you forgot the parenthesis in the "print(Variable)" command.
Different ways to print:

Code: (python) [Select]
>>> Variable = "5"
>>> print('Variable') #literally print "Variable"
Variable
>>> print(Variable) #print actual value of a variable
5

Edit: Post an introduction will ya
« Last Edit: June 04, 2014, 07:09:44 AM by Architect »

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Python scripting - Setting up a Python environment
« Reply #21 on: June 04, 2014, 07:14:18 AM »
AFAIK print() is P3 syntax, just "print" is for P2.

Offline TiRoX

  • NULL
  • Posts: 2
  • Cookies: 0
  • Learn, to grow, until perfection.
    • View Profile
Re: Starting Python scripting - Setting up a Python environment
« Reply #22 on: June 04, 2014, 12:22:30 PM »
Thanks for replying.. Sorry for pushing old thread.. but at least its working now. =)
Learning, and growing, until perfection.

Offline Architect

  • Sir
  • ***
  • Posts: 428
  • Cookies: 56
  • STFU
    • View Profile
    • Rootd IRC
Re: Starting Python scripting - Setting up a Python environment
« Reply #23 on: June 04, 2014, 02:10:48 PM »
AFAIK print() is P3 syntax, just "print" is for P2.
'print(Variable1)' and 'print Variable1' are the same thing essentially in 2.7.x.

Code: (python) [Select]
Python 2.7.6 (default, May 25 2014, 00:42:52)
[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> Variable1 = "5"
>>> print Variable1
5
>>> print(Variable1)
5

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Starting Python scripting - Setting up a Python environment
« Reply #24 on: June 04, 2014, 02:43:22 PM »
'print(Variable1)' and 'print Variable1' are the same thing essentially in 2.7.x.
Yes, in P2. In P3 only "print()" is available.

Offline Architect

  • Sir
  • ***
  • Posts: 428
  • Cookies: 56
  • STFU
    • View Profile
    • Rootd IRC
Re: Starting Python scripting - Setting up a Python environment
« Reply #25 on: June 04, 2014, 04:19:21 PM »
Why would you even want to use 3.x?

Offline L0aD1nG

  • Peasant
  • *
  • Posts: 83
  • Cookies: 6
  • NeverFear1isHere
    • View Profile
Re: Starting Python scripting - Setting up a Python environment
« Reply #26 on: October 26, 2014, 05:50:34 PM »
Great tutorial, for a fast Python start up.
I would recommend starting with python2.7, if there is not a specific reason for 3.x .

At last I would like to point out that in the most Debian based Linux distros python2.6 and python2.7 will be pre-installed normally at least both are pre-installed on Debian stable itself.

Cheers!

Helpful Note
On Debian based Linux distros  you can install idle as a starting 'IDE' with : apt-get install idle-python2.7;
« Last Edit: October 26, 2014, 05:57:17 PM by L0aD1nG »

Offline L0aD1nG

  • Peasant
  • *
  • Posts: 83
  • Cookies: 6
  • NeverFear1isHere
    • View Profile
Re: Starting Python scripting - Setting up a Python environment
« Reply #27 on: October 27, 2014, 10:35:07 AM »
FL0W if you are looking for the best Python IDE just install Pycharm through here : https://www.jetbrains.com/pycharm/

Offline xtream1101

  • /dev/null
  • *
  • Posts: 10
  • Cookies: 3
    • View Profile
    • Github
Re: Starting Python scripting - Setting up a Python environment
« Reply #28 on: October 27, 2014, 02:30:26 PM »
+1 for PyCharm for the best Python IDE

Offline Dan John

  • NULL
  • Posts: 2
  • Cookies: 0
    • View Profile
Re: Starting Python scripting - Setting up a Python environment
« Reply #29 on: July 31, 2015, 01:31:19 PM »
Well i'm learning Python as a first programming language and i can tell, its cool and easy to learn.
I found this book to be interesting as a first one and theres also this one here. (First is PDF, second is HTML).
Avoid "learning python the hard way" cuz it sucks.

Bye.

Wow, I was just about to post a thread asking where's a good place to start with Python and now look where I've found me.
Why thank you! 8)

 



Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.