Ubuntu :: Python - IndentationError - Expected An Indented Block

Aug 23, 2010

I am trying to do my first Python program and I am having a little bit of trouble. I get this "IndentationError: expected an indented block".

Here is the code:

Code:

View 8 Replies


ADVERTISEMENT

Debian Programming :: Python-TK Alloc - Invalid Block Error

Sep 23, 2015

Just installed Debian 8 last night and trying to run one a few of my scripts that use easygui (a front-end for python-tk basically) and I keep getting alloc: invalid block any time a file or folder selection dialog is presented. I'm able to select a file/folder with no issues, but once the dialog closes I get a variation of what appears to be a memory error followed by alloc: invalid block.

Here's one of my scripts that does it. This one pops up a file selection dialog pretty early on to ask for a file to check, and as soon as I select any file the dialog closes and that error appears in the terminal. It happens whether I run it with Python 2 or Python 3. You will need to install python3-easygui for this script to run properly if you want to check for yourself what happens. This is a first time encountering this error for me.

View 1 Replies View Related

Fedora :: Commenting Out Block Of Code In EMacs In Python Mode

Jan 13, 2010

I usually develop python code with emacs, emacs being in python code. On my desktop a version is installed and/or configured that way, so I easily can choose a region in the code and simply click on a menu option to comment out this block of code (i.e. at the begin of each line in the selected code two '##' are put). That is very convenient.

However, on my Laptop, running F12 and emacs 23.1.1, this menu option is missing! I searched within google and found the hint that by pressing 'C-c #' I also can comment out a selected region. But on my emacs it says: 'C-c # is undefined'. Am I missing something? Anyone any idea how to fix/install/update/solve this problem, so I can easily choose a couple of python lines and comment them out?

View 3 Replies View Related

Programming :: IndentationError: Unindent Does Not Match Any Outer Indentation Level

Feb 2, 2010

i was recently building on a simple socket program i had written in python basically like a little chat client but i added a server_socket.close command to kill the server on disconnect and now im getting all sorts of indentation errors


Code:

#! /usr/bin/python
2 import socket
3 server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
4 server_socket.bind(("localhost", 5000))

[code]....

IndentationError: unindent does not match any outer indentation level

View 1 Replies View Related

Programming :: Make Python Programs Run Without Entering The Command Python?

Mar 22, 2009

I want to be able to do

sudo ./program.py

instead of always having to do

sudo python program.py

What do I need to change?

View 5 Replies View Related

Programming :: Python - Get Text File Data Into An Array On Python?

Nov 30, 2009

I've already used line split stuff to transform my data into something like this in a text file:

Code:

['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']

[code]....

How can I get this on a python program so I can manipulate it as an array?

View 3 Replies View Related

General :: Get Apt-get To Install Python Packages For A Different Version Of Python?

Oct 27, 2010

in ubuntu 10.10, I have installed python 2.7. I would like to use apt-get to install packages to this version of python but I haven't been able to figure out howThings I have tried without success:changing the symlink at /usr/bin/python to point to /usr/bin/python2.7 - even after doing this apt-get still installs stuff to python2.6.Set up python2.7 as the primary alternative using update-alternatives - doesn't work

View 3 Replies View Related

Software :: Python 3 Want Situation For Python 2 And Become Stop?

Jul 17, 2010

Python 3 want situation for python 2?Python 2 become stop?

View 1 Replies View Related

CentOS 5 :: Yum - Python-devel / Python Dependency

Jan 7, 2011

yum dependency problem please? I am running Centos 5.5. I need to install python-devel, but when I do so I get:

[Code]....

View 2 Replies View Related

Programming :: Python 2.x - Represent The Same In Python 3.x

Mar 4, 2010

I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x

Code:

def blah(self, (string1, string2))

View 4 Replies View Related

CentOS 5 :: Upgrade Python-2.4.3 To Python-2.5?

Mar 30, 2011

How can I upgrade python-2.4.3 to python-2.5?

View 1 Replies View Related

Ubuntu :: Sudo Does Not Preserve PATH As Expected?

Jun 11, 2010

I'm attempting to add a directory to PATH so it's available when I sudo. (I do not want to sudo -i), but it's not behaving as I expect.I've added a line to add the directory to PATH in all of these files:

Code:
/etc/environment
/etc/bash.bashrc

[code]....

View 4 Replies View Related

Ubuntu :: Gksudo Doesn't Work As Expected

Oct 7, 2010

I am running following command- $ gksudo ./myscript

It doesnt do anything. If i run sudo, then it works perfectly fine.

View 4 Replies View Related

Ubuntu :: Folder View Screenlet Not Working As Expected?

Mar 4, 2010

I want to try out the screenlet called Folder View:[URL]I have downloaded and installed it fine. However, when I double-click on it (or use the Start/Stop button) there is a momentary flash and then nothing interesting. I have checked on the widget layer and on all desktops and I have tried various settings in Options all to no avail

View 2 Replies View Related

Ubuntu Networking :: Ethernet Not Reaching Expected Speed?

Sep 13, 2010

I have been doing a variety of speed tests on my ethernet connection in preparation for upgrading my service and found that the connection on my dell d630 is not getting expected download speeds. In fact, it is getting about a third of the expected speed. This machine is running Lucid. It also dual boots Windows Vista. Checking Vista a moment ago, the speed is fine. What could be the problem that is preventing the ethernet from working at 100%?

View 7 Replies View Related

Ubuntu :: Gnome-settings-daemon Does Not Work As Expected?

Oct 28, 2010

I just installed Ubuntu 10.10 on a brand new HP EliteBook 8540w with an Nvidia card. To get the machine to work at all I have to use the proprietary nvidia driver. The downside is that when I use this driver gnome-settings-daemon seems to crash when I start the machine which results in a ugly theme. To fix this I have to run the following command:

Code:
sudo gnome-settings-daemon

After this the theme is re-applied. If I try to run gnome-settings-daemon as my regular user I get the following messages:

Code:
** (gnome-settings-daemon:2187): WARNING **: Failed to acquire org.gnome.SettingsDaemon
** (gnome-settings-daemon:2187): WARNING **: Could not acquire name

[Code]...

View 1 Replies View Related

Ubuntu Servers :: Postfix+dovecot Not Working As Expected?

Nov 9, 2010

I have tried to find solution in existing posts but could not specifically find any with my kind of issues and hence a new post on oft repeated subject !! -- and apologies for a long long post here.Here is where I am ..On a AMD 64bit machine - I have ubuntu 10.10 desktop installed. I want this development machine to support virtual mailboxes so that I can use them from multiple apps and create real life deployment situations.I installed postfix + dovecot following the tutorials available here and current state is - I can send mails using telnet sessions and I see that the mail files are getting created in /Maildir form as I have directed in the conf files. I have configured Thunderbird mail client as well.

Issue #1: Mail sending works from Thunderbird but it always responds back with 'No mail on server' message when I try to receive mails. SMTP is configured with STARTTLS and POP3 with None (i.e. plain text password)Issue #2: Also, while going thru conf, logs and during testing - I found a few things which defer in this installation for authentication. I have given the session transcripts here.Issue #3: That being major issue - I also want to configure my virtual users to use TB client to access their mails - I did not find any tutorials or pointers towards that in my search for past few days. If I send mails to a non-Unix virtual user - the mail gets stored into /home/vmail/<domain>/<user>/new directory.Here are the conf files.main.cf for postfix

Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first

[code]....

View 1 Replies View Related

Ubuntu :: Rsyslog Upstart Script Not Working As Expected?

Mar 13, 2011

Not sure if this is the correct area to ask this question as it pertains to Upstart but not necessarily to Ubuntu.

Anyhoo, I have made a small alteration (obviously the cause of error ) but not really sure why it does not work.

rsyslog.conf:
Code:
# rsyslog - system logging daemon
#
# rsyslog is an enhanced multi-threaded replacement for the traditional
# syslog daemon, logging messages from applications

[Code].....

View 3 Replies View Related

Ubuntu :: Update To 10.10 - Unable To Find Expected Entry

Jan 8, 2011

I am running ubuntu 10.04 on an emac powerpc. I go to the update manager and click on 'Update to Ubuntu 10.10', and then it starts the update and everything goes well until step 2 which is setting new software channels. It displays the error message:
W: Failed to fetch httports.ubuntu.com/ubuntu-ports/dists/maverick/Release
Unable to find expected entry partner/binary-powerpc/Packages in Meta-index file (malformed Release file?)
,E:Some index files failed to download, they have been ignored, or old ones used instead.

View 2 Replies View Related

Ubuntu :: Python Interactive Session: "help()", Then "modules" Freezes Python?

Jan 12, 2011

This problem has to do with Python's interactive help (To get to the interactive help, just type help() at any interactive session). I like to browse all my installed Python modules, to see if I can find something that would be useful for my hobby programming projects. However, recently, typing modules (which is the command to list all installed modules) freezes the interactive session.

View 1 Replies View Related

OpenSUSE :: Use Of Setfacl Not Working As Expected

Jun 4, 2010

I used setfacl to set permissions as follows:

As you can see all settings lead to permissions 777 but that's not what happens. What happens if I say, touch a file, I get: 666 as this shows:

Same for files that are not obviously scripts such as just a.txt.

My umask is 0022.

Does anyone know why this is? Is it changeable for specific directories?

This is a special world viewed directory required by a piece of software... in other words, no, I am not in a habit of setting file permissions to 777 so please no comments about you shouldn't be using such permissions.

Truthfully, I can probably get away with permissions 666 and will if I can but right now I just want to know why it's happening this way and how to control it.

View 4 Replies View Related

Red Hat / Fedora :: DST Change Over Not Working As Expected

Mar 24, 2010

I'm trying to test whether some software that I am using will behave as expected when DST change over occurs. I'm specifically testing it for the GB timezone when it enters British Summer Time (BST) and then reverts to GMT. From the information I have, BST starts: Sunday 28 March 01:00 GMT (02:00 BST)and ends: Sunday 31 October 02:00 BST (01:00 GMT )To do this test I wrote a shell script that sets the date, runs the program, checks some logs and then reverts the time.

Entering BST was fairly straight forward as all I had to do was the following: export TZ=GB
date 032800582010This set the date to be 28th March and the time to be 00:58 in the GB (GMT) timezone. As expected, the date then rolled forward to 02:00 BST. However, when I tried to do the same for coming out of BST into GMT, the time did not work out as expected. export TZ=GB
date 103101582010Setting the time as above put the time straight into GMT and not BST even though it was two minutes before the time should have rolled-over.

However if I put the following: export TZ=GB
date 103100582010the date was reported as BST!
How can I setup the time so that I don't have to wait for hour before BST ends?

View 2 Replies View Related

General :: Awk Does Not Print The Value Of The Variable As Expected

Apr 4, 2011

I have this simple awk program but it not prints var_cab whe^E or ^S or ^M after he finds the second ^C

/^C/ { var_cab = substr($0,1,28); ent = 0 ; print "estoy en cabecera" var_cab;}
/^E/ { if ( ent ==0 ) var_fech = substr($0,4,8) ; ent ++;
print var_cab var_fech $0; }
/^S/ { print var_cab var_fech $0; }
/^M/ { print var_cab var_fech $0; }
END { print var_cab,ent}

the input file is many lines like this, every new block stats with ^CAB

CABES3000088888880000007EAMB
ENT20090706D060709-888 0028560000000012VALLE CA'ZULIA5501, 5502, 5498 y 5535
SAL201008250000134900000321V1202935-MU

[code]....

View 4 Replies View Related

Programming :: C Code Not Running As Expected / Cause Of It?

Apr 27, 2010

I was wondering why this code only returns me the same value ten times instead of valuate the conta+0.1 value code...

View 6 Replies View Related

Ubuntu Networking :: Expected Transfer Rate For Gigabit Ethernet

Sep 26, 2010

I have 2 10.04 machines connected through a switch, both with gigabit on board ethernet. Both machines show 1000 Mb/s connections.When I transfer large files (gig plus up to multi-gig) the maximum I get according to ftp 11472 kB/s.I did rough computer school math in my head and that seems low but I'll admit I know very little about network transfer rates.My question is what transfer rates should I expect to get between the 2?

View 9 Replies View Related

Ubuntu Servers :: Varnish Configuration - Expected Return Action Name

Nov 29, 2010

I have to configure the varnish cache for the varnish 2.1 from the already configured varnish.conf(version 2.07)

When i run the new varnish file which resolves the error

Message from vcc compiler ""Expected return Action name.(Input line 120 pos 12) return discard ""

May i clear about switching the configuration from varnish 2.1 to varnish 2.07?

View 1 Replies View Related

Ubuntu :: File (group) Permission Dont Work As Expected

Feb 4, 2011

Well, this is a problem that keeps on coming, and I never found a solution: Maybe it is just me misunderstanding how it should work, but:

1) do you confirm that, as a member of the group "fuse", I should be able to read the file?
2) of course, I could change the permission of the file, or read it as sudo, but sometimes this is not possible. how to achieve it then?

View 7 Replies View Related

Ubuntu Networking :: Ping From A Specific Interface, Not The Expected Result

Mar 28, 2011

im trying to ping from a specific interface, I have a wired and a wireless connection both going into my laptop.

My wired adaptor eth0 is on the ip 172.16.109.75 my wifi adaptor wlan0 is on the ip 192.168.1.69

when I ping google with my eth0 unplugged with the following command

Code:
conneco@mcr-pc-29334:~$ ping -I wlan0 www.google.co.uk
PING www.l.google.com (74.125.230.115) from 192.168.1.69 wlan0: 56(84) bytes of data.
64 bytes from 74.125.230.115: icmp_seq=1 ttl=51 time=32.7 ms

[Code].....

View 1 Replies View Related

Ubuntu Servers :: MDADM Not Acting As Expected On Latest Version?

May 31, 2011

All, This is a x-post from the Linuxmint forums. I did this testing on Mint 11 install - but also tried the exact same thing on an Ubuntu 11.04 release and had the exact same output to deal with..Follow along: I'm having trouble with MDADM.... It's not acting like I expect it to.... hopefully someone can enlighten me.


Code:
MintRAID aaron # mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
MintRAID aaron # mkfs.ext3 /dev/md0
Added this line to /etc/fstab:[code]...........

I update my fstab with /dev/md127 instead of /dev/md0 and it seems to be working ok.What in the heck is going on? Why all of the naming descrepencies? Can someone help me understand what's going on? I have used the same steps on other (and older) distros and haven't had these troubles. (Ubuntu 9 or 10 something and Cent/RHEL 5.5) I've always named the first array md0, and it's always stayed md0 through reboots, etc etc etc...

View 9 Replies View Related

Fedora :: Using Python 2.5 With Python 2.6 With F12?

Nov 30, 2009

Fedora 12 officially uses Python 2.6, good. But the Google AppEngine still goes by Python 2.5 and is showing import errors while i try to start the SDK. Here is the stack trace.

[URL]

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved